3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-23 00:55:32 +00:00

Merge pull request #2578 from zachjs/genblk-port

verlog: allow shadowing module ports within generate blocks
This commit is contained in:
Zachary Snow 2021-02-11 10:26:49 -05:00 committed by GitHub
commit 73d611990d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 4 deletions

View file

@ -0,0 +1,10 @@
module top(x);
generate
if (1) begin : blk
wire x;
assign x = 0;
end
endgenerate
output wire x;
assign x = blk.x;
endmodule

View file

@ -0,0 +1,12 @@
logger -expect error "Cannot declare module port `\\x' within a generate block\." 1
read_verilog <<EOT
module top(x);
generate
if (1) begin : blk
output wire x;
assign x = 1;
end
endgenerate
output wire x;
endmodule
EOT