Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verilog: add KNOWNBUG test for enums in module hierarchy #375

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions regression/verilog/enums/enum_with_hierarchy1.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
KNOWNBUG
enum_with_hierarchy1.sv
--bound 0
^EXIT=0$
^SIGNAL=0$
--
--
Asserted values are wrong.
18 changes: 18 additions & 0 deletions regression/verilog/enums/enum_with_hierarchy1.sv
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module sub;

parameter step = 1;

typedef enum { E0 = 0 * step, E1 = 1 * step, E2 = 2 * step } my_enumt;

endmodule

module main;

// The value of enum constants may differ for each module instance.
sub #(1) sub1();
sub #(2) sub2();

p1: assert property (sub1.E0 == 0 && sub1.E1 == 1 && sub1.E2 == 2);
p2: assert property (sub2.E0 == 0 && sub2.E2 == 2 && sub2.E2 == 4);

endmodule