mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
Optimized away unused support for fmv with quads
This commit is contained in:
parent
0d56a281b9
commit
0235970313
@ -263,23 +263,23 @@ module fpu import cvw::*; #(parameter cvw_t P) (
|
||||
.ToInt(FWriteIntE), .XZero(XZeroE), .Fmt(FmtE), .Ce(CeE), .ShiftAmt(CvtShiftAmtE),
|
||||
.ResSubnormUf(CvtResSubnormUfE), .Cs(CsE), .IntZero(IntZeroE), .LzcIn(CvtLzcInE));
|
||||
|
||||
// NaN Box SrcA to convert integer to requested FP size for fmv int->fp
|
||||
// NaN Box SrcA to convert integer to requested FP size for fmv.*.x
|
||||
if(P.FPSIZES == 1) assign AlignedSrcAE = {{P.FLEN-P.XLEN{1'b1}}, ForwardedSrcAE};
|
||||
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);
|
||||
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
|
||||
mux4 #(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-P.H_LEN{1'b1}}, ForwardedSrcAE[P.H_LEN-1:0]},
|
||||
{{P.FLEN-P.XLEN{1'b1}}, ForwardedSrcAE}, FmtE, AlignedSrcAE); // NaN boxing zeroes
|
||||
FmtE, AlignedSrcAE); // NaN boxing zeroes
|
||||
end
|
||||
|
||||
// select a result that may be written to the FP register
|
||||
mux3 #(P.FLEN) FResMux(SgnResE, AlignedSrcAE, CmpFpResE, {OpCtrlE[2], &OpCtrlE[1:0]}, PreFpResE);
|
||||
assign PreNVE = CmpNVE&(OpCtrlE[2]|FWriteIntE);
|
||||
|
||||
// select the result that may be written to the integer register with fmv - to IEU
|
||||
// select the result that may be written to the integer register with fmv.x.*
|
||||
if(P.FPSIZES == 1) begin
|
||||
assign mvsgn = XE[P.FLEN-1];
|
||||
assign SgnExtXE = XE;
|
||||
@ -288,16 +288,17 @@ module fpu import cvw::*; #(parameter cvw_t P) (
|
||||
mux2 #(P.FLEN) sgnextmux ({{P.FLEN-P.LEN1{mvsgn}}, XE[P.LEN1-1:0]}, XE, FmtE, SgnExtXE);
|
||||
end else if(P.FPSIZES == 3 | P.FPSIZES == 4) begin
|
||||
mux4 #(1) sgnmux (XE[P.S_LEN-1], XE[P.D_LEN-1], XE[P.H_LEN-1], XE[P.LLEN-1], FmtE, mvsgn);
|
||||
mux4 #(P.FLEN) sgnextmux ({{P.FLEN-P.S_LEN{mvsgn}}, XE[P.S_LEN-1:0]},
|
||||
mux3 #(P.FLEN) sgnextmux ({{P.FLEN-P.S_LEN{mvsgn}}, XE[P.S_LEN-1:0]},
|
||||
{{P.FLEN-P.D_LEN{mvsgn}}, XE[P.D_LEN-1:0]},
|
||||
{{P.FLEN-P.H_LEN{mvsgn}}, XE[P.H_LEN-1:0]},
|
||||
XE, FmtE, SgnExtXE);
|
||||
FmtE, SgnExtXE); // Q not needed because there is no fmv.x.q
|
||||
end
|
||||
|
||||
// sign extend to XLEN if necessary
|
||||
if (P.FLEN>P.XLEN)
|
||||
assign IntSrcXE = SgnExtXE[P.XLEN-1:0];
|
||||
else
|
||||
assign IntSrcXE = {{P.XLEN-P.FLEN{mvsgn}}, SgnExtXE};
|
||||
assign IntSrcXE = {{P.XLEN-P.FLEN{mvsgn}}, SgnExtXE};
|
||||
mux3 #(P.XLEN) IntResMux (ClassResE, IntSrcXE, CmpIntResE, {~FResSelE[1], FResSelE[0]}, FIntResE);
|
||||
|
||||
// E/M pipe registers
|
||||
|
Loading…
Reference in New Issue
Block a user