diff options
author | David Shah <dave@ds0.me> | 2019-09-19 20:43:13 +0100 |
---|---|---|
committer | David Shah <dave@ds0.me> | 2019-10-03 09:54:14 +0100 |
commit | f6b5e47e40b4a2bda6e5d928480ea218a6a911c2 (patch) | |
tree | 354bb0f38fda5863c32b635d482dd4db4c7e3acf /tests | |
parent | e0a6742935b423991668e0fe901d676782db5648 (diff) | |
download | yosys-f6b5e47e40b4a2bda6e5d928480ea218a6a911c2.tar.gz yosys-f6b5e47e40b4a2bda6e5d928480ea218a6a911c2.tar.bz2 yosys-f6b5e47e40b4a2bda6e5d928480ea218a6a911c2.zip |
sv: Switch parser to glr, prep for typedef
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/svtypes/typedef1.sv | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/svtypes/typedef1.sv b/tests/svtypes/typedef1.sv new file mode 100644 index 000000000..9e5d02364 --- /dev/null +++ b/tests/svtypes/typedef1.sv @@ -0,0 +1,22 @@ +`define STRINGIFY(x) `"x`" +`define STATIC_ASSERT(x) if(!(x)) $error({"assert failed: ", `STRINGIFY(x)}) + +module top; + + typedef logic [1:0] uint2_t; + typedef logic signed [3:0] int4_t; + typedef logic signed [7:0] int8_t; + typedef int8_t char_t; + + (* keep *) uint2_t int2 = 2'b10; + (* keep *) int4_t int4 = -1; + (* keep *) int8_t int8 = int4; + (* keep *) char_t ch = int8; + + + always @* assert(int2 == 2'b10); + always @* assert(int4 == 4'b1111); + always @* assert(int8 == 8'b11111111); + always @* assert(ch == 8'b11111111); + +endmodule
\ No newline at end of file |