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
`INTDIVUNIT: begin
#20;
if (OpCtrl === `INTDIV_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];
@ -1367,125 +1366,44 @@ module readvectors (
if (~clk) #5;
IDivStart = 1'b1;
IntDivE = 1'b1;
case (OpCtrl)
`INTDIV_OPCTRL: begin
Funct3E = 3'b100;
W64 = 1'b0;
#10 // one clk cycle
IDivStart = 1'b0;
IntDivE = 1'b0;
W64 = 1'b0;
end
else if (OpCtrl == `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;
`INTREM_OPCTRL: begin
Funct3E = 3'b110;
W64 = 1'b0;
#10 // one clk cycle
IDivStart = 1'b0;
IntDivE = 1'b0;
W64 = 1'b0;
end
else if (OpCtrl == `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;
`INTREMU_OPCTRL: begin
Funct3E = 3'b111;
W64 = 1'b0;
#10 // one clk cycle
IDivStart = 1'b0;
IntDivE = 1'b0;
W64 = 1'b0;
end
else if (OpCtrl == `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;
`INTDIVU_OPCTRL: begin
Funct3E = 3'b101;
W64 = 1'b0;
#10 // one clk cycle
IDivStart = 1'b0;
IntDivE = 1'b0;
W64 = 1'b0;
end
else if (OpCtrl == `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;
`INTDIVW_OPCTRL: begin
Funct3E = 3'b100;
W64 = 1'b1;
#10 // one clk cycle
IDivStart = 1'b0;
IntDivE = 1'b0;
W64 = 1'b1;
end
else if (OpCtrl == `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;
`INTDIVUW_OPCTRL: begin
Funct3E = 3'b101;
W64 = 1'b1;
#10 // one clk cycle
IDivStart = 1'b0;
IntDivE = 1'b0;
W64 = 1'b1;
end
else if (OpCtrl == `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;
`INTREMW_OPCTRL: begin
Funct3E = 3'b110;
W64 = 1'b1;
#10 // one clk cycle
IDivStart = 1'b0;
IntDivE = 1'b0;
W64 = 1'b0;
end
else if (OpCtrl == `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;
`INTREMUW_OPCTRL: begin
Funct3E = 3'b111;
W64 = 1'b1;
end
endcase
#10 // one clk cycle
IDivStart = 1'b0;
IntDivE = 1'b0;
W64 = 1'b0;
end
end
`CMPUNIT: