mirror of
https://github.com/openhwgroup/cvw
synced 2025-01-28 23:44:29 +00:00
Added conditional OTFC swap for simplified int postprocessing
This commit is contained in:
parent
c3e635c788
commit
54f09f3616
@ -127,6 +127,7 @@
|
||||
`define DURLEN ($clog2(`FPDUR+1))
|
||||
`define QLEN (`FPDUR*`LOGR*`DIVCOPIES)
|
||||
`define DIVb (`QLEN-1)
|
||||
`define DIVa (`DIVb+4-`XLEN)
|
||||
`define DIVBLEN ($clog2(`DIVb+1)-1)
|
||||
|
||||
|
||||
|
@ -65,10 +65,11 @@ module fdivsqrt(
|
||||
logic WZero;
|
||||
logic SpecialCaseM;
|
||||
logic [`DIVBLEN:0] n, p, m;
|
||||
logic OTFCSwap;
|
||||
|
||||
fdivsqrtpreproc fdivsqrtpreproc(
|
||||
.clk, .DivStartE, .Xm(XmE), .QeM, .Xe(XeE), .Fmt(FmtE), .Ye(YeE),
|
||||
.Sqrt(SqrtE), .Ym(YmE), .XZero(XZeroE), .X, .Dpreproc, .n, .p, .m,
|
||||
.Sqrt(SqrtE), .Ym(YmE), .XZero(XZeroE), .X, .Dpreproc, .n, .p, .m, .OTFCSwap,
|
||||
.ForwardedSrcAE, .ForwardedSrcBE, .Funct3E, .Funct3M, .MDUE, .W64E);
|
||||
fdivsqrtfsm fdivsqrtfsm(
|
||||
.clk, .reset, .FmtE, .XsE, .SqrtE,
|
||||
@ -78,7 +79,7 @@ module fdivsqrt(
|
||||
fdivsqrtiter fdivsqrtiter(
|
||||
.clk, .Firstun, .D, .FirstU, .FirstUM, .FirstC, .SqrtE, .SqrtM,
|
||||
.X,.Dpreproc, .FirstWS(WS), .FirstWC(WC),
|
||||
.DivStartE, .Xe(XeE), .Ye(YeE), .XZeroE, .YZeroE,
|
||||
.DivStartE, .Xe(XeE), .Ye(YeE), .XZeroE, .YZeroE, .OTFCSwap,
|
||||
.DivBusy);
|
||||
fdivsqrtpostproc fdivsqrtpostproc(
|
||||
.WS, .WC, .D, .FirstU, .FirstUM, .FirstC, .Firstun,
|
||||
|
@ -38,6 +38,7 @@ module fdivsqrtiter(
|
||||
input logic XZeroE, YZeroE,
|
||||
input logic SqrtE,
|
||||
input logic SqrtM,
|
||||
input logic OTFCSwap,
|
||||
input logic [`DIVb+3:0] X,
|
||||
input logic [`DIVN-2:0] Dpreproc,
|
||||
output logic [`DIVN-2:0] D, // U0.N-1
|
||||
|
@ -42,6 +42,7 @@ module fdivsqrtpreproc (
|
||||
input logic [2:0] Funct3E, Funct3M,
|
||||
input logic MDUE, W64E,
|
||||
output logic [`DIVBLEN:0] n, p, m,
|
||||
output logic OTFCSwap,
|
||||
output logic [`NE+1:0] QeM,
|
||||
output logic [`DIVb+3:0] X,
|
||||
output logic [`DIVN-2:0] Dpreproc
|
||||
@ -56,7 +57,7 @@ module fdivsqrtpreproc (
|
||||
// Intdiv signals
|
||||
logic [`DIVb-1:0] ZeroBufX, ZeroBufY;
|
||||
logic [`XLEN-1:0] PosA, PosB;
|
||||
logic As, Bs;
|
||||
logic As, Bs, OTFCSwapTemp;
|
||||
logic [`XLEN-1:0] A64, B64;
|
||||
logic [`DIVBLEN:0] ZeroDiff, IntBits, RightShiftX;
|
||||
logic [`DIVBLEN:0] pPlusr, pPrCeil;
|
||||
@ -70,6 +71,8 @@ module fdivsqrtpreproc (
|
||||
assign Bs = ForwardedSrcBE[`XLEN-1] & Funct3E[0];
|
||||
assign A64 = W64E ? {{(`XLEN-32){As}}, ForwardedSrcAE[31:0]} : ForwardedSrcAE;
|
||||
assign B64 = W64E ? {{(`XLEN-32){Bs}}, ForwardedSrcBE[31:0]} : ForwardedSrcBE;
|
||||
|
||||
assign OTFCSwapTemp = (As ^ Bs) & MDUE;
|
||||
|
||||
assign PosA = As ? -A64 : A64;
|
||||
assign PosB = Bs ? -B64 : B64;
|
||||
@ -111,6 +114,7 @@ module fdivsqrtpreproc (
|
||||
// r = 1 or 2
|
||||
// DIVRESLEN/(r*`DIVCOPIES)
|
||||
flopen #(`NE+2) expflop(clk, DivStartE, Qe, QeM);
|
||||
flopen #(1) swapflop(clk, DivStartE, OTFCSwapTemp, OTFCSwap);
|
||||
expcalc expcalc(.Fmt, .Xe, .Ye, .Sqrt, .XZero, .L, .m, .Qe);
|
||||
|
||||
endmodule
|
||||
|
@ -61,7 +61,7 @@ module fdivsqrtstage2 (
|
||||
// 0001 = -2
|
||||
fdivsqrtqsel2 qsel2(WS[`DIVb+3:`DIVb], WC[`DIVb+3:`DIVb], up, uz, un);
|
||||
|
||||
// Sqrt F generatin
|
||||
// Sqrt F generation
|
||||
fdivsqrtfgen2 fgen2(.up, .uz, .C(CNext), .U, .UM, .F);
|
||||
|
||||
// Divisor multiple
|
||||
|
Loading…
Reference in New Issue
Block a user