data/full_repos/permissive/173003307/src/vga_wrapper.v
1: b"%Error: data/full_repos/permissive/173003307/src/vga_wrapper.v:127: Cannot find file containing module: 'Generic_counter'\n    Generic_counter # (.COUNTER_WIDTH(8),\n    ^~~~~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/173003307/src,data/full_repos/permissive/173003307/Generic_counter\n             data/full_repos/permissive/173003307/src,data/full_repos/permissive/173003307/Generic_counter.v\n             data/full_repos/permissive/173003307/src,data/full_repos/permissive/173003307/Generic_counter.sv\n             Generic_counter\n             Generic_counter.v\n             Generic_counter.sv\n             obj_dir/Generic_counter\n             obj_dir/Generic_counter.v\n             obj_dir/Generic_counter.sv\n%Error: data/full_repos/permissive/173003307/src/vga_wrapper.v:139: Cannot find file containing module: 'Frame_Buffer'\n    Frame_Buffer # (.HorRes(160),\n    ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/173003307/src/vga_wrapper.v:160: Cannot find file containing module: 'VGA_Sig_Gen'\n    VGA_Sig_Gen vga_control(\n    ^~~~~~~~~~~\n%Error: Exiting due to 3 error(s)\n"
module vga_wrapper(
        input CLK,
        input RESET,
        input [7:0] BUS_ADDR,
        inout [7:0] BUS_DATA,
        output [7:0] VGA_COLOUR,
        output VGA_HS,
        output VGA_VS
        );

    wire B_DATA_1;
    wire IMG_DATA;
    wire A_DATA_OUT;

    

    wire DPR_CLK;
    wire [14:0] VGA_ADDR;

    

    reg A_DATA_IN;
    wire [14:0] A_ADDR;
    reg A_WE;

    

    wire TRIG_1_S;
    wire [7:0] ColourCount;
    reg COLOUR_IN;
    wire [15:0] CONFIG_COLOURS;
    
    reg [7:0] X_ADDR; 
    reg [6:0] Y_ADDR; 
    reg RE;
    

    assign CONFIG_COLOURS = {ColourCount[7:0], 8'h15};
    

    assign A_ADDR = {Y_ADDR, X_ADDR};
        
    initial 
        RE <= 1'b1;
    

    always @(*)
    begin

        if (BUS_ADDR==8'hB1)
        begin
            X_ADDR <= BUS_DATA;
            A_WE <= 1'b0;
            COLOUR_IN <= 1'b0; 
        end
        

        else if (BUS_ADDR==8'hB0)
        begin
            Y_ADDR <= BUS_DATA[7:1];
            A_WE <= 1'b1;
            COLOUR_IN <= 1'b0;
            A_DATA_IN <= BUS_DATA[0];
        end

        else if (BUS_ADDR==8'hB2)
        begin
            COLOUR_IN <= BUS_DATA[0];
            A_WE <= 1'b0;
        end
        else
        begin
            X_ADDR <= X_ADDR;
            Y_ADDR <= Y_ADDR;
            A_WE <= 1'b0;
            COLOUR_IN <= 1'b0;
        end
    end
        


    Generic_counter # (.COUNTER_WIDTH(8),
                       .COUNTER_MAX(2**8-1)
                       )
                     COL_SELECT (
                     .CLK(COLOUR_IN),
                     .ENABLE_IN(1'b1),
                     .RESET(1'b0),
                     .COUNT(ColourCount[7:0])   
                     );
    
    

    Frame_Buffer # (.HorRes(160),
                    .VertRes(120),
                    .HorConst(0),
                    .VertConst(8),
                    .image("Mymatrix_1d.txt")
                    )
    basic_image(
                    .A_CLK(CLK),
                    .A_ADDR(A_ADDR),
                    .A_DATA_IN(A_DATA_IN),
                    .A_DATA_OUT(), 
                    .A_WE(A_WE),
                    .B_CLK(DPR_CLK),
                    .B_ADDR(VGA_ADDR),
                    .B_DATA(B_DATA_1)
                    );   
    

    assign IMG_DATA = B_DATA_1; 


    VGA_Sig_Gen vga_control(
                    .CLK(CLK),
                    .RESET(RESET),
                    .RE(RE),

                    .CONFIG_COLOURS(CONFIG_COLOURS), 

                    .DPR_CLK(DPR_CLK),
                    .VGA_ADDR(VGA_ADDR),
                    .VGA_DATA(IMG_DATA),

                    .VGA_HS(VGA_HS),
                    .VGA_VS(VGA_VS),
                    .VGA_COLOUR(VGA_COLOUR)
                    ); 

endmodule
module vga_wrapper(
        input CLK,
        input RESET,
        input [7:0] BUS_ADDR,
        inout [7:0] BUS_DATA,
        output [7:0] VGA_COLOUR,
        output VGA_HS,
        output VGA_VS
        );


    wire B_DATA_1;
    wire IMG_DATA;
    wire A_DATA_OUT;

    

    wire DPR_CLK;
    wire [14:0] VGA_ADDR;

    

    reg A_DATA_IN;
    wire [14:0] A_ADDR;
    reg A_WE;

    

    wire TRIG_1_S;
    wire [7:0] ColourCount;
    reg COLOUR_IN;
    wire [15:0] CONFIG_COLOURS;
    
    reg [7:0] X_ADDR; 
    reg [6:0] Y_ADDR; 
    reg RE;
    

    assign CONFIG_COLOURS = {ColourCount[7:0], 8'h15};
    

    assign A_ADDR = {Y_ADDR, X_ADDR};
        
    initial 
        RE <= 1'b1;
    

    always @(*)
    begin

        if (BUS_ADDR==8'hB1)
        begin
            X_ADDR <= BUS_DATA;
            A_WE <= 1'b0;
            COLOUR_IN <= 1'b0; 
        end
        

        else if (BUS_ADDR==8'hB0)
        begin
            Y_ADDR <= BUS_DATA[7:1];
            A_WE <= 1'b1;
            COLOUR_IN <= 1'b0;
            A_DATA_IN <= BUS_DATA[0];
        end

        else if (BUS_ADDR==8'hB2)
        begin
            COLOUR_IN <= BUS_DATA[0];
            A_WE <= 1'b0;
        end
        else
        begin
            X_ADDR <= X_ADDR;
            Y_ADDR <= Y_ADDR;
            A_WE <= 1'b0;
            COLOUR_IN <= 1'b0;
        end
    end
        


    Generic_counter # (.COUNTER_WIDTH(8),
                       .COUNTER_MAX(2**8-1)
                       )
                     COL_SELECT (
                     .CLK(COLOUR_IN),
                     .ENABLE_IN(1'b1),
                     .RESET(1'b0),
                     .COUNT(ColourCount[7:0])   
                     );
    
    

    Frame_Buffer # (.HorRes(160),
                    .VertRes(120),
                    .HorConst(0),
                    .VertConst(8),
                    .image("Mymatrix_1d.txt")
                    )
    basic_image(
                    .A_CLK(CLK),
                    .A_ADDR(A_ADDR),
                    .A_DATA_IN(A_DATA_IN),
                    .A_DATA_OUT(), 
                    .A_WE(A_WE),
                    .B_CLK(DPR_CLK),
                    .B_ADDR(VGA_ADDR),
                    .B_DATA(B_DATA_1)
                    );   
    

    assign IMG_DATA = B_DATA_1; 


    VGA_Sig_Gen vga_control(
                    .CLK(CLK),
                    .RESET(RESET),
                    .RE(RE),

                    .CONFIG_COLOURS(CONFIG_COLOURS), 

                    .DPR_CLK(DPR_CLK),
                    .VGA_ADDR(VGA_ADDR),
                    .VGA_DATA(IMG_DATA),

                    .VGA_HS(VGA_HS),
                    .VGA_VS(VGA_VS),
                    .VGA_COLOUR(VGA_COLOUR)
                    ); 

endmodule