data/full_repos/permissive/194450802/level_loader.v
1: b"%Error: data/full_repos/permissive/194450802/level_loader.v:149: Cannot find file containing module: 'level_0'\n    level_0 lvl0(.x(grid_x), .y(grid_y), .value(grid_in0));\n    ^~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/194450802,data/full_repos/permissive/194450802/level_0\n             data/full_repos/permissive/194450802,data/full_repos/permissive/194450802/level_0.v\n             data/full_repos/permissive/194450802,data/full_repos/permissive/194450802/level_0.sv\n             level_0\n             level_0.v\n             level_0.sv\n             obj_dir/level_0\n             obj_dir/level_0.v\n             obj_dir/level_0.sv\n%Error: data/full_repos/permissive/194450802/level_loader.v:150: Cannot find file containing module: 'level_1'\n    level_1 lvl1(.x(grid_x), .y(grid_y), .value(grid_in1));\n    ^~~~~~~\n%Error: data/full_repos/permissive/194450802/level_loader.v:151: Cannot find file containing module: 'level_2'\n    level_2 lvl2(.x(grid_x), .y(grid_y), .value(grid_in2));\n    ^~~~~~~\n%Error: data/full_repos/permissive/194450802/level_loader.v:152: Cannot find file containing module: 'level_3'\n    level_3 lvl3(.x(grid_x), .y(grid_y), .value(grid_in3));\n    ^~~~~~~\n%Error: Exiting due to 4 error(s)\n"
module _level_loader_datapath(clock, reset, level,
                            grid_x, grid_y, grid_in,
                            reset_counter, increment_counter, counter_at_max);

    input clock;
    input reset;


    input [1:0] level;


    localparam LEVEL_0 = 2'd0,
               LEVEL_1 = 2'd1,
               LEVEL_2 = 2'd2,
               LEVEL_3 = 2'd3;


    output [5:0] grid_x;
    output [4:0] grid_y;
    output [2:0] grid_in;
    reg [2:0] grid_in;


    input reset_counter;
    input increment_counter;
    output counter_at_max;


    reg [5:0] grid_x;
    reg [4:0] grid_y;


    wire x_at_max;
    wire y_at_max;
    assign x_at_max = grid_x == 6'd39;
    assign y_at_max = grid_y == 5'd29;
    always @(posedge clock) begin
        if (reset_counter | reset) begin
            grid_x <= 6'b0;
            grid_y <= 5'b0;
        end
        else if (increment_counter) begin
            if (x_at_max) begin
                grid_x <= 0;
                grid_y <= grid_y + 1;
            end
            else
                grid_x <= grid_x + 1;
        end
    end
    assign counter_at_max = x_at_max & y_at_max;


    wire [2:0] grid_in0, grid_in1, grid_in2, grid_in3;
    level_0 lvl0(.x(grid_x), .y(grid_y), .value(grid_in0));
    level_1 lvl1(.x(grid_x), .y(grid_y), .value(grid_in1));
    level_2 lvl2(.x(grid_x), .y(grid_y), .value(grid_in2));
    level_3 lvl3(.x(grid_x), .y(grid_y), .value(grid_in3));

    always @(*) begin
        case (level)
            LEVEL_0: grid_in = grid_in0;
            LEVEL_1: grid_in = grid_in1;
            LEVEL_2: grid_in = grid_in2;
            LEVEL_3: grid_in = grid_in3;
            default: grid_in = grid_in0;
        endcase
    end
endmodule
module _level_loader_datapath(clock, reset, level,
                            grid_x, grid_y, grid_in,
                            reset_counter, increment_counter, counter_at_max);


    input clock;
    input reset;


    input [1:0] level;


    localparam LEVEL_0 = 2'd0,
               LEVEL_1 = 2'd1,
               LEVEL_2 = 2'd2,
               LEVEL_3 = 2'd3;


    output [5:0] grid_x;
    output [4:0] grid_y;
    output [2:0] grid_in;
    reg [2:0] grid_in;


    input reset_counter;
    input increment_counter;
    output counter_at_max;


    reg [5:0] grid_x;
    reg [4:0] grid_y;


    wire x_at_max;
    wire y_at_max;
    assign x_at_max = grid_x == 6'd39;
    assign y_at_max = grid_y == 5'd29;
    always @(posedge clock) begin
        if (reset_counter | reset) begin
            grid_x <= 6'b0;
            grid_y <= 5'b0;
        end
        else if (increment_counter) begin
            if (x_at_max) begin
                grid_x <= 0;
                grid_y <= grid_y + 1;
            end
            else
                grid_x <= grid_x + 1;
        end
    end
    assign counter_at_max = x_at_max & y_at_max;


    wire [2:0] grid_in0, grid_in1, grid_in2, grid_in3;
    level_0 lvl0(.x(grid_x), .y(grid_y), .value(grid_in0));
    level_1 lvl1(.x(grid_x), .y(grid_y), .value(grid_in1));
    level_2 lvl2(.x(grid_x), .y(grid_y), .value(grid_in2));
    level_3 lvl3(.x(grid_x), .y(grid_y), .value(grid_in3));

    always @(*) begin
        case (level)
            LEVEL_0: grid_in = grid_in0;
            LEVEL_1: grid_in = grid_in1;
            LEVEL_2: grid_in = grid_in2;
            LEVEL_3: grid_in = grid_in3;
            default: grid_in = grid_in0;
        endcase
    end
endmodule