Download Arithmetic/Multiplier/multi_8bit/testbench.v from chipagents/RTLLM-verified: direct link, hf CLI and curl.
- Browser
- Download file 1.13 kB
-
https://huggingface.co/datasets/chipagents/RTLLM-verified/resolve/main/Arithmetic/Multiplier/multi_8bit/testbench.v
- Command line
-
hf download hf://datasets/chipagents/RTLLM-verified/Arithmetic/Multiplier/multi_8bit/testbench.v
-
curl -L -o testbench.v https://huggingface.co/datasets/chipagents/RTLLM-verified/resolve/main/Arithmetic/Multiplier/multi_8bit/testbench.v
1.13 kB
| module testbench; | |
| reg [7:0] A; // Input A (8 bits) | |
| reg [7:0] B; // Input B (8 bits) | |
| wire [15:0] product; // Product result (16 bits) | |
| integer i; // Loop variable | |
| integer error = 0; // Error count for failed tests | |
| multi_8bit uut ( | |
| .A(A), | |
| .B(B), | |
| .product(product) | |
| ); | |
| // Test cases | |
| initial begin | |
| for (i = 0; i < 100; i = i + 1) begin | |
| // Generate random 8-bit inputs | |
| A = $random; | |
| B = $random; | |
| // Wait for the operation to complete | |
| #10; | |
| // $display("A = %d, B = %d, Expected Product = %d", A, B, A * B); | |
| // Check the result of the multiplication | |
| if (product !== A * B) begin | |
| error = error + 1; | |
| $display("Test failed: A = %d, B = %d, Expected Product = %d, Got = %d", A, B, A * B, product); | |
| end | |
| end | |
| // Final test result summary | |
| if (error == 0) begin | |
| $display("=========== Your Design Passed ==========="); | |
| end | |
| else begin | |
| $display("=========== Test completed with %d /100 failures ===========", error); | |
| end | |
| $finish; | |
| end | |
| endmodule |