File size: 724 Bytes
035592e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
module fmultiplier_tb;

reg [31:0] a, b;
wire [31:0] z;
reg clk, rst;

float_multi uut(clk , rst, a, b, z);
integer error = 0;
initial begin
	clk <= 0;
	rst <= 1;
	repeat(17000)
		#5 clk <= ~clk;
end

initial #13 rst <= 0;

initial begin
// $monitor("a=%b, b=%b, z=%b", a,b,z);
	#3
	repeat(2) begin
		#80
		a = 32'b00111110100110011001100110011010;
		b = 32'b00111110100110011001100110011010;
	end
	
	#80
    error = (z==32'b00111101101110000101000111101100) ? error:error+1;
    if (error == 0) begin
            $display("=========== Your Design Passed ===========");
            end
    else begin
        $display("=========== Test completed with %d/20 failures ===========", error);
    end
    $finish;
end


endmodule