data/full_repos/permissive/460183508/rtl/top.v
1: b"%Error: data/full_repos/permissive/460183508/rtl/top.v:69: Cannot find file containing module: 'sync_gen'\n    sync_gen #(\n    ^~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/460183508/rtl,data/full_repos/permissive/460183508/sync_gen\n             data/full_repos/permissive/460183508/rtl,data/full_repos/permissive/460183508/sync_gen.v\n             data/full_repos/permissive/460183508/rtl,data/full_repos/permissive/460183508/sync_gen.sv\n             sync_gen\n             sync_gen.v\n             sync_gen.sv\n             obj_dir/sync_gen\n             obj_dir/sync_gen.v\n             obj_dir/sync_gen.sv\n%Error: data/full_repos/permissive/460183508/rtl/top.v:93: Cannot find file containing module: 'sync_gen'\n    sync_gen #(\n    ^~~~~~~~\n%Error: data/full_repos/permissive/460183508/rtl/top.v:121: Cannot find file containing module: 'upcounter'\n    upcounter #(\n    ^~~~~~~~~\n%Error: data/full_repos/permissive/460183508/rtl/top.v:143: Cannot find file containing module: 'upcounter'\n    upcounter #(\n    ^~~~~~~~~\n%Error: data/full_repos/permissive/460183508/rtl/top.v:162: Cannot find file containing module: 'upcounter'\n    upcounter #(\n    ^~~~~~~~~\n%Error: data/full_repos/permissive/460183508/rtl/top.v:193: Cannot find file containing module: 'loadable_upcounter'\n    loadable_upcounter #(\n    ^~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/460183508/rtl/top.v:209: Cannot find file containing module: 'upcounter'\n    upcounter #(\n    ^~~~~~~~~\n%Error: data/full_repos/permissive/460183508/rtl/top.v:241: Cannot find file containing module: 'register_file'\n    register_file registers(\n    ^~~~~~~~~~~~~\n%Error: data/full_repos/permissive/460183508/rtl/top.v:275: Cannot find file containing module: 'cursor'\n    cursor cursor(\n    ^~~~~~\n%Error: data/full_repos/permissive/460183508/rtl/top.v:297: Cannot find file containing module: 'pixel_generator'\n    pixel_generator pix_gen(\n    ^~~~~~~~~~~~~~~\n%Error: Exiting due to 10 error(s)\n"
module CRTC
(
    input wire n_reset,
    input wire pixel_clk,
    

    input wire [7:0] cpu_data,
    input wire [1:0] cpu_address,
    input wire n_write,
    

    input wire [7:0] attribute_data,
    input wire [7:0] font_data,
    input wire [2:0] char_msbs,
    output wire [10:0] vram_address,
    output wire [3:0] scanline,


    input wire n_blank_in,
    output wire n_blank_out,
    output wire n_hsync,
    output wire vsync,
    output wire [3:0] colour_index
);

    wire hsync_backporch;
    wire hsync_active;
    wire hsync_frontporch;
    wire hsync_sync;
    
    sync_gen #(
        .WIDTH(10),
        .ACTIVE_COUNT(50),
        .FRONT_COUNT(770),
        .SYNC_COUNT(785),
        .RESET_COUNT(894)
    )
    hsync_gen(
        .reset(~n_reset),
        .clk(pixel_clk),
        .backporch(hsync_backporch),
        .active(hsync_active),
        .frontporch(hsync_frontporch),
        .sync(hsync_sync)
    );
    

    wire vsync_backporch;
    wire vsync_active;
    wire vsync_sync;
    
    sync_gen #(
        .WIDTH(9),
        .ACTIVE_COUNT(30),
        .FRONT_COUNT(430),
        .SYNC_COUNT(441),
        .RESET_COUNT(444)
    )
    vsync_gen(
        .reset(~n_reset),
        .clk(hsync_sync),
        .backporch(vsync_backporch),
        .active(vsync_active),
        .sync(vsync_sync)
    );
    

    wire [3:0] char_pix_count;
    
    upcounter #(
        .WIDTH(4),
        .MAX_COUNT(8),
        .RESET_VALUE(8)
    )
    char_pix(
        .reset(~hsync_active),
        .enable(1'b1),
        .clk(pixel_clk),
        .count(char_pix_count)
    );
    

    wire [3:0] scanline_val;
    
    upcounter #(
        .WIDTH(4)
    )
    scanline_ctr(
        .reset(~vsync_active),
        .enable(1'b1),
        .clk(hsync_frontporch),
        .count(scanline_val)
    );
    

    wire [10:0] text_row_val;
    wire text_row_inc = (scanline_val == 0);
    
    upcounter #(
        .WIDTH(11),
        .INCREMENT(80)
    )
    text_row(
        .reset(~vsync_active),
        .enable(1'b1),
        .clk(text_row_inc),
        .count(text_row_val)
    );
    

    wire [10:0] text_col_val;
    wire text_col_inc = (char_pix_count == 2);
    
    loadable_upcounter #(
        .WIDTH(11)
    )
    text_col(
        .reset(~vsync_active),
        .clk(text_col_inc | hsync_sync),
        .load(~hsync_active),
        .value(text_row_val),
        .count(text_col_val)
    );
    

    wire [4:0] blink_val;
    
    upcounter #(
        .WIDTH(5)
    )
    blink(
        .reset(~n_reset),
        .enable(1'b1),
        .clk(vsync_sync),
        .count(blink_val)
    );
    

    wire [10:0] match_address;
    wire cursor_disable;
    wire [3:0] start_scanline;
    wire [3:0] end_scanline;
    wire screen_blank;
    wire extended_bg_colours;
    
    register_file registers(
        .reset(~n_reset),
        .cpu_data(cpu_data),
        .cpu_address(cpu_address),
        .n_write(n_write),
        
        .match_address(match_address),
        .cursor_disable(cursor_disable),
        .start_scanline(start_scanline),
        .end_scanline(end_scanline),
        
        .screen_blank(screen_blank),
        
        .extended_bg_colours(extended_bg_colours)
    );
    

    wire cursor_active;
    
    cursor cursor(
        .vram_address(text_col_val),
        .scanline(scanline_val),
        .blink_state(blink_val[3]),
        .match_address(match_address),
        .cursor_disable(cursor_disable),
        .start_scanline(start_scanline),
        .end_scanline(end_scanline),
        .cursor_active(cursor_active)
    );
    

    pixel_generator pix_gen(
        .reset(~vsync_active),
        .clk(pixel_clk),
        .load(char_pix_count == 8),
        .attribute_data(attribute_data),
        .font_data(font_data),
        .char_msbs(char_msbs),
        .blink_state(blink_val[4]),
        .cursor_active(cursor_active),
        .extended_bg_colours(extended_bg_colours),
        .colour_index(colour_index)
    );
    

    assign n_hsync = ~hsync_sync;
    

    assign vsync = vsync_sync;
    

    assign n_blank_out = hsync_active & vsync_active & n_blank_in &
                         ~screen_blank;
    

    assign vram_address = text_col_val;
    

    assign scanline = scanline_val;
endmodule
module CRTC
(
    input wire n_reset,
    input wire pixel_clk,
    

    input wire [7:0] cpu_data,
    input wire [1:0] cpu_address,
    input wire n_write,
    

    input wire [7:0] attribute_data,
    input wire [7:0] font_data,
    input wire [2:0] char_msbs,
    output wire [10:0] vram_address,
    output wire [3:0] scanline,


    input wire n_blank_in,
    output wire n_blank_out,
    output wire n_hsync,
    output wire vsync,
    output wire [3:0] colour_index
);


    wire hsync_backporch;
    wire hsync_active;
    wire hsync_frontporch;
    wire hsync_sync;
    
    sync_gen #(
        .WIDTH(10),
        .ACTIVE_COUNT(50),
        .FRONT_COUNT(770),
        .SYNC_COUNT(785),
        .RESET_COUNT(894)
    )
    hsync_gen(
        .reset(~n_reset),
        .clk(pixel_clk),
        .backporch(hsync_backporch),
        .active(hsync_active),
        .frontporch(hsync_frontporch),
        .sync(hsync_sync)
    );
    

    wire vsync_backporch;
    wire vsync_active;
    wire vsync_sync;
    
    sync_gen #(
        .WIDTH(9),
        .ACTIVE_COUNT(30),
        .FRONT_COUNT(430),
        .SYNC_COUNT(441),
        .RESET_COUNT(444)
    )
    vsync_gen(
        .reset(~n_reset),
        .clk(hsync_sync),
        .backporch(vsync_backporch),
        .active(vsync_active),
        .sync(vsync_sync)
    );
    

    wire [3:0] char_pix_count;
    
    upcounter #(
        .WIDTH(4),
        .MAX_COUNT(8),
        .RESET_VALUE(8)
    )
    char_pix(
        .reset(~hsync_active),
        .enable(1'b1),
        .clk(pixel_clk),
        .count(char_pix_count)
    );
    

    wire [3:0] scanline_val;
    
    upcounter #(
        .WIDTH(4)
    )
    scanline_ctr(
        .reset(~vsync_active),
        .enable(1'b1),
        .clk(hsync_frontporch),
        .count(scanline_val)
    );
    

    wire [10:0] text_row_val;
    wire text_row_inc = (scanline_val == 0);
    
    upcounter #(
        .WIDTH(11),
        .INCREMENT(80)
    )
    text_row(
        .reset(~vsync_active),
        .enable(1'b1),
        .clk(text_row_inc),
        .count(text_row_val)
    );
    

    wire [10:0] text_col_val;
    wire text_col_inc = (char_pix_count == 2);
    
    loadable_upcounter #(
        .WIDTH(11)
    )
    text_col(
        .reset(~vsync_active),
        .clk(text_col_inc | hsync_sync),
        .load(~hsync_active),
        .value(text_row_val),
        .count(text_col_val)
    );
    

    wire [4:0] blink_val;
    
    upcounter #(
        .WIDTH(5)
    )
    blink(
        .reset(~n_reset),
        .enable(1'b1),
        .clk(vsync_sync),
        .count(blink_val)
    );
    

    wire [10:0] match_address;
    wire cursor_disable;
    wire [3:0] start_scanline;
    wire [3:0] end_scanline;
    wire screen_blank;
    wire extended_bg_colours;
    
    register_file registers(
        .reset(~n_reset),
        .cpu_data(cpu_data),
        .cpu_address(cpu_address),
        .n_write(n_write),
        
        .match_address(match_address),
        .cursor_disable(cursor_disable),
        .start_scanline(start_scanline),
        .end_scanline(end_scanline),
        
        .screen_blank(screen_blank),
        
        .extended_bg_colours(extended_bg_colours)
    );
    

    wire cursor_active;
    
    cursor cursor(
        .vram_address(text_col_val),
        .scanline(scanline_val),
        .blink_state(blink_val[3]),
        .match_address(match_address),
        .cursor_disable(cursor_disable),
        .start_scanline(start_scanline),
        .end_scanline(end_scanline),
        .cursor_active(cursor_active)
    );
    

    pixel_generator pix_gen(
        .reset(~vsync_active),
        .clk(pixel_clk),
        .load(char_pix_count == 8),
        .attribute_data(attribute_data),
        .font_data(font_data),
        .char_msbs(char_msbs),
        .blink_state(blink_val[4]),
        .cursor_active(cursor_active),
        .extended_bg_colours(extended_bg_colours),
        .colour_index(colour_index)
    );
    

    assign n_hsync = ~hsync_sync;
    

    assign vsync = vsync_sync;
    

    assign n_blank_out = hsync_active & vsync_active & n_blank_in &
                         ~screen_blank;
    

    assign vram_address = text_col_val;
    

    assign scanline = scanline_val;
endmodule