forked from Github_Repos/cvw
moved D flop to preproc
This commit is contained in:
parent
d5e2fefe2c
commit
054c8d638c
@ -57,7 +57,7 @@ module fdivsqrt(
|
|||||||
|
|
||||||
logic [`DIVb+3:0] WS, WC; // Partial remainder components
|
logic [`DIVb+3:0] WS, WC; // Partial remainder components
|
||||||
logic [`DIVb+3:0] X; // Iterator Initial Value (from dividend)
|
logic [`DIVb+3:0] X; // Iterator Initial Value (from dividend)
|
||||||
logic [`DIVb-1:0] DPreproc, D; // Iterator Divisor
|
logic [`DIVb-1:0] D; // Iterator Divisor
|
||||||
logic [`DIVb:0] FirstU, FirstUM; // Intermediate result values
|
logic [`DIVb:0] FirstU, FirstUM; // Intermediate result values
|
||||||
logic [`DIVb+1:0] FirstC; // Step tracker
|
logic [`DIVb+1:0] FirstC; // Step tracker
|
||||||
logic Firstun; // Quotient selection
|
logic Firstun; // Quotient selection
|
||||||
@ -75,8 +75,7 @@ module fdivsqrt(
|
|||||||
|
|
||||||
fdivsqrtpreproc fdivsqrtpreproc( // Preprocessor
|
fdivsqrtpreproc fdivsqrtpreproc( // Preprocessor
|
||||||
.clk, .IFDivStartE, .Xm(XmE), .Ym(YmE), .Xe(XeE), .Ye(YeE),
|
.clk, .IFDivStartE, .Xm(XmE), .Ym(YmE), .Xe(XeE), .Ye(YeE),
|
||||||
.Fmt(FmtE), .Sqrt(SqrtE), .XZeroE, .Funct3E,
|
.Fmt(FmtE), .Sqrt(SqrtE), .XZeroE, .Funct3E, .QeM, .X, .D,
|
||||||
.QeM, .X, .DPreproc,
|
|
||||||
// Int-specific
|
// Int-specific
|
||||||
.ForwardedSrcAE, .ForwardedSrcBE, .IntDivE, .W64E, .ISpecialCaseE,
|
.ForwardedSrcAE, .ForwardedSrcBE, .IntDivE, .W64E, .ISpecialCaseE,
|
||||||
.nE, .BZeroM, .nM, .mM, .AM,
|
.nE, .BZeroM, .nM, .mM, .AM,
|
||||||
@ -90,8 +89,8 @@ module fdivsqrt(
|
|||||||
.IDivStartE, .ISpecialCaseE, .nE, .IntDivE);
|
.IDivStartE, .ISpecialCaseE, .nE, .IntDivE);
|
||||||
|
|
||||||
fdivsqrtiter fdivsqrtiter( // CSA Iterator
|
fdivsqrtiter fdivsqrtiter( // CSA Iterator
|
||||||
.clk, .IFDivStartE, .FDivBusyE, .SqrtE, .X, .DPreproc,
|
.clk, .IFDivStartE, .FDivBusyE, .SqrtE, .X, .D,
|
||||||
.D, .FirstU, .FirstUM, .FirstC, .Firstun, .FirstWS(WS), .FirstWC(WC));
|
.FirstU, .FirstUM, .FirstC, .Firstun, .FirstWS(WS), .FirstWC(WC));
|
||||||
|
|
||||||
fdivsqrtpostproc fdivsqrtpostproc( // Postprocessor
|
fdivsqrtpostproc fdivsqrtpostproc( // Postprocessor
|
||||||
.clk, .reset, .StallM, .WS, .WC, .D, .FirstU, .FirstUM, .FirstC,
|
.clk, .reset, .StallM, .WS, .WC, .D, .FirstU, .FirstUM, .FirstC,
|
||||||
|
@ -34,8 +34,7 @@ module fdivsqrtiter(
|
|||||||
input logic FDivBusyE,
|
input logic FDivBusyE,
|
||||||
input logic SqrtE,
|
input logic SqrtE,
|
||||||
input logic [`DIVb+3:0] X,
|
input logic [`DIVb+3:0] X,
|
||||||
input logic [`DIVb-1:0] DPreproc,
|
input logic [`DIVb-1:0] D,
|
||||||
output logic [`DIVb-1:0] D,
|
|
||||||
output logic [`DIVb:0] FirstU, FirstUM,
|
output logic [`DIVb:0] FirstU, FirstUM,
|
||||||
output logic [`DIVb+1:0] FirstC,
|
output logic [`DIVb+1:0] FirstC,
|
||||||
output logic Firstun,
|
output logic Firstun,
|
||||||
@ -95,9 +94,6 @@ module fdivsqrtiter(
|
|||||||
mux2 #(`DIVb+2) cmux(C[`DIVCOPIES], initC, IFDivStartE, NextC);
|
mux2 #(`DIVb+2) cmux(C[`DIVCOPIES], initC, IFDivStartE, NextC);
|
||||||
flopen #(`DIVb+2) creg(clk, FDivBusyE, NextC, C[0]);
|
flopen #(`DIVb+2) creg(clk, FDivBusyE, NextC, C[0]);
|
||||||
|
|
||||||
// Divisior register
|
|
||||||
flopen #(`DIVb) dreg(clk, IFDivStartE, DPreproc, D);
|
|
||||||
|
|
||||||
// Divisor Selections
|
// Divisor Selections
|
||||||
// - choose the negitive version of what's being selected
|
// - choose the negitive version of what's being selected
|
||||||
// - D is a 0.b mantissa
|
// - D is a 0.b mantissa
|
||||||
|
@ -39,7 +39,7 @@ module fdivsqrtpreproc (
|
|||||||
input logic [2:0] Funct3E,
|
input logic [2:0] Funct3E,
|
||||||
output logic [`NE+1:0] QeM,
|
output logic [`NE+1:0] QeM,
|
||||||
output logic [`DIVb+3:0] X,
|
output logic [`DIVb+3:0] X,
|
||||||
output logic [`DIVb-1:0] DPreproc,
|
output logic [`DIVb-1:0] D,
|
||||||
// Int-specific
|
// Int-specific
|
||||||
input logic [`XLEN-1:0] ForwardedSrcAE, ForwardedSrcBE, // *** these are the src outputs before the mux choosing between them and PCE to put in srcA/B
|
input logic [`XLEN-1:0] ForwardedSrcAE, ForwardedSrcBE, // *** these are the src outputs before the mux choosing between them and PCE to put in srcA/B
|
||||||
input logic IntDivE, W64E,
|
input logic IntDivE, W64E,
|
||||||
@ -50,7 +50,7 @@ module fdivsqrtpreproc (
|
|||||||
output logic [`XLEN-1:0] AM
|
output logic [`XLEN-1:0] AM
|
||||||
);
|
);
|
||||||
|
|
||||||
logic [`DIVb-1:0] XPreproc;
|
logic [`DIVb-1:0] XPreproc, DPreproc;
|
||||||
logic [`DIVb:0] PreSqrtX;
|
logic [`DIVb:0] PreSqrtX;
|
||||||
logic [`DIVb+3:0] DivX, DivXShifted, SqrtX, PreShiftX; // Variations of dividend, to be muxed
|
logic [`DIVb+3:0] DivX, DivXShifted, SqrtX, PreShiftX; // Variations of dividend, to be muxed
|
||||||
logic [`NE+1:0] QeE; // Quotient Exponent (FP only)
|
logic [`NE+1:0] QeE; // Quotient Exponent (FP only)
|
||||||
@ -173,5 +173,8 @@ module fdivsqrtpreproc (
|
|||||||
// Floating-point exponent
|
// Floating-point exponent
|
||||||
fdivsqrtexpcalc expcalc(.Fmt, .Xe, .Ye, .Sqrt, .XZero(XZeroE), .ell, .m(mE), .Qe(QeE));
|
fdivsqrtexpcalc expcalc(.Fmt, .Xe, .Ye, .Sqrt, .XZero(XZeroE), .ell, .m(mE), .Qe(QeE));
|
||||||
flopen #(`NE+2) expreg(clk, IFDivStartE, QeE, QeM);
|
flopen #(`NE+2) expreg(clk, IFDivStartE, QeE, QeM);
|
||||||
|
|
||||||
|
// Divisior register
|
||||||
|
flopen #(`DIVb) dreg(clk, IFDivStartE, DPreproc, D);
|
||||||
endmodule
|
endmodule
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user