OpenCores
URL https://opencores.org/ocsvn/thor/thor/trunk

Subversion Repositories thor

[/] [thor/] [trunk/] [FT64v5/] [rtl/] [fpUnit/] [fpAddsub_tb.v] - Blame information for rev 51

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 51 robfinch
module fpAddsub_tb();
2
reg rst;
3
reg clk;
4
reg [12:0] adr;
5
reg [95:0] mem [0:8191];
6
reg [95:0] memo [0:9000];
7
reg [31:0] a,b,a6,b6;
8
wire [31:0] a5,b5;
9
wire [31:0] o;
10
 
11
initial begin
12
        rst = 1'b0;
13
        clk = 1'b0;
14
        adr = 0;
15
        $readmemh("c:/cores5/ft64/trunk/rtl/fpUnit/fpAddsub_tv.txt", mem);
16
        #20 rst = 1;
17
        #50 rst = 0;
18
end
19
 
20
always #5
21
        clk = ~clk;
22
 
23
delay4 #(32) u2 (clk, 1'b1, a, a5);
24
delay4 #(32) u3 (clk, 1'b1, b, b5);
25
 
26
always @(posedge clk)
27
if (rst)
28
        adr = 0;
29
else
30
begin
31
        adr <= adr + 1;
32
        a <= mem[adr][31: 0];
33
        b <= mem[adr][63:32];
34
        a6 <= a5;
35
        b6 <= b5;
36
        if (adr > 5)
37
                memo[adr-6] <= {o,b5,a5};
38
        if (adr==8191) begin
39
                $writememh("c:/cores5/ft64/trunk/rtl/fpUnit/fpAddsub_tvo.txt", memo);
40
                $finish;
41
        end
42
end
43
 
44
fpAddsubnr #(32) u1 (clk, 1'b1, 3'b000, 1'b0, a, b, o);
45
 
46
endmodule

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.