sv: Improve tests

Signed-off-by: David Shah <dave@ds0.me>
This commit is contained in:
David Shah 2019-09-20 18:40:35 +01:00
parent 5501d9090a
commit 9b9d24f15b
8 changed files with 30 additions and 7 deletions

View File

@ -0,0 +1,23 @@
typedef logic [3:0] outer_uint4_t;
module top;
outer_uint4_t u4_i = 8'hA5;
always @(*) assert(u4_i == 4'h5);
typedef logic [3:0] inner_type;
inner_type inner_i1 = 8'h5A;
always @(*) assert(inner_i1 == 4'hA);
if (1) begin: genblock
typedef logic [7:0] inner_type;
inner_type inner_gb_i = 8'hA5;
always @(*) assert(inner_gb_i == 8'hA5);
end
inner_type inner_i2 = 8'h42;
always @(*) assert(inner_i2 == 4'h2);
endmodule