Line 38... |
Line 38... |
reg rst;
|
reg rst;
|
reg clk;
|
reg clk;
|
reg [12:0] adr;
|
reg [12:0] adr;
|
reg [95:0] mem [0:8191];
|
reg [95:0] mem [0:8191];
|
reg [95:0] memo [0:9000];
|
reg [95:0] memo [0:9000];
|
reg [31:0] a,b,a6,b6;
|
reg [191:0] memd [0:8191];
|
|
reg [191:0] memdo [0:9000];
|
|
reg [31:0] a,b;
|
wire [31:0] a5,b5;
|
wire [31:0] a5,b5;
|
wire [31:0] o;
|
wire [31:0] o;
|
|
reg [63:0] ad,bd;
|
|
wire [63:0] ad5,bd5;
|
|
wire [63:0] od;
|
|
|
initial begin
|
initial begin
|
rst = 1'b0;
|
rst = 1'b0;
|
clk = 1'b0;
|
clk = 1'b0;
|
adr = 0;
|
adr = 0;
|
$readmemh("c:/cores5/ft64/trunk/rtl/fpUnit/fpMul_tv.txt", mem);
|
$readmemh("c:/cores5/ft64/trunk/rtl/fpUnit/fpMul_tv.txt", mem);
|
|
$readmemh("c:/cores5/ft64/trunk/rtl/fpUnit/fpMul_tvd.txt", memd);
|
#20 rst = 1;
|
#20 rst = 1;
|
#50 rst = 0;
|
#50 rst = 0;
|
end
|
end
|
|
|
always #5
|
always #5
|
clk = ~clk;
|
clk = ~clk;
|
|
|
delay5 #(32) u2 (clk, 1'b1, a, a5);
|
delay5 #(32) u2 (clk, 1'b1, a, a5);
|
delay5 #(32) u3 (clk, 1'b1, b, b5);
|
delay5 #(32) u3 (clk, 1'b1, b, b5);
|
|
delay5 #(64) u4 (clk, 1'b1, ad, ad5);
|
|
delay5 #(64) u5 (clk, 1'b1, bd, bd5);
|
|
|
always @(posedge clk)
|
always @(posedge clk)
|
if (rst)
|
if (rst)
|
adr = 0;
|
adr = 0;
|
else
|
else
|
begin
|
begin
|
adr <= adr + 1;
|
adr <= adr + 1;
|
a <= mem[adr][31: 0];
|
a <= mem[adr][31: 0];
|
b <= mem[adr][63:32];
|
b <= mem[adr][63:32];
|
a6 <= a5;
|
ad <= memd[adr][63: 0];
|
b6 <= b5;
|
bd <= memd[adr][127:64];
|
if (adr > 5)
|
if (adr > 5) begin
|
memo[adr-6] <= {o,b5,a5};
|
memo[adr-6] <= {o,b5,a5};
|
|
memdo[adr-6] <= {od,bd5,ad5};
|
|
end
|
if (adr==8191) begin
|
if (adr==8191) begin
|
$writememh("c:/cores5/ft64/trunk/rtl/fpUnit/fpMul_tvo.txt", memo);
|
$writememh("c:/cores5/ft64/trunk/rtl/fpUnit/fpMul_tvo.txt", memo);
|
|
$writememh("c:/cores5/ft64/trunk/rtl/fpUnit/fpMul_tvdo.txt", memdo);
|
$finish;
|
$finish;
|
end
|
end
|
end
|
end
|
|
|
fpMulnr #(32) u1 (clk, 1'b1, a, b, o, 3'b000);//, sign_exe, inf, overflow, underflow);
|
fpMulnr #(32) u1 (clk, 1'b1, a, b, o, 3'b000);//, sign_exe, inf, overflow, underflow);
|
|
fpMulnr #(64) u6 (clk, 1'b1, ad, bd, od, 3'b000);//, sign_exe, inf, overflow, underflow);
|
|
|
endmodule
|
endmodule
|
|
|
No newline at end of file
|
No newline at end of file
|