diff options
author | Zachary Snow <zach@zachjs.com> | 2021-03-04 14:07:56 -0500 |
---|---|---|
committer | Zachary Snow <zachary.j.snow@gmail.com> | 2021-03-16 11:01:30 -0400 |
commit | 4f187d53c5a0580275857ec308b41f57808ec727 (patch) | |
tree | 296bfc0f1f7fdffbb9c2fedd3a91d92a1677cbfd /tests | |
parent | 3d9698153fc7f01cef0dec99cc834ffecec766a5 (diff) | |
download | yosys-4f187d53c5a0580275857ec308b41f57808ec727.tar.gz yosys-4f187d53c5a0580275857ec308b41f57808ec727.tar.bz2 yosys-4f187d53c5a0580275857ec308b41f57808ec727.zip |
verilog: support module scope identifiers in parametric modules
Diffstat (limited to 'tests')
-rw-r--r-- | tests/simple/module_scope.v | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/simple/module_scope.v b/tests/simple/module_scope.v new file mode 100644 index 000000000..3e46b72ef --- /dev/null +++ b/tests/simple/module_scope.v @@ -0,0 +1,29 @@ +`default_nettype none + +module Example(o1, o2); + parameter [31:0] v1 = 10; + parameter [31:0] v2 = 20; + output [31:0] o1, o2; + assign Example.o1 = Example.v1; + assign Example.o2 = Example.v2; +endmodule + +module ExampleLong(o1, o2); + parameter [31:0] ThisIsAnExtremelyLongParameterNameToTriggerTheSHA1Checksum1 = 10; + parameter [31:0] ThisIsAnExtremelyLongParameterNameToTriggerTheSHA1Checksum2 = 20; + output [31:0] o1, o2; + assign ExampleLong.o1 = ExampleLong.ThisIsAnExtremelyLongParameterNameToTriggerTheSHA1Checksum1; + assign ExampleLong.o2 = ExampleLong.ThisIsAnExtremelyLongParameterNameToTriggerTheSHA1Checksum2; +endmodule + +module top( + output [31:0] a1, a2, b1, b2, c1, c2, + output [31:0] d1, d2, e1, e2, f1, f2 +); + Example a(a1, a2); + Example #(1) b(b1, b2); + Example #(1, 2) c(c1, c2); + ExampleLong d(d1, d2); + ExampleLong #(1) e(e1, e2); + ExampleLong #(1, 2) f(f1, f2); +endmodule |