diff options
Diffstat (limited to 'lab_5/SRC/macro.svh')
| -rw-r--r-- | lab_5/SRC/macro.svh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lab_5/SRC/macro.svh b/lab_5/SRC/macro.svh new file mode 100644 index 0000000..72bf471 --- /dev/null +++ b/lab_5/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 |