Skip to content

Commit fbe9da3

Browse files
Fix for OpenSTA issue 398 and OpenROAD issue 9454 with regression (#401)
* Fix for OpenSTA issue 398 and OpenROAD issue 9454 with regression Signed-off-by: dsengupta0628 <dsengupta@precisioninno.com> * Incorporated feedbacks from previous version Signed-off-by: dsengupta0628 <dsengupta@precisioninno.com> * rename tests Signed-off-by: dsengupta0628 <dsengupta@precisioninno.com> * remove unnecessary newline Signed-off-by: dsengupta0628 <dsengupta@precisioninno.com> * Updated to use network_->portBitIterator Signed-off-by: dsengupta0628 <dsengupta@precisioninno.com> --------- Signed-off-by: dsengupta0628 <dsengupta@precisioninno.com>
1 parent 6280635 commit fbe9da3

File tree

5 files changed

+58
-9
lines changed

5 files changed

+58
-9
lines changed

test/regression_vars.tcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ record_public_tests {
166166
verilog_attribute
167167
verilog_specify
168168
verilog_write_escape
169+
verilog_unconnected_hpin
169170
}
170171

171172
define_test_group fast [group_tests all]

test/verilog_unconnected_hpin.ok

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Find b1/out2: b1/out2
2+
Find b2/out2: b2/out2
3+
Net b2/out2
4+
Pin capacitance: 0.00
5+
Wire capacitance: 0.00
6+
Total capacitance: 0.00
7+
Number of drivers: 1
8+
Number of loads: 0
9+
Number of pins: 1
10+
11+
Driver pins
12+
b2/u3/Y output (BUFx2_ASAP7_75t_R)
13+

test/verilog_unconnected_hpin.tcl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
read_liberty asap7_small.lib.gz
2+
read_verilog verilog_unconnected_hpin.v
3+
link_design top
4+
puts "Find b1/out2: [get_full_name [get_pins b1/out2]]"
5+
puts "Find b2/out2: [get_full_name [get_pins b2/out2]]"
6+
# Check if net is connected to "b2/u3/Y" that was the b2/out2 in parent block
7+
set iterm [sta::find_pin "b2/u3/Y"]
8+
set net [get_net -of_object [get_pin $iterm]]
9+
report_net [get_full_name $net]

test/verilog_unconnected_hpin.v

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
module top (in, clk1, clk2, out, out2);
2+
input in, clk1, clk2;
3+
output out, out2;
4+
block1 b1 (.in(in), .clk(clk1), .out(b1out), .out2(out2));
5+
block2 b2 (.in(b1out), .clk(clk2), .out(out));
6+
endmodule // top
7+
8+
module block1 (in, clk, out, out2);
9+
input in, clk;
10+
output out, out2;
11+
BUFx2_ASAP7_75t_R u1 (.A(in), .Y(u1out));
12+
DFFHQx4_ASAP7_75t_R r1 (.D(u1out), .CLK(clk), .Q(r1q));
13+
BUFx2_ASAP7_75t_R u2 (.A(r1q), .Y(out));
14+
BUFx2_ASAP7_75t_R u3 (.A(out), .Y(out2));
15+
endmodule // block1
16+
17+
module block2 (in, clk, out, out2);
18+
input in, clk;
19+
output out, out2;
20+
BUFx2_ASAP7_75t_R u1 (.A(in), .Y(u1out));
21+
DFFHQx4_ASAP7_75t_R r1 (.D(u1out), .CLK(clk), .Q(r1q));
22+
BUFx2_ASAP7_75t_R u2 (.A(r1q), .Y(out));
23+
BUFx2_ASAP7_75t_R u3 (.A(out), .Y(out2));
24+
endmodule // block2

verilog/VerilogReader.cc

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1824,14 +1824,13 @@ VerilogReader::makeModuleInstNetwork(VerilogModuleInst *mod_inst,
18241824
}
18251825
}
18261826

1827-
if (lib_cell) {
1828-
// Make all pins so timing arcs are built.
1829-
LibertyCellPortBitIterator port_iter(lib_cell);
1830-
while (port_iter.hasNext()) {
1831-
LibertyPort *port = port_iter.next();
1832-
network_->makePin(inst, reinterpret_cast<Port*>(port), nullptr);
1833-
}
1827+
// Make all pins so timing arcs are built and get_pins finds them.
1828+
CellPortBitIterator *port_iter = network_->portBitIterator(cell);
1829+
while (port_iter->hasNext()) {
1830+
Port *port = port_iter->next();
1831+
network_->makePin(inst, port, nullptr);
18341832
}
1833+
delete port_iter;
18351834
bool is_leaf = network_->isLeaf(cell);
18361835
VerilogBindingTbl bindings(zero_net_name_, one_net_name_);
18371836
if (mod_inst->hasPins()) {
@@ -1983,8 +1982,11 @@ VerilogReader::makeInstPin(Instance *inst,
19831982
network_->connect(inst, port, net);
19841983
}
19851984
else {
1986-
Pin *pin = network_->makePin(inst, port, net);
1987-
if (!is_leaf && net) {
1985+
// Pin should already exist by prior makePin, then connect to parent
1986+
// net if present and create a term for the child-side net.
1987+
Pin *pin = network_->findPin(inst, port);
1988+
if (net) {
1989+
network_->connect(inst, port, net);
19881990
const char *port_name = network_->name(port);
19891991
Net *child_net = bindings->ensureNetBinding(port_name, inst, network_);
19901992
network_->makeTerm(pin, child_net);

0 commit comments

Comments
 (0)