The-OpenROAD-Project / OpenSTA

OpenSTA engine
GNU General Public License v3.0
389 stars 170 forks source link

VerilogWriter.cc: write assign statements #66

Closed tgingold closed 2 years ago

tgingold commented 3 years ago

Assign statements are written for output ports when they are connected to a net whose name is not the name of the port.

This happen naturally when a cell is connected to more than one output ports, like in this reproducer extracted from a larger design:

module top(A, X1, X2); input A; output X1, X2; wire w;

mybuf buf1(.A(A), .X(w)); assign X1 = w; assign X2 = w; endmodule

If read and written with this change using these tcl commands:

read_verilog verilog1.v link_design top write_verilog t1.v

The verilog written is:

module top (A, X1, X2); input A; output X1; output X2;

mybuf buf1 (.A(A), .X(w)); assign X2 = w; assign X1 = w; endmodule

Without the assign statements, the written verilog is not equivalent to the read verilog. For ports other than output, additional work is needed (like adding trans gates), but I have not yet found a real example.

jjcherry56 commented 2 years ago

this functionality was added by 46a835a5 master origin/master write_verilog assigns for nets with multiple output ports