Line 29... |
Line 29... |
//
|
//
|
// ============================================================================
|
// ============================================================================
|
|
|
module fpAddsub_L10(clk, ce, rm, op, a, b, o);
|
module fpAddsub_L10(clk, ce, rm, op, a, b, o);
|
parameter WID = 128;
|
parameter WID = 128;
|
localparam MSB = WID-1;
|
`include "fpSize.sv"
|
localparam EMSB = WID==128 ? 14 :
|
|
WID==96 ? 14 :
|
|
WID==80 ? 14 :
|
|
WID==64 ? 10 :
|
|
WID==52 ? 10 :
|
|
WID==48 ? 11 :
|
|
WID==44 ? 10 :
|
|
WID==42 ? 10 :
|
|
WID==40 ? 9 :
|
|
WID==32 ? 7 :
|
|
WID==24 ? 6 : 4;
|
|
localparam FMSB = WID==128 ? 111 :
|
|
WID==96 ? 79 :
|
|
WID==80 ? 63 :
|
|
WID==64 ? 51 :
|
|
WID==52 ? 39 :
|
|
WID==48 ? 34 :
|
|
WID==44 ? 31 :
|
|
WID==42 ? 29 :
|
|
WID==40 ? 28 :
|
|
WID==32 ? 22 :
|
|
WID==24 ? 15 : 9;
|
|
|
|
localparam FX = (FMSB+2)*2-1; // the MSB of the expanded fraction
|
|
localparam EX = FX + 1 + EMSB + 1 + 1 - 1;
|
|
|
|
input clk; // system clock
|
input clk; // system clock
|
input ce; // core clock enable
|
input ce; // core clock enable
|
input [2:0] rm; // rounding mode
|
input [2:0] rm; // rounding mode
|
input op; // operation 0 = add, 1 = subtract
|
input op; // operation 0 = add, 1 = subtract
|
Line 252... |
Line 227... |
begin
|
begin
|
if (WID==128)
|
if (WID==128)
|
redor128 u1 (.a(xdif4), .b({mfs4,2'b0}), .o(sticky) );
|
redor128 u1 (.a(xdif4), .b({mfs4,2'b0}), .o(sticky) );
|
else if (WID==96)
|
else if (WID==96)
|
redor96 u1 (.a(xdif4), .b({mfs4,2'b0}), .o(sticky) );
|
redor96 u1 (.a(xdif4), .b({mfs4,2'b0}), .o(sticky) );
|
|
else if (WID==84)
|
|
redor84 u1 (.a(xdif4), .b({mfs4,2'b0}), .o(sticky) );
|
else if (WID==80)
|
else if (WID==80)
|
redor80 u1 (.a(xdif4), .b({mfs4,2'b0}), .o(sticky) );
|
redor80 u1 (.a(xdif4), .b({mfs4,2'b0}), .o(sticky) );
|
else if (WID==64)
|
else if (WID==64)
|
redor64 u1 (.a(xdif4), .b({mfs4,2'b0}), .o(sticky) );
|
redor64 u1 (.a(xdif4), .b({mfs4,2'b0}), .o(sticky) );
|
else if (WID==40)
|
else if (WID==40)
|
Line 353... |
Line 330... |
|
|
endmodule
|
endmodule
|
|
|
module fpAddsubnr_L10(clk, ce, rm, op, a, b, o);
|
module fpAddsubnr_L10(clk, ce, rm, op, a, b, o);
|
parameter WID = 128;
|
parameter WID = 128;
|
localparam MSB = WID-1;
|
`include "fpSize.sv"
|
localparam EMSB = WID==128 ? 14 :
|
|
WID==96 ? 14 :
|
|
WID==80 ? 14 :
|
|
WID==64 ? 10 :
|
|
WID==52 ? 10 :
|
|
WID==48 ? 11 :
|
|
WID==44 ? 10 :
|
|
WID==42 ? 10 :
|
|
WID==40 ? 9 :
|
|
WID==32 ? 7 :
|
|
WID==24 ? 6 : 4;
|
|
localparam FMSB = WID==128 ? 111 :
|
|
WID==96 ? 79 :
|
|
WID==80 ? 63 :
|
|
WID==64 ? 51 :
|
|
WID==52 ? 39 :
|
|
WID==48 ? 34 :
|
|
WID==44 ? 31 :
|
|
WID==42 ? 29 :
|
|
WID==40 ? 28 :
|
|
WID==32 ? 22 :
|
|
WID==24 ? 15 : 9;
|
|
|
|
localparam FX = (FMSB+2)*2-1; // the MSB of the expanded fraction
|
|
localparam EX = FX + 1 + EMSB + 1 + 1 - 1;
|
|
|
|
input clk; // system clock
|
input clk; // system clock
|
input ce; // core clock enable
|
input ce; // core clock enable
|
input [2:0] rm; // rounding mode
|
input [2:0] rm; // rounding mode
|
input op; // operation 0 = add, 1 = subtract
|
input op; // operation 0 = add, 1 = subtract
|