3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-28 03:15:50 +00:00

sv: Switch parser to glr, prep for typedef

Signed-off-by: David Shah <dave@ds0.me>
This commit is contained in:
David Shah 2019-09-19 20:43:13 +01:00
parent e0a6742935
commit f6b5e47e40
6 changed files with 111 additions and 11 deletions

22
tests/svtypes/typedef1.sv Normal file
View file

@ -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