-
-
Save Wren6991/1aab258428b4fc8e3e82ee64fa8383da to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module tb(); | |
localparam W = 29; | |
localparam TEST_LEN = 10000; | |
reg [W-1:0] a; | |
reg [W-1:0] b; | |
wire [W*2-1:0] out; | |
wallace_mult #(.W(W)) inst_radix2_mult (.sext_a(1'b0), .sext_b(1'b0), .a(a), .b(b), .out(out)); | |
integer i; | |
initial begin | |
for (i = 0; i < TEST_LEN; i = i + 1) begin | |
a = $random; | |
b = $random; | |
#5; | |
if (out != a * b) begin | |
$display("Fail: %d * %d != %d", a, b, out); | |
$finish(2); | |
end | |
#5; | |
end | |
$display("Test PASSED."); | |
$finish; | |
end | |
endmodule |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment