Skip to content

Commit

Permalink
Verilog: add KNOWNBUG test for $low/$high
Browse files Browse the repository at this point in the history
  • Loading branch information
kroening committed Sep 24, 2024
1 parent 8d678b6 commit f2c1da9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
9 changes: 9 additions & 0 deletions regression/verilog/system-functions/low1.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
KNOWNBUG
low1.sv
--module main --bound 0
^EXIT=0$
^SIGNAL=0$
--
^warning: ignoring
--
This yields an error in the typechecker.
13 changes: 13 additions & 0 deletions regression/verilog/system-functions/low1.sv
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module main;

logic [7:0] mask;

genvar i;
generate
for (i=$low(mask); i<=$high(mask); i = i + 1)
always_comb @* mask[i] = (i%2)==1;
endgenerate

assert final (mask == 'b10101010);

endmodule

0 comments on commit f2c1da9

Please sign in to comment.