data/full_repos/permissive/501710956/my_snake.srcs/sources_1/new/VGA.v
1: b"%Error: data/full_repos/permissive/501710956/my_snake.srcs/sources_1/new/VGA.v:70: Cannot find file containing module: 'print_num'\n    print_num numout(.num(score),.x(x),.y(y),.red(num_red),.grn(num_grn),.blu(num_blu));\n    ^~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/501710956/my_snake.srcs/sources_1/new,data/full_repos/permissive/501710956/print_num\n             data/full_repos/permissive/501710956/my_snake.srcs/sources_1/new,data/full_repos/permissive/501710956/print_num.v\n             data/full_repos/permissive/501710956/my_snake.srcs/sources_1/new,data/full_repos/permissive/501710956/print_num.sv\n             print_num\n             print_num.v\n             print_num.sv\n             obj_dir/print_num\n             obj_dir/print_num.v\n             obj_dir/print_num.sv\n%Error: Exiting due to 1 error(s)\n"
module VGA(input CLK,
                input [999:0] map,
                input [5:0] head1_x,
                input [4:0] head1_y,
                input [5:0] head2_x,
                input [4:0] head2_y,
                input [5:0] food_x,
                input [4:0] food_y,
                input [3:0] score_l,
                input [3:0] score_m,
                input [3:0] score_l2,
                input [3:0] score_m2,









                output reg [3:0] RED,
                output reg [3:0] GRN,
                output reg [3:0] BLU,
                output reg HSync,
                output reg VSync);

    reg [11:0] Hsync_s;
    reg [20:0] Vsync_s;


    reg [5:0] y_m;
    reg [4:0] x_m;
    reg [1:0] cnt_m;


    reg [5:0] y_l;
    reg [4:0] x_l;
    reg [1:0] cnt_l;


    reg [5:0] y2_m;
    reg [4:0] x2_m;
    reg [1:0] cnt2_m;


    reg [5:0] y2_l;
    reg [4:0] x2_l;
    reg [1:0] cnt2_l;

    reg [5:0] y;
    reg [4:0] x;
    wire [3:0] num_red;
    wire [3:0] num_grn;
    wire [3:0] num_blu;

    reg [3:0] row;
    reg [5:0] col;
    reg [3:0] block_clk;
    reg [1:0] pixel_cnt;
    reg [4:0] row_block;

    reg [3:0] score;






    print_num numout(.num(score),.x(x),.y(y),.red(num_red),.grn(num_grn),.blu(num_blu));

    always @(posedge CLK) begin


        Hsync_s <= 0;
        Vsync_s <= 0;
        if (Hsync_s == 0) begin
            HSync   <= 0;
            Hsync_s <= Hsync_s+1;
        end
        else if (Hsync_s == 384) begin
            HSync   <= 1;
            Hsync_s <= Hsync_s+1;
        end
        else if (Hsync_s == 3199) Hsync_s <= 0;
        else if (Hsync_s>0&&Hsync_s<3199&&Hsync_s != 384) Hsync_s <= Hsync_s+1;
        if (Vsync_s == 0) begin
            VSync   <= 0;
            Vsync_s <= Vsync_s+1;
        end
        else if (Vsync_s == 6400) begin
            VSync   <= 1;
            Vsync_s <= Vsync_s+1;
        end
        else if (Vsync_s == 1667199) begin
            Vsync_s <= 0;
            VSync   <= 0;
        end
        else if (Vsync_s>0&&Vsync_s<1667199&&Vsync_s != 6400) Vsync_s <= Vsync_s+1;
    end
    always @(posedge CLK) begin





        if(Vsync_s>=0&&Vsync_s<10&&Hsync_s>=0&&Hsync_s<10) begin
            y_m<=0;
            x_m<=0;
            cnt_m<=0;
            y_l<=0;
            x_l<=0;
            cnt_l<=0;
            row<=0;
            col<=0;
            block_clk<=0;
            pixel_cnt<=0;
            row_block<=0;
        end
        else if((Vsync_s>=99200&&Vsync_s<1379200)&&(Hsync_s>=576&&Hsync_s<3136)) begin
            if(pixel_cnt==3) begin
                pixel_cnt<=0;
                if(block_clk==15) begin
                    block_clk<=0;
                    if(col==39) begin
                        col<=0;
                        if(row==15) begin
                            row<=0;
                            if(row_block==24) begin
                                pixel_cnt<=0;
                                block_clk<=0;
                                col<=0;
                                row<=0;
                                row_block<=0;
                            end
                            else row_block<=row_block+1;
                        end
                        else row<=row+1;
                    end
                    else col<=col+1;
                end
                block_clk<=block_clk+1;
            end
            else pixel_cnt<=pixel_cnt+1;

            if(col==0||col==39||row_block==0||row_block==24) begin
                RED<=4'b1111;
                GRN<=4'b1111;
                BLU<=4'b1111;
            end
            else if(row_block==food_y&&col==food_x) begin
                RED<=4'b1111;
                GRN<=4'b0000;
                BLU<=4'b0000;
            end
            else if(map[40*row_block+col]==1) begin
                if(row_block==head1_y&&col==head1_x) begin
                    RED<=4'b0000;
                    GRN<=4'b1111;
                    BLU<=4'b1111;
                end
                else if (row_block==head2_y&&col==head2_x) begin
                    RED<=4'b1111;
                    GRN<=4'b0000;
                    BLU<=4'b1111;
                end
                else begin
                    RED<=4'b1111;
                    GRN<=4'b1111;
                    BLU<=4'b0000;
                end
            end
            else begin
                RED<=4'b0000;
                GRN<=4'b0000;
                BLU<=4'b0000;
            end
        end
        else if(Vsync_s>=1446400&&Vsync_s<1568000) begin
            if(Hsync_s>=948&&Hsync_s<1056) begin
                score<=score_m;
                y<=y_m;
                x<=x_m;
                if(cnt_m==3) begin
                    cnt_m<=0;
                    if(x_m==26) begin
                        x_m<=0;
                        if(y_m==37) begin
                            x_m<=0;
                            y_m<=0;
                        end
                        else y_m<=y_m+1;
                    end
                    else x_m<=x_m+1;
                end
                else begin
                    cnt_m<=cnt_m+1;
                    x_m<=x_m;
                    y_m<=y_m;
                end
            end
            else if(Hsync_s>=1056&&Hsync_s<1164) begin
                score<=score_l;
                y<=y_l;
                x<=x_l;
                if(cnt_l==3) begin
                    cnt_l<=0;
                    if(x_l==26) begin
                        x_l<=0;
                        if(y_l==37) begin
                            x_l<=0;
                            y_l<=0;
                        end
                        else y_l<=y_l+1;
                    end
                    else x_l<=x_l+1;
                end
                else begin
                    cnt_l<=cnt_l+1;
                    x_l<=x_l;
                    y_l<=y_l;
                end
            end
            else if(Hsync_s>=2548&&Hsync_s<2656) begin
                score<=score_m2;
                y<=y2_m;
                x<=x2_m;
                if(cnt2_m==3) begin
                    cnt2_m<=0;
                    if(x2_m==26) begin
                        x2_m<=0;
                        if(y2_m==37) begin
                            x2_m<=0;
                            y2_m<=0;
                        end
                        else y2_m<=y2_m+1;
                    end
                    else x2_m<=x2_m+1;
                end
                else begin
                    cnt2_m<=cnt2_m+1;
                    x2_m<=x2_m;
                    y2_m<=y2_m;
                end
            end
            else if(Hsync_s>=2656&&Hsync_s<2764) begin
                score<=score_l2;
                y<=y2_l;
                x<=x2_l;
                if(cnt2_l==3) begin
                    cnt2_l<=0;
                    if(x2_l==26) begin
                        x2_l<=0;
                        if(y2_l==37) begin
                            x2_l<=0;
                            y2_l<=0;
                        end
                        else y2_l<=y2_l+1;
                    end
                    else x2_l<=x2_l+1;
                end
                else begin
                    cnt2_l<=cnt2_l+1;
                    x2_l<=x2_l;
                    y2_l<=y2_l;
                end
            end
            else begin
                cnt_m<=cnt_m;
                x_m<=x_m;
                y_m<=y_m;
                cnt_l<=cnt_l;
                x_l<=x_l;
                y_l<=y_l;
                pixel_cnt<=pixel_cnt;
                block_clk<=block_clk;
                col<=col;
                row<=row;
                row_block<=row_block;
                RED<=4'b0000;
                GRN<=4'b0000;
                BLU<=4'b0000;
            end
            RED<=num_red;
            GRN<=num_grn;
            BLU<=num_blu;
        end
        
        else begin
            RED<=4'b0000;
            GRN<=4'b0000;
            BLU<=4'b0000;
        end
    end
