Merge upstream OpenSTA 08/24 - #404
Conversation
… (#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>
# Conflicts: # .gitignore
|
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. |
There was a problem hiding this comment.
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.
| else { | ||
| cpin->net_ = cnet; | ||
| connectNetPin(cnet, cpin); | ||
| } |
There was a problem hiding this comment.
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);
}| lappend opts $canon | ||
| } | ||
| } | ||
| foreach match [regexp -all -inline -- {-[a-zA-Z][a-zA-Z0-9_]*} $arglist] { |
There was a problem hiding this comment.
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] {
| 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] } { |
There was a problem hiding this comment.
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] } {
| for (const MinMax *min_max : min_max->range()) | ||
| scene->addLiberty(lib, min_max); |
There was a problem hiding this comment.
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);| proc cmd_opt_anchor { cmd opt } { | ||
| return "opt-$cmd-[string range $opt 1 end]" | ||
| } |
There was a problem hiding this comment.
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"
}
| -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.} |
| -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.} |
| 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. |
| [-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.} \ |
There was a problem hiding this comment.
| [-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.} \ |
There was a problem hiding this comment.
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.} \
|
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. 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 |
Merge
parallaxsw/OpenSTAmaster (737b52f3).src/stabump plus the OpenROAD changes this merge needs:The-OpenROAD-Project/OpenROAD#11226
%typemap(freearg), soremove_buffers_cmdandwrite_verilog_cmdhad tostop deleting them - double free, 13 tests.
std::stolon an unsized constant into anSTA-2724/STA-2725warning, which invalidated fivehier_expected_fail.bzlentries. 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-mergebuilds OpenROADmasteragainst this branch, so it is reduntil #11226 lands.