mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
Coded Zfa fmvp but no tests exist
This commit is contained in:
parent
8654375f26
commit
07e7e02241
@ -155,7 +155,7 @@ module fpu import cvw::*; #(parameter cvw_t P) (
|
|||||||
logic [P.FLEN-1:0] FResultW; // final FP result being written to the FP register
|
logic [P.FLEN-1:0] FResultW; // final FP result being written to the FP register
|
||||||
|
|
||||||
// other signals
|
// other signals
|
||||||
logic [P.FLEN-1:0] AlignedSrcAE; // align SrcA from IEU to the floating point format for fmv
|
logic [P.FLEN-1:0] PreIntSrcE, IntSrcE; // align SrcA from IEU to the floating point format for fmv / fmvp
|
||||||
logic [P.FLEN-1:0] BoxedZeroE; // Zero value for Z for multiplication, with NaN boxing if needed
|
logic [P.FLEN-1:0] BoxedZeroE; // Zero value for Z for multiplication, with NaN boxing if needed
|
||||||
logic [P.FLEN-1:0] BoxedOneE; // One value for Z for multiplication, with NaN boxing if needed
|
logic [P.FLEN-1:0] BoxedOneE; // One value for Z for multiplication, with NaN boxing if needed
|
||||||
logic StallUnpackedM; // Stall unpacker outputs during multicycle fdivsqrt
|
logic StallUnpackedM; // Stall unpacker outputs during multicycle fdivsqrt
|
||||||
@ -273,23 +273,27 @@ module fpu import cvw::*; #(parameter cvw_t P) (
|
|||||||
fli #(P) fli(.Rs1(Rs1E), .Fmt(FmtE), .Imm(FliResE));
|
fli #(P) fli(.Rs1(Rs1E), .Fmt(FmtE), .Imm(FliResE));
|
||||||
end else assign FliResE = '0;
|
end else assign FliResE = '0;
|
||||||
|
|
||||||
// NaN Box SrcA to convert integer to requested FP size for fmv.*.x
|
// fmv.*.x: NaN Box SrcA to extend integer to requested FP size
|
||||||
if(P.FPSIZES == 1) assign AlignedSrcAE = {{P.FLEN-P.XLEN{1'b1}}, ForwardedSrcAE};
|
if(P.FPSIZES == 1) assign PreIntSrcE = {{P.FLEN-P.XLEN{1'b1}}, ForwardedSrcAE};
|
||||||
else if(P.FPSIZES == 2)
|
else if(P.FPSIZES == 2)
|
||||||
mux2 #(P.FLEN) SrcAMux ({{P.FLEN-P.LEN1{1'b1}}, ForwardedSrcAE[P.LEN1-1:0]}, {{P.FLEN-P.XLEN{1'b1}}, ForwardedSrcAE}, FmtE, AlignedSrcAE);
|
mux2 #(P.FLEN) SrcAMux ({{P.FLEN-P.LEN1{1'b1}}, ForwardedSrcAE[P.LEN1-1:0]}, {{P.FLEN-P.XLEN{1'b1}}, ForwardedSrcAE}, FmtE, PreIntSrcE);
|
||||||
else if(P.FPSIZES == 3 | P.FPSIZES == 4) begin
|
else if(P.FPSIZES == 3 | P.FPSIZES == 4) begin
|
||||||
localparam XD_LEN = P.D_LEN < P.XLEN ? P.D_LEN : P.XLEN; // shorter of D_LEN and XLEN
|
localparam XD_LEN = P.D_LEN < P.XLEN ? P.D_LEN : P.XLEN; // shorter of D_LEN and XLEN
|
||||||
mux3 #(P.FLEN) SrcAMux ({{P.FLEN-P.S_LEN{1'b1}}, ForwardedSrcAE[P.S_LEN-1:0]},
|
mux3 #(P.FLEN) SrcAMux ({{P.FLEN-P.S_LEN{1'b1}}, ForwardedSrcAE[P.S_LEN-1:0]},
|
||||||
{{P.FLEN-XD_LEN{1'b1}}, ForwardedSrcAE[XD_LEN-1:0]},
|
{{P.FLEN-XD_LEN{1'b1}}, ForwardedSrcAE[XD_LEN-1:0]},
|
||||||
{{P.FLEN-P.H_LEN{1'b1}}, ForwardedSrcAE[P.H_LEN-1:0]},
|
{{P.FLEN-P.H_LEN{1'b1}}, ForwardedSrcAE[P.H_LEN-1:0]},
|
||||||
FmtE, AlignedSrcAE); // NaN boxing zeroes
|
FmtE, PreIntSrcE); // NaN boxing zeroes
|
||||||
end
|
end
|
||||||
|
// fmvp.*.x: Select pair of registers
|
||||||
|
if (P.ZFA_SUPPORTED & (P.XLEN==32 & P.D_SUPPORTED) | (P.XLEN==64 & P.Q_SUPPORTED))
|
||||||
|
assign IntSrcE = ZfaE ? {ForwardedSrcBE, ForwardedSrcAE} : PreIntSrcE; // choose pair of integer registers for fmvp.d.x / fmvp.q.x
|
||||||
|
else assign IntSrcE = PreIntSrcE;
|
||||||
|
|
||||||
// select a result that may be written to the FP register
|
// select a result that may be written to the FP register
|
||||||
mux4 #(P.FLEN) FResMux(SgnResE, AlignedSrcAE, CmpFpResE, FliResE, {OpCtrlE[2], &OpCtrlE[1:0]}, PreFpResE);
|
mux4 #(P.FLEN) FResMux(SgnResE, IntSrcE, CmpFpResE, FliResE, {OpCtrlE[2], &OpCtrlE[1:0]}, PreFpResE);
|
||||||
assign PreNVE = CmpNVE&(OpCtrlE[2]|FWriteIntE);
|
assign PreNVE = CmpNVE&(OpCtrlE[2]|FWriteIntE);
|
||||||
|
|
||||||
// select the result that may be written to the integer register with fmv.x.*
|
// fmv.x.*: select the result that may be written to the integer register
|
||||||
if(P.FPSIZES == 1) begin
|
if(P.FPSIZES == 1) begin
|
||||||
assign mvsgn = XE[P.FLEN-1];
|
assign mvsgn = XE[P.FLEN-1];
|
||||||
assign SgnExtXE = XE;
|
assign SgnExtXE = XE;
|
||||||
|
@ -2004,6 +2004,8 @@ string arch64zbs[] = '{
|
|||||||
"rv32i_m/F_Zfa/src/fli.s-01.S",
|
"rv32i_m/F_Zfa/src/fli.s-01.S",
|
||||||
"rv32i_m/F_Zfa/src/fltq_b1-01.S",
|
"rv32i_m/F_Zfa/src/fltq_b1-01.S",
|
||||||
"rv32i_m/F_Zfa/src/fltq_b19-01.S",
|
"rv32i_m/F_Zfa/src/fltq_b19-01.S",
|
||||||
|
"rv32i_m/D_Zfa/src/fltq_b1-01.S", // these D tests are more comprehensive and seem they should replace the F tests. Applies to all F tests duplicated in D
|
||||||
|
"rv32i_m/D_Zfa/src/fltq_b19-01.S",
|
||||||
"rv32i_m/F_Zfa/src/fminm_b1-01.S",
|
"rv32i_m/F_Zfa/src/fminm_b1-01.S",
|
||||||
"rv32i_m/F_Zfa/src/fminm_b19-01.S",
|
"rv32i_m/F_Zfa/src/fminm_b19-01.S",
|
||||||
"rv32i_m/F_Zfa/src/fmaxm_b1-01.S",
|
"rv32i_m/F_Zfa/src/fmaxm_b1-01.S",
|
||||||
@ -2015,13 +2017,21 @@ string arch64zbs[] = '{
|
|||||||
`RISCVARCHTEST,
|
`RISCVARCHTEST,
|
||||||
"rv32i_m/D_Zfa/src/fleq_b1-01.S",
|
"rv32i_m/D_Zfa/src/fleq_b1-01.S",
|
||||||
"rv32i_m/D_Zfa/src/fleq_b19-01.S",
|
"rv32i_m/D_Zfa/src/fleq_b19-01.S",
|
||||||
|
"rv32i_m/D_Zfa/src/fleq.d_b1-01.S",
|
||||||
|
"rv32i_m/D_Zfa/src/fleq.d_b19-01.S",
|
||||||
"rv32i_m/D_Zfa/src/fli.d-01.S",
|
"rv32i_m/D_Zfa/src/fli.d-01.S",
|
||||||
"rv32i_m/D_Zfa/src/fltq_b1-01.S",
|
"rv32i_m/D_Zfa/src/fltq_b1-01.S",
|
||||||
"rv32i_m/D_Zfa/src/fltq_b19-01.S",
|
"rv32i_m/D_Zfa/src/fltq_b19-01.S",
|
||||||
|
"rv32i_m/D_Zfa/src/fltq.d_b1-01.S",
|
||||||
|
"rv32i_m/D_Zfa/src/fltq.d_b19-01.S",
|
||||||
"rv32i_m/D_Zfa/src/fminm_b1-01.S",
|
"rv32i_m/D_Zfa/src/fminm_b1-01.S",
|
||||||
"rv32i_m/D_Zfa/src/fminm_b19-01.S",
|
"rv32i_m/D_Zfa/src/fminm_b19-01.S",
|
||||||
|
"rv32i_m/D_Zfa/src/fminm.d_b1-01.S",
|
||||||
|
"rv32i_m/D_Zfa/src/fminm.d_b19-01.S",
|
||||||
"rv32i_m/D_Zfa/src/fmaxm_b1-01.S",
|
"rv32i_m/D_Zfa/src/fmaxm_b1-01.S",
|
||||||
"rv32i_m/D_Zfa/src/fmaxm_b19-01.S"
|
"rv32i_m/D_Zfa/src/fmaxm_b19-01.S",
|
||||||
|
"rv32i_m/D_Zfa/src/fmaxm.d_b1-01.S",
|
||||||
|
"rv32i_m/D_Zfa/src/fmaxm.d_b19-01.S"
|
||||||
/* "rv32i_m/D_Zfa/src/fround_b1-01.S" */
|
/* "rv32i_m/D_Zfa/src/fround_b1-01.S" */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user