File tree 3 files changed +22
-0
lines changed
3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,18 @@ ifdef TEST_PRINT
33
33
vsim_args += +TEST_PRINT
34
34
endif
35
35
36
+ ifeq ($(BUG ) , 1)
37
+ vlog_args += +define+BUG_ADDSUB
38
+ else
39
+ ifeq ($(BUG ) , 2)
40
+ vlog_args += +define+BUG_MULDIV
41
+ else
42
+ ifeq ($(BUG ) , 3)
43
+ vlog_args += +define+BUG_ADDSUB +define+BUG_MULDIV
44
+ endif
45
+ endif
46
+ endif
47
+
36
48
build :
37
49
vlog $(vlog_args ) $(SV_TARGET )
38
50
Original file line number Diff line number Diff line change @@ -112,9 +112,15 @@ module pfpu32_addsub
112
112
addsub_agtb_i ? fract24b_i : fract24a_i;
113
113
114
114
// shift amount
115
+ `ifdef BUG_ADDSUB
116
+ wire [9 :0 ] s1t_exp_diff =
117
+ addsub_agtb_i ? (exp10a_i + exp10b_i) :
118
+ (exp10b_i + exp10a_i);
119
+ `else
115
120
wire [9 :0 ] s1t_exp_diff =
116
121
addsub_agtb_i ? (exp10a_i - exp10b_i) :
117
122
(exp10b_i - exp10a_i);
123
+ `endif
118
124
119
125
// limiter by 31
120
126
wire [4 :0 ] s1t_shr = s1t_exp_diff[4 :0 ] | {5 {| s1t_exp_diff[9 :5 ]}};
Original file line number Diff line number Diff line change @@ -586,7 +586,11 @@ module pfpu32_muldiv
586
586
// In fact, as the dividend and divisor was normalized
587
587
// and the result is non-zero
588
588
// the '1' is maximum number of leading zeros in the quotient.
589
+ `ifdef BUG_MULDIV
590
+ wire s4t_nlz = s3o_res_qtnt26[25 ];
591
+ `else
589
592
wire s4t_nlz = ~ s3o_res_qtnt26[25 ];
593
+ `endif
590
594
// left shift flag and corrected exponent
591
595
wire s4t_shlx =
592
596
// shift isn't needed (includes zero result)
You can’t perform that action at this time.
0 commit comments