Version
Yosys 0.62 (git sha1 v0.62, g++ 15.2.0 -fPIC -O3)
On which OS did this happen?
Linux
Reproduction Steps
loops.v
`default_nettype none
module topEntity();
genvar i;
generate
for (i = 0; i < 128 * 4; i = i + 1) begin
wire [383:0] ws;
genvar j;
for (j=0; j < 64; j = j + 1) begin
localparam vec_index = 63 - j;
assign ws[vec_index*6+:6] = j[0+:6];
end
end
endgenerate
endmodule
`default_nettype wire
For the above reproducer
yosys -p "read_verilog loops.v"
seems to have poor performance. For the different bounds of i we have:
- i = 128 * 1 -> 2 sec
- i = 128 * 2 -> 8 sec
- i = 128 * 3 -> 21 sec
- i = 128 * 4 -> 44 sec
The issue does not occur when wire ws is declared in the inner-most loop or in top level.
The issue appears for smaller bounds of the loops if we add more nested loops:
loops4.v
`default_nettype none
module topEntity();
genvar i;
generate
for (i = 0; i < 24; i = i + 1) begin
genvar j;
for (j = 0; j < 5; j = j + 1) begin
genvar k;
for (k = 0; k < 5; k = k + 1) begin
wire [383:0] ws;
genvar l;
for (l=0; l < 64; l = l + 1) begin
localparam vec_index = 63 - l;
assign ws[vec_index*6+:6] = l[0+:6];
end
end
end
end
endgenerate
endmodule
`default_nettype wire
Expected Behavior
read_verilog performance should not differ for different levels of nested loop wire declarations.
Actual Behavior
read_verilog should be able to generate RTLIL with better time complexity with respect to the bounds of for-loops with intermediate wire declarations.
Version
Yosys 0.62 (git sha1 v0.62, g++ 15.2.0 -fPIC -O3)
On which OS did this happen?
Linux
Reproduction Steps
loops.v
For the above reproducer
seems to have poor performance. For the different bounds of i we have:
The issue does not occur when wire ws is declared in the inner-most loop or in top level.
The issue appears for smaller bounds of the loops if we add more nested loops:
loops4.v
Expected Behavior
read_verilog performance should not differ for different levels of nested loop wire declarations.
Actual Behavior
read_verilog should be able to generate RTLIL with better time complexity with respect to the bounds of for-loops with intermediate wire declarations.