diff options
| author | Fuwn <[email protected]> | 2026-02-13 23:23:19 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-02-13 23:23:19 -0800 |
| commit | 583bec7ffd3c2809ea41aa8a518f53403af3efaa (patch) | |
| tree | 551fa62ee04d40616db4f2375176c362ae6f3cbc /lab_4/SRC/macro.svh | |
| download | cst456-583bec7ffd3c2809ea41aa8a518f53403af3efaa.tar.xz cst456-583bec7ffd3c2809ea41aa8a518f53403af3efaa.zip | |
Initial commit
Diffstat (limited to 'lab_4/SRC/macro.svh')
| -rw-r--r-- | lab_4/SRC/macro.svh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lab_4/SRC/macro.svh b/lab_4/SRC/macro.svh new file mode 100644 index 0000000..72bf471 --- /dev/null +++ b/lab_4/SRC/macro.svh @@ -0,0 +1,14 @@ +`ifndef MACRO_SVH + `define MACRO_SVH + + `define FAIL_UNLESS_EQUAL(a,b,c="") \ + if ((a) !== (b)) begin \ + $display ("FAIL_UNLESS_EQUAL[%s]: Expected %h but actual value is %h.", c, a, b); \ + end + + `define RND_CHECK(a) \ + if (!a) begin \ + $display ("Randomization failure. Simulation halted."); \ + $finish; \ + end +`endif |