Skip to content

Commit 568f187

Browse files
committed
SystemVerilog: nested modules
This adds SystemVerilog nested modules.
1 parent 6866dfe commit 568f187

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CORE
2+
nested1.sv
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module main;
2+
3+
module my_module;
4+
wire [7:0] value = 123;
5+
endmodule
6+
7+
my_module m();
8+
9+
assert final (m.value == 123);
10+
11+
endmodule

src/verilog/parser.y

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,8 +870,9 @@ module_or_generate_item_declaration:
870870
non_port_module_item:
871871
attribute_instance_brace generate_region { $$=$2; }
872872
| module_or_generate_item
873-
| attribute_instance_brace specparam_declaration {$$=$2; }
874873
| attribute_instance_brace specify_block { $$=$2;}
874+
| attribute_instance_brace specparam_declaration {$$=$2; }
875+
| module_declaration
875876
;
876877

877878
/*

0 commit comments

Comments
 (0)