Skip to content

Commit cda574e

Browse files
committed
drl acc int sign-extend fix
1 parent c8d171b commit cda574e

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

‎hw/rtl/tcu/VX_tcu_fedp_drl.sv‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ module VX_tcu_fedp_drl #(
9595
.N(TCK+1)
9696
) csa_acc (
9797
.sigsIn (pipe_aln_sigs),
98+
.fmt_sel (pipe_fmt_sel),
9899
.sigOut (acc_sig),
99100
.signOuts (sigs_sign)
100101
);

‎hw/rtl/tcu/drl/VX_tcu_drl_acc.sv‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@ module VX_tcu_drl_acc #(
1818
parameter W = 25+$clog2(N)+1
1919
) (
2020
input wire [N-1:0][24:0] sigsIn,
21+
input wire fmt_sel,
2122
output logic [W-1:0] sigOut,
2223
output logic [N-2:0] signOuts
2324
);
24-
// Sign-extend addends to W bits
25+
// Sign-extend fp significands to W bits
2526
wire [N-1:0][W-1:0] sigsIn_ext;
2627
for (genvar i = 0; i < N; i++) begin : g_ext_sign
27-
assign sigsIn_ext[i] = {{(W-25){sigsIn[i][24]}}, sigsIn[i]};
28+
assign sigsIn_ext[i] = fmt_sel ? {{(W-25){1'b0}}, sigsIn[i]} : {{(W-25){sigsIn[i][24]}}, sigsIn[i]};
2829
end
2930

3031
//Carry-Save-Adder based significand accumulation

‎hw/rtl/tcu/drl/VX_tcu_drl_norm_round.sv‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ module VX_tcu_drl_norm_round #(
6262

6363
//Final INT addition
6464
wire [6:0] ext_acc_int = 7'($signed(acc_sig[25+$clog2(N):25]));
65-
wire [N-1:0][6:0] ext_signs;
65+
wire [N-2:0][6:0] ext_signs;
6666
for (genvar i = 0; i < N-1; i++) begin : g_sign_ext
6767
assign ext_signs[i] = 7'($signed(sigSigns[i]));
6868
end
69-
assign ext_signs[N-1] = 7'd0; //($signed(acc_sig[25+$clog2(N)-1]));
69+
7070
wire [6:0] int_hi;
7171

7272
VX_csa_tree #(
73-
.N (N+2),
73+
.N (N+1),
7474
.W (7),
7575
.S (7)
7676
) int_adder (

0 commit comments

Comments
 (0)