Skip to content

Merge upstream OpenSTA 08/24 - #404

Open
minjukim55 wants to merge 23 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:secure-sta_update_0824
Open

Merge upstream OpenSTA 08/24#404
minjukim55 wants to merge 23 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:secure-sta_update_0824

Conversation

@minjukim55

@minjukim55 minjukim55 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Merge parallaxsw/OpenSTA master (737b52f3).

src/sta bump plus the OpenROAD changes this merge needs:
The-OpenROAD-Project/OpenROAD#11226

  • #470 moved ownership of the SWIG-allocated Seq containers to a
    %typemap(freearg), so remove_buffers_cmd and write_verilog_cmd had to
    stop deleting them - double free, 13 tests.
  • #489 turned the throwing std::stol on an unsized constant into an
    STA-2724/STA-2725 warning, which invalidated five hier_expected_fail.bzl
    entries. Worth a look: input that used to stop the reader now yields a netlist
    with the constant dropped, which kepler-formal will not load.

CI-Public/pr-merge builds OpenROAD master against this branch, so it is red
until #11226 lands.

akashlevy and others added 23 commits August 15, 2026 12:01
… (#487)

* FEATURE: MkDocs documentation generated from Tcl command help

Replace the OpenOffice manual with Markdown. Command, variable, and
CLI docs are generated from define_cmd_args / define_var_help so help
and the website stay in sync.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Regenerate messages.md after merging upstream delay-calc line shifts.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Wrap generated command synopses one option per line.

Long usage lines were forcing horizontal scroll in the docs preview.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Link synopsis option flags to their option descriptions.

Markdown code fences cannot contain links, so the generated synopsis
is HTML with per-command option anchors.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: James Cherry <cherry@CerezoBook.local>
Signed-off-by: James Cherry <cherry@CerezoBook.local>
Signed-off-by: James Cherry <cherry@CerezoBook.local>
Signed-off-by: James Cherry <cherry@CerezoBook.local>
Signed-off-by: James Cherry <cherry@CerezoBook.local>
Signed-off-by: James Cherry <cherry@CerezoBook.local>
Signed-off-by: dsengupta0628 <dsengupta@precisioninno.com>
non_seq_setup/hold timing types were omitted from setSetupAccting and
setHoldAccting, so release and capture incorrectly shared the same edge.

Co-authored-by: Cursor <cursoragent@cursor.com>
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5 to 7.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v5...v7)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…#491)

* Use Liberty retain tables as min-path contamination delay.

Memories and similar cells characterize how long an output keeps its
previous value separately from propagation delay. Parse retaining_rise,
retaining_fall, retain_rise_slew, and retain_fall_slew and use them for
min delay calculation.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Drop ChangeLog and ApiChanges notes from the retain-arc change.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Address review comments on retain arcs.

Restore model() instead of arcModel, drop the retain-model fallback,
remove redundant path sentinels, and extract makeRetainTableModels.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
* Fix double-free of SWIG-allocated Seq containers.

Transfer ownership of PinSeq/PortSeq/etc. to SWIG freearg typemaps and
remove matching manual deletes in FilterObjects and fanin/fanout wrappers.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Remove extra blank lines after freearg typemaps.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Regenerate Messages.md after merging master.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Run SWIG freearg after STA exceptions so filter Seq inputs do not leak.

Exception.i returned TCL_ERROR from the catch, which skipped the wrapper
fail: cleanup. That leaked tclListSeqPtr containers on get_filter's
invalid ~= path after the C++ deletes were removed. Use SWIG_fail instead,
and add regressions for the success-path double-free and the error-path leak.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Drop comments that only note types without a freearg typemap.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: James Cherry <cherry@CerezoBook.local>
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: James Cherry <cherry@CerezoBook.local>
* Generate command docs at documentation build time instead of checking them in.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Place generated command docs in doc/ before the MkDocs CI job.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: James Cherry <cherry@CerezoBook.local>
* Disable GitHub Pages; docs are published on Read the Docs.

