Skip to content

Update sta ptr to 08/24 - #11226

Draft
minjukim55 wants to merge 3 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:secure-or_sta_update_0824
Draft

Update sta ptr to 08/24#11226
minjukim55 wants to merge 3 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:secure-or_sta_update_0824

Conversation

@minjukim55

@minjukim55 minjukim55 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Bump src/sta to the upstream OpenSTA merge in
The-OpenROAD-Project/OpenSTA#404, plus the two OpenROAD-side changes that merge
requires.

rsz, dbSta: stop deleting SWIG-owned Seq containers.
parallaxsw/OpenSTA#470 added %typemap(freearg) for InstanceSeq*, CellSeq*
and the other Seq pointer types, so the wrapper now frees the container it
allocated in the (in) typemap, and upstream dropped its own matching deletes.
remove_buffers_cmd and write_verilog_cmd still deleted it - a double free,
Signal 11 with free in the stack trace, 13 tests across dbSta, rsz and
grt. write_verilog_cmd is annotated "Copied from sta/verilog/Verilog.i";
upstream fixed the original and this copy went stale. Dropping the deletes does
not leak. find_fanin_fanouts and insert_buffer_before_loads_cmd take
PinSet*, which got no freearg, so they are untouched.

dbSta/test: refresh constant-width expected-fail entries.
parallaxsw/OpenSTA#489 replaced the std::stol that threw on an unsized
constant with STA-2724/STA-2725 warnings and a 1-bit default.
bx_constants_unsized_b0.v, bx_constants_unsized_d1.v and
structural/wb_sta_reader_const_negative_width.v now round-trip, so they leave
STRUCTURAL_EXPECTED_FAIL. The two bx_constants_* conformance entries still
fail but as tool-error rather than or-error: OpenROAD now emits a netlist
with the constant dropped, and kepler-formal will not load it -

setTermsNets only supported when terms (size: 1 [A2]) and nets share same size (size: 0)

Losing the connection silently instead of stopping is a behaviour change worth
raising upstream; recording the new mode does not endorse it.

Signed-off-by: Minju Kim <mkim@precisioninno.com>
OpenSTA 3a595df0 (parallaxsw/OpenSTA#470) added %typemap(freearg) for
InstanceSeq*, CellSeq* and the other Seq pointer types in tcl/StaTclTypes.i,
so the SWIG wrapper now frees the container it allocated in the (in) typemap.
Upstream dropped its own matching deletes in search/Search.i,
verilog/Verilog.i and sdc/FilterObjects.cc at the same time.

Two wrappers here still deleted the same container, so the callee and the
wrapper both freed it:

  remove_buffers_cmd(InstanceSeq*)                  src/rsz/src/Resizer.i
  write_verilog_cmd(..., CellSeq *remove_cells)     src/dbSta/src/dbSta.i

write_verilog_cmd is annotated "Copied from sta/verilog/Verilog.i"; upstream
fixed the original and this copy went stale. The double free shows up as
"Signal 11 received" with free in the stack trace, failing 13 tests:

  dbSta.write_verilog7, write_verilog9, write_verilog9_hier
  rsz.remove_buffers3, remove_buffers6, remove_buffers_hier1, repair_fanout3
  grt.remove_buffers1, remove_buffers2, remove_buffers3
  grt.remove_buffers1_cugr, remove_buffers2_cugr, remove_buffers3_cugr

Dropping the deletes does not leak: the freearg typemap frees the container
exactly once.

find_fanin_fanouts and insert_buffer_before_loads_cmd also delete their
argument, but that argument is PinSet*, which got no freearg typemap, so they
are left alone.

Signed-off-by: Minju Kim <mkim@precisioninno.com>
OpenSTA d2c508dd (parallaxsw/OpenSTA#489) rewrote the unsized-constant path in
verilog/VerilogReader.cc. It used to be

  size_t size = std::stol(csize);

which threw std::invalid_argument on 'd1 and on a negative width, so
read_verilog/link_design aborted and OpenROAD reported an error. It is now a
warning plus a 1-bit default:

  if (csize.empty())
    reader->warn(2724, ..., "unsized constant {} not supported.", constant);
  else { auto [size_value, valid] = stringLong(csize); ... }

Two consequences, both recorded here.

STRUCTURAL_EXPECTED_FAIL: read_verilog now accepts the input, so these three
round-trip and the framework reports them as unexpected passes.

  bx_constants_unsized_b0.v
  bx_constants_unsized_d1.v
  structural/wb_sta_reader_const_negative_width.v

Dropped from both the flat and hier lists. The remaining entries in those lists
still throw, from the stoi in the attribute parser, so they stay.

CONFORMANCE_EXPECTED_FAIL: the same two constant cases still fail, but no
longer as "or-error". OpenROAD now emits a netlist in which the constant has
been dropped, and kepler-formal refuses to load it:

  Netlist loading failed: In SNLVRLConstructor construct: setTermsNets only
  supported when terms (size: 1 [A2]) and nets share same size (size: 0)

so the observed mode is "tool-error". Recorded, with a comment noting that
losing the connection silently instead of stopping is a behaviour change worth
raising with upstream. Updating the entry does not endorse it.

Signed-off-by: Minju Kim <mkim@precisioninno.com>
@minjukim55 minjukim55 self-assigned this Aug 25, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request removes redundant memory deletions in dbSta.i and Resizer.i, updates the src/sta subproject commit, and adjusts the expected failure test configurations in hier_expected_fail.bzl to align with the updated OpenSTA behavior regarding unsized constants. There are no review comments, so I have no feedback to provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant