mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
Merge branch 'main' of https://github.com/openhwgroup/cvw into dev
This commit is contained in:
commit
df57ccd885
@ -25,7 +25,7 @@ vlib work
|
|||||||
# start and run simulation
|
# start and run simulation
|
||||||
# remove +acc flag for faster sim during regressions if there is no need to access internal signals
|
# remove +acc flag for faster sim during regressions if there is no need to access internal signals
|
||||||
# $num = the added words after the call
|
# $num = the added words after the call
|
||||||
vlog +incdir+../config/$1 +incdir+../config/shared ../testbench/testbench-fp.sv ../src/fpu/*.sv ../src/fpu/*/*.sv ../src/generic/*.sv ../src/generic/flop/*.sv -suppress 2583,7063,8607,2697
|
vlog +incdir+../config/$1 +incdir+../config/shared ../src/wally/cvw.sv ../testbench/testbench-fp.sv ../src/fpu/*.sv ../src/fpu/*/*.sv ../src/generic/*.sv ../src/generic/flop/*.sv -suppress 2583,7063,8607,2697
|
||||||
|
|
||||||
vsim -voptargs=+acc work.testbenchfp -G TEST=$2
|
vsim -voptargs=+acc work.testbenchfp -G TEST=$2
|
||||||
|
|
||||||
|
@ -24,8 +24,11 @@
|
|||||||
// and limitations under the License.
|
// and limitations under the License.
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
`include "wally-config.vh"
|
`include "wally-config.vh"
|
||||||
|
`include "config.vh"
|
||||||
`include "tests-fp.vh"
|
`include "tests-fp.vh"
|
||||||
|
|
||||||
|
import cvw::*;
|
||||||
|
|
||||||
module testbenchfp;
|
module testbenchfp;
|
||||||
parameter TEST="none";
|
parameter TEST="none";
|
||||||
|
|
||||||
@ -108,6 +111,9 @@ module testbenchfp;
|
|||||||
logic [`DIVb:0] QmM;
|
logic [`DIVb:0] QmM;
|
||||||
logic [`XLEN-1:0] FIntDivResultM;
|
logic [`XLEN-1:0] FIntDivResultM;
|
||||||
|
|
||||||
|
`include "parameter-defs.vh"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@ -681,7 +687,7 @@ module testbenchfp;
|
|||||||
.ASticky);
|
.ASticky);
|
||||||
end
|
end
|
||||||
|
|
||||||
postprocess postprocess(.Xs(Xs), .Ys(Ys), .PostProcSel(UnitVal[1:0]),
|
postprocess #(P) postprocess(.Xs(Xs), .Ys(Ys), .PostProcSel(UnitVal[1:0]),
|
||||||
.OpCtrl(OpCtrlVal), .DivQm(Quot), .DivQe(DivCalcExp),
|
.OpCtrl(OpCtrlVal), .DivQm(Quot), .DivQe(DivCalcExp),
|
||||||
.Xm(Xm), .Ym(Ym), .Zm(Zm), .CvtCe(CvtCalcExpE), .DivSticky(DivSticky), .FmaSs(Ss),
|
.Xm(Xm), .Ym(Ym), .Zm(Zm), .CvtCe(CvtCalcExpE), .DivSticky(DivSticky), .FmaSs(Ss),
|
||||||
.XNaN(XNaN), .YNaN(YNaN), .ZNaN(ZNaN), .CvtResSubnormUf(CvtResSubnormUfE),
|
.XNaN(XNaN), .YNaN(YNaN), .ZNaN(ZNaN), .CvtResSubnormUf(CvtResSubnormUfE),
|
||||||
@ -704,7 +710,7 @@ module testbenchfp;
|
|||||||
.XNaN, .YNaN, .XSNaN, .YSNaN, .X, .Y, .CmpNV(CmpFlg[4]), .CmpFpRes(FpCmpRes));
|
.XNaN, .YNaN, .XSNaN, .YSNaN, .X, .Y, .CmpNV(CmpFlg[4]), .CmpFpRes(FpCmpRes));
|
||||||
end
|
end
|
||||||
if (TEST === "div" | TEST === "sqrt" | TEST === "all") begin: fdivsqrt
|
if (TEST === "div" | TEST === "sqrt" | TEST === "all") begin: fdivsqrt
|
||||||
fdivsqrt fdivsqrt(.clk, .reset, .XsE(Xs), .FmtE(ModFmt), .XmE(Xm), .YmE(Ym),
|
fdivsqrt #(P) fdivsqrt(.clk, .reset, .XsE(Xs), .FmtE(ModFmt), .XmE(Xm), .YmE(Ym),
|
||||||
.XeE(Xe), .YeE(Ye), .SqrtE(OpCtrlVal[0]), .SqrtM(OpCtrlVal[0]),
|
.XeE(Xe), .YeE(Ye), .SqrtE(OpCtrlVal[0]), .SqrtM(OpCtrlVal[0]),
|
||||||
.XInfE(XInf), .YInfE(YInf), .XZeroE(XZero), .YZeroE(YZero),
|
.XInfE(XInf), .YInfE(YInf), .XZeroE(XZero), .YZeroE(YZero),
|
||||||
.XNaNE(XNaN), .YNaNE(YNaN),
|
.XNaNE(XNaN), .YNaNE(YNaN),
|
||||||
@ -982,6 +988,8 @@ module readvectors (
|
|||||||
);
|
);
|
||||||
logic XEn, YEn, ZEn;
|
logic XEn, YEn, ZEn;
|
||||||
|
|
||||||
|
`include "parameter-defs.vh"
|
||||||
|
|
||||||
// apply test vectors on rising edge of clk
|
// apply test vectors on rising edge of clk
|
||||||
// Format of vectors Inputs(1/2/3)_AnsFlg
|
// Format of vectors Inputs(1/2/3)_AnsFlg
|
||||||
always @(VectorNum) begin
|
always @(VectorNum) begin
|
||||||
@ -1338,7 +1346,8 @@ module readvectors (
|
|||||||
assign YEn = ~((Unit == `CVTINTUNIT)|(Unit == `CVTFPUNIT)|((Unit == `DIVUNIT)&OpCtrl[0]));
|
assign YEn = ~((Unit == `CVTINTUNIT)|(Unit == `CVTFPUNIT)|((Unit == `DIVUNIT)&OpCtrl[0]));
|
||||||
assign ZEn = (Unit == `FMAUNIT);
|
assign ZEn = (Unit == `FMAUNIT);
|
||||||
|
|
||||||
unpack unpack(.X, .Y, .Z, .Fmt(ModFmt), .Xs, .Ys, .Zs, .Xe, .Ye, .Ze,
|
|
||||||
|
unpack #(P) unpack(.X, .Y, .Z, .Fmt(ModFmt), .Xs, .Ys, .Zs, .Xe, .Ye, .Ze,
|
||||||
.Xm, .Ym, .Zm, .XNaN, .YNaN, .ZNaN, .XSNaN, .YSNaN, .ZSNaN,
|
.Xm, .Ym, .Zm, .XNaN, .YNaN, .ZNaN, .XSNaN, .YSNaN, .ZSNaN,
|
||||||
.XSubnorm, .XZero, .YZero, .ZZero, .XInf, .YInf, .ZInf,
|
.XSubnorm, .XZero, .YZero, .ZZero, .XInf, .YInf, .ZInf,
|
||||||
.XEn, .YEn, .ZEn, .XExpMax, .XPostBox);
|
.XEn, .YEn, .ZEn, .XExpMax, .XPostBox);
|
||||||
|
Loading…
Reference in New Issue
Block a user