The Pages workflow fails because Pages is not enabled, and documentation
already lives at opensta.readthedocs.io.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Drop GitHub Pages mentions from command-doc build comments.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: dependabot[bot] <support@github.com>
@minjukim55 minjukim55 self-assigned this Aug 24, 2026
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 5 committers have signed the CLA.

✅ dsengupta0628
✅ minjukim55
❌ James Cherry
❌ dependabot[bot]
❌ akashlevy


James Cherry seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

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

Copy link
Copy Markdown

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 introduces a comprehensive documentation generation system using MkDocs and Read the Docs, adding detailed help text and argument descriptions to numerous Tcl commands and variables. It also adds support for Liberty contamination delay tables (retaining_* and retain_*_slew), fixes SWIG memory leaks and double-free issues, and hardens ConcreteNetwork against memory corruption from bus and bundle ports. The review feedback highlights several critical issues in the new code, including a potential null pointer dereference in ConcreteNetwork.cc, regular expression bugs in tcl/Util.tcl and etc/WriteCmdDocs.tcl that truncate hyphenated options, incorrect anchor generation for positional arguments, variable shadowing in search/Sta.cc, and unsafe /tmp usage in etc/build_sta.sh, alongside various typos in the newly added help texts.

Comment on lines +1442 to +1445
else {
cpin->net_ = cnet;
connectNetPin(cnet, cpin);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

If cnet is nullptr, calling connectNetPin(cnet, cpin) will result in a null pointer dereference and crash, as connectNetPin directly calls net->addPin(pin). Since cnet can be nullptr (as evidenced by the if (cnet) guard in the top_instance_ block above), we should also guard the connectNetPin call here.

    else {
      cpin->net_ = cnet;
      if (cnet)
        connectNetPin(cnet, cpin);
    }

Comment thread tcl/Util.tcl
lappend opts $canon
}
}
foreach match [regexp -all -inline -- {-[a-zA-Z][a-zA-Z0-9_]*} $arglist] {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The regular expression {-[a-zA-Z][a-zA-Z0-9_]*} does not allow hyphens inside option names. For commands with hyphenated options (such as -highest_power_instances, -subtract_pin_load, or -stop_propagation), this regular expression will truncate the option name to its first hyphenated segment (e.g., -highest, -subtract, or -stop). This breaks help generation and documentation lookup for these options. Consider updating the pattern to allow hyphens.

  foreach match [regexp -all -inline -- {-[a-zA-Z][-a-zA-Z0-9_]*} $arglist] {

Comment thread etc/WriteCmdDocs.tcl
set n [string length $token]
while { $i < $n } {
set rest [string range $token $i end]
if { [regexp {^(-[a-zA-Z][a-zA-Z0-9_]*)} $rest match] } {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Similar to the issue in tcl/Util.tcl, the regular expression ^(-[a-zA-Z][a-zA-Z0-9_]*) will truncate any option containing a hyphen (e.g., -highest_power_instances -> -highest), causing incorrect anchor links and broken documentation generation. Consider updating the pattern to allow hyphens.

    if { [regexp {^(-[a-zA-Z][-a-zA-Z0-9_]*)} $rest match] } {

Comment thread search/Sta.cc
Comment on lines +2738 to +2739
for (const MinMax *min_max : min_max->range())
scene->addLiberty(lib, min_max);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The loop variable min_max shadows the parameter min_max of the enclosing function. While valid in C++, this shadowing is highly confusing and can trigger compiler warnings (e.g., -Wshadow). Consider renaming the loop variable to mm or m to improve readability and maintainability.

      for (const MinMax *mm : min_max->range())
        scene->addLiberty(lib, mm);

Comment thread etc/WriteCmdDocs.tcl
Comment on lines +120 to +122
proc cmd_opt_anchor { cmd opt } {
return "opt-$cmd-[string range $opt 1 end]"
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The cmd_opt_anchor procedure assumes that all options start with a hyphen - and unconditionally strips the first character using string range $opt 1 end. However, for positional arguments (such as delay or slew), this results in incorrect anchor names like opt-set_assigned_delay-elay or opt-set_assigned_transition-lew. Consider checking if the option starts with a hyphen before stripping it.

proc cmd_opt_anchor { cmd opt } {
  if { [string index $opt 0] == "-" } {
    set opt [string range $opt 1 end]
  }
  return "opt-$cmd-$opt"
}

Comment thread sdc/Sdc.tcl
-clock {`clock`: The arrival time is from clock.}
-clock_fall {The arrival time is from the falling edge of clock.}
-reference_pin {`ref_pin`: The arrival time is with respect to the clock that arrives at ref_pin.}
-source_latency_included {D no add the clock source latency (insertion delay) to the delay value.}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

There is a typo in the help text for -source_latency_included: "D no add" instead of "Do not add".

    -source_latency_included {Do not add the clock source latency (insertion delay) to the delay value.}

Comment thread search/Search.tcl
-recovery {Report asynchronous recovery checks.}
-removal {Report asynchronous removal checks.}
-clock_gating_setup {Report gated clock enable setup checks.}
-clock_gating_hold {Report gated clock hold setup checks.}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

There is a copy-paste error in the description of -clock_gating_hold, which says "hold setup checks" instead of "hold checks" or "enable hold checks".

    -clock_gating_hold {Report gated clock enable hold checks.}

Comment thread search/Search.tcl
set_timing_derate
```

Using `set_input_transition` with the slew from the block context will be used will improve the match between the timing model and the block netlist. Paths defined on clocks that are defined on internal pins are ignored because the model has no way to include the clock definition.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

There is a grammatical error/typo in the help text: "will be used will improve" instead of "will improve".

Using set_input_transition with the slew from the block context will improve the match between the timing model and the block netlist.

Comment thread tcl/Sta.tcl
[-levels level_count] [-pin_levels pin_count]\
[-trace_arcs timing|enabled|all]}
[-trace_arcs timing|enabled|all]} \
-help {The `get_fanin` command returns traverses the design from sink_list pins, ports or nets backwards and return the fanin pins or instances.} \

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

There is a grammatical error in the get_fanin help text: "returns traverses" instead of "traverses", and "and return" instead of "and returns".

  -help {The get_fanin command traverses the design from sink_list pins, ports or nets backwards and returns the fanin pins or instances.} \

Comment thread tcl/Sta.tcl
[-levels level_count] [-pin_levels pin_count]\
[-trace_arcs timing|enabled|all]}
[-trace_arcs timing|enabled|all]} \
-help {The `get_fanout` command returns traverses the design from source_list pins, ports or nets backwards and return the fanout pins or instances.} \

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Similar to get_fanin, there is a grammatical error in the get_fanout help text: "returns traverses" instead of "traverses", and "and return" instead of "and returns".

  -help {The get_fanout command traverses the design from source_list pins, ports or nets backwards and returns the fanout pins or instances.} \

@dsengupta0628

Copy link
Copy Markdown
Contributor

Hi Minju. Please check the reviews from Gemini. Sometimes it is actually able to find some true issues, then those will need to be followed up. I usually create a very minimal test (in parallaxsw/OpenSTA fork not this one) to depict any problematic issue and let James fix it upstream or I propose the fix too and he either takes it or explains the caveats what that situation is not possible. Of course you can ignore the comments about spelling mistakes and what not from Gemini- James typically fixes them in subsequent commits.

Also, you can reference the OpenROAD PR that bumps the src/sta to this version with whatever changes required in OpenROAD for this CI to pass.. sometimes those can expose issues with the OpenSTA changes too- then we again have to follow up- otherwise, for mechanical changes, you can just add them here.

Please note that while a cronjob is good to pull the changes regularly, I think you may need some more manual intervention- this PR's description is unnecessarily large. For example, the "Merge conflict resolved section" is not needed here- the change in .gitignore was rather simple to resolve- this section would be helpful if and when our repo deviates significantly from upstream repo- but not now.
Also, this PR description refers to private repos here which has no place in a public PR.

Finally the PR says "Generated by etc/sta_sync/sta_sync.sh". where is this file? Unless it is part of a public repo, please do not mention here- or maybe consider merging this script to the public repo for us to use - please check with @maliberty for that

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.

4 participants