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

Subversion Repositories double_fpu

[/] [double_fpu/] [trunk/] [pipeline/] [fpu_mul_TB.v] - Blame information for rev 13

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 6 davidklun
 
2
`timescale 1ps / 1ps
3
module fpu_mul_tb;
4
 
5
reg clk;
6
reg rst;
7
reg enable;
8 8 davidklun
reg [1:0]rmode;
9 6 davidklun
reg [63:0]opa;
10
reg [63:0]opb;
11
wire ready;
12 8 davidklun
wire [63:0]outfp;
13 6 davidklun
 
14
        fpu_mul UUT (
15
                .clk(clk),
16
                .rst(rst),
17
                .enable(enable),
18 8 davidklun
                .rmode(rmode),
19 6 davidklun
                .opa(opa),
20
                .opb(opb),
21
                .ready(ready),
22
                .outfp(outfp));
23
 
24
initial
25
begin : STIMUL
26
        #0
27 8 davidklun
        enable = 1'b0;
28 6 davidklun
        rst = 1'b1;
29 8 davidklun
    #10000; //0
30
        enable = 1'b1;
31
        rst = 1'b0;
32
//inputA:9.6300000000e+001
33
//inputB:-2.5600000000e-001
34
opa = 64'b0100000001011000000100110011001100110011001100110011001100110011;
35
opb = 64'b1011111111010000011000100100110111010010111100011010100111111100;
36
rmode = 2'b11;
37 6 davidklun
         #10000;
38 8 davidklun
//inputA:3.6600000000e+000
39
//inputB:2.2500000000e+000
40
opa = 64'b0100000000001101010001111010111000010100011110101110000101001000;
41
opb = 64'b0100000000000010000000000000000000000000000000000000000000000000;
42
rmode = 2'b00;
43 6 davidklun
           #10000;
44 8 davidklun
//inputA:-5.6970000000e+001
45
//inputB:1.2340000000e-001
46
opa = 64'b1100000001001100011111000010100011110101110000101000111101011100;
47
opb = 64'b0011111110111111100101110010010001110100010100111000111011110011;
48
rmode = 2'b11;
49 6 davidklun
           #10000;
50 8 davidklun
//inputA:4.5680000000e+001
51
//inputB:2.1300000000e+000
52
opa = 64'b0100000001000110110101110000101000111101011100001010001111010111;
53
opb = 64'b0100000000000001000010100011110101110000101000111101011100001010;
54
rmode = 2'b00;
55 6 davidklun
          #10000;
56 8 davidklun
//inputA:3.0000000000e-311
57
//inputB:-4.0000000000e+060
58
opa = 64'b0000000000000000000001011000010111000011011011101010101101110011;
59
opb = 64'b1100110010000011111010011110010011100100110000101111001101000100;
60
rmode = 2'b10;
61 6 davidklun
           #10000;
62 8 davidklun
//inputA:4.6300000000e+001
63
//inputB:2.3110000000e+001
64
opa = 64'b0100000001000111001001100110011001100110011001100110011001100110;
65
opb = 64'b0100000000110111000111000010100011110101110000101000111101011100;
66
rmode = 2'b00;
67 6 davidklun
           #10000;
68
//inputA:5.0000000000e-250
69 8 davidklun
//inputB:-1.#INF000000e+000
70 6 davidklun
opa = 64'b0000110000101100101000111000111100110101000010110010001011011111;
71 8 davidklun
opb = 64'b1111111111110000000000000000000000000000000000000000000000000000;
72
rmode = 2'b11;
73
            #10000;
74
//inputA:
75
//inputB:
76
opa = 64'b0100000000111111111111111111111111111111111111111111111111111110;
77
opb = 64'b0100000000110000000000000000000000000000000000000000000000000001;
78
rmode = 2'b00;
79 6 davidklun
           #10000;
80 8 davidklun
//inputA:1.2000000000e-001
81
//inputB:5.2000000000e+001
82
opa = 64'b0011111110111110101110000101000111101011100001010001111010111000;
83
opb = 64'b0100000001001010000000000000000000000000000000000000000000000000;
84
rmode = 2'b00;
85 6 davidklun
            #10000;
86
//inputA:8.9999000000e+004
87
//inputB:1.6000000000e+001
88
opa = 64'b0100000011110101111110001111000000000000000000000000000000000000;
89 8 davidklun
opb = 64'b0100000000110000000000000000000000000000000000000000000000000000;
90
rmode = 2'b10;
91
 
92
        #120000;
93
//Output:-2.465280000000000e+001
94
if (outfp==64'hC038A71DE69AD42D)
95 6 davidklun
        $display($time,"ps Answer is correct %h", outfp);
96
else
97 8 davidklun
        $display($time,"ps Error! out is incorrect %h", outfp);
98 6 davidklun
        #10000; //0
99 8 davidklun
//Output:8.235000000000001e+000
100
if (outfp==64'h40207851EB851EB8)
101 6 davidklun
        $display($time,"ps Answer is correct %h", outfp);
102
else
103 8 davidklun
        $display($time,"ps Error! out is incorrect %h", outfp);
104 6 davidklun
        #10000; //0
105 8 davidklun
//Output:-7.030098000000000e+000
106
if (outfp==64'hC01C1ED20296B335)
107 6 davidklun
        $display($time,"ps Answer is correct %h", outfp);
108
else
109 8 davidklun
        $display($time,"ps Error! out is incorrect %h", outfp);
110 6 davidklun
        #10000; //0
111 8 davidklun
//Output:9.729840000000000e+001
112
if (outfp==64'h40585318FC504817)
113 6 davidklun
        $display($time,"ps Answer is correct %h", outfp);
114
else
115
        $display($time,"ps Error! out is incorrect %h", outfp);
116
        #10000; //0
117 8 davidklun
//Output:-0
118
if (outfp==64'h8000000000000000)
119 6 davidklun
        $display($time,"ps Answer is correct %h", outfp);
120
else
121 8 davidklun
        $display($time,"ps Error! out is incorrect %h", outfp);
122 6 davidklun
        #10000; //0
123 8 davidklun
//Output:1.069993000000000e+003
124
if (outfp==64'h4090B7F8D4FDF3B6)
125 6 davidklun
        $display($time,"ps Answer is correct %h", outfp);
126
else
127
        $display($time,"ps Error! out is incorrect %h", outfp);
128
        #10000; //0
129 8 davidklun
//Output:-INF
130
if (outfp==64'hFFF0000000000000)
131 6 davidklun
        $display($time,"ps Answer is correct %h", outfp);
132
else
133
        $display($time,"ps Error! out is incorrect %h", outfp);
134 8 davidklun
                #10000; //0
135
        //Output
136
if (outfp==64'h4080000000000000)
137
        $display($time,"ps Answer is correct %h", outfp);
138
else
139
        $display($time,"ps Error! out is incorrect %h", outfp);
140 6 davidklun
        #10000; //0
141 8 davidklun
//Output:6.240000000000000e+000
142
if (outfp==64'h4018F5C28F5C28F6)
143 6 davidklun
        $display($time,"ps Answer is correct %h", outfp);
144
else
145 8 davidklun
        $display($time,"ps Error! out is incorrect %h", outfp);
146
 
147 6 davidklun
        #10000; //0
148
        //Output:1.439984000000000e+006
149
if (outfp==64'h4135F8F000000000)
150
        $display($time,"ps Answer is correct %h", outfp);
151
else
152 8 davidklun
        $display($time,"ps Error! out is incorrect %h", outfp);
153
 
154
    #290000; //10000
155 6 davidklun
        $finish;
156 8 davidklun
end // end of stimulus process
157 6 davidklun
 
158
always
159
begin : CLOCK_clk
160
 
161
        clk = 1'b0;
162
        #5000;
163
        clk = 1'b1;
164
        #5000;
165
end
166
 
167
 
168
endmodule

powered by: WebSVN 2.1.0

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