diff options
author | Udi Finkelstein <github@udifink.com> | 2019-05-03 03:10:43 +0300 |
---|---|---|
committer | Udi Finkelstein <github@udifink.com> | 2019-05-03 03:10:43 +0300 |
commit | ac10e7d96da4965751fd60a8dd42a8998c011c39 (patch) | |
tree | 88926f01f42afee890ad8bed010977ce4b95a126 /tests/various/elab_sys_tasks.sv | |
parent | 98925f6c4be611434e75f0ccf645a7ef8adcfc63 (diff) | |
download | yosys-ac10e7d96da4965751fd60a8dd42a8998c011c39.tar.gz yosys-ac10e7d96da4965751fd60a8dd42a8998c011c39.tar.bz2 yosys-ac10e7d96da4965751fd60a8dd42a8998c011c39.zip |
Initial implementation of elaboration system tasks
(IEEE1800-2017 section 20.11)
This PR allows us to use $info/$warning/$error/$fatal **at elaboration time** within a generate block.
This is very useful to stop a synthesis of a parametrized block when an
illegal combination of parameters is chosen.
Diffstat (limited to 'tests/various/elab_sys_tasks.sv')
-rw-r--r-- | tests/various/elab_sys_tasks.sv | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/various/elab_sys_tasks.sv b/tests/various/elab_sys_tasks.sv new file mode 100644 index 000000000..774d85b32 --- /dev/null +++ b/tests/various/elab_sys_tasks.sv @@ -0,0 +1,30 @@ +module test; +localparam X=1; +genvar i; +generate +if (X == 1) + $info("X is 1"); +if (X == 1) + $warning("X is 1"); +else + $error("X is not 1"); +case (X) + 1: $info("X is 1 in a case statement"); +endcase +//case (X-1) +// 1: $warn("X is 2"); +// default: $warn("X might be anything in a case statement"); +//endcase +for (i = 0; i < 3; i = i + 1) +begin + case(i) + 0: $info; + 1: $warning; + default: $info("default case statemnent"); + endcase +end + +$info("This is a standalone $info(). Next $info has no parameters"); +$info; +endgenerate +endmodule |