endmodule
module VGA(input CLK,
                input [999:0] map,
                input [5:0] head1_x,
                input [4:0] head1_y,
                input [5:0] head2_x,
                input [4:0] head2_y,
                input [5:0] food_x,
                input [4:0] food_y,
                input [3:0] score_l,
                input [3:0] score_m,
                input [3:0] score_l2,
                input [3:0] score_m2,









                output reg [3:0] RED,
                output reg [3:0] GRN,
                output reg [3:0] BLU,
                output reg HSync,
                output reg VSync);


    reg [11:0] Hsync_s;
    reg [20:0] Vsync_s;


    reg [5:0] y_m;
    reg [4:0] x_m;
    reg [1:0] cnt_m;


    reg [5:0] y_l;
    reg [4:0] x_l;
    reg [1:0] cnt_l;


    reg [5:0] y2_m;
    reg [4:0] x2_m;
    reg [1:0] cnt2_m;


    reg [5:0] y2_l;
    reg [4:0] x2_l;
    reg [1:0] cnt2_l;

    reg [5:0] y;
    reg [4:0] x;
    wire [3:0] num_red;
    wire [3:0] num_grn;
    wire [3:0] num_blu;

    reg [3:0] row;
    reg [5:0] col;
    reg [3:0] block_clk;
    reg [1:0] pixel_cnt;
    reg [4:0] row_block;

    reg [3:0] score;






    print_num numout(.num(score),.x(x),.y(y),.red(num_red),.grn(num_grn),.blu(num_blu));

    always @(posedge CLK) begin


        Hsync_s <= 0;
        Vsync_s <= 0;
        if (Hsync_s == 0) begin
            HSync   <= 0;
            Hsync_s <= Hsync_s+1;
        end
        else if (Hsync_s == 384) begin
            HSync   <= 1;
            Hsync_s <= Hsync_s+1;
        end
        else if (Hsync_s == 3199) Hsync_s <= 0;
        else if (Hsync_s>0&&Hsync_s<3199&&Hsync_s != 384) Hsync_s <= Hsync_s+1;
        if (Vsync_s == 0) begin
            VSync   <= 0;
            Vsync_s <= Vsync_s+1;
        end
        else if (Vsync_s == 6400) begin
            VSync   <= 1;
            Vsync_s <= Vsync_s+1;
        end
        else if (Vsync_s == 1667199) begin
            Vsync_s <= 0;
            VSync   <= 0;
        end
        else if (Vsync_s>0&&Vsync_s<1667199&&Vsync_s != 6400) Vsync_s <= Vsync_s+1;
    end
    always @(posedge CLK) begin





        if(Vsync_s>=0&&Vsync_s<10&&Hsync_s>=0&&Hsync_s<10) begin
            y_m<=0;
            x_m<=0;
            cnt_m<=0;
            y_l<=0;
            x_l<=0;
            cnt_l<=0;
            row<=0;
            col<=0;
            block_clk<=0;
            pixel_cnt<=0;
            row_block<=0;
        end
        else if((Vsync_s>=99200&&Vsync_s<1379200)&&(Hsync_s>=576&&Hsync_s<3136)) begin
            if(pixel_cnt==3) begin
                pixel_cnt<=0;
                if(block_clk==15) begin
                    block_clk<=0;
                    if(col==39) begin
                        col<=0;
                        if(row==15) begin
                            row<=0;
                            if(row_block==24) begin
                                pixel_cnt<=0;
                                block_clk<=0;
                                col<=0;
                                row<=0;
                                row_block<=0;
                            end
                            else row_block<=row_block+1;
                        end
                        else row<=row+1;
                    end
                    else col<=col+1;
                end
                block_clk<=block_clk+1;
            end
            else pixel_cnt<=pixel_cnt+1;

            if(col==0||col==39||row_block==0||row_block==24) begin
                RED<=4'b1111;
                GRN<=4'b1111;
                BLU<=4'b1111;
            end
            else if(row_block==food_y&&col==food_x) begin
                RED<=4'b1111;
                GRN<=4'b0000;
                BLU<=4'b0000;
            end
            else if(map[40*row_block+col]==1) begin
                if(row_block==head1_y&&col==head1_x) begin
                    RED<=4'b0000;
                    GRN<=4'b1111;
                    BLU<=4'b1111;
                end
                else if (row_block==head2_y&&col==head2_x) begin
                    RED<=4'b1111;
                    GRN<=4'b0000;
                    BLU<=4'b1111;
                end
                else begin
                    RED<=4'b1111;
                    GRN<=4'b1111;
                    BLU<=4'b0000;
                end
            end
            else begin
                RED<=4'b0000;
                GRN<=4'b0000;
                BLU<=4'b0000;
            end
        end
        else if(Vsync_s>=1446400&&Vsync_s<1568000) begin
            if(Hsync_s>=948&&Hsync_s<1056) begin
                score<=score_m;
                y<=y_m;
                x<=x_m;
                if(cnt_m==3) begin
                    cnt_m<=0;
                    if(x_m==26) begin
                        x_m<=0;
                        if(y_m==37) begin
                            x_m<=0;
                            y_m<=0;
                        end
                        else y_m<=y_m+1;
                    end
                    else x_m<=x_m+1;
                end
                else begin
                    cnt_m<=cnt_m+1;
                    x_m<=x_m;
                    y_m<=y_m;
                end
            end
            else if(Hsync_s>=1056&&Hsync_s<1164) begin
                score<=score_l;
                y<=y_l;
                x<=x_l;
                if(cnt_l==3) begin
                    cnt_l<=0;
                    if(x_l==26) begin
                        x_l<=0;
                        if(y_l==37) begin
                            x_l<=0;
                            y_l<=0;
                        end
                        else y_l<=y_l+1;
                    end
                    else x_l<=x_l+1;
                end
                else begin
                    cnt_l<=cnt_l+1;
                    x_l<=x_l;
                    y_l<=y_l;
                end
            end
            else if(Hsync_s>=2548&&Hsync_s<2656) begin
                score<=score_m2;
                y<=y2_m;
                x<=x2_m;
                if(cnt2_m==3) begin
                    cnt2_m<=0;
                    if(x2_m==26) begin
                        x2_m<=0;
                        if(y2_m==37) begin
                            x2_m<=0;
                            y2_m<=0;
                        end
                        else y2_m<=y2_m+1;
                    end
                    else x2_m<=x2_m+1;
                end
                else begin
                    cnt2_m<=cnt2_m+1;
                    x2_m<=x2_m;
                    y2_m<=y2_m;
                end
            end
            else if(Hsync_s>=2656&&Hsync_s<2764) begin
                score<=score_l2;
                y<=y2_l;
                x<=x2_l;
                if(cnt2_l==3) begin
                    cnt2_l<=0;
                    if(x2_l==26) begin
                        x2_l<=0;
                        if(y2_l==37) begin
                            x2_l<=0;
                            y2_l<=0;
                        end
                        else y2_l<=y2_l+1;
                    end
                    else x2_l<=x2_l+1;
                end
                else begin
                    cnt2_l<=cnt2_l+1;
                    x2_l<=x2_l;
                    y2_l<=y2_l;
                end
            end
            else begin
                cnt_m<=cnt_m;
                x_m<=x_m;
                y_m<=y_m;
                cnt_l<=cnt_l;
                x_l<=x_l;
                y_l<=y_l;
                pixel_cnt<=pixel_cnt;
                block_clk<=block_clk;
                col<=col;
                row<=row;
                row_block<=row_block;
                RED<=4'b0000;
                GRN<=4'b0000;
                BLU<=4'b0000;
            end
            RED<=num_red;
            GRN<=num_grn;
            BLU<=num_blu;
        end
        
        else begin
            RED<=4'b0000;
            GRN<=4'b0000;
            BLU<=4'b0000;
        end
    end
endmodule