mirror of
https://github.com/YosysHQ/yosys
synced 2026-02-26 18:15:39 +00:00
splitnets: add -ports_only and -top_only options
Add two new options to the splitnets pass: - `-ports_only`: Split only module ports, not internal signals. This is useful when you want to split ports for interface compatibility while keeping internal signals as multi-bit wires for better readability. - `-top_only`: Apply splitting only at the top module level, not in submodules. This is helpful for hierarchical designs where you need split signals only at the top-level interface. These options can be combined with existing flags: - `splitnets -ports_only`: Split all ports in all modules - `splitnets -ports_only -top_only`: Split ports only in top module - `splitnets -ports -top_only`: Split both ports and nets only in top Add comprehensive tests that verify wire/port counts for all flag combinations using a hierarchical design.
This commit is contained in:
parent
71feb2a2a1
commit
6503ad91c9
4 changed files with 107 additions and 12 deletions
13
tests/various/test_splitnets.v
Normal file
13
tests/various/test_splitnets.v
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
module bottom(input clk, input wire [1:0] i, output reg [1:0] q);
|
||||
reg [1:0] q1;
|
||||
always @(posedge clk) begin
|
||||
q1 <= i;
|
||||
q <= q1;
|
||||
end
|
||||
endmodule
|
||||
|
||||
module top(input clk, input wire [1:0] i, output wire [1:0] q);
|
||||
wire [1:0] q1;
|
||||
bottom u1 (.clk(clk), .i(i), .q(q1));
|
||||
assign q = ~q1;
|
||||
endmodule
|
||||
Loading…
Add table
Add a link
Reference in a new issue