Skip to content

Commit

Permalink
[mvu rtl]: minor change to width of signal
Browse files Browse the repository at this point in the history
  • Loading branch information
mmrahorovic committed May 12, 2024
1 parent 39fb885 commit 34343e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion finn-rtllib/mvu/mvu_4sx4u.sv
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ module mvu_4sx4u #(
uwire [$clog2(SIMD)+7:0] lo4[3];
for(genvar i = 0; i < 4; i++) begin
localparam int unsigned LO_WIDTH = D[i+1] - D[i];
localparam int unsigned HI_WIDTH = ACCU_WIDTH - LO_WIDTH;
localparam int unsigned HI_WIDTH = (ACCU_WIDTH - LO_WIDTH) < ($clog2(1+SIMD) + 1) ? $clog2(1+SIMD) : (ACCU_WIDTH - LO_WIDTH);

// Conclusive high part accumulation
if(i >= PE_REM && i < 3) begin : genHi
Expand Down
4 changes: 2 additions & 2 deletions finn-rtllib/mvu/mvu_8sx8u_dsp48.sv
Original file line number Diff line number Diff line change
Expand Up @@ -449,11 +449,11 @@ module mvu_8sx8u_dsp48 #(

uwire signed [ACCU_WIDTH -1:0] up4;
uwire signed [ACCU_WIDTH -SINGLE_PROD_WIDTH:0] hi4;
uwire [$clog2(SIMD)+SINGLE_PROD_WIDTH-1:0] lo4;
uwire [$clog2(SIMD)+SINGLE_PROD_WIDTH:0] lo4;

// Conclusive high part accumulation
if(PE_REM == 0) begin : genHi
localparam int unsigned HI_WIDTH = ACCU_WIDTH - D[1];
localparam int unsigned HI_WIDTH = (ACCU_WIDTH - SINGLE_PROD_WIDTH) < ($clog2(1+SIMD)+1) ? $clog2(1+SIMD)+1 : ACCU_WIDTH - SINGLE_PROD_WIDTH;
// Adder Tree across all SIMD high contributions, each from [-1:1]
uwire signed [2*SIMD-2:0][$clog2(1+SIMD):0] tree;
for(genvar s = 0; s < SIMD; s++) assign tree[SIMD-1+s] = h3[s];
Expand Down

0 comments on commit 34343e9

Please sign in to comment.