Skip to content

Commit

Permalink
Restrict to narrow-range weights for the moment.
Browse files Browse the repository at this point in the history
  • Loading branch information
preusser committed May 22, 2024
1 parent 6772e03 commit 9e2ba5c
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions finn-rtllib/mvu/tb/mvu_axi_tb.sv
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ module mvu_axi_tb();
localparam int unsigned MH = 32;
localparam int unsigned SIMD = 48;
localparam int unsigned PE = 16;
localparam int unsigned SEGMENTLEN = 2.0;
localparam bit FORCE_BEHAVIORAL = 1;
localparam int unsigned SEGMENTLEN = 2;
localparam bit FORCE_BEHAVIORAL = 0;
localparam bit M_REG_LUT = 1;
// Bit-width config
localparam int unsigned ACTIVATION_WIDTH = 4;
Expand Down Expand Up @@ -112,6 +112,17 @@ module mvu_axi_tb();
function weight_matrix_t init_WEIGHTS;
automatic weight_matrix_t res;
std::randomize(res);
for(int unsigned nf = 0; nf < NF; nf++) begin
for(int unsigned sf = 0; sf < SF; sf++) begin
for(int unsigned pe = 0; pe < PE; pe++) begin
for(int unsigned simd = 0; simd < SIMD; simd++) begin
if(res[nf][sf][pe][simd] == (1 << (WEIGHT_WIDTH-1))) begin
res[nf][sf][pe][simd]++;
end
end
end
end
end
return res;
endfunction : init_WEIGHTS;

Expand Down

0 comments on commit 9e2ba5c

Please sign in to comment.