fix testbench_fp formatting

This commit is contained in:
Jordan Carlin 2024-09-22 20:40:20 -07:00
parent ba6481305f
commit 5618e27424
No known key found for this signature in database

View File

@ -796,8 +796,7 @@ module testbench_fp;
// an integer output can't be a NaN
AnsNaN = 1'b0;
ResNaN = 1'b0;
end
else if (UnitVal === `CVTFPUNIT) begin
end else if (UnitVal === `CVTFPUNIT) begin
case (OpCtrlVal[1:0])
2'b11: begin // quad
AnsNaN = &Ans[P.Q_LEN-2:P.NF]&(|Ans[P.Q_NF-1:0]);
@ -816,8 +815,7 @@ module testbench_fp;
ResNaN = &Res[P.H_LEN-2:P.H_NF]&(|Res[P.H_NF-1:0]);
end
endcase
end
else begin
end else begin
case (FmtVal)
2'b11: begin // quad
AnsNaN = &Ans[P.Q_LEN-2:P.Q_NF]&(|Ans[P.Q_NF-1:0]);
@ -890,7 +888,6 @@ module testbench_fp;
nextstate = S0;
end
endcase // case (state)
end
// Provide reset for divsqrt to reset state
@ -908,18 +905,15 @@ module testbench_fp;
// various cycle counts for different fp/int operations
// Adds vector at start of clock
always @(posedge clk) begin
// state machine element for testing
if (reset)
state <= S0;
else
state <= nextstate;
// Increment the vector when Done with each test
if (state == Done) begin
VectorNum += 1; // increment the vector
end
end
// check results on falling edge of clk
@ -975,7 +969,6 @@ module testbench_fp;
endcase
else NaNGood = 1'b0; // integers can't be NaNs
///////////////////////////////////////////////////////////////////////////////////////////////
// ||||||| ||| ||| ||||||| ||||||| ||| |||
@ -1093,11 +1086,12 @@ module readvectors import cvw::*; #(parameter cvw_t P) (
X = TestVector[8+4*(P.Q_LEN)-1:8+3*(P.Q_LEN)];
Y = TestVector[8+3*(P.Q_LEN)-1:8+2*(P.Q_LEN)];
Z = TestVector[8+2*(P.Q_LEN)-1:8+P.Q_LEN];
end
else begin
end else begin
X = TestVector[8+3*(P.Q_LEN)-1:8+2*(P.Q_LEN)];
if (OpCtrl === `MUL_OPCTRL) Y = TestVector[8+2*(P.Q_LEN)-1:8+(P.Q_LEN)]; else Y = {2'b0, {P.Q_NE-1{1'b1}}, (P.Q_NF)'(0)};
if (OpCtrl === `MUL_OPCTRL) Z = 0; else Z = TestVector[8+2*(P.Q_LEN)-1:8+(P.Q_LEN)];
if (OpCtrl === `MUL_OPCTRL) Y = TestVector[8+2*(P.Q_LEN)-1:8+(P.Q_LEN)];
else Y = {2'b0, {P.Q_NE-1{1'b1}}, (P.Q_NF)'(0)};
if (OpCtrl === `MUL_OPCTRL) Z = 0;
else Z = TestVector[8+2*(P.Q_LEN)-1:8+(P.Q_LEN)];
end
Ans = TestVector[8+(P.Q_LEN-1):8];
end
@ -1106,8 +1100,7 @@ module readvectors import cvw::*; #(parameter cvw_t P) (
X = {{P.Q_LEN-P.D_LEN{1'b1}}, TestVector[8+4*(P.D_LEN)-1:8+3*(P.D_LEN)]};
Y = {{P.Q_LEN-P.D_LEN{1'b1}}, TestVector[8+3*(P.D_LEN)-1:8+2*(P.D_LEN)]};
Z = {{P.Q_LEN-P.D_LEN{1'b1}}, TestVector[8+2*(P.D_LEN)-1:8+P.D_LEN]};
end
else begin
end else begin
X = {{P.Q_LEN-P.D_LEN{1'b1}}, TestVector[8+3*(P.D_LEN)-1:8+2*(P.D_LEN)]};
if (OpCtrl === `MUL_OPCTRL) Y = {{P.Q_LEN-P.D_LEN{1'b1}}, TestVector[8+2*(P.D_LEN)-1:8+(P.D_LEN)]};
else Y = {{P.Q_LEN-P.D_LEN{1'b1}}, 2'b0, {P.D_NE-1{1'b1}}, (P.D_NF)'(0)};
@ -1121,8 +1114,7 @@ module readvectors import cvw::*; #(parameter cvw_t P) (
X = {{P.Q_LEN-P.S_LEN{1'b1}}, TestVector[8+4*(P.S_LEN)-1:8+3*(P.S_LEN)]};
Y = {{P.Q_LEN-P.S_LEN{1'b1}}, TestVector[8+3*(P.S_LEN)-1:8+2*(P.S_LEN)]};
Z = {{P.Q_LEN-P.S_LEN{1'b1}}, TestVector[8+2*(P.S_LEN)-1:8+P.S_LEN]};
end
else begin
end else begin
X = {{P.Q_LEN-P.S_LEN{1'b1}}, TestVector[8+3*(P.S_LEN)-1:8+2*(P.S_LEN)]};
if (OpCtrl === `MUL_OPCTRL) Y = {{P.Q_LEN-P.S_LEN{1'b1}}, TestVector[8+2*(P.S_LEN)-1:8+(P.S_LEN)]};
else Y = {{P.Q_LEN-P.S_LEN{1'b1}}, 2'b0, {P.S_NE-1{1'b1}}, (P.S_NF)'(0)};
@ -1136,8 +1128,7 @@ module readvectors import cvw::*; #(parameter cvw_t P) (
X = {{P.Q_LEN-P.H_LEN{1'b1}}, TestVector[8+4*(P.H_LEN)-1:8+3*(P.H_LEN)]};
Y = {{P.Q_LEN-P.H_LEN{1'b1}}, TestVector[8+3*(P.H_LEN)-1:8+2*(P.H_LEN)]};
Z = {{P.Q_LEN-P.H_LEN{1'b1}}, TestVector[8+2*(P.H_LEN)-1:8+P.H_LEN]};
end
else begin
end else begin
X = {{P.Q_LEN-P.H_LEN{1'b1}}, TestVector[8+3*(P.H_LEN)-1:8+2*(P.H_LEN)]};
if (OpCtrl === `MUL_OPCTRL) Y = {{P.Q_LEN-P.H_LEN{1'b1}}, TestVector[8+2*(P.H_LEN)-1:8+(P.H_LEN)]};
else Y = {{P.Q_LEN-P.H_LEN{1'b1}}, 2'b0, {P.H_NE-1{1'b1}}, (P.H_NF)'(0)};
@ -1415,5 +1406,4 @@ module readvectors import cvw::*; #(parameter cvw_t P) (
.Xm, .Ym, .Zm, .XNaN, .YNaN, .ZNaN, .XSNaN, .YSNaN, .ZSNaN,
.XSubnorm, .XZero, .YZero, .ZZero, .XInf, .YInf, .ZInf,
.XEn, .YEn, .ZEn, .XExpMax, .XPostBox, .Bias(BiasE), .Nf(NfE));
endmodule