1 `timescale 1ns/1ns
 2 module tb_wallace;
 3     // Unsigned multiplier testbench
 4     // John Bryan, 2017
 5     reg  [32:0] a;
 6     reg  [12:0] b;
 7     wire [45:0] product;
 8     reg  [45:0] check;
 9     integer i;
10 
11     wallace wall0(a,b,product);
12 
13     initial
14     begin
15         for (i=0;i<10000;i=i+1)
16         begin
17             a[31:0]=$urandom;
18             a[32:32]=$urandom;
19             b=$urandom;
20             check=a*b;
21             #1;
22             if (product != check)
23             begin
24                 $display("time=%0t", $time);
25                 $display("a =%0d, b=%0d", a, b);
26                 $display("product=%0d, check=%0d", product, check);
27                 $finish;
28             end
29         end
30         $display("   All 10000 were correct.\n");
31         $finish;
32     end
33 
34  endmodule