testbench-fp code cleanup

This commit is contained in:
Kevin Kim 2023-07-12 19:39:11 -07:00
parent f91d8c20e4
commit e37e989ede

View File

@ -1358,7 +1358,6 @@ module readvectors (
end end
`INTDIVUNIT: begin `INTDIVUNIT: begin
#20; #20;
if (OpCtrl === `INTDIV_OPCTRL) begin
X = {P.FLEN{1'bx}}; X = {P.FLEN{1'bx}};
SrcA = TestVector[2*(P.Q_LEN)+P.D_LEN-1:2*(P.Q_LEN)]; SrcA = TestVector[2*(P.Q_LEN)+P.D_LEN-1:2*(P.Q_LEN)];
SrcB = TestVector[(P.Q_LEN)+P.D_LEN-1:P.Q_LEN]; SrcB = TestVector[(P.Q_LEN)+P.D_LEN-1:P.Q_LEN];
@ -1367,125 +1366,44 @@ module readvectors (
if (~clk) #5; if (~clk) #5;
IDivStart = 1'b1; IDivStart = 1'b1;
IntDivE = 1'b1; IntDivE = 1'b1;
case (OpCtrl)
`INTDIV_OPCTRL: begin
Funct3E = 3'b100; Funct3E = 3'b100;
W64 = 1'b0; W64 = 1'b0;
#10 // one clk cycle
IDivStart = 1'b0;
IntDivE = 1'b0;
W64 = 1'b0;
end end
else if (OpCtrl == `INTREM_OPCTRL) begin `INTREM_OPCTRL: begin
X = {P.FLEN{1'bx}};
SrcA = TestVector[2*(P.Q_LEN)+P.D_LEN-1:2*(P.Q_LEN)];
SrcB = TestVector[(P.Q_LEN)+P.D_LEN-1:P.Q_LEN];
Ans = TestVector[P.D_LEN-1:0];
AnsFlg = 5'bx;
if (~clk) #5;
IDivStart = 1'b1;
IntDivE = 1'b1;
Funct3E = 3'b110; Funct3E = 3'b110;
W64 = 1'b0; W64 = 1'b0;
#10 // one clk cycle
IDivStart = 1'b0;
IntDivE = 1'b0;
W64 = 1'b0;
end end
else if (OpCtrl == `INTREMU_OPCTRL) begin `INTREMU_OPCTRL: begin
X = {P.FLEN{1'bx}};
SrcA = TestVector[2*(P.Q_LEN)+P.D_LEN-1:2*(P.Q_LEN)];
SrcB = TestVector[(P.Q_LEN)+P.D_LEN-1:P.Q_LEN];
Ans = TestVector[P.D_LEN-1:0];
AnsFlg = 5'bx;
if (~clk) #5;
IDivStart = 1'b1;
IntDivE = 1'b1;
Funct3E = 3'b111; Funct3E = 3'b111;
W64 = 1'b0; W64 = 1'b0;
#10 // one clk cycle
IDivStart = 1'b0;
IntDivE = 1'b0;
W64 = 1'b0;
end end
else if (OpCtrl == `INTDIVU_OPCTRL) begin `INTDIVU_OPCTRL: begin
X = {P.FLEN{1'bx}};
SrcA = TestVector[2*(P.Q_LEN)+P.D_LEN-1:2*(P.Q_LEN)];
SrcB = TestVector[(P.Q_LEN)+P.D_LEN-1:P.Q_LEN];
Ans = TestVector[P.D_LEN-1:0];
AnsFlg = 5'bx;
if (~clk) #5;
IDivStart = 1'b1;
IntDivE = 1'b1;
Funct3E = 3'b101; Funct3E = 3'b101;
W64 = 1'b0; W64 = 1'b0;
#10 // one clk cycle
IDivStart = 1'b0;
IntDivE = 1'b0;
W64 = 1'b0;
end end
else if (OpCtrl == `INTDIVW_OPCTRL) begin `INTDIVW_OPCTRL: begin
X = {P.FLEN{1'bx}};
SrcA = TestVector[2*(P.Q_LEN)+P.D_LEN-1:2*(P.Q_LEN)];
SrcB = TestVector[(P.Q_LEN)+P.D_LEN-1:P.Q_LEN];
Ans = TestVector[P.D_LEN-1:0];
AnsFlg = 5'bx;
if (~clk) #5;
IDivStart = 1'b1;
IntDivE = 1'b1;
Funct3E = 3'b100; Funct3E = 3'b100;
W64 = 1'b1; W64 = 1'b1;
#10 // one clk cycle
IDivStart = 1'b0;
IntDivE = 1'b0;
W64 = 1'b1;
end end
else if (OpCtrl == `INTDIVUW_OPCTRL) begin `INTDIVUW_OPCTRL: begin
X = {P.FLEN{1'bx}};
SrcA = TestVector[2*(P.Q_LEN)+P.D_LEN-1:2*(P.Q_LEN)];
SrcB = TestVector[(P.Q_LEN)+P.D_LEN-1:P.Q_LEN];
Ans = TestVector[P.D_LEN-1:0];
AnsFlg = 5'bx;
if (~clk) #5;
IDivStart = 1'b1;
IntDivE = 1'b1;
Funct3E = 3'b101; Funct3E = 3'b101;
W64 = 1'b1; W64 = 1'b1;
#10 // one clk cycle
IDivStart = 1'b0;
IntDivE = 1'b0;
W64 = 1'b1;
end end
else if (OpCtrl == `INTREMW_OPCTRL) begin `INTREMW_OPCTRL: begin
X = {P.FLEN{1'bx}};
SrcA = TestVector[2*(P.Q_LEN)+P.D_LEN-1:2*(P.Q_LEN)];
SrcB = TestVector[(P.Q_LEN)+P.D_LEN-1:P.Q_LEN];
Ans = TestVector[P.D_LEN-1:0];
AnsFlg = 5'bx;
if (~clk) #5;
IDivStart = 1'b1;
IntDivE = 1'b1;
Funct3E = 3'b110; Funct3E = 3'b110;
W64 = 1'b1; W64 = 1'b1;
#10 // one clk cycle
IDivStart = 1'b0;
IntDivE = 1'b0;
W64 = 1'b0;
end end
else if (OpCtrl == `INTREMUW_OPCTRL) begin `INTREMUW_OPCTRL: begin
X = {P.FLEN{1'bx}};
SrcA = TestVector[2*(P.Q_LEN)+P.D_LEN-1:2*(P.Q_LEN)];
SrcB = TestVector[(P.Q_LEN)+P.D_LEN-1:P.Q_LEN];
Ans = TestVector[P.D_LEN-1:0];
AnsFlg = 5'bx;
if (~clk) #5;
IDivStart = 1'b1;
IntDivE = 1'b1;
Funct3E = 3'b111; Funct3E = 3'b111;
W64 = 1'b1; W64 = 1'b1;
end
endcase
#10 // one clk cycle #10 // one clk cycle
IDivStart = 1'b0; IDivStart = 1'b0;
IntDivE = 1'b0; IntDivE = 1'b0;
W64 = 1'b0; W64 = 1'b0;
end
end end
`CMPUNIT: `CMPUNIT: