3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-06-02 07:07:56 +00:00

Merge pull request #4235 from ylm/genblk_wire

Add autowires in genblk/for expension
This commit is contained in:
Emil J 2026-01-13 16:40:22 +01:00 committed by GitHub
commit 5ba0e9cae3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 125 additions and 0 deletions

View file

@ -0,0 +1,20 @@
module gold(a, b);
output wire [1:0] a;
input wire [1:0] b;
genvar i;
for (i = 0; i < 2; i++) begin
wire x;
assign x = b[i];
assign a[i] = x;
end
endmodule
module gate(a, b);
output wire [1:0] a;
input wire [1:0] b;
genvar i;
for (i = 0; i < 2; i++) begin
assign x = b[i];
assign a[i] = x;
end
endmodule

View file

@ -0,0 +1,17 @@
logger -expect warning "Identifier `\\genblk1[[]0[]]\.x' is implicitly declared." 1
logger -expect warning "Identifier `\\genblk1[[]1[]]\.x' is implicitly declared." 1
read_verilog -sv genblk_wire.sv
logger -check-expected
select -assert-count 1 gate/genblk1[0].x
select -assert-count 1 gate/genblk1[1].x
select -assert-count 0 gate/genblk1[2].x
select -assert-count 1 gold/genblk1[0].x
select -assert-count 1 gold/genblk1[1].x
select -assert-count 0 gold/genblk1[2].x
proc
equiv_make gold gate equiv
equiv_simple
equiv_status -assert