data/full_repos/permissive/474294847/rtl-src/pooling-activations/max-pooling.v
1: b'%Error: data/full_repos/permissive/474294847/rtl-src/pooling-activations/max-pooling.v:1: Cannot find include file: max-compare.v\n`include "max-compare.v" \n         ^~~~~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/474294847/rtl-src/pooling-activations,data/full_repos/permissive/474294847/max-compare.v\n             data/full_repos/permissive/474294847/rtl-src/pooling-activations,data/full_repos/permissive/474294847/max-compare.v.v\n             data/full_repos/permissive/474294847/rtl-src/pooling-activations,data/full_repos/permissive/474294847/max-compare.v.sv\n             max-compare.v\n             max-compare.v.v\n             max-compare.v.sv\n             obj_dir/max-compare.v\n             obj_dir/max-compare.v.v\n             obj_dir/max-compare.v.sv\n%Error: Exiting due to 1 error(s)\n'
module max_pooling (activations, max_pool_out);


    parameter POOLING_NxN = 2;
    parameter WIDTH = 8;
    localparam KERNEL_SIZE = POOLING_NxN * POOLING_NxN;
    localparam MAX_VAL_UNITS = KERNEL_SIZE - 1;
    localparam MAX_VAL_ARRAY_COUNT = (MAX_VAL_UNITS * 2) + 1;


    input signed [(WIDTH*KERNEL_SIZE)-1:0] activations;
    output signed [WIDTH-1:0] max_pool_out;


wire [WIDTH-1:0] max_val_array [0:MAX_VAL_ARRAY_COUNT-1];
genvar gi;


generate
    for (gi = 0; gi < KERNEL_SIZE; gi = gi + 1)
    begin
        if (gi == 0)
        begin
            assign max_val_array[gi] = activations[((gi+1)*WIDTH)-1:(gi*WIDTH)];
        end
        else
        begin
            assign max_val_array[(gi*2)-1] = activations[((gi+1)*WIDTH)-1:(gi*WIDTH)];
        end
    end
endgenerate


generate
    for (gi = 0; gi < MAX_VAL_UNITS; gi = gi + 1)
    begin
        max_compare max_compare_inst
        (
            max_val_array[gi*2], 
            max_val_array[(gi*2)+1], 
            max_val_array[(gi*2)+2]
        );
        defparam max_compare_inst.WIDTH = WIDTH;
    end
endgenerate

assign max_pool_out = max_val_array[MAX_VAL_ARRAY_COUNT-1];

endmodule
module max_pooling (activations, max_pool_out);



    parameter POOLING_NxN = 2;
    parameter WIDTH = 8;
    localparam KERNEL_SIZE = POOLING_NxN * POOLING_NxN;
    localparam MAX_VAL_UNITS = KERNEL_SIZE - 1;
    localparam MAX_VAL_ARRAY_COUNT = (MAX_VAL_UNITS * 2) + 1;


    input signed [(WIDTH*KERNEL_SIZE)-1:0] activations;
    output signed [WIDTH-1:0] max_pool_out;


wire [WIDTH-1:0] max_val_array [0:MAX_VAL_ARRAY_COUNT-1];
genvar gi;


generate
    for (gi = 0; gi < KERNEL_SIZE; gi = gi + 1)
    begin
        if (gi == 0)
        begin
            assign max_val_array[gi] = activations[((gi+1)*WIDTH)-1:(gi*WIDTH)];
        end
        else
        begin
            assign max_val_array[(gi*2)-1] = activations[((gi+1)*WIDTH)-1:(gi*WIDTH)];
        end
    end
endgenerate


generate
    for (gi = 0; gi < MAX_VAL_UNITS; gi = gi + 1)
    begin
        max_compare max_compare_inst
        (
            max_val_array[gi*2], 
            max_val_array[(gi*2)+1], 
            max_val_array[(gi*2)+2]
        );
        defparam max_compare_inst.WIDTH = WIDTH;
    end
endgenerate

assign max_pool_out = max_val_array[MAX_VAL_ARRAY_COUNT-1];

endmodule