forked from Github_Repos/cvw
messy FMA rewrite using section 7.5.4 in The Handbook of Floating-Point Arithmetic
This commit is contained in:
parent
85363e941d
commit
e317e7511e
@ -11,19 +11,19 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
module add(r[105:0], s[105:0], t[157:0], sum[157:0],
|
||||
module add(r, s, t, sum,
|
||||
negsum, invz, selsum1, killprod, negsum0, negsum1, proddenorm);
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
input [105:0] r; // partial product 1
|
||||
input [105:0] s; // partial product 2
|
||||
input [157:0] t; // aligned addend
|
||||
input [163:0] t; // aligned addend
|
||||
input invz; // invert addend
|
||||
input selsum1; // select +1 mode of compound adder
|
||||
input killprod; // z >> product
|
||||
input negsum; // Negate sum
|
||||
input proddenorm;
|
||||
output [157:0] sum; // sum
|
||||
output [163:0] sum; // sum
|
||||
output negsum0; // sum was negative in +0 mode
|
||||
output negsum1; // sum was negative in +1 mode
|
||||
|
||||
@ -31,13 +31,14 @@ module add(r[105:0], s[105:0], t[157:0], sum[157:0],
|
||||
|
||||
wire [105:0] r2; // partial product possibly zeroed out
|
||||
wire [105:0] s2; // partial product possibly zeroed out
|
||||
wire [157:0] t2; // addend after inversion if necessary
|
||||
wire [157:0] sum0; // sum of compound adder +0 mode
|
||||
wire [157:0] sum1; // sum of compound adder +1 mode
|
||||
wire [163:0] t2; // addend after inversion if necessary
|
||||
wire [163:0] sum0; // sum of compound adder +0 mode
|
||||
wire [163:0] sum1; // sum of compound adder +1 mode
|
||||
wire [163:0] prodshifted; // sum of compound adder +1 mode
|
||||
|
||||
// Invert addend if z's sign is diffrent from the product's sign
|
||||
|
||||
assign t2 = invz ? -t : t;
|
||||
assign t2 = invz ? ~t : t;
|
||||
|
||||
// Zero out product if Z >> product or product really should be zero
|
||||
|
||||
@ -46,9 +47,9 @@ module add(r[105:0], s[105:0], t[157:0], sum[157:0],
|
||||
|
||||
// Compound adder
|
||||
// Consists of 3:2 CSA followed by long compound CPA
|
||||
|
||||
assign sum0 = {52'b0, r2} + {52'b0, s2} + t2 + 158'b0;
|
||||
assign sum1 = {52'b0, r2} + {52'b0, s2} + t2 + 158'b1;
|
||||
assign prodshifted = {56'b0, r2, 2'b0} + {56'b0, s2, 2'b0};
|
||||
assign sum0 = prodshifted + t2 + 158'b0;
|
||||
assign sum1 = prodshifted + t2 + 158'b1;
|
||||
|
||||
// Check sign bits in +0/1 modes
|
||||
assign negsum0 = sum0[157];
|
||||
@ -56,6 +57,6 @@ module add(r[105:0], s[105:0], t[157:0], sum[157:0],
|
||||
|
||||
// Mux proper result (+Oil mode and inversion) using 4:1 mux
|
||||
|
||||
assign sum = selsum1 ? (negsum ? ~sum1 : sum1) : (negsum ? ~sum0 : sum0);
|
||||
assign sum = selsum1 ? (negsum ? -sum1 : sum1) : (negsum ? -sum0 : sum0);
|
||||
|
||||
endmodule
|
@ -11,11 +11,11 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
module align(z[51:0], ae[12:0], aligncnt, xzero, yzero, zzero, zdenorm, proddenorm, t[157:0], bs, ps,
|
||||
killprod, bypsel[1], bypplus1, byppostnorm);
|
||||
module align(zman, ae, aligncnt, xzero, yzero, zzero, zdenorm, proddenorm, t, bs, ps,
|
||||
killprod, zexpsel, sumshift);
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
input [51:0] z; // Fraction of addend z;
|
||||
input [51:0] zman; // Fraction of addend z;
|
||||
input [12:0] ae; // sign of exponent of addend z;
|
||||
input [11:0] aligncnt; // amount to shift
|
||||
input xzero; // Input X = 0
|
||||
@ -23,30 +23,28 @@ module align(z[51:0], ae[12:0], aligncnt, xzero, yzero, zzero, zdenorm, proddeno
|
||||
input zzero; // Input Z = 0
|
||||
input zdenorm; // Input Z is denormalized
|
||||
input proddenorm; // product is denormalized
|
||||
input [1:1] bypsel; // Select bypass to X or Z
|
||||
input bypplus1; // Add one to bypassed result
|
||||
input byppostnorm; // Postnormalize bypassed result
|
||||
output [157:0] t; // aligned addend (54 bits left of bpt)
|
||||
output [163:0] t; // aligned addend (54 bits left of bpt)
|
||||
output bs; // sticky bit of addend
|
||||
output ps; // sticky bit of product
|
||||
output killprod; // Z >> product
|
||||
output zexpsel; // Z >> product
|
||||
output [7:0] sumshift;
|
||||
|
||||
// Internal nodes
|
||||
|
||||
reg [157:0] t; // aligned addend from shifter
|
||||
reg [163:0] t; // aligned addend from shifter
|
||||
reg [215:0] shift; // aligned addend from shifter
|
||||
reg killprod; // Z >> product
|
||||
reg bs; // sticky bit of addend
|
||||
reg ps; // sticky bit of product
|
||||
reg zexpsel; // sticky bit of product
|
||||
reg [7:0] i; // temp storage for finding sticky bit
|
||||
wire [52:0] z1; // Z plus 1
|
||||
wire [51:0] z2; // Z selected after handling rounds
|
||||
wire [11:0] align104; // alignment count + 104
|
||||
logic [8:0] sumshift;
|
||||
|
||||
// Increment fraction of Z by one if necessary for prerounded bypass
|
||||
// This incrementor delay is masked by the alignment count computation
|
||||
|
||||
assign z1 = z + 1;
|
||||
assign z2 = bypsel[1] && bypplus1 ? (byppostnorm ? z1[52:1] : z1[51:0]): z;
|
||||
|
||||
// Compute sign of aligncnt + 104 to check for shifting too far right
|
||||
|
||||
@ -66,27 +64,35 @@ module align(z[51:0], ae[12:0], aligncnt, xzero, yzero, zzero, zdenorm, proddeno
|
||||
// And to using product as primary operand in adder I exponent gen
|
||||
killprod = 0;
|
||||
|
||||
if(zzero) begin // if z = 0
|
||||
t = 158'b0;
|
||||
if (xzero || yzero) killprod = 1;
|
||||
end else if ((aligncnt > 53 && ~aligncnt[11]) || xzero || yzero) begin
|
||||
// Left shift by huge amount
|
||||
// or product = 0
|
||||
t = {53'b0, ~zzero, z2, 52'b0};
|
||||
killprod = 1;
|
||||
ps = ~xzero && ~yzero;
|
||||
end else if ((ae[12] && align104[11]) && ~proddenorm) begin //***fix the if statement
|
||||
// KEP if the multiplier's exponent overflows
|
||||
t = {53'b0, ~zzero, z2, 52'b0};
|
||||
killprod = 1;
|
||||
ps = ~xzero && ~yzero;
|
||||
end else if(align104[11]) begin // Right shift by huge amount
|
||||
bs = ~zzero;
|
||||
t = 0;
|
||||
end else if (~aligncnt[11]) begin // Left shift by reasonable amount
|
||||
t = {53'b0, ~zzero, z2, 52'b0} << aligncnt;
|
||||
end else begin // Otherwise right shift
|
||||
t = {53'b0, ~zzero, z2, 52'b0} >> -aligncnt;
|
||||
if ($signed(aligncnt) <= $signed(-105)) begin //ae<=-103
|
||||
//product ancored case with saturated shift
|
||||
sumshift = 163;
|
||||
shift = {~zdenorm,zman,163'b0} >> sumshift;
|
||||
t = {shift[208:51]};
|
||||
bs = |(shift[50:0]);
|
||||
//bs = ~zzero; //set sticky bit
|
||||
zexpsel = 0;
|
||||
end else if($signed(aligncnt) <= $signed(2)) begin // -103<ae<=2
|
||||
// product ancored or cancellation
|
||||
sumshift = 56-aligncnt;
|
||||
shift = {~zdenorm,zman,163'b0} >> sumshift;
|
||||
t = {shift[208:51]};
|
||||
bs = |(shift[51:0]);
|
||||
zexpsel = 0;
|
||||
end else if ($signed(aligncnt)<=$signed(55)) begin //2<ae<=54
|
||||
// addend ancored case
|
||||
sumshift = 56-aligncnt;
|
||||
shift = {~zdenorm,zman, 163'b0} >> sumshift;
|
||||
t = {shift[208:51]};
|
||||
bs = |(shift[51:0]);
|
||||
zexpsel = 1;
|
||||
end else begin // ae>= 55
|
||||
// addend anchored case with saturated shift
|
||||
sumshift = 0;
|
||||
shift = {~zdenorm,zman, 163'b0} >> sumshift;
|
||||
t = {shift[215:52]};
|
||||
bs = |(shift[51:0]);
|
||||
zexpsel = 1;
|
||||
|
||||
// use some behavioral code to find sticky bit. This is really
|
||||
// done by hardware in the shifter.
|
@ -1,114 +0,0 @@
|
||||
|
||||
module array(x, y, xdenorm, ydenorm, r, s, bypsel, bypplus1);
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
input [51:0] x; // Fraction of multiplicand x
|
||||
input [51:0] y; // Fraction of multiplicand y
|
||||
input xdenorm; // is x denormalized
|
||||
input ydenorm; // is y denormalized
|
||||
input bypsel; // Bypass X
|
||||
input bypplus1; // Add 1 to X to handle rounding
|
||||
output [105:0] r; // partial product 1
|
||||
output [105:0] s; // partial product 2
|
||||
|
||||
wire [51:0] xnorm;
|
||||
wire [51:0] ynorm;
|
||||
|
||||
wire [54:0] yExt; //y with appended 0 and assumed 1
|
||||
wire [53:0] xExt; //y with assumed 1
|
||||
wire [26:0][1:0] add1;
|
||||
wire [26:0][54:0] pp;
|
||||
wire [26:0] e;
|
||||
logic [17:0][105:0] lv1add;
|
||||
logic [11:0][105:0] lv2add;
|
||||
logic [7:0][105:0] lv3add;
|
||||
logic [3:0][105:0] lv4add;
|
||||
logic [21:0][106:0] carryTmp;
|
||||
wire [26:0][105:0] acc;
|
||||
// wire [105:0] acc
|
||||
genvar i;
|
||||
|
||||
assign xnorm = xdenorm ? {x[50:0], 1'b0} : x; // normalization of denormalized numbers
|
||||
assign ynorm = ydenorm ? {y[50:0], 1'b0} : y;
|
||||
//assign yExt = {2'b01,ynorm,1'b0}; // y extended and added assumed 1
|
||||
//assign xExt = {2'b01,xnorm}; // x with added assumed 1
|
||||
|
||||
|
||||
//booth encoding
|
||||
|
||||
// generate
|
||||
// for(i=0; i<27; i=i+1) begin
|
||||
// booth booth(.xExt(xExt), .choose(yExt[(i*2)+2:i*2]), .add1(add1[i]), .e(e[i]), .pp(pp[i]));
|
||||
// end
|
||||
// endgenerate
|
||||
|
||||
// assign acc[0] = {49'b0,~e[0],e[0],e[0],pp[0]};
|
||||
// assign acc[1] = {50'b01,~e[1],pp[1],add1[0]};
|
||||
// assign acc[2] = {48'b01,~e[2],pp[2],add1[1], 2'b0};
|
||||
// assign acc[3] = {46'b01,~e[3],pp[3],add1[2], 4'b0};
|
||||
// assign acc[4] = {44'b01,~e[4],pp[4],add1[3], 6'b0};
|
||||
// assign acc[5] = {42'b01,~e[5],pp[5],add1[4], 8'b0};
|
||||
// assign acc[6] = {40'b01,~e[6],pp[6],add1[5], 10'b0};
|
||||
// assign acc[7] = {38'b01,~e[7],pp[7],add1[6], 12'b0};
|
||||
// assign acc[8] = {36'b01,~e[8],pp[8],add1[7], 14'b0};
|
||||
// assign acc[9] = {34'b01,~e[9],pp[9],add1[8], 16'b0};
|
||||
// assign acc[10] = {32'b01,~e[10],pp[10],add1[9], 18'b0};
|
||||
// assign acc[11] = {30'b01,~e[11],pp[11],add1[10], 20'b0};
|
||||
// assign acc[12] = {28'b01,~e[12],pp[12],add1[11], 22'b0};
|
||||
// assign acc[13] = {26'b01,~e[13],pp[13],add1[12], 24'b0};
|
||||
// assign acc[14] = {24'b01,~e[14],pp[14],add1[13], 26'b0};
|
||||
// assign acc[15] = {22'b01,~e[15],pp[15],add1[14], 28'b0};
|
||||
// assign acc[16] = {20'b01,~e[16],pp[16],add1[15], 30'b0};
|
||||
// assign acc[17] = {18'b01,~e[17],pp[17],add1[16], 32'b0};
|
||||
// assign acc[18] = {16'b01,~e[18],pp[18],add1[17], 34'b0};
|
||||
// assign acc[19] = {14'b01,~e[19],pp[19],add1[18], 36'b0};
|
||||
// assign acc[20] = {12'b01,~e[20],pp[20],add1[19], 38'b0};
|
||||
// assign acc[21] = {10'b01,~e[21],pp[21],add1[20], 40'b0};
|
||||
// assign acc[22] = {8'b01,~e[22],pp[22],add1[21], 42'b0};
|
||||
// assign acc[23] = {6'b01,~e[23],pp[23],add1[22], 44'b0};
|
||||
// assign acc[24] = {4'b01,~e[24],pp[24],add1[23], 46'b0};
|
||||
// assign acc[25] = {~e[25],pp[25],add1[24], 48'b0};
|
||||
// assign acc[26] = {pp[26],add1[25], 50'b0};
|
||||
|
||||
// //*** resize adders
|
||||
// generate
|
||||
// for(i=0; i<9; i=i+1) begin
|
||||
// add3comp2 #(.BITS(106)) add1(.a(acc[i*3]), .b(acc[i*3+1]), .c(acc[i*3+2]),
|
||||
// .carry(carryTmp[i][105:0]), .sum(lv1add[i*2+1]));
|
||||
// assign lv1add[i*2] = {carryTmp[i][104:0], 1'b0};
|
||||
// end
|
||||
// endgenerate
|
||||
|
||||
// generate
|
||||
// for(i=0; i<6; i=i+1) begin
|
||||
// add3comp2 #(.BITS(106)) add2(.a(lv1add[i*3]), .b(lv1add[i*3+1]), .c(lv1add[i*3+2]),
|
||||
// .carry(carryTmp[i+9][105:0]), .sum(lv2add[i*2+1]));
|
||||
// assign lv2add[i*2] = {carryTmp[i+9][104:0], 1'b0};
|
||||
// end
|
||||
// endgenerate
|
||||
|
||||
// generate
|
||||
// for(i=0; i<4; i=i+1) begin
|
||||
// add3comp2 #(.BITS(106)) add3(.a(lv2add[i*3]), .b(lv2add[i*3+1]), .c(lv2add[i*3+2]),
|
||||
// .carry(carryTmp[i+15][105:0]), .sum(lv3add[i*2+1]));
|
||||
// assign lv3add[i*2] = {carryTmp[i+15][104:0], 1'b0};
|
||||
// end
|
||||
// endgenerate
|
||||
|
||||
|
||||
// generate
|
||||
// for(i=0; i<2; i=i+1) begin
|
||||
// add4comp2 #(.BITS(106)) add4(.a(lv3add[i*4]), .b(lv3add[i*4+1]), .c(lv3add[i*4+2]), .d(lv3add[i*4+3]),
|
||||
// .carry(carryTmp[i+19]), .sum(lv4add[i*2+1]));
|
||||
// assign lv4add[i*2] = {carryTmp[i+19][104:0], 1'b0};
|
||||
// end
|
||||
// endgenerate
|
||||
|
||||
// add4comp2 #(.BITS(106)) add5(.a(lv4add[0]), .b(lv4add[1]), .c(lv4add[2]), .d(lv4add[3]) ,
|
||||
// .carry(carryTmp[21]), .sum(s));
|
||||
// assign r = {carryTmp[21][104:0], 1'b0};
|
||||
|
||||
assign r = 106'b0;
|
||||
assign s = ({54'b1,xnorm} + (bypsel && bypplus1)) * {54'b1,ynorm};
|
||||
|
||||
endmodule
|
@ -1,55 +0,0 @@
|
||||
module booth(xExt, choose, add1, e, pp);
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
input [53:0] xExt; // multiplicand xExt
|
||||
input [2:0] choose; // bits needed to choose which encoding
|
||||
output [1:0] add1; // do you add 1
|
||||
output e;
|
||||
output [54:0] pp; // the resultant encoding
|
||||
|
||||
logic [54:0] pp, temp;
|
||||
logic e;
|
||||
logic [1:0] add1;
|
||||
logic [53:0] negx;
|
||||
//logic temp;
|
||||
|
||||
assign negx = ~xExt;
|
||||
|
||||
always @(choose, xExt, negx)
|
||||
case (choose)
|
||||
3'b000 : pp = 55'b0; // 0
|
||||
3'b001 : pp = {xExt[53], xExt}; // 1
|
||||
3'b010 : pp = {xExt[53], xExt}; // 1
|
||||
3'b011 : pp = {xExt, 1'b0}; // 2
|
||||
3'b100 : pp = {negx, 1'b0}; // -2
|
||||
3'b101 : pp = {negx[53], negx}; // -1
|
||||
3'b110 : pp = {negx[53], negx}; // -1
|
||||
3'b111 : pp = 55'hfffffffffffffff; // -0
|
||||
endcase
|
||||
|
||||
always @(choose, xExt, negx)
|
||||
case (choose)
|
||||
3'b000 : e = 0; // 0
|
||||
3'b001 : e = xExt[53]; // 1
|
||||
3'b010 : e = xExt[53]; // 1
|
||||
3'b011 : e = xExt[53]; // 2
|
||||
3'b100 : e = negx[53]; // -2
|
||||
3'b101 : e = negx[53]; // -1
|
||||
3'b110 : e = negx[53]; // -1
|
||||
3'b111 : e = 1; // -0
|
||||
endcase
|
||||
// assign add1 = (choose[2] == 1'b1) ? ((choose[1:0] == 2'b11) ? 1'b0 : 1'b1) : 1'b0;
|
||||
// assign add1 = choose[2];
|
||||
always @(choose)
|
||||
case (choose)
|
||||
3'b000 : add1 = 2'b0; // 0
|
||||
3'b001 : add1 = 2'b0; // 1
|
||||
3'b010 : add1 = 2'b0; // 1
|
||||
3'b011 : add1 = 2'b0; // 2
|
||||
3'b100 : add1 = 2'b10; // -2
|
||||
3'b101 : add1 = 2'b1; // -1
|
||||
3'b110 : add1 = 2'b1; // -1
|
||||
3'b111 : add1 = 2'b1; // -0
|
||||
endcase
|
||||
|
||||
endmodule
|
@ -1,30 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Block Name: bypass.v
|
||||
// Author: David Harris
|
||||
// Date: 11/2/1995
|
||||
//
|
||||
// Block Description:
|
||||
// This block contains the bypass muxes which allow fast prerounded
|
||||
// bypass to the X and Z inputs of the FMAC
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
module bypass(xrf[63:0], zrf[63:0], wbypass[63:0], bypsel[1:0],
|
||||
x[63:0], z[63:0]);
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
input [63:0] xrf; // X from register file
|
||||
input [63:0] zrf; // Z from register file
|
||||
input [63:0] wbypass; // Prerounded result for bypass
|
||||
input [1:0] bypsel; // Select bypass to X or Z
|
||||
output [63:0] x; // Source X
|
||||
output [63:0] z; // Source Z
|
||||
|
||||
// If bypass select is asserted, bypass source, else take reg file value
|
||||
|
||||
assign x = bypsel[0] ? wbypass : xrf;
|
||||
assign z = bypsel[1] ? wbypass : zrf;
|
||||
|
||||
endmodule
|
@ -1,90 +0,0 @@
|
||||
module add3comp2(a, b, c, carry, sum);
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//look into diffrent implementations of the compressors?
|
||||
|
||||
parameter BITS = 4;
|
||||
input [BITS-1:0] a;
|
||||
input [BITS-1:0] b;
|
||||
input [BITS-1:0] c;
|
||||
output [BITS-1:0] carry;
|
||||
output [BITS-1:0] sum;
|
||||
genvar i;
|
||||
|
||||
generate
|
||||
for(i= 0; i<BITS; i=i+1) begin
|
||||
sng3comp2 add0(a[i], b[i], c[i], carry[i], sum[i]);
|
||||
end
|
||||
endgenerate
|
||||
|
||||
endmodule
|
||||
|
||||
module add4comp2(a, b, c, d, carry, sum);
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
parameter BITS = 4;
|
||||
input [BITS-1:0] a;
|
||||
input [BITS-1:0] b;
|
||||
input [BITS-1:0] c;
|
||||
input [BITS-1:0] d;
|
||||
output [BITS:0] carry;
|
||||
output [BITS-1:0] sum;
|
||||
|
||||
logic [BITS-1:0] cout;
|
||||
logic carryTmp;
|
||||
genvar i;
|
||||
|
||||
|
||||
sng4comp2 add0(a[0], b[0], c[0], d[0], 1'b0, cout[0], carry[0], sum[0]);
|
||||
|
||||
generate
|
||||
for(i= 1; i<BITS-1; i=i+1) begin
|
||||
sng4comp2 add1(a[i], b[i], c[i], d[i], cout[i-1], cout[i], carry[i], sum[i]);
|
||||
end
|
||||
endgenerate
|
||||
|
||||
|
||||
sng4comp2 add2(a[BITS-1], b[BITS-1], c[BITS-1], d[BITS-1], cout[BITS-2], cout[BITS-1], carryTmp, sum[BITS-1]);
|
||||
|
||||
assign carry[BITS-1] = carryTmp & cout[BITS-1];
|
||||
assign carry[BITS] = carryTmp ^ cout[BITS-1];
|
||||
|
||||
endmodule
|
||||
|
||||
module sng3comp2(a, b, c, carry, sum);
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//look into diffrent implementations of the compressors?
|
||||
|
||||
input a;
|
||||
input b;
|
||||
input c;
|
||||
output carry;
|
||||
output sum;
|
||||
|
||||
logic axorb;
|
||||
|
||||
assign axorb = a ^ b;
|
||||
assign sum = axorb ^ c;
|
||||
|
||||
assign carry = axorb ? c : a;
|
||||
|
||||
endmodule
|
||||
|
||||
module sng4comp2(a, b, c, d, cin, cout, carry, sum);
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//look into pass gate 4:2 counters?
|
||||
|
||||
input a;
|
||||
input b;
|
||||
input c;
|
||||
input d;
|
||||
input cin;
|
||||
output cout;
|
||||
output carry;
|
||||
output sum;
|
||||
|
||||
logic TmpSum;
|
||||
|
||||
sng3comp2 add1(.carry(cout), .sum(TmpSum),.*);
|
||||
sng3comp2 add2(.a(TmpSum), .b(d), .c(cin), .*);
|
||||
|
||||
endmodule
|
@ -15,25 +15,20 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
module expgen(x[62:52], y[62:52], z[62:52],
|
||||
earlyres[62:52], earlyressel, bypsel[1], byppostnorm,
|
||||
killprod, sumzero, postnormalize, normcnt, infinity,
|
||||
module expgen(xexp, yexp, zexp,
|
||||
killprod, sumzero, resultdenorm, normcnt, infinity,
|
||||
invalid, overflow, underflow, inf,
|
||||
nan, xnan, ynan, znan, zdenorm, proddenorm, specialsel,
|
||||
aligncnt, w[62:52], wbypass[62:52],
|
||||
prodof, sumof, sumuf, denorm0, ae[12:0]);
|
||||
nan, de0, xnan, ynan, znan, xdenorm, ydenorm, zdenorm, proddenorm, specialsel, zexpsel,
|
||||
aligncnt, wexp,
|
||||
prodof, sumof, sumuf, denorm0, ae);
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
input [62:52] x; // Exponent of multiplicand x
|
||||
input [62:52] y; // Exponent of multiplicand y
|
||||
input [62:52] z; // Exponent of addend z
|
||||
input [62:52] earlyres; // Result from other FPU block
|
||||
input earlyressel; // Select result from other block
|
||||
input [1:1] bypsel; // Bypass X or Z
|
||||
input byppostnorm; // Postnormalize bypassed result
|
||||
input [62:52] xexp; // Exponent of multiplicand x
|
||||
input [62:52] yexp; // Exponent of multiplicand y
|
||||
input [62:52] zexp; // Exponent of addend z
|
||||
input killprod; // Z >> product
|
||||
input sumzero; // sum exactly equals zero
|
||||
input postnormalize; // postnormalize rounded result
|
||||
input resultdenorm; // postnormalize rounded result
|
||||
input [8:0] normcnt; // normalization shift count
|
||||
input infinity; // generate infinity on overflow
|
||||
input invalid; // Result invalid
|
||||
@ -41,15 +36,18 @@ module expgen(x[62:52], y[62:52], z[62:52],
|
||||
input underflow; // Result underflowed
|
||||
input inf; // Some input is infinity
|
||||
input nan; // Some input is NaN
|
||||
input [12:0] de0; // X is NaN NaN
|
||||
input xnan; // X is NaN
|
||||
input ynan; // Y is NaN
|
||||
input znan; // Z is NaN
|
||||
input xdenorm; // Z is denorm
|
||||
input ydenorm; // Z is denorm
|
||||
input zdenorm; // Z is denorm
|
||||
input proddenorm; // product is denorm
|
||||
input specialsel; // Select special result
|
||||
input zexpsel; // Select special result
|
||||
output [11:0] aligncnt; // shift count for alignment shifter
|
||||
output [62:52] w; // Exponent of result
|
||||
output [62:52] wbypass; // Prerounded exponent for bypass
|
||||
output [62:52] wexp; // Exponent of result
|
||||
output prodof; // X*Y exponent out of bounds
|
||||
output sumof; // X*Y+Z exponent out of bounds
|
||||
output sumuf; // X*Y+Z exponent underflows
|
||||
@ -62,7 +60,6 @@ module expgen(x[62:52], y[62:52], z[62:52],
|
||||
wire [12:0] aligncnt0; // Shift count for alignment
|
||||
wire [12:0] aligncnt1; // Shift count for alignment
|
||||
wire [12:0] be; // Exponent of multiply
|
||||
wire [12:0] de0; // Normalized exponent
|
||||
wire [12:0] de1; // Normalized exponent
|
||||
wire [12:0] de; // Normalized exponent
|
||||
wire [10:0] infinityres; // Infinity or max number
|
||||
@ -75,9 +72,9 @@ module expgen(x[62:52], y[62:52], z[62:52],
|
||||
// if exponent is out of bounds
|
||||
|
||||
|
||||
assign ae = x + y - 1023;
|
||||
assign ae = xexp + yexp;
|
||||
|
||||
assign prodof = (ae > 2046 && ~ae[12]);
|
||||
assign prodof = (ae - 1023 > 2046 && ~ae[12]);
|
||||
|
||||
// Compute alignment shift count
|
||||
// Adjust for postrounding normalization of Z.
|
||||
@ -85,22 +82,19 @@ module expgen(x[62:52], y[62:52], z[62:52],
|
||||
// check if a round overflows is shorter than the actual round and
|
||||
// is masked by the bypass mux and two 10 bit adder delays.
|
||||
|
||||
assign aligncnt0 = z - ae + 13'b0;// KEP use all of ae
|
||||
assign aligncnt1 = z - ae + 13'b1;
|
||||
//assign aligncnt0 = z - ae[10:0] + 13'b0;//original
|
||||
//assign aligncnt1 = z - ae[10:0] + 13'b1;
|
||||
assign aligncnt = bypsel[1] && byppostnorm ? aligncnt1 : aligncnt0;
|
||||
assign aligncnt = zexp - ae;// KEP use all of ae
|
||||
|
||||
|
||||
// Select exponent (usually from product except in case of huge addend)
|
||||
|
||||
assign be = killprod ? z : ae;
|
||||
assign be = zexpsel ? zexp : ae;
|
||||
|
||||
// Adjust exponent based on normalization
|
||||
// A compound adder takes care of the case of post-rounding normalization
|
||||
// requiring an extra increment
|
||||
|
||||
assign de0 = sumzero ? 13'b0 : be + 53 - normcnt;
|
||||
assign de1 = sumzero ? 13'b0 : be + 53 - normcnt + 13'b1;
|
||||
//assign de0 = sumzero ? 13'b0 : be + normcnt + 2;
|
||||
// assign de1 = sumzero ? 13'b0 : be + normcnt + 2;
|
||||
|
||||
// If the exponent becomes exactly zero (denormalized)
|
||||
// signal such to adjust R bit before rounding
|
||||
@ -109,9 +103,9 @@ module expgen(x[62:52], y[62:52], z[62:52],
|
||||
|
||||
// check for exponent out of bounds after add
|
||||
|
||||
assign de = postnormalize ? de1 : de0;
|
||||
assign sumof = de > 2046 && ~de[12];
|
||||
assign sumuf = (de == 0 || de[12]) && ~sumzero && ~zdenorm;//KEP ~zdenorm to prevent underflow flag
|
||||
assign de = resultdenorm ? 0 : de0;
|
||||
assign sumof = de[12];
|
||||
assign sumuf = de == 0 && ~sumzero && ~resultdenorm;
|
||||
|
||||
// bypass occurs before rounding or taking early results
|
||||
|
||||
@ -122,8 +116,7 @@ module expgen(x[62:52], y[62:52], z[62:52],
|
||||
// produces either infinity or the largest finite number, depending on the
|
||||
// rounding mode. NaNs are propagated or generated.
|
||||
|
||||
assign specialres = earlyressel ? earlyres :
|
||||
invalid | nan ? nanres : // KEP added nan
|
||||
assign specialres = invalid | nan ? nanres : // KEP added nan
|
||||
overflow ? infinityres :
|
||||
inf ? 11'b11111111111 :
|
||||
underflow ? 11'b0 : 11'bx;
|
||||
@ -134,11 +127,11 @@ module expgen(x[62:52], y[62:52], z[62:52],
|
||||
// "If two or more inputs are NaN, then the payload of the resulting NaN should be
|
||||
// identical to the payload of one of the input NaNs if representable in the destination
|
||||
// format. This standard does not specify which of the input NaNs will provide the payload."
|
||||
assign nanres = xnan ? x : (ynan ? y : (znan? z : 11'b11111111111));
|
||||
assign nanres = xnan ? xexp : (ynan ? yexp : (znan? zexp : 11'b11111111111));
|
||||
|
||||
// A mux selects the early result from other FPU blocks or the
|
||||
// normalized FMAC result. Special cases are also detected.
|
||||
|
||||
assign w = specialsel ? specialres[10:0] : de;
|
||||
assign wexp = specialsel ? specialres[10:0] : de[10:0];
|
||||
endmodule
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
module flag(xnan, ynan, znan, xinf, yinf, zinf, prodof, sumof, sumuf,
|
||||
psign, zsign, xzero, yzero, v[1:0],
|
||||
psign, zsign, xzero, yzero, vbits,
|
||||
inf, nan, invalid, overflow, underflow, inexact);
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ -26,7 +26,7 @@ module flag(xnan, ynan, znan, xinf, yinf, zinf, prodof, sumof, sumuf,
|
||||
input zsign; // Sign of z
|
||||
input xzero; // x = 0
|
||||
input yzero; // y = 0
|
||||
input [1:0] v; // R and S bits of result
|
||||
input [1:0] vbits; // R and S bits of result
|
||||
output inf; // Some source is Inf
|
||||
output nan; // Some source is NaN
|
||||
output invalid; // Result is invalid
|
||||
@ -81,6 +81,6 @@ module flag(xnan, ynan, znan, xinf, yinf, zinf, prodof, sumof, sumuf,
|
||||
// 2) Addition inexact
|
||||
// One of these cases occurred if the R or S bit is set
|
||||
|
||||
assign inexact = (v[0] || v[1] || suminf) && ~(inf || nan);
|
||||
assign inexact = (vbits[0] || vbits[1] || suminf) && ~(inf || nan);
|
||||
|
||||
endmodule
|
138
wally-pipelined/src/fpu/FMA/fmac.sv
Normal file
138
wally-pipelined/src/fpu/FMA/fmac.sv
Normal file
@ -0,0 +1,138 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Block Name: fmac.v
|
||||
// Author: David Harris
|
||||
// Date: 11/2/1995
|
||||
//
|
||||
// Block Description:
|
||||
// This is the top level block of a floating-point multiply/accumulate
|
||||
// unit(FMAC). It instantiates the following sub-blocks:
|
||||
//
|
||||
// array Booth encoding, partial product generation, product summation
|
||||
// expgen Exponent summation, compare, and adjust
|
||||
// align Alignment shifter
|
||||
// add Carry-save adder for accumulate, carry propagate adder
|
||||
// lza Leading zero anticipator to control normalization shifter
|
||||
// normalize Normalization shifter
|
||||
// round Rounding of result
|
||||
// exception Handles exceptional cases
|
||||
// bypass Handles bypass of result to X or Z inputs
|
||||
// sign One bit sign handling block
|
||||
// special Catch special cases (inputs = 0 / infinity / etc.)
|
||||
//
|
||||
// The FMAC computes W=X*Y+Z, rounded with the mode specified by
|
||||
// RN, RZ, RM, or RP. The result is optionally bypassed back to
|
||||
// the X or Z inputs for use on the next cycle. In addition, four signals
|
||||
// are produced: trap, overflow, underflow, and inexact. Trap indicates
|
||||
// an infinity, NaN, or denormalized number to be handled in software;
|
||||
// the other three signals are IEEE flags.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
module fmac(x, y, z, rn, rz, rp, rm,
|
||||
earlyres, earlyressel, bypsel, bypplus1, byppostnorm,
|
||||
w, wbypass, invalid, overflow, underflow, inexact);
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
input [63:0] x; // input X from reg file
|
||||
input [63:0] y; // input Y
|
||||
input [63:0] z; // input Z from reg file
|
||||
input rn; // Round to Nearest
|
||||
input rz; // Round toward zero
|
||||
input rm; // Round toward minus infinity
|
||||
input rp; // Round toward plus infinity
|
||||
input [63:0] earlyres; // Early result from other FP logic
|
||||
input earlyressel; // Select early result, not W
|
||||
input [1:0] bypsel; // Select W bypass to X, or z
|
||||
input bypplus1; // Add one in bypass
|
||||
input byppostnorm; // postnormalize in bypass
|
||||
output [63:0] w; // output W=X*Y+Z
|
||||
output [63:0] wbypass; // prerounded output W=X*Y+Z for bypass
|
||||
output invalid; // Result is invalid
|
||||
output overflow; // Result overflowed
|
||||
output underflow; // Result underflowed
|
||||
output inexact; // Result is not an exact number
|
||||
|
||||
// Internal nodes
|
||||
|
||||
logic [105:0] r; // one result of partial product sum
|
||||
logic [105:0] s; // other result of partial products
|
||||
logic [163:0] t; // output of alignment shifter
|
||||
logic [163:0] sum; // output of carry prop adder
|
||||
logic [53:0] v; // normalized sum, R, S bits
|
||||
logic [11:0] aligncnt; // shift count for alignment
|
||||
logic [8:0] normcnt; // shift count for normalizer
|
||||
logic [12:0] ae; // multiplier expoent
|
||||
logic bs; // sticky bit of addend
|
||||
logic ps; // sticky bit of product
|
||||
logic killprod; // Z >> product
|
||||
logic negsum; // negate sum
|
||||
logic invz; // invert addend
|
||||
logic selsum1; // select +1 mode of sum
|
||||
logic negsum0; // sum +0 < 0
|
||||
logic negsum1; // sum +1 < 0
|
||||
logic sumzero; // sum = 0
|
||||
logic infinity; // generate infinity on overflow
|
||||
logic prodof; // X*Y out of range
|
||||
logic sumof; // result out of range
|
||||
logic xzero;
|
||||
logic yzero;
|
||||
logic zzero;
|
||||
logic xdenorm;
|
||||
logic ydenorm;
|
||||
logic zdenorm;
|
||||
logic proddenorm;
|
||||
logic zexpsel;
|
||||
logic denorm0;
|
||||
logic resultdenorm;
|
||||
logic inf;
|
||||
logic xinf;
|
||||
logic yinf;
|
||||
logic zinf;
|
||||
logic xnan;
|
||||
logic ynan;
|
||||
logic znan;
|
||||
logic specialsel;
|
||||
logic nan;
|
||||
logic sumuf;
|
||||
logic psign;
|
||||
logic [8:0] sumshift;
|
||||
logic [12:0] de0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Instantiate fraction datapath
|
||||
|
||||
multiply multiply(.xman(x[51:0]), .yman(y[51:0]), .*);
|
||||
align align(.zman(z[51:0]),.*);
|
||||
add add(.*);
|
||||
lza lza(.*);
|
||||
normalize normalize(.zexp(z[62:52]),.*);
|
||||
round round(.xman(x[51:0]), .yman(y[51:0]),.zman(z[51:0]), .wman(w[51:0]),.wsign(w[63]),.*);
|
||||
|
||||
// Instantiate exponent datapath
|
||||
|
||||
expgen expgen(.xexp(x[62:52]),.yexp(y[62:52]),.zexp(z[62:52]),.wexp(w[62:52]),.*);
|
||||
// Instantiate special case detection across datapath & exponent path
|
||||
|
||||
special special(.*);
|
||||
|
||||
|
||||
// Instantiate control logic
|
||||
|
||||
sign sign(.xsign(x[63]),.ysign(y[63]),.zsign(z[63]),.wsign(w[63]),.*);
|
||||
flag flag(.zsign(z[63]),.vbits(v[1:0]),.*);
|
||||
|
||||
endmodule
|
||||
|
@ -1,130 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Block Name: fmac.v
|
||||
// Author: David Harris
|
||||
// Date: 11/2/1995
|
||||
//
|
||||
// Block Description:
|
||||
// This is the top level block of a floating-point multiply/accumulate
|
||||
// unit(FMAC). It instantiates the following sub-blocks:
|
||||
//
|
||||
// array Booth encoding, partial product generation, product summation
|
||||
// expgen Exponent summation, compare, and adjust
|
||||
// align Alignment shifter
|
||||
// add Carry-save adder for accumulate, carry propagate adder
|
||||
// lza Leading zero anticipator to control normalization shifter
|
||||
// normalize Normalization shifter
|
||||
// round Rounding of result
|
||||
// exception Handles exceptional cases
|
||||
// bypass Handles bypass of result to X or Z inputs
|
||||
// sign One bit sign handling block
|
||||
// special Catch special cases (inputs = 0 / infinity / etc.)
|
||||
//
|
||||
// The FMAC computes W=X*Y+Z, rounded with the mode specified by
|
||||
// RN, RZ, RM, or RP. The result is optionally bypassed back to
|
||||
// the X or Z inputs for use on the next cycle. In addition, four signals
|
||||
// are produced: trap, overflow, underflow, and inexact. Trap indicates
|
||||
// an infinity, NaN, or denormalized number to be handled in software;
|
||||
// the other three signals are IEEE flags.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
module fmac(xrf, y, zrf, rn, rz, rp, rm,
|
||||
earlyres, earlyressel, bypsel, bypplus1, byppostnorm,
|
||||
w, wbypass, invalid, overflow, underflow, inexact);
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
input [63:0] xrf; // input X from reg file
|
||||
input [63:0] y; // input Y
|
||||
input [63:0] zrf; // input Z from reg file
|
||||
input rn; // Round to Nearest
|
||||
input rz; // Round toward zero
|
||||
input rm; // Round toward minus infinity
|
||||
input rp; // Round toward plus infinity
|
||||
input [63:0] earlyres; // Early result from other FP logic
|
||||
input earlyressel; // Select early result, not W
|
||||
input [1:0] bypsel; // Select W bypass to X, or z
|
||||
input bypplus1; // Add one in bypass
|
||||
input byppostnorm; // postnormalize in bypass
|
||||
output [63:0] w; // output W=X*Y+Z
|
||||
output [63:0] wbypass; // prerounded output W=X*Y+Z for bypass
|
||||
output invalid; // Result is invalid
|
||||
output overflow; // Result overflowed
|
||||
output underflow; // Result underflowed
|
||||
output inexact; // Result is not an exact number
|
||||
|
||||
// Internal nodes
|
||||
|
||||
wire [63:0] x; // input X after bypass mux
|
||||
wire [63:0] z; // input Z after bypass mux
|
||||
wire [105:0] r; // one result of partial product sum
|
||||
wire [105:0] s; // other result of partial products
|
||||
wire [157:0] t; // output of alignment shifter
|
||||
wire [157:0] sum; // output of carry prop adder
|
||||
wire [53:0] v; // normalized sum, R, S bits
|
||||
wire [11:0] aligncnt; // shift count for alignment
|
||||
wire [8:0] normcnt; // shift count for normalizer
|
||||
wire [12:0] ae; // multiplier expoent
|
||||
wire bs; // sticky bit of addend
|
||||
wire ps; // sticky bit of product
|
||||
wire killprod; // Z >> product
|
||||
wire negsum; // negate sum
|
||||
wire invz; // invert addend
|
||||
wire selsum1; // select +1 mode of sum
|
||||
wire negsum0; // sum +0 < 0
|
||||
wire negsum1; // sum +1 < 0
|
||||
wire sumzero; // sum = 0
|
||||
wire infinity; // generate infinity on overflow
|
||||
wire prodof; // X*Y out of range
|
||||
wire sumof; // result out of range
|
||||
|
||||
// Instantiate fraction datapath
|
||||
|
||||
array array(x[51:0], y[51:0], xdenorm, ydenorm, r[105:0], s[105:0],
|
||||
bypsel[0], bypplus1);
|
||||
align align(z[51:0], ae, aligncnt, xzero, yzero, zzero, zdenorm, proddenorm,
|
||||
t[157:0], bs, ps, killprod,
|
||||
bypsel[1], bypplus1, byppostnorm);
|
||||
add add(r[105:0], s[105:0], t[157:0], sum[157:0],
|
||||
negsum, invz, selsum1, killprod, negsum0, negsum1, proddenorm);
|
||||
lop lop(sum, normcnt, sumzero);
|
||||
normalize normalize(sum[157:0], normcnt, sumzero, bs, ps, denorm0, zdenorm,
|
||||
v[53:0]);
|
||||
round round(v[53:0], earlyres[51:0], earlyressel, rz, rn, rp, rm, w[63],
|
||||
invalid, overflow, underflow, inf, nan, xnan, ynan, znan,
|
||||
x[51:0], y[51:0], z[51:0],
|
||||
w[51:0], postnorrnalize, infinity, specialsel);
|
||||
bypass bypass(xrf[63:0], zrf[63:0], wbypass[63:0], bypsel[1:0],
|
||||
x[63:0], z[63:0]);
|
||||
|
||||
// Instantiate exponent datapath
|
||||
|
||||
expgen expgen(x[62:52], y[62:52], z[62:52],
|
||||
earlyres[62:52], earlyressel, bypsel[1], byppostnorm,
|
||||
killprod, sumzero, postnorrnalize, normcnt,
|
||||
infinity, invalid, overflow, underflow,
|
||||
inf, nan, xnan, ynan, znan, zdenorm, proddenorm, specialsel,
|
||||
aligncnt, w[62:52], wbypass[62:52],
|
||||
prodof, sumof, sumuf, denorm0, ae);
|
||||
// Instantiate special case detection across datapath & exponent path
|
||||
|
||||
special special(x[63:0], y[63:0], z[63:0], ae, xzero, yzero, zzero,
|
||||
xnan, ynan, znan, xdenorm, ydenorm, zdenorm, proddenorm,
|
||||
xinf, yinf, zinf);
|
||||
|
||||
// Produce W for bypass
|
||||
|
||||
assign wbypass[51:0] = v[53:2];
|
||||
assign wbypass[63] = w[63];
|
||||
|
||||
// Instantiate control logic
|
||||
|
||||
sign sign(x[63], y[63], z[63], negsum0, negsum1, bs, ps,
|
||||
killprod, rm, overflow, sumzero, nan, invalid, xinf, yinf, zinf, inf,
|
||||
w[63], invz, negsum, selsum1, psign);
|
||||
flag flag(xnan, ynan, znan, xinf, yinf, zinf, prodof, sumof, sumuf,
|
||||
psign, z[63], xzero, yzero, v[1:0],
|
||||
inf, nan, invalid, overflow, underflow, inexact);
|
||||
|
||||
endmodule
|
||||
|
@ -9,10 +9,10 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
module lop(sum, normcnt, sumzero);
|
||||
module lza(sum, normcnt, sumzero);
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
input [157:0] sum; // sum
|
||||
input [163:0] sum; // sum
|
||||
output [8:0] normcnt; // normalization shift count
|
||||
output sumzero; // sum = 0
|
||||
|
||||
@ -30,7 +30,7 @@ module lop(sum, normcnt, sumzero);
|
||||
always @ ( sum)
|
||||
begin
|
||||
i = 0;
|
||||
while (~sum[157-i] && i < 157) i = i+1; // search for leading one
|
||||
while (~sum[108-i] && i < 108) i = i+1; // search for leading one
|
||||
normcnt = i; // compute shift count
|
||||
end
|
||||
|
15
wally-pipelined/src/fpu/FMA/multiply.sv
Normal file
15
wally-pipelined/src/fpu/FMA/multiply.sv
Normal file
@ -0,0 +1,15 @@
|
||||
|
||||
module multiply(xman, yman, xdenorm, ydenorm, r, s);
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
input [51:0] xman; // Fraction of multiplicand x
|
||||
input [51:0] yman; // Fraction of multiplicand y
|
||||
input xdenorm; // is x denormalized
|
||||
input ydenorm; // is y denormalized
|
||||
output [105:0] r; // partial product 1
|
||||
output [105:0] s; // partial product 2
|
||||
|
||||
assign r = 106'b0;
|
||||
assign s = {53'b0,~xdenorm,xman} * {53'b0,~ydenorm,yman};
|
||||
|
||||
endmodule
|
@ -14,21 +14,30 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
module normalize(sum[157:0], normcnt, sumzero, bs, ps, denorm0, zdenorm, v[53:0]);
|
||||
module normalize(sum, zexp, normcnt, ae, aligncnt, sumshift, sumzero, bs, ps, denorm0, zdenorm, de0, resultdenorm, v);
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
input [157:0] sum; // sum
|
||||
input [163:0] sum; // sum
|
||||
input [62:52] zexp; // sum
|
||||
input [8:0] normcnt; // normalization shift count
|
||||
input [12:0] ae; // normalization shift count
|
||||
input [11:0] aligncnt; // normalization shift count
|
||||
input [8:0] sumshift; // normalization shift count
|
||||
input sumzero; // sum is zero
|
||||
input bs; // sticky bit for addend
|
||||
input ps; // sticky bit for product
|
||||
input denorm0; // exponent = -1023
|
||||
input zdenorm; // Input Z is denormalized
|
||||
output [12:0] de0;
|
||||
output resultdenorm; // Input Z is denormalized
|
||||
output [53:0] v; // normalized sum, R, S bits
|
||||
|
||||
// Internal nodes
|
||||
|
||||
reg [53:0] v; // normalized sum, R, S bits
|
||||
wire [157:0] sumshifted; // shifted sum
|
||||
logic resultdenorm; // Input Z is denormalized
|
||||
logic [12:0] de0;
|
||||
logic [163:0] sumshifted; // shifted sum
|
||||
logic tmp;
|
||||
|
||||
// When the sum is zero, normalization does not apply and only the
|
||||
// sticky bit must be computed. Otherwise, the sum is right-shifted
|
||||
@ -41,23 +50,33 @@ module normalize(sum[157:0], normcnt, sumzero, bs, ps, denorm0, zdenorm, v[53:0]
|
||||
// The sticky bit calculation is actually built into the shifter and
|
||||
// does not require a true subtraction shown in the model.
|
||||
|
||||
always @(sum or normcnt or sumzero or bs or ps or sumshifted or denorm0)
|
||||
assign tmp = ($signed(ae-normcnt+2) >= $signed(-1022));
|
||||
always @(sum or normcnt or sumshift or ae or aligncnt)
|
||||
begin
|
||||
if (sumzero) begin // special case
|
||||
v[53:1] = 0;
|
||||
v[0] = ps || bs ;
|
||||
if ($signed(aligncnt)<=$signed(2)) begin // special case
|
||||
if ($signed(ae-normcnt+2) >= $signed(-1022)) begin
|
||||
sumshifted = sum << (55+normcnt);
|
||||
v = sumshifted[157:104];
|
||||
resultdenorm = 0;
|
||||
de0 = ae-normcnt+2;
|
||||
end else begin
|
||||
sumshifted = sum << (1079+ae);
|
||||
v = sumshifted[157:104];
|
||||
resultdenorm = 1;
|
||||
de0 = 0;
|
||||
end
|
||||
|
||||
end else begin // extract normalized bits
|
||||
v[53:3] = sumshifted[156:106];
|
||||
// KEP prevent plus1 in round.v when z is denormalized.
|
||||
v[2] = sumshifted[105] || sumshifted[106] && denorm0 && ~zdenorm;
|
||||
v[1] = sumshifted[104] || sumshifted[105] && denorm0 && ~zdenorm;
|
||||
v[0] = |(sumshifted[103:0]) || ps || bs;
|
||||
sumshifted = sum << sumshift;
|
||||
v = sumshifted[157:104];
|
||||
resultdenorm = 0;
|
||||
de0 = zexp;
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
// shift sum left by normcnt, filling the right with zeros
|
||||
assign sumshifted = sum << normcnt;
|
||||
//assign sumshifted = sum << normcnt;
|
||||
|
||||
endmodule
|
||||
|
@ -13,15 +13,13 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
module round(v[53:0], earlyres[51:0], earlyressel, rz, rn, rp, rm, wsign,
|
||||
module round(v, rz, rn, rp, rm, wsign,
|
||||
invalid, overflow, underflow, inf, nan, xnan, ynan, znan,
|
||||
x[51:0], y[51:0], z[51:0],
|
||||
w[51:0], postnormalize, infinity, specialsel);
|
||||
xman, yman, zman,
|
||||
wman, infinity, specialsel);
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
input [53:0] v; // normalized sum, R, S bits
|
||||
input [51:0] earlyres; // result from other FPU blocks
|
||||
input earlyressel; // use result from other FPU blocks
|
||||
input rz; // Round toward zero
|
||||
input rn; // Round toward nearest
|
||||
input rp; // Round toward plus infinity
|
||||
@ -35,11 +33,11 @@ module round(v[53:0], earlyres[51:0], earlyressel, rz, rn, rp, rm, wsign,
|
||||
input xnan; // X is NaN
|
||||
input ynan; // Y is NaN
|
||||
input znan; // Z is NaN
|
||||
input [51:0] x; // Input X
|
||||
input [51:0] y; // Input Y
|
||||
input [51:0] z; // Input Z
|
||||
output [51:0] w; // rounded result of FMAC
|
||||
output postnormalize; // Right shift 1 for post-rounding norm
|
||||
input [51:0] xman; // Input X
|
||||
input [51:0] yman; // Input Y
|
||||
input [51:0] zman; // Input Z
|
||||
output [51:0] wman; // rounded result of FMAC
|
||||
//output postnormalize; // Right shift 1 for post-rounding norm
|
||||
output infinity; // Generate infinity on overflow
|
||||
output specialsel; // Select special result
|
||||
|
||||
@ -64,7 +62,7 @@ module round(v[53:0], earlyres[51:0], earlyressel, rz, rn, rp, rm, wsign,
|
||||
// Determine if postnormalization is necessary
|
||||
// Predicted by all bits =1 before round +1
|
||||
|
||||
assign postnormalize = &(v[53:2]) && plus1;
|
||||
//assign postnormalize = &(v[53:2]) && plus1;
|
||||
|
||||
// Determine special result in event of of selection of a result from
|
||||
// another FPU functional unit, infinity, NAN, or underflow
|
||||
@ -74,10 +72,9 @@ module round(v[53:0], earlyres[51:0], earlyressel, rz, rn, rp, rm, wsign,
|
||||
// inputs to the wide muxes can be combined at the expense of more
|
||||
// complicated non-critical control in the circuit implementation.
|
||||
|
||||
assign specialsel = earlyressel || overflow || underflow || invalid ||
|
||||
assign specialsel = overflow || underflow || invalid ||
|
||||
nan || inf;
|
||||
assign specialres = earlyressel ? earlyres :
|
||||
invalid | nan ? nanres : //KEP added nan
|
||||
assign specialres = invalid | nan ? nanres : //KEP added nan
|
||||
overflow ? infinityres :
|
||||
inf ? 52'b0 :
|
||||
underflow ? 52'b0 : 52'bx; // default to undefined
|
||||
@ -98,14 +95,14 @@ module round(v[53:0], earlyres[51:0], earlyressel, rz, rn, rp, rm, wsign,
|
||||
// "If two or more inputs are NaN, then the payload of the resulting NaN should be
|
||||
// identical to the payload of one of the input NaNs if representable in the destination
|
||||
// format. This standard does not specify which of the input NaNs will provide the payload."
|
||||
assign nanres = xnan ? {1'b1, x[50:0]}: (ynan ? {1'b1, y[50:0]} : (znan ? {1'b1, z[50:0]} : {1'b1, 51'b0}));// KEP 210112 add the 1 to make NaNs quiet
|
||||
assign nanres = xnan ? {1'b1, xman[50:0]}: (ynan ? {1'b1, yman[50:0]} : (znan ? {1'b1, zman[50:0]} : {1'b1, 51'b0}));// KEP 210112 add the 1 to make NaNs quiet
|
||||
|
||||
// Select result with 4:1 mux
|
||||
// If the sum is zero and we round up, there is a special case in
|
||||
// which we produce a massive loss of significance and trap to software.
|
||||
// It is handled in the exception unit.
|
||||
|
||||
assign w = specialsel ? specialres : (plus1 ? v1[51:0] : v[53:2]);
|
||||
assign wman = specialsel ? specialres : (plus1 ? v1[51:0] : v[53:2]);
|
||||
|
||||
endmodule
|
||||
|
@ -43,6 +43,7 @@ module sign(xsign, ysign, zsign, negsum0, negsum1, bs, ps, killprod, rm, overflo
|
||||
wire infsign; // sign if result= Inf
|
||||
reg negsum; // negate result of adder
|
||||
reg selsum1; // select +1 mode from compound adder
|
||||
logic tmp;
|
||||
|
||||
// Compute sign of product
|
||||
|
||||
@ -89,6 +90,7 @@ module sign(xsign, ysign, zsign, negsum0, negsum1, bs, ps, killprod, rm, overflo
|
||||
assign zerosign = (~invz && killprod) ? zsign : rm;
|
||||
assign infsign = zinf ? zsign : psign; //KEP 210112 keep the correct sign when result is infinity
|
||||
//assign infsign = xinf ? (yinf ? psign : xsign) : yinf ? ysign : zsign;//original
|
||||
assign tmp = invalid ? 0 : (inf ? infsign :(sumzero ? zerosign : psign ^ negsum));
|
||||
assign wsign = invalid ? 0 : (inf ? infsign :(sumzero ? zerosign : psign ^ negsum));
|
||||
|
||||
endmodule
|
@ -10,7 +10,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
module special(x[63:0], y[63:0], z[63:0], ae, xzero, yzero, zzero,
|
||||
module special(x, y, z, ae, xzero, yzero, zzero,
|
||||
xnan, ynan, znan, xdenorm, ydenorm, zdenorm, proddenorm, xinf, yinf, zinf);
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,199 +0,0 @@
|
||||
c22000007fffffff 24700000ffffffef a6a00001800007ed
|
||||
bfc00000000011fe 3fdfffffffffff03 bfb000000000117f
|
||||
a83100000007fffe 41e0000effffffff aa21000ff0080004
|
||||
0000000000000000 001ffffffffffffe 0000000000000000
|
||||
400327ca64d70ec7 3ca0000000000001 3cb327ca64d70ec9
|
||||
0000000000000000 43e207ffffffffff 0000000000000000
|
||||
0000000000000000 3fd0000000000000 0000000000000000
|
||||
0000000000000000 3fdfffffffffffff 0000000000000000
|
||||
0000000000000000 3fe0000000000000 0000000000000000
|
||||
c870200000010000 3fefffffffffffff c87020000000ffff
|
||||
c00aaa4fd557ef13 c3b8917384eb32d0 43d478efdc9216d8
|
||||
0000000000000000 7ffc000000000000 7ff8000000000000
|
||||
0000000000000000 c18aca47203438e2 0000000000000000
|
||||
0000000000000000 4000000000000001 0000000000000000
|
||||
47efff0008000000 b1dcb0523546117f b9dcaf6cb9e07bdb
|
||||
43f000ffffff7fff 22300000001fffdf 26300100001f81de
|
||||
402ff000001fffff 40759558e27de226 40b58a8e3622388e
|
||||
0000000000000000 40efdeffffffffff 0000000000000000
|
||||
0000000000000000 434fffffffffffff 0000000000000000
|
||||
7ffc000000000000 7fe0000000000000 7ff8000000000000
|
||||
b35e061abc769f3a c078000003fffffe 33e684941119bac2
|
||||
403a793cfb1e2471 bff0000100007fff c03a793ea2b2c7eb
|
||||
3d1ffffbfe000000 216898822a24af3f 1e98987f158ae1d8
|
||||
bfb00000001bffff 7ffc000000000000 7ff8000000000000
|
||||
37f0000000efffff c3d00007fffffeff bbd0000800efff75
|
||||
0000000000000000 ffefff8000080000 0000000000000000
|
||||
3fb00200000000ff c0000000011fffff bfc00200012024fd
|
||||
41c0000007ffffff 49103fffefffffff 4ae03ffff81ffff6
|
||||
407effbfffffffff 3e00000040001fff 3e8effc07bff3dfd
|
||||
c1f00013fffffffe 7ffc000000000000 7ff8000000000000
|
||||
c3f00004000001ff c3d00bfffffffffe 47d00c04030001ff
|
||||
403b5ab30b28be12 bfdfffffffffffff c02b5ab30b28be11
|
||||
0000000000000000 c1cfffffff87ffff 0000000000000000
|
||||
0000000000000000 bfe0000000000001 0000000000000000
|
||||
801ffc000007ffff bfeffffffffffffe 001ffc000007fffe
|
||||
0000000000000000 ffe0000005fffffe 0000000000000000
|
||||
0000000000000000 bfffffffffffffff 0000000000000000
|
||||
0000000000000000 c000000000000000 0000000000000000
|
||||
c3d09308769f3f51 c00fffffffffffff 43f09308769f3f51
|
||||
0000000000000000 402ffffdfefffffe 0000000000000000
|
||||
0000000000000000 c010000000000001 0000000000000000
|
||||
c01fffffffc00fff c01ffffffffffffe 404fffffffc00ffe
|
||||
c025e14360f49046 412fff0000000003 c165e09456d988a3
|
||||
0000000000000000 43ee59a2f1155c8b 0000000000000000
|
||||
3fe0000000008fff 802ffffff7fffff6 801ffffff8011ff3
|
||||
0000000000000000 ffefffffffffffff 0000000000000000
|
||||
40401007fffffffe fff0000000000000 80401007fffffffe
|
||||
0000000000000000 c0045abb4860cbf3 0000000000000000
|
||||
0000000000000000 7ffc000000000000 7ff8000000000000
|
||||
bffffffec0000000 c000000000003eff 400ffffec0007dfe
|
||||
48000000004001ff 41f331de979ac49e 4a0331de97e78e7e
|
||||
3d0fffffbff7ffff 7ffc000000000000 7ff8000000000000
|
||||
43d3ffffff000000 3caffffffffffffe 4093fffffeffffff
|
||||
7ffc000000000000 43dfff8004000000 7ff8000000000000
|
||||
bcaffe0000000008 3fd00008000000ff bc8ffe0fff000205
|
||||
404ffbfffffffffc c34ffff8003fffff c3affbf8013ff7fb
|
||||
43e0000000000082 3db000003ffffeff 41a000003fffff82
|
||||
c1d004000ffffffe 4000000000000000 c1e004000ffffffe
|
||||
c00fffffc000007e c02ffffdfffffbff 404ffffdc000007e
|
||||
409dfffbffffffff 4010000000000001 40bdfffc00000001
|
||||
c120000003ffffe0 c06000fffbffffff 4190010000003fde
|
||||
3fd1f7ffffffffff c01000001dffffff bff1f80021b0fffd
|
||||
2e0fefdfffffffff 4030000020000040 2e4fefe03fdfc07f
|
||||
43c0000803ffffff 3fcfffffffffffff 43a0000803ffffff
|
||||
c0afffffbffffdfe 3fc07ffdffffffff c0807ffddf0002f5
|
||||
c0fffffffeffffee 55139bb9349e058c d6239bb9340127b7
|
||||
41ffdbaf18ce06bd 8010000000000000 821fdbaf18ce06bd
|
||||
c0e1000000080000 801ffffffffffffe 011100000007ffff
|
||||
3fbffffff0000007 c807dfffffffffff c7d7dffff4100004
|
||||
c357b53537b96da5 bfd0000000000000 4337b53537b96da5
|
||||
401fffffffffffff ffebff8000000000 801bff7fffffffff
|
||||
c7eff77bf2b59c3c bfe0000000000001 47dff77bf2b59c3e
|
||||
380c3f72cc3dec98 c3fffffffbffffff bc1c3f72c8b5fe3d
|
||||
b8e0000003fbffff c503f4d44f4bf888 3df3f4d454443066
|
||||
3f3ffffc001fffff c000000000000001 bf4ffffc00200000
|
||||
c340002000004000 c0db3367e0423019 442b339e47125d6b
|
||||
4f60000801ffffff 41c07fe000000000 51307fe841fffbff
|
||||
c1ffffffbfefffff c340000000000001 454fffffbff00001
|
||||
404fff7fffffff7f 48ab7e2aad4ec686 490b7dbcb4a410dd
|
||||
7ffc000000000000 ffefffffffffffff 7ff8000000000000
|
||||
41e189ea1a6fff97 7ffc000000000000 7ff8000000000000
|
||||
3ff0ee9046c9330f 8479e1e79766e02b 847b63d14ff91acb
|
||||
d2f805130a8c11df 43effffdfdfffffe d6f8051188ba9004
|
||||
4f1fffbfffe00000 bcd02000000007ff cc001fdfbfefe7fe
|
||||
be70000077ffffff c1efffffffffffff 4070000077ffffff
|
||||
41e1ffffbffffffe 3caffffffffffffe 3ea1ffffbffffffd
|
||||
3bbd976272fb1d2a c06ffff80007fffe bc3d975b0d29e641
|
||||
434fff01ffffffff 403dfeffffffffff 439dfe11e7efffff
|
||||
be6fff7fffffffff 3feffffffffffffe be6fff7ffffffffd
|
||||
41d007ff80000000 41f0fffffffc0000 43d1087f77fbfe01
|
||||
ffeef7a206029708 bdcfa4109a3a5b22 7dce9eaa2542875b
|
||||
3b6ffffffeffffc0 3c7ffffe003ffffe 37fffffdff3fffce
|
||||
c1d1ffffffbfffff bfcffffefffff800 41b1ffff6fbffb82
|
||||
2030000000000090 c05e2e90015c47a1 a09e2e90015c48b0
|
||||
bbf000000007efff 001fe0000007fffe fc1fe0000017d01c
|
||||
41cae866712069f4 c02fffffffffffff c20ae866712069f3
|
||||
bfce1e32ccf56348 3ca1f66d4c8eeef3 bc80e7fa025544da
|
||||
ffedfffff0000000 ffeffff000000800 3fedfff0f0000f80
|
||||
37effffc3ffffffe bca0fffffffffffd b4a0fffe01fffffb
|
||||
bc950a021bf9dee1 3db0001fffdffffe ba550a2c2fd402cd
|
||||
fd4fffffdfffffef 41cffffdffffffef ff2ffffde00001de
|
||||
bfc00000004007ff bcafffffffffffff 3c800000004007ff
|
||||
c009130b80fe8274 b811571307061a38 382b2cb1993b60f3
|
||||
c0600000ffffffdf 7feda1b8c591f9c6 805da1ba9fad85e2
|
||||
c1e4af3f8d45e031 3ca0020002000000 be94b1d577cd70de
|
||||
3800008100000000 b810000020000080 b020008120010280
|
||||
372ff00000003fff 7fe000fdfffffffe 771ff1fb02003fff
|
||||
47d00021fffffffe c00fffffffffffff c7f00021fffffffd
|
||||
bfbc9ea0c2b4884b 43f4a552574073d5 c3c277000b21a4e7
|
||||
bf1fe0000000ffff c01ffffffffffffe 3f4fe0000000fffe
|
||||
41ffffffff7ffffb 0027ffffffffeffe 0237ffffff9feffb
|
||||
c7e040000fffffff ffe0000000000000 07d040000fffffff
|
||||
7ffc000000000000 3fe0000ffffff7ff 7ff8000000000000
|
||||
c1effc1fffffffff 7ffc000000000000 7ff8000000000000
|
||||
c0d000000001ffbf c03ba46e644e4e9c 411ba46e6451c2ba
|
||||
c4500000005fffff c03a20ab4de47fc9 449a20ab4e8143cc
|
||||
400e00000000007e 001fffffffffffff 003e00000000007e
|
||||
45a01fffff7fffff c3c0020200000000 c9702206037fefee
|
||||
3e8ff800000000ff 3caffffffffffffe 3b4ff800000000fe
|
||||
be004000000007fe 3fdffff7ff7fffff bdf03ffbefbf07fd
|
||||
b11000007ffffe00 3fe0000000000000 b10000007ffffe00
|
||||
b80cef50bd17db40 c05fffc00000000e 387cef16de76611d
|
||||
3d4000ffffffffff 3d47f68d8eb6b9a4 3a97f80cf78fa50f
|
||||
ffe3fffffffffffb c03dc3321aaa5380 003299ff50aa742c
|
||||
3ca3fffffffffeff bf02ffafb4e9241d bbb7bf9ba2236bf3
|
||||
53598c812c3c39dd 3f20000100fffffe 52898c82c69d14b1
|
||||
c3dffffff8000001 3fe0020000003ffe c3d001fffbffbffe
|
||||
7ba00800003fffff 3ff9a9a129c791b3 7ba9b675fac31bff
|
||||
c3d0000fffffffef 7fe0000000000001 83c0000ffffffff0
|
||||
c34f80001fffffff b7fffffe0007ffff 3b5f7ffe2807ddff
|
||||
0010000000001ff8 4800020000010000 0820020000011ffc
|
||||
2c4c0000003fffff 230ffffc00400000 0f6bfffc8077fff8
|
||||
381fffffffbff7fe 8010000000000000 f83fffffffbff7fe
|
||||
802d3018ea8c241d c007fdffffffffff 0045e23fae5a7253
|
||||
43e047fffffffffe 4000003ffdfffffe 43f048411df6fffc
|
||||
c000005fffffffff 403ffffffff00002 c050005ffff7ffd0
|
||||
3fc8b60e46a80f6d bfdffffffffffffe bfb8b60e46a80f6b
|
||||
bd5fdffdffffffff 5644b72ace1bbb6b d3b4a27257daf2cd
|
||||
b80010001fffffff 40e01ffffff7fffe b8f030202037f7fc
|
||||
407000003ffbfffe 38042862fe8e3368 388428634f2ab547
|
||||
bf8ffbfff7ffffff c00fffffffffffff 3faffbfff7ffffff
|
||||
bcafc000003fffff c010000000000001 3ccfc00000400001
|
||||
47eddf042473ef08 b7e00000fe000000 bfdddf05fea850ca
|
||||
3fbfffff7fffffef c340ffffffffffbf c310ffffbbffffb5
|
||||
c02f8000000007ff ffe0000000000001 001f800000000801
|
||||
002f37ebf6c8eaec c08be464f4c81c69 80cb36000706e168
|
||||
c00e800000000000 7ffc000000000000 7ff8000000000000
|
||||
0010000000000000 0000000000000000 0000000000000000
|
||||
bfffc00000000003 391001ffffffffff b91fc3f800000001
|
||||
c1db54446247aa52 bfcc001fffffffff 41b7e9d72a43174f
|
||||
0010000000000000 c0392c59c8e48f37 80592c59c8e48f37
|
||||
0010000000000000 c0000800000001ff 80200800000001ff
|
||||
0010000000000000 c1d0000004000fff 81f0000004000fff
|
||||
4030040000200000 0017055f48beeff5 00570b20a0bf2a70
|
||||
bc7000000000ffee c1e0001100000000 3e6000110000fff0
|
||||
c040000000007fff c3b2a6c91c557f56 4402a6c91c56148c
|
||||
41ffffffff003fff c3b0000007ffffee c5c0000007801fed
|
||||
21900001dfffffff bf20000017fffffe a0c00001f80002cc
|
||||
0029954d0f0df5b3 41e00000000003ff 0219954d0f0dfc17
|
||||
b810000020000001 47ffdfffffffff80 c01fe0003fbfff81
|
||||
0010000000000000 ffeffff800007fff c00ffff800007fff
|
||||
0010000000000000 4010000000000000 0030000000000000
|
||||
bf700000000100ff 401fffffffffffff bfa00000000100fe
|
||||
37feffffffffffff 47ef8000000fffff 3ffe8400000f7fff
|
||||
b80f800001fffffe 44e00000ffff7fff bcff8001f9ff041c
|
||||
0010000000000000 434ffffffffffffe 036ffffffffffffe
|
||||
41ffffdfffff8000 7fe0000000000001 01efffdfffff8002
|
||||
b80a16ad02c87cd3 380fffffffffe7fe b02a16ad02c86940
|
||||
47f0fffffffffffb 7ffc000000000000 7ff8000000000000
|
||||
0010000000000000 41ffffffffbfff7f 021fffffffbfff7f
|
||||
0010000000000000 8000000000000000 0000000000000000
|
||||
c3d00001000001ff b7f60cb3edb38762 3bd60cb54e7ec8fe
|
||||
0010000000000000 8010000000000001 c030000000000001
|
||||
43c0007fffdfffff 801ffffffffffffe 83f0007fffdffffd
|
||||
c7efffffdffffbff bca0000000000001 449fffffdffffc01
|
||||
0010000000000000 c11ff00000000003 813ff00000000003
|
||||
0010000000000000 bfd0000000000000 ffefffffffffffff
|
||||
c0ffffffffeffffe bfdfffffffffffff 40efffffffeffffe
|
||||
6f7000000001fdff 1510010000000fff 4490010000020e1e
|
||||
37f002000000000f b1effcfffffffffe a9f0007fd000000d
|
||||
cc3050bc013d7cd7 bff0000000000000 4c3050bc013d7cd7
|
||||
0010000000000000 87fff0000000fffe c81ff0000000fffe
|
||||
0010000000000000 bffffffffffffffe 801ffffffffffffe
|
||||
43effbfffffff7ff 7fefffffff801ffe 03effbffff8027fa
|
||||
c015834380f2b995 3f9fff0000000400 bfc5829766d6b4af
|
||||
0010000000000000 41dfffffc0001000 01ffffffc0001000
|
||||
0010000000000000 c01fffffffffffff 803fffffffffffff
|
||||
41e010000000001f c5b04000000fffff c7a050400010101e
|
||||
3b40018000000000 3ea0400000000100 39f0418600000101
|
||||
0010000000000000 4cdffeffff7fffff 0cfffeffff7fffff
|
||||
16dff0001ffffffe 3fb500ae0796659d 16a4f62dc5934871
|
||||
b7e003ffffffff7f deafffffeffffffd 56a003fff7fdff7e
|
||||
406000001fffbfff 3f20020000080000 3f900200200bbff8
|
||||
0010000000000000 7ffc000000000000 7ff8000000000000
|
||||
439fbffffffbffff bf8454fd38ef0ba0 c3342c533e7aa2e8
|
||||
c1c000000200007e bf000001ffffffbf 40d000020200007e
|
||||
480000000008fffe 001637e790e69de2 082637e790f31d52
|
||||
bffffffc000003fe 3ca0000000000001 bcaffffc000003ff
|
||||
6b4848a9a8c0dcd5 480ffffffffbdfff 736848a9a8bdbb77
|
@ -1,199 +0,0 @@
|
||||
c22000007fffffff 24700000ffffffef a6a00001800007ee
|
||||
bfc00000000011fe 3fdfffffffffff03 bfb000000000117f
|
||||
a83100000007fffe 41e0000effffffff aa21000ff0080004
|
||||
0000000000000000 001ffffffffffffe 0000000000000000
|
||||
400327ca64d70ec7 3ca0000000000001 3cb327ca64d70ec8
|
||||
0000000000000000 43e207ffffffffff 0000000000000000
|
||||
0000000000000000 3fd0000000000000 0000000000000000
|
||||
0000000000000000 3fdfffffffffffff 0000000000000000
|
||||
0000000000000000 3fe0000000000000 0000000000000000
|
||||
c870200000010000 3fefffffffffffff c87020000000ffff
|
||||
c00aaa4fd557ef13 c3b8917384eb32d0 43d478efdc9216d7
|
||||
0000000000000000 7ffc000000000000 7ffc000000000000
|
||||
0000000000000000 c18aca47203438e2 8000000000000000
|
||||
0000000000000000 4000000000000001 0000000000000000
|
||||
47efff0008000000 b1dcb0523546117f b9dcaf6cb9e07bdc
|
||||
43f000ffffff7fff 22300000001fffdf 26300100001f81de
|
||||
402ff000001fffff 40759558e27de226 40b58a8e3622388d
|
||||
0000000000000000 40efdeffffffffff 0000000000000000
|
||||
0000000000000000 434fffffffffffff 0000000000000000
|
||||
7ffc000000000000 7fe0000000000000 7ffc000000000000
|
||||
b35e061abc769f3a c078000003fffffe 33e684941119bac1
|
||||
403a793cfb1e2471 bff0000100007fff c03a793ea2b2c7eb
|
||||
3d1ffffbfe000000 216898822a24af3f 1e98987f158ae1d8
|
||||
bfb00000001bffff 7ffc000000000000 7ffc000000000000
|
||||
37f0000000efffff c3d00007fffffeff bbd0000800efff76
|
||||
0000000000000000 ffefff8000080000 8000000000000000
|
||||
3fb00200000000ff c0000000011fffff bfc00200012024fe
|
||||
41c0000007ffffff 49103fffefffffff 4ae03ffff81ffff6
|
||||
407effbfffffffff 3e00000040001fff 3e8effc07bff3dfd
|
||||
c1f00013fffffffe 7ffc000000000000 7ffc000000000000
|
||||
c3f00004000001ff c3d00bfffffffffe 47d00c04030001fe
|
||||
403b5ab30b28be12 bfdfffffffffffff c02b5ab30b28be11
|
||||
0000000000000000 c1cfffffff87ffff 8000000000000000
|
||||
0000000000000000 bfe0000000000001 8000000000000000
|
||||
801ffc000007ffff bfeffffffffffffe 001ffc000007fffd
|
||||
0000000000000000 ffe0000005fffffe 8000000000000000
|
||||
0000000000000000 bfffffffffffffff 8000000000000000
|
||||
0000000000000000 c000000000000000 8000000000000000
|
||||
c3d09308769f3f51 c00fffffffffffff 43f09308769f3f50
|
||||
0000000000000000 402ffffdfefffffe 0000000000000000
|
||||
0000000000000000 c010000000000001 8000000000000000
|
||||
c01fffffffc00fff c01ffffffffffffe 404fffffffc00ffd
|
||||
c025e14360f49046 412fff0000000003 c165e09456d988a4
|
||||
0000000000000000 43ee59a2f1155c8b 0000000000000000
|
||||
3fe0000000008fff 802ffffff7fffff6 801ffffff8011ff4
|
||||
0000000000000000 ffefffffffffffff 8000000000000000
|
||||
40401007fffffffe fff0000000000000 fff0000000000000
|
||||
0000000000000000 c0045abb4860cbf3 8000000000000000
|
||||
0000000000000000 7ffc000000000000 7ffc000000000000
|
||||
bffffffec0000000 c000000000003eff 400ffffec0007dfe
|
||||
48000000004001ff 41f331de979ac49e 4a0331de97e78e7d
|
||||
3d0fffffbff7ffff 7ffc000000000000 7ffc000000000000
|
||||
43d3ffffff000000 3caffffffffffffe 4093fffffeffffff
|
||||
7ffc000000000000 43dfff8004000000 7ffc000000000000
|
||||
bcaffe0000000008 3fd00008000000ff bc8ffe0fff000206
|
||||
404ffbfffffffffc c34ffff8003fffff c3affbf8013ff7fb
|
||||
43e0000000000082 3db000003ffffeff 41a000003fffff81
|
||||
c1d004000ffffffe 4000000000000000 c1e004000ffffffe
|
||||
c00fffffc000007e c02ffffdfffffbff 404ffffdc000007d
|
||||
409dfffbffffffff 4010000000000001 40bdfffc00000001
|
||||
c120000003ffffe0 c06000fffbffffff 4190010000003fde
|
||||
3fd1f7ffffffffff c01000001dffffff bff1f80021b0fffe
|
||||
2e0fefdfffffffff 4030000020000040 2e4fefe03fdfc07f
|
||||
43c0000803ffffff 3fcfffffffffffff 43a0000803fffffe
|
||||
c0afffffbffffdfe 3fc07ffdffffffff c0807ffddf0002f6
|
||||
c0fffffffeffffee 55139bb9349e058c d6239bb9340127b7
|
||||
41ffdbaf18ce06bd 8010000000000000 821fdbaf18ce06bd
|
||||
c0e1000000080000 801ffffffffffffe 011100000007ffff
|
||||
3fbffffff0000007 c807dfffffffffff c7d7dffff4100004
|
||||
c357b53537b96da5 bfd0000000000000 4337b53537b96da5
|
||||
401fffffffffffff ffebff8000000000 fff0000000000000
|
||||
c7eff77bf2b59c3c bfe0000000000001 47dff77bf2b59c3e
|
||||
380c3f72cc3dec98 c3fffffffbffffff bc1c3f72c8b5fe3e
|
||||
b8e0000003fbffff c503f4d44f4bf888 3df3f4d454443065
|
||||
3f3ffffc001fffff c000000000000001 bf4ffffc00200001
|
||||
c340002000004000 c0db3367e0423019 442b339e47125d6b
|
||||
4f60000801ffffff 41c07fe000000000 51307fe841fffbff
|
||||
c1ffffffbfefffff c340000000000001 454fffffbff00001
|
||||
404fff7fffffff7f 48ab7e2aad4ec686 490b7dbcb4a410dc
|
||||
7ffc000000000000 ffefffffffffffff 7ffc000000000000
|
||||
41e189ea1a6fff97 7ffc000000000000 7ffc000000000000
|
||||
3ff0ee9046c9330f 8479e1e79766e02b 847b63d14ff91acb
|
||||
d2f805130a8c11df 43effffdfdfffffe d6f8051188ba9004
|
||||
4f1fffbfffe00000 bcd02000000007ff cc001fdfbfefe7ff
|
||||
be70000077ffffff c1efffffffffffff 4070000077fffffe
|
||||
41e1ffffbffffffe 3caffffffffffffe 3ea1ffffbffffffd
|
||||
3bbd976272fb1d2a c06ffff80007fffe bc3d975b0d29e642
|
||||
434fff01ffffffff 403dfeffffffffff 439dfe11e7effffe
|
||||
be6fff7fffffffff 3feffffffffffffe be6fff7ffffffffd
|
||||
41d007ff80000000 41f0fffffffc0000 43d1087f77fbfe00
|
||||
ffeef7a206029708 bdcfa4109a3a5b22 7dce9eaa2542875b
|
||||
3b6ffffffeffffc0 3c7ffffe003ffffe 37fffffdff3fffce
|
||||
c1d1ffffffbfffff bfcffffefffff800 41b1ffff6fbffb81
|
||||
2030000000000090 c05e2e90015c47a1 a09e2e90015c48b1
|
||||
bbf000000007efff 001fe0000007fffe 8000000000000000
|
||||
41cae866712069f4 c02fffffffffffff c20ae866712069f3
|
||||
bfce1e32ccf56348 3ca1f66d4c8eeef3 bc80e7fa025544db
|
||||
ffedfffff0000000 ffeffff000000800 7ff0000000000000
|
||||
37effffc3ffffffe bca0fffffffffffd b4a0fffe01fffffc
|
||||
bc950a021bf9dee1 3db0001fffdffffe ba550a2c2fd402ce
|
||||
fd4fffffdfffffef 41cffffdffffffef ff2ffffde00001de
|
||||
bfc00000004007ff bcafffffffffffff 3c800000004007fe
|
||||
c009130b80fe8274 b811571307061a38 382b2cb1993b60f2
|
||||
c0600000ffffffdf 7feda1b8c591f9c6 fff0000000000000
|
||||
c1e4af3f8d45e031 3ca0020002000000 be94b1d577cd70df
|
||||
3800008100000000 b810000020000080 b020008120010280
|
||||
372ff00000003fff 7fe000fdfffffffe 771ff1fb02003fff
|
||||
47d00021fffffffe c00fffffffffffff c7f00021fffffffd
|
||||
bfbc9ea0c2b4884b 43f4a552574073d5 c3c277000b21a4e8
|
||||
bf1fe0000000ffff c01ffffffffffffe 3f4fe0000000fffd
|
||||
41ffffffff7ffffb 0027ffffffffeffe 0237ffffff9feffa
|
||||
c7e040000fffffff ffe0000000000000 7ff0000000000000
|
||||
7ffc000000000000 3fe0000ffffff7ff 7ffc000000000000
|
||||
c1effc1fffffffff 7ffc000000000000 7ffc000000000000
|
||||
c0d000000001ffbf c03ba46e644e4e9c 411ba46e6451c2ba
|
||||
c4500000005fffff c03a20ab4de47fc9 449a20ab4e8143cb
|
||||
400e00000000007e 001fffffffffffff 003e00000000007d
|
||||
45a01fffff7fffff c3c0020200000000 c9702206037fefef
|
||||
3e8ff800000000ff 3caffffffffffffe 3b4ff800000000fd
|
||||
be004000000007fe 3fdffff7ff7fffff bdf03ffbefbf07fd
|
||||
b11000007ffffe00 3fe0000000000000 b10000007ffffe00
|
||||
b80cef50bd17db40 c05fffc00000000e 387cef16de76611d
|
||||
3d4000ffffffffff 3d47f68d8eb6b9a4 3a97f80cf78fa50e
|
||||
ffe3fffffffffffb c03dc3321aaa5380 7ff0000000000000
|
||||
3ca3fffffffffeff bf02ffafb4e9241d bbb7bf9ba2236bf3
|
||||
53598c812c3c39dd 3f20000100fffffe 52898c82c69d14b0
|
||||
c3dffffff8000001 3fe0020000003ffe c3d001fffbffbfff
|
||||
7ba00800003fffff 3ff9a9a129c791b3 7ba9b675fac31bff
|
||||
c3d0000fffffffef 7fe0000000000001 fff0000000000000
|
||||
c34f80001fffffff b7fffffe0007ffff 3b5f7ffe2807ddfe
|
||||
0010000000001ff8 4800020000010000 0820020000011ffc
|
||||
2c4c0000003fffff 230ffffc00400000 0f6bfffc8077fff7
|
||||
381fffffffbff7fe 8010000000000000 8000000000000000
|
||||
802d3018ea8c241d c007fdffffffffff 0045e23fae5a7253
|
||||
43e047fffffffffe 4000003ffdfffffe 43f048411df6fffc
|
||||
c000005fffffffff 403ffffffff00002 c050005ffff7ffd0
|
||||
3fc8b60e46a80f6d bfdffffffffffffe bfb8b60e46a80f6b
|
||||
bd5fdffdffffffff 5644b72ace1bbb6b d3b4a27257daf2cd
|
||||
b80010001fffffff 40e01ffffff7fffe b8f030202037f7fd
|
||||
407000003ffbfffe 38042862fe8e3368 388428634f2ab547
|
||||
bf8ffbfff7ffffff c00fffffffffffff 3faffbfff7fffffe
|
||||
bcafc000003fffff c010000000000001 3ccfc00000400001
|
||||
47eddf042473ef08 b7e00000fe000000 bfdddf05fea850cb
|
||||
3fbfffff7fffffef c340ffffffffffbf c310ffffbbffffb6
|
||||
c02f8000000007ff ffe0000000000001 7ff0000000000000
|
||||
002f37ebf6c8eaec c08be464f4c81c69 80cb36000706e169
|
||||
c00e800000000000 7ffc000000000000 7ffc000000000000
|
||||
0010000000000000 0000000000000000 0000000000000000
|
||||
bfffc00000000003 391001ffffffffff b91fc3f800000001
|
||||
c1db54446247aa52 bfcc001fffffffff 41b7e9d72a43174f
|
||||
0010000000000000 c0392c59c8e48f37 80592c59c8e48f37
|
||||
0010000000000000 c0000800000001ff 80200800000001ff
|
||||
0010000000000000 c1d0000004000fff 81f0000004000fff
|
||||
4030040000200000 0017055f48beeff5 00570b20a0bf2a70
|
||||
bc7000000000ffee c1e0001100000000 3e6000110000ffef
|
||||
c040000000007fff c3b2a6c91c557f56 4402a6c91c56148b
|
||||
41ffffffff003fff c3b0000007ffffee c5c0000007801fed
|
||||
21900001dfffffff bf20000017fffffe a0c00001f80002cd
|
||||
0029954d0f0df5b3 41e00000000003ff 0219954d0f0dfc17
|
||||
b810000020000001 47ffdfffffffff80 c01fe0003fbfff82
|
||||
0010000000000000 ffeffff800007fff c00ffff800007fff
|
||||
0010000000000000 4010000000000000 0030000000000000
|
||||
bf700000000100ff 401fffffffffffff bfa00000000100fe
|
||||
37feffffffffffff 47ef8000000fffff 3ffe8400000f7ffe
|
||||
b80f800001fffffe 44e00000ffff7fff bcff8001f9ff041c
|
||||
0010000000000000 434ffffffffffffe 036ffffffffffffe
|
||||
41ffffdfffff8000 7fe0000000000001 7ff0000000000000
|
||||
b80a16ad02c87cd3 380fffffffffe7fe b02a16ad02c86940
|
||||
47f0fffffffffffb 7ffc000000000000 7ffc000000000000
|
||||
0010000000000000 41ffffffffbfff7f 021fffffffbfff7f
|
||||
0010000000000000 8000000000000000 8000000000000000
|
||||
c3d00001000001ff b7f60cb3edb38762 3bd60cb54e7ec8fd
|
||||
0010000000000000 8010000000000001 8000000000000000
|
||||
43c0007fffdfffff 801ffffffffffffe 83f0007fffdffffe
|
||||
c7efffffdffffbff bca0000000000001 449fffffdffffc01
|
||||
0010000000000000 c11ff00000000003 813ff00000000003
|
||||
0010000000000000 bfd0000000000000 8000000000000000
|
||||
c0ffffffffeffffe bfdfffffffffffff 40efffffffeffffd
|
||||
6f7000000001fdff 1510010000000fff 4490010000020e1e
|
||||
37f002000000000f b1effcfffffffffe a9f0007fd000000e
|
||||
cc3050bc013d7cd7 bff0000000000000 4c3050bc013d7cd7
|
||||
0010000000000000 87fff0000000fffe 8000000000000000
|
||||
0010000000000000 bffffffffffffffe 801ffffffffffffe
|
||||
43effbfffffff7ff 7fefffffff801ffe 7ff0000000000000
|
||||
c015834380f2b995 3f9fff0000000400 bfc5829766d6b4b0
|
||||
0010000000000000 41dfffffc0001000 01ffffffc0001000
|
||||
0010000000000000 c01fffffffffffff 803fffffffffffff
|
||||
41e010000000001f c5b04000000fffff c7a050400010101e
|
||||
3b40018000000000 3ea0400000000100 39f0418600000100
|
||||
0010000000000000 4cdffeffff7fffff 0cfffeffff7fffff
|
||||
16dff0001ffffffe 3fb500ae0796659d 16a4f62dc5934870
|
||||
b7e003ffffffff7f deafffffeffffffd 56a003fff7fdff7d
|
||||
406000001fffbfff 3f20020000080000 3f900200200bbff7
|
||||
0010000000000000 7ffc000000000000 7ffc000000000000
|
||||
439fbffffffbffff bf8454fd38ef0ba0 c3342c533e7aa2e8
|
||||
c1c000000200007e bf000001ffffffbf 40d000020200007d
|
||||
480000000008fffe 001637e790e69de2 082637e790f31d51
|
||||
bffffffc000003fe 3ca0000000000001 bcaffffc00000400
|
||||
6b4848a9a8c0dcd5 480ffffffffbdfff 736848a9a8bdbb76
|
111
wally-pipelined/src/fpu/FMA/tbgen/results.srt
Normal file
111
wally-pipelined/src/fpu/FMA/tbgen/results.srt
Normal file
@ -0,0 +1,111 @@
|
||||
3fdfffffffffffff 7fefffffffffffff ffe0000000000001 fcafffffffffffff fcb0000000000000 Wrong 1008219
|
||||
3fdfffffffffffff bcafffffffffffff 3fde6565aa50f6d7 bf99a9a55af092b0 3fde6565aa50f6d5 Wrong 1020499
|
||||
c1b000000007fffc f792000000000000 bfeffffffffffffe 795200000008fffc 795200000008fffb Wrong 1169087
|
||||
3fefffffffffffff 4010000000000001 43600000080007ff 43600000080007ff 4360000008000800 Wrong 1280221
|
||||
3fefffffffffffff bca00000001ffff7 bffb69bd490d5d32 bffb69bd490d5d32 bffb69bd490d5d33 Wrong 1309693
|
||||
3feffffffffffffe bca0000000000001 3fe00000ffffffbf bfdffffe00000084 3fe00000ffffffbe Wrong 1368637
|
||||
3ff0000000000000 3fffdffffffffffe c34ffffffbfffdff 41a0000807fc0000 c34ffffffbfffdfe Wrong 1414687
|
||||
3ff0000000000000 bcafffffffffffff 3ffffffffffffffe bcc8000000000000 3ffffffffffffffd Wrong 1439247
|
||||
3ff0000000000001 c340000000000001 bfeffffffffffffe c340000000000002 c340000000000003 Wrong 1527663
|
||||
47afffffbffc0000 3847cedaf8426a4c c34ffffff800007f 41affffe09f3b6b2 c34ffffff800007e Wrong 1667655
|
||||
4000000000000000 3fdffffffffffffe bff0000000000000 bcaffffffffffffe bcb0000000000000 Wrong 1687917
|
||||
400fffffffffffff 3fd0000000000001 c340000000000001 c340000000000001 c340000000000000 Wrong 1826067
|
||||
4010000000000000 bca00ffffffffffe 401fc0000fffffff bfaffff8000000c0 401fc0000ffffffe Wrong 1972813
|
||||
3fdfffffffffffdb 3cafffffffffffff bfeffffffffffffe bfeffffffffffffe bfeffffffffffffd Wrong 2032985
|
||||
4010000000000001 bfd0000000000000 4340000000000001 c33fffffffffffff 4340000000000000 Wrong 2069211
|
||||
bfffffffffffffde bfe0040000003ffe c34fffffffffffff c34fffffffffffff c34ffffffffffffe Wrong 2114033
|
||||
bfe886c7cff8293d c00ff000000000fe 434fffffffffffff 3ff0f508d8205bd6 4350000000000000 Wrong 2843465
|
||||
c02ffffffffffffe 404fffc007fffffe 43cfeffffffdffff c340000002000300 43cfeffffffdfffd Wrong 3439045
|
||||
bcafffffffffffff 3fffffffffffffff c000000000000000 c000000000000000 c000000000000001 Wrong 3787797
|
||||
bcafffffffffffff bfd0000000000001 bca0000000000001 bc90000000000001 bc90000000000002 Wrong 3815427
|
||||
3ca3809288505f2e bfeffffffffffffe 3ffffffffffffffe 3ffffffffffffffe 3ffffffffffffffd Wrong 3889721
|
||||
bfd0000000000001 c010000000000001 c3400010003ffffe 433fffdfff800005 c3400010003ffffd Wrong 4037695
|
||||
bfdfffffffffffff c01fffffffffffff c00fffffffffffff bcbffffffffffffd bcbfffffffffffff Wrong 4108305
|
||||
bfdffffffffffffe c00fffffffffffff 434fffffffffffff 434fffffffffffff 4350000000000000 Wrong 4174617
|
||||
bfe0000000000000 3fe0000000000001 3feffffffffffffe 3fe7fffffffffffd 3fe7fffffffffffe Wrong 4202247
|
||||
bfe0000000000001 bcafffffffffffff bca0000000000001 b94ffffffffffffe b950000000000001 Wrong 4301715
|
||||
bff0000000000001 bff0000000000000 c010000000000001 c008000000000001 c008000000000002 Wrong 4589067
|
||||
bafff9ffffffffff c18fffffffffffff bfe44b07ce3485bb bfe44b07ce3485bb bfe44b07ce3485ba Wrong 4640643
|
||||
bfffffffffffffff bffffffffffffffe 434fffffffffffff 3ffffffffffffffa 4350000000000000 Wrong 4660905
|
||||
bffffffffffffffe 3fdfffffffffffff 3feffffffffffffe 3c9ffffffffffffc 3c9ffffffffffffe Wrong 4688535
|
||||
3ff6119af86b7717 bfeffffffffffffe 4340000000000000 4340000000000000 433fffffffffffff Wrong 469127
|
||||
c000000000000001 3fd0000000000000 4340000000000000 4340000000000000 433fffffffffffff Wrong 4826685
|
||||
be02001ffffffffe bfdf000400000000 c13e2351e06b232f 40fdcae1f94dcd21 c13e2351e06b232e Wrong 5082723
|
||||
c010000000000001 bca0000000000000 c0100007f7fffffe 400ffff010000005 c0100007f7fffffd Wrong 5137369
|
||||
ffe0000000000000 bcaffffffffffffe ffee000000008000 7faffffffff80010 ffee000000007fff Wrong 5629183
|
||||
3a0c00000000007f 400ffffffffffffe 3d70200003fffffe 3d70200003fffffe 3d70200003ffffff Wrong 5885835
|
||||
3ca0000000000000 c010000000000000 401fffffffffffff bcd8000000000000 401ffffffffffffe Wrong 615873
|
||||
3cafffffffffffff 401fffffffffffff 4021e792682c4909 4021e792682c4909 4021e792682c490a Wrong 722095
|
||||
3caffffffffffffe c01bf4d171e6823d c01fffffffffffff bcc7e9a2e3cd0477 c020000000000000 Wrong 769373
|
||||
3fd0000000000000 c00fffe7ffffffff 4340000000000000 4340000000000000 433fffffffffffff Wrong 846737
|
||||
3fd0000000000000 c01ffffffffffffe bca0000000000001 bffffffffffffffe bfffffffffffffff Wrong 897699
|
||||
3fd0000000000001 bff0000000000000 3ff0000000000000 3fe7ffffffffffff 3fe8000000000000 Wrong 958485
|
||||
801fffffffffffff bfbffffffffd7ffe 0000000000000000 0000000000000000 0003ffffffffb000 Wrong unflw 3499217
|
||||
0010000000000001 bd0081ffffffffff 0010000000000001 0000000000000000 000fffffffffffe0 Wrong unflw 410183
|
||||
0021ffffffffff7e 3feffffffffffffe 801fff0010000000 0000000000000000 000400ffeffffefa Wrong unflw 4134093
|
||||
001fffffffffffff 3caffffffffffffe 8000000000000000 0000000000000000 0000000000000002 Wrong unflw 427989
|
||||
80220000000000ff bcaffffffffffffe 802ffffff00fffff 0000000000000000 802ffffff00ffffe Wrong unflw 5349813
|
||||
82c0040000007fff 3ca0000000000000 0010000000000001 0000000000000000 000ffbfeffffffe1 Wrong unflw 5381741
|
||||
3fe0000000000000 801ffffffffffffe 0000000000000000 8000000000000000 800fffffffffffff Wrong w=-zero unflw 1157421
|
||||
0010000000000000 c000000000000001 001ffffffffffffe 8000000000000000 8000000000000004 Wrong w=-zero unflw 334047
|
||||
801fffffffffffff bfe0000040000000 801fffffdffffffd 8000000000000000 800fffff9ffffffe Wrong w=-zero unflw 3525619
|
||||
001fffffffffffff 3fe100000fffffff 801ffffffffffffe 8000000000000000 800efffff0000000 Wrong w=-zero unflw 487547
|
||||
000fffffffffffff bfd0000000000001 0000000000000000 8000000000000000 8004000000000000 Wrong w=-zero xdenorm unflw 184845
|
||||
800ffffffffffffe bffffffffffffffe 801fffffffffffff 8000000000000000 8000000000000005 Wrong w=-zero xdenorm unflw 3334665
|
||||
0000000000000001 c340000000000000 0021f7ffffffffff 8350000000000000 0003effffffffffe Wrong xdenorm 130813
|
||||
0000000000000001 ffefffffffffffff 400ffffffffffffe 3ffffffffffffff9 400ffffffffffffc Wrong xdenorm 135111
|
||||
0000000000000001 ffeffffffffffffe 38041fffffffffff c000000000000001 bccffffffffffffe Wrong xdenorm 136339
|
||||
000fffffffffffff 7fe0000000000000 3ca0000000000001 3ffffffffffffffe 3fffffffffffffff Wrong xdenorm 168267
|
||||
000f7ffffffffbfe 7fdfffffffeeffff c34fffffffffffff c34fffffffffffff c34ffffffffffffe Wrong xdenorm 168881
|
||||
00076127f4ebe458 7feffffff7f7fffe c1d0def838064556 c1d0def8371032d7 c1d0def8379032d7 Wrong xdenorm 2761803
|
||||
8000000000000001 bfcf000000003ffe 0010000000000000 0011f00000000400 0010000000000000 Wrong xdenorm 3167657
|
||||
8000000000000001 ffeffffffffffffe 401ffffffffffffe 4023ffffffffffff 401fffffffffffff Wrong xdenorm 3207567
|
||||
000000000008ffff 7feffffffffffffe 4340000000000000 4340000000000001 4340000000000000 Wrong xdenorm 4359431
|
||||
8006734cfd26d7ab bfeffffffffffffe 001ffffffffffffe 002739a67e936bd4 002339a67e936bd4 Wrong xdenorm 5215961
|
||||
00056efa865ceb48 ffdf7fdfffffffff c000000000000000 c00d39312d48f13e c00559392d48f13e Wrong xdenorm 5860661
|
||||
0000000000000001 3fcce6810165a323 001fffffffffffff 0020e734080b2d19 001fffffffffffff Wrong xdenorm 84149
|
||||
0000000000000001 48001caa6570456b 0000000000000000 08101caa6570456d 04e01caa6570456b Wrong xdenorm 95201
|
||||
0000000000000001 4340000000000001 8010000000000000 0350000000000002 0010000000000002 Wrong xdenorm 96429
|
||||
000ffffffffffffe bfeb2c0fbae7607b 0010000000000000 0000000000000000 000269f8228c4fc4 Wrong xdenorm unflw 249929
|
||||
0000000000000001 400fffffffffffff 801ffffffffffffe 0000000000000000 801ffffffffffffa Wrong xdenorm unflw 90903
|
||||
8000000000000001 c03ffffffffffef7 0000000000000001 00507fffffffff7e 0000000000000021 Wrong xdenorm zdenorm 3173183
|
||||
800fffffffffffff 3f1dffffffffbfff 800ffffffffffffe 80100077fffffffe 80100077fffffffd Wrong xdenorm zdenorm 3250547
|
||||
800fffffffffffff bff0000000000001 0000000000000001 0018000000000000 0010000000000001 Wrong xdenorm zdenorm 3262827
|
||||
800ffffffffffffe c01fffffffffffff 800ffffffffffffe 003bfffffffffffb 003bfffffffffffc Wrong xdenorm zdenorm 3340191
|
||||
8001c94a70185f15 bf9080000000001e 0000000000000001 000050bca61cc912 0000075e530e6489 Wrong xdenorm zdenorm 5335691
|
||||
0000000000000001 c3c000004000001f 000ffffffffffffe 83d0000040000021 809ff0008000003e Wrong xdenorm zdenorm 89675
|
||||
4010000000000000 800002fffffffffe 8019e21990370ecf 802cf70cc81b8764 8019ee1990370ec7 Wrong ydenorm 2011495
|
||||
ffd00000000013fe 8000000000000001 8010000000000000 3fe0000000001400 3cb00000000013fe Wrong ydenorm 2060615
|
||||
401fffffffffffff 8000000000000001 0000000000000000 8030000000000001 8000000000000008 Wrong ydenorm 2129997
|
||||
401ffffffffffffe 8000000fc0000000 0010000000000000 8028003efffffffe 000fff8200000000 Wrong ydenorm 2195081
|
||||
7fe0000000000000 000000000000007f 40108001ffffffff 401480020000003e 401080020000003e Wrong ydenorm 2558569
|
||||
7fe0000000000001 0000000000000001 b80ffeffffffff7f 3ff0000000000003 3cc0000000000001 Wrong ydenorm 2584357
|
||||
7fe0000000000001 80058a95d520aff2 bcaffffffffffffe bffb152baa415fe7 bfe62a575482bfcb Wrong ydenorm 2587427
|
||||
bfe0000000000000 8000000000000001 001ffffffffffffe 0021ffffffffffff 001ffffffffffffe Wrong ydenorm 4224351
|
||||
c1dfffffffffd7ff 00008000003fffff 001ffffffffffffe 81f0ffffffffeabd 81afffffffffd7bf Wrong ydenorm 461759
|
||||
ffe0000000000001 0000000000000001 3fffffffffffffff 3feffffffffffff8 3ffffffffffffffd Wrong ydenorm 5655585
|
||||
ffe0000000000001 8005e2e035872cbc 4010000000000001 4016f1701ac3965f 4012f1701ac3965f Wrong ydenorm 5715143
|
||||
ffefffffffffffff 8000000000000001 bca0000000000001 4000000000000001 3ccbffffffffffff Wrong ydenorm 5760579
|
||||
41ffffffffffff87 8000000000000001 0000000000000000 820fffffffffff8b 8000000200000000 Wrong ydenorm 6039335
|
||||
3fe0000000000001 8000008100000000 0010000000000000 0000000000000000 000fffbf80000000 Wrong ydenorm unflw 1222505
|
||||
400ffffffffffffe 8000000000000001 0000000001ffff80 8017ffffff000042 0000000001ffff7c Wrong ydenorm zdenorm 1921237
|
||||
40afae6465ddbca7 00006f1e30d0e43a 800ffffffffffffe 00c0b137d3169bd3 007b40b404f7afe8 Wrong ydenorm zdenorm 2495327
|
||||
c05d0d58b7637bf5 000ffffffffffffe 8002f77910ff1aeb 807d3347a9857a27 807d19369ba7785d Wrong ydenorm zdenorm 2724963
|
||||
3fc8b2426b25d8d2 80000200007fffff 000fffffffffffff 000ce8f220568732 000fff9d36dda125 Wrong ydenorm zdenorm 3064505
|
||||
bca0000000000000 8000000000000001 800fffffffffffff 7cc8000000000001 800fffffffffffff Wrong ydenorm zdenorm 3666225
|
||||
c3e760ff13e9db70 0000000000000001 800ffffffffffffe 83f760ff13e9db73 80c762ff13e9db70 Wrong ydenorm zdenorm 4818089
|
||||
e9b000000040000e 8000000000000001 000fffffffffffff 29c0000000400010 269000000040000e Wrong ydenorm zdenorm 524387
|
||||
3ca0000000000001 800ffffffffffffe 000ffffffffffffe fcd7ffffffffffff 000ffffffffffffe Wrong ydenorm zdenorm 665607
|
||||
3fd0000000000001 0000000000000001 800ffffffffffffe 800bfffffffffffd 800ffffffffffffe Wrong ydenorm zdenorm 908751
|
||||
3fe0000000000000 802ffffffbfffffc 000ffff7ffffffbf 80100003fc00001c 80100007fc00003d Wrong zdenorm 1154965
|
||||
3feffffffffffffe 801ffffffffffffb 000fffffffffffff 800ffffffffffff3 800ffffffffffffa Wrong zdenorm 1388285
|
||||
3ffffffffffffffe 002bffbffffffffe 000ff7fffffffefe 003ffebfffffffdc 003ffdbfffffffbc Wrong zdenorm 1663357
|
||||
bff0000040040000 001ffffffffffffe 0000000000000001 801800008007fffd 802000004003fffe Wrong zdenorm 2309285
|
||||
001ffffbfffff7ff bffafaef051722b5 000ffffffffffffe 8022faeba5b93b53 8022faeba5b93b54 Wrong zdenorm 3224759
|
||||
8010000000000000 3ff00000000000c0 8000000000000001 80180000000000c0 80100000000000c1 Wrong zdenorm 3416327
|
||||
801fffffffffffff 3feffffffffffffe 8000000000000001 8023ffffffffffff 801ffffffffffffe Wrong zdenorm 3505971
|
||||
0010000000000001 bfbfffffc07fffff 000fffffffffffff 000c000007efffff 000e000003f7ffff Wrong zdenorm 415709
|
||||
001ffffffffffffe 3ff0000000000001 000fffffffffffff 0028000000000000 0027ffffffffffff Wrong zdenorm 505353
|
||||
001ffffffffffffe 4010000000000001 0000003ffbffffff 00410003ffc00000 00400007ff800000 Wrong zdenorm 512107
|
||||
0020007fffffffff bcafffffffffffff 800fffffffffffff 8010000000000002 8010000000000001 Wrong zdenorm 6116699
|
||||
3ca0000000000001 00184112bdfd66a0 800fffffffffffff 800ffffffffffffd 800ffffffffffffe Wrong zdenorm 658853
|
Binary file not shown.
@ -20,18 +20,18 @@ void main() {
|
||||
// b68ffff8000000ff_3f9080000007ffff_b6307ffbe0080080_00001
|
||||
char ch;
|
||||
int i,j,n;
|
||||
char xrf[17];
|
||||
char x[17];
|
||||
char y[17];
|
||||
char zrf[17];
|
||||
char z[17];
|
||||
char ans[81];
|
||||
char flags[3];
|
||||
int rn,rz,rm,rp;
|
||||
long stop = 6039335;
|
||||
int debug = 0;
|
||||
long stop = 6128601;
|
||||
int debug = 1;
|
||||
//my_string = (char *) malloc (nbytes + 1);
|
||||
//bytes_read = getline (&my_string, &nbytes, stdin);
|
||||
|
||||
for(n=0; n < 613; n++) {//613 for 10000
|
||||
for(n=0; n < 2013; n++) {//613 for 10000
|
||||
if(getline(&ln,&nbytes,fp) < 0 || feof(fp)) break;
|
||||
if(k == stop && debug == 1) break;
|
||||
k++;
|
||||
@ -40,17 +40,17 @@ void main() {
|
||||
|
||||
if(!feof(fp)) {
|
||||
|
||||
strncpy(xrf, ln, 16); xrf[16]=0;
|
||||
strncpy(x, ln, 16); x[16]=0;
|
||||
strncpy(y, &ln[17], 16); y[16]=0;
|
||||
strncpy(zrf, &ln[34], 16); zrf[16]=0;
|
||||
// fprintf(stdout,"[%s]\n[%s]\n", ln,zrf);
|
||||
strncpy(z, &ln[34], 16); z[16]=0;
|
||||
// fprintf(stdout,"[%s]\n[%s]\n", ln,z);
|
||||
strncpy(ans, &ln[51], 16); ans[16]=0;
|
||||
strncpy(flags,&ln[68],2); flags[2]=0;
|
||||
|
||||
// fprintf(stdout,"[%s]\n[%s]\n", ln,zrf);
|
||||
fprintf(fq," xrf = 64'h%s;\n",xrf);
|
||||
// fprintf(stdout,"[%s]\n[%s]\n", ln,z);
|
||||
fprintf(fq," x = 64'h%s;\n",x);
|
||||
fprintf(fq," y = 64'h%s;\n",y);
|
||||
fprintf(fq," zrf = 64'h%s;\n",zrf);
|
||||
fprintf(fq," z = 64'h%s;\n",z);
|
||||
fprintf(fq," ans = 64'h%s;\n", ans);
|
||||
// fprintf(fq," flags = 5'h%s;\n", flags);
|
||||
|
||||
@ -74,28 +74,28 @@ void main() {
|
||||
}
|
||||
fprintf(fq,"#10\n");
|
||||
// IEEE 754-2008 section 6.3 states "When ether an input or result is NaN, this standard does not interpret the sign of a NaN."
|
||||
//fprintf(fq," $fwrite(fp, \"%%h %%h %%h %%h \",xrf,y,w, ans);\n");
|
||||
//fprintf(fq," $fwrite(fp, \"%%h %%h %%h %%h \",x,y,w, ans);\n");
|
||||
fprintf(fq," // IEEE 754-2008 section 6.3 states: \"When ether an input or result is NaN, this\n");
|
||||
fprintf(fq," // standard does not interpret the sign of a NaN.\"\n");
|
||||
fprintf(fq," wnan = &w[62:52] && |w[51:0]; \n");
|
||||
fprintf(fq," xnan = &xrf[62:52] && |xrf[51:0]; \n");
|
||||
fprintf(fq," xnan = &x[62:52] && |x[51:0]; \n");
|
||||
fprintf(fq," ynan = &y[62:52] && |y[51:0]; \n");
|
||||
fprintf(fq," znan = &zrf[62:52] && |zrf[51:0]; \n");
|
||||
fprintf(fq," znan = &z[62:52] && |z[51:0]; \n");
|
||||
fprintf(fq," ansnan = &ans[62:52] && |ans[51:0]; \n");
|
||||
fprintf(fq," xnorm = ~(|xrf[62:52]) && |xrf[51:0] ? {xrf[50:0], 1'b0} : xrf; \n");
|
||||
fprintf(fq," xnorm = ~(|x[62:52]) && |x[51:0] ? {x[50:0], 1'b0} : x; \n");
|
||||
fprintf(fq," ynorm = ~(|y[62:52]) && |y[51:0] ? {y[50:0], 1'b0} : y;\n");
|
||||
fprintf(fq," s = ({54'b1,xnorm} + (bypsel && bypplus1)) * {54'b1,ynorm}; \n");
|
||||
// fprintf(fq," if(!(~(|xrf[62:52]) && |xrf[51:0] || ~(|y[62:52]) && |y[51:0])) begin\n");
|
||||
// fprintf(fq," if(!(~(|x[62:52]) && |x[51:0] || ~(|y[62:52]) && |y[51:0])) begin\n");
|
||||
// not looknig at negative zero results right now
|
||||
//fprintf(fq," if( (nan && (w[62:0] != ans[62:0])) || (!nan && (w != ans)) && !(w == 64'h8000000000000000 && ans == 64'b0)) begin\n");
|
||||
// fprintf(fq," if( (nan && (w[62:0] != ans[62:0])) || (!nan && (w != ans)) ) begin\n");
|
||||
fprintf(fq," if((!wnan && (w != ans)) || (wnan && ansnan && ~(((xnan && (w[62:0] == {xrf[62:52],1'b1,xrf[50:0]})) || (ynan && (w[62:0] == {y[62:52],1'b1,y[50:0]})) || (znan && (w[62:0] == {zrf[62:52],1'b1,zrf[50:0]})) || (w[62:0] == ans[62:0])) ))) begin\n");
|
||||
fprintf(fq," $fwrite(fp, \"%%h %%h %%h %%h %%h Wrong \",xrf,y, zrf, w, ans);\n");
|
||||
fprintf(fq," if((!wnan && (w != ans)) || (wnan && ansnan && ~(((xnan && (w[62:0] == {x[62:52],1'b1,x[50:0]})) || (ynan && (w[62:0] == {y[62:52],1'b1,y[50:0]})) || (znan && (w[62:0] == {z[62:52],1'b1,z[50:0]})) || (w[62:0] == ans[62:0])) ))) begin\n");
|
||||
fprintf(fq," $fwrite(fp, \"%%h %%h %%h %%h %%h Wrong \",x,y, z, w, ans);\n");
|
||||
//fprintf(fq," $fwrite(fp, \"%%h \",s);\n");
|
||||
fprintf(fq," if(w == 64'h8000000000000000) $fwrite(fp, \"w=-zero \");\n");
|
||||
fprintf(fq," if(~(|xrf[62:52]) && |xrf[51:0]) $fwrite(fp, \"xdenorm \");\n");
|
||||
fprintf(fq," if(~(|x[62:52]) && |x[51:0]) $fwrite(fp, \"xdenorm \");\n");
|
||||
fprintf(fq," if(~(|y[62:52]) && |y[51:0]) $fwrite(fp, \"ydenorm \");\n");
|
||||
fprintf(fq," if(~(|zrf[62:52]) && |zrf[51:0]) $fwrite(fp, \"zdenorm \");\n");
|
||||
fprintf(fq," if(~(|z[62:52]) && |z[51:0]) $fwrite(fp, \"zdenorm \");\n");
|
||||
fprintf(fq," if(invalid != 0) $fwrite(fp, \"invld \");\n");
|
||||
fprintf(fq," if(overflow != 0) $fwrite(fp, \"ovrflw \");\n");
|
||||
fprintf(fq," if(underflow != 0) $fwrite(fp, \"unflw \");\n");
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2,9 +2,9 @@
|
||||
module tb;
|
||||
|
||||
|
||||
reg [63:0] xrf;
|
||||
reg [63:0] x;
|
||||
reg [63:0] y;
|
||||
reg [63:0] zrf;
|
||||
reg [63:0] z;
|
||||
reg [63:0] ans;
|
||||
reg rn;
|
||||
reg rz;
|
||||
@ -33,9 +33,7 @@ reg [51:0] xnorm;
|
||||
reg [51:0] ynorm;
|
||||
|
||||
localparam period = 20;
|
||||
fmac UUT(.xrf(xrf), .y(y), .zrf(zrf), .rn(rn), .rz(rz), .rp(rp), .rm(rm),
|
||||
.earlyres(earlyres), .earlyressel(earlyressel), .bypsel(bypsel), .bypplus1(bypplus1), .byppostnorm(byppostnorm),
|
||||
.w(w), .wbypass(wbypass), .invalid(invalid), .overflow(overflow), .underflow(underflow), .inexact(inexact));
|
||||
fmac UUT(.*);
|
||||
|
||||
|
||||
initial
|
||||
|
Loading…
Reference in New Issue
Block a user