Skip to content

Fix for OpenSTA issue 398 and OpenROAD issue 9454 with regression#401

Merged
parallaxsw merged 5 commits intoparallaxsw:masterfrom
dsengupta0628:sta_issue_9454
Mar 10, 2026
Merged

Fix for OpenSTA issue 398 and OpenROAD issue 9454 with regression#401
parallaxsw merged 5 commits intoparallaxsw:masterfrom
dsengupta0628:sta_issue_9454

Conversation

@dsengupta0628
Copy link
Contributor

Issue: #398
Instance b2 is of the type block2 which has a 2nd output pin "out2". Even if it is unconnected to any net in the top level (i.e. the "top" module), the pin b2/out2 should be still a valid object.

Potential fix per feedback in the issue.

So in VerilogReader::makeModuleInstNetwork I just enhanced the existing code that was for liberty cells only to include non-liberty cells too
Needed an updation in VerilogReader::makeInstPin because we have already called makePin now even for non-liberty cells by the new change- so need to make sure we don't create duplicate here.

Added a regression for the issue.

Signed-off-by: dsengupta0628 <dsengupta@precisioninno.com>
verilog_specify
verilog_write_escape
verilog_unconnected_dbterm
}
Copy link
Owner

@parallaxsw parallaxsw Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dbterm is ODB terminolgy, which is irrelevant here. use unconnected_hpin

@@ -0,0 +1,14 @@
read_liberty ../examples/nangate45_typ.lib.gz
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

asap7_small.lib is a smaller library to use for simple tests

} else {
puts "b2/u3/Z is not connected to any net."
}
puts "Find internal net connected to b2/out2: [get_property [get_net b2/out2] full_name]" No newline at end of file
Copy link
Owner

@parallaxsw parallaxsw Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use get_full name like above instead of get_property
but both are overkill. easier to just use report_net to see the pin listed than all of this
printing/if logic

// Ensure pin exists (may have been pre-created), then connect to parent
// net if present. Always create a term for the child-side net.
Pin *pin = network_->findPin(inst, port);
if (pin == nullptr)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cannot happen now that all of the pins are already made.

Signed-off-by: dsengupta0628 <dsengupta@precisioninno.com>
Signed-off-by: dsengupta0628 <dsengupta@precisioninno.com>
Signed-off-by: dsengupta0628 <dsengupta@precisioninno.com>
}
// Make all pins so timing arcs are built and get_pins finds them.
ConcreteCellPortBitIterator port_iter(reinterpret_cast<const ConcreteCell*>(cell));
while (port_iter.hasNext()) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would be better off using Network::portBitIterator so there are no casts involved.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Network::portBitIterator returns a heap-allocated CellPortBitIterator*, So I will have to use a delete on it later, would that be okay? (this is the pattern used in ConcreteNetwork::makePins)

Otherwise I can also use std::unique_ptr port_iter(network_->portBitIterator(cell))

Please let me know your preference. Thanks

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, you have to delete it either explicitly (like all the other network iterator calls you can find in OpenSTA) or use unique_ptr which I haven't adopted much because it makes the declaration lines sooooo wiiiiddddde.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha! Done.

Signed-off-by: dsengupta0628 <dsengupta@precisioninno.com>
@parallaxsw
Copy link
Owner

Did you resolve the openroad issues you mentioned in the issue?

@dsengupta0628
Copy link
Contributor Author

Did you resolve the openroad issues you mentioned in the issue?

Yes- But only after I pulled all the OpenSTA changes into OpenROAD (that also needed some OpenROAD changes due to the string vector changes in StringUtil). After that OpenROAD issue w.r.t. this issue was resolved.

@parallaxsw parallaxsw merged commit fbe9da3 into parallaxsw:master Mar 10, 2026
2 checks passed
@dsengupta0628 dsengupta0628 deleted the sta_issue_9454 branch March 11, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants