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_fsm(clock, reset,
                         start, done,
                         reset_counter, increment_counter, grid_write, counter_at_max);

    input clock;
    input reset;


    input start;
    output done;


    output reset_counter, increment_counter, grid_write;
    input counter_at_max;


    reg [2:0] state;


    localparam WAIT          = 3'd0,
               INITIALIZE    = 3'd1,
               STORE_IN_GRID = 3'd2,
               INCREMENT     = 3'd3,
               DONE          = 3'd4;


    always @(posedge clock) begin
       if (reset)
           state <= WAIT;
       else begin
           case (state)
               WAIT:           state <= start ? INITIALIZE : WAIT;
               INITIALIZE:     state <= STORE_IN_GRID;
               STORE_IN_GRID:  state <= counter_at_max ? DONE : INCREMENT;
               INCREMENT:      state <= STORE_IN_GRID;
               DONE:           state <= WAIT;
               default:        state <= WAIT;
           endcase
       end
    end


    assign reset_counter = state == INITIALIZE;
    assign increment_counter = state == INCREMENT;
    assign grid_write = state == STORE_IN_GRID;
    assign done = state == DONE;
endmodule
module _level_loader_fsm(clock, reset,
                         start, done,
                         reset_counter, increment_counter, grid_write, counter_at_max);


    input clock;
    input reset;


    input start;
    output done;


    output reset_counter, increment_counter, grid_write;
    input counter_at_max;


    reg [2:0] state;


    localparam WAIT          = 3'd0,
               INITIALIZE    = 3'd1,
               STORE_IN_GRID = 3'd2,
               INCREMENT     = 3'd3,
               DONE          = 3'd4;


    always @(posedge clock) begin
       if (reset)
           state <= WAIT;
       else begin
           case (state)
               WAIT:           state <= start ? INITIALIZE : WAIT;
               INITIALIZE:     state <= STORE_IN_GRID;
               STORE_IN_GRID:  state <= counter_at_max ? DONE : INCREMENT;
               INCREMENT:      state <= STORE_IN_GRID;
               DONE:           state <= WAIT;
               default:        state <= WAIT;
           endcase
       end
    end


    assign reset_counter = state == INITIALIZE;
    assign increment_counter = state == INCREMENT;
    assign grid_write = state == STORE_IN_GRID;
    assign done = state == DONE;
endmodule