Line 52... |
Line 52... |
parameter N=33;
|
parameter N=33;
|
reg rst;
|
reg rst;
|
reg clk;
|
reg clk;
|
reg [15:0] adr;
|
reg [15:0] adr;
|
reg [N*4+16+4-1:0] a,b;
|
reg [N*4+16+4-1:0] a,b;
|
wire [N*4+16+4-1:0] o;
|
wire [N*4+16+4-1:0] o, sqrto;
|
reg [N*4+16+4-1:0] ad,bd;
|
reg [N*4+16+4-1:0] ad,bd;
|
wire [N*4+16+4-1:0] od;
|
wire [N*4+16+4-1:0] od;
|
reg [3:0] rm;
|
reg [3:0] rm;
|
wire done;
|
wire done;
|
|
|
Line 104... |
Line 104... |
end
|
end
|
else
|
else
|
begin
|
begin
|
if (adr==0) begin
|
if (adr==0) begin
|
outfile = $fopen("d:/cores2020/rtf64/v2/rtl/verilog/cpu/fpu/test_bench/DFPDivide_tvo.txt", "wb");
|
outfile = $fopen("d:/cores2020/rtf64/v2/rtl/verilog/cpu/fpu/test_bench/DFPDivide_tvo.txt", "wb");
|
$fwrite(outfile, "rm ------ A ------ ------- B ------ - DUT Quotient - - SIM Quotient -\n");
|
$fwrite(outfile, "rm ------ A ------ ------- B ------ - DUT Quotient - - Square root -\n");
|
sum_cc = 0;
|
sum_cc = 0;
|
end
|
end
|
count <= count + 1;
|
count <= count + 1;
|
if (count > 750)
|
if (count > 1000)
|
count <= 1'd1;
|
count <= 1'd1;
|
if (count==2) begin
|
if (count==2) begin
|
a[N*4+16+4-1:0] <= a1;
|
a[N*4+16+4-1:0] <= a1;
|
b[N*4+16+4-1:0] <= b1;
|
b[N*4+16+4-1:0] <= b1;
|
a[N*4+16+4-1:N*4+16+4-4] <= 4'h5;
|
a[N*4+16+4-1:N*4+16+4-4] <= 4'h5;
|
Line 143... |
Line 143... |
end
|
end
|
if (adr==4 && count==2) begin
|
if (adr==4 && count==2) begin
|
a <= 152'h50000100000000000000000000000000000000;
|
a <= 152'h50000100000000000000000000000000000000;
|
b <= 152'h50000300000000000000000000000000000000;
|
b <= 152'h50000300000000000000000000000000000000;
|
end
|
end
|
if (count > 750) begin
|
if (adr==5 && count==2) begin
|
|
a <= 152'h50002100000000000000000000000000000000;
|
|
b <= 152'h50000300000000000000000000000000000000;
|
|
end
|
|
if (adr==6 && count==2) begin
|
|
a <= 152'h50002987654321000000000000000000000000;
|
|
b <= 152'h50000300000000000000000000000000000000;
|
|
end
|
|
if (count > 1000) begin
|
sum_cc = sum_cc + u6.u1.u2.clkcnt;
|
sum_cc = sum_cc + u6.u1.u2.clkcnt;
|
$fwrite(outfile, "%h\t%h\t%h\t%h\t%d\t%f\n", rm, a, b, o, u6.u1.u2.clkcnt, $itor(sum_cc) / $itor(adr));
|
$fwrite(outfile, "%h\t%h\t%h\t%h\t%h\t%d\t%f\n", rm, a, b, o, sqrto, u6.u1.u2.clkcnt, $itor(sum_cc) / $itor(adr));
|
adr <= adr + 1;
|
adr <= adr + 1;
|
end
|
end
|
end
|
end
|
|
|
//fpMulnr #(64) u1 (clk, 1'b1, a, b, o, rm);//, sign_exe, inf, overflow, underflow);
|
//fpMulnr #(64) u1 (clk, 1'b1, a, b, o, rm);//, sign_exe, inf, overflow, underflow);
|
Line 168... |
Line 176... |
.inf(),
|
.inf(),
|
.overflow(),
|
.overflow(),
|
.underflow()
|
.underflow()
|
);
|
);
|
|
|
|
DFPSqrtnr #(.N(N)) u1 (rst, clk, 1'b1, count==3, a, sqrto, rm);//, sign_exe, inf, overflow, underflow);
|
|
|
endmodule
|
endmodule
|
|
|
No newline at end of file
|
No newline at end of file
|