Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .cursor/rules/cpp-coding-standards.mdc
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
---
description: C++ coding standards and formatting for OpenSTA
globs: ["**/*.cc", "**/*.hh", "**/*.h"]
alwaysApply: false
alwaysApply: true
---

# C++ Coding Standards

## File-internal helpers (translation-unit local)

- For helpers used only in one `.cc` file, put them in the **same namespace** as the rest of the implementation (e.g. `namespace sta { ... }`).
- Mark them **`static`** at namespace scope so they have internal linkage.
- **Do not** wrap them in an **anonymous namespace** in this project (no `namespace { ... }` file-static helpers). The user preference is `static` inside the real namespace, not a nested anonymous namespace inside `sta` or at file scope before `sta`.

## Line Width

- **Keep lines under 90 characters** to match `.clang-format` (ColumnLimit: 90).
- Break long lines at logical points: after commas, before operators, after opening parens.
- Only break a line when it would exceed 90 characters. Do not introduce unnecessary line breaks when the expression fits on one line.
- When a break is needed, break at logical points: after commas, before operators. Keep the first argument on the same line as the opening paren (do not break immediately after an opening paren).

## Naming Conventions

Expand Down
46 changes: 46 additions & 0 deletions Dockerfile.ubuntu24.04
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
FROM ubuntu:24.04
LABEL author="James Cherry"
LABEL maintainer="James Cherry <cherry@parallaxsw.com>"

# Install basics
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y \
git \
wget \
cmake \
gcc \

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 package list includes gcc but is missing g++ (or build-essential). Since OpenSTA is a C++ project, the build will fail during the CMake compilation phase if a C++ compiler is not installed. Please add g++ to the package list.

    gcc \\
    g++ \\

gdb \
tcl-dev \
tcl-tclreadline \
swig \
bison \
flex \
automake \
autotools-dev \
libeigen3-dev \
libfmt-dev

# Download CUDD
RUN wget https://raw.githubusercontent.com/davidkebo/cudd/main/cudd_versions/cudd-3.0.0.tar.gz && \
tar -xvf cudd-3.0.0.tar.gz && \
rm cudd-3.0.0.tar.gz

# Build CUDD
RUN cd cudd-3.0.0 && \
mkdir ../cudd && \
./configure && \
make -j`nproc`

# Copy files and install OpenSTA
RUN mkdir OpenSTA
COPY . OpenSTA
RUN cd OpenSTA && \
rm -rf build && \
mkdir build && \
cd build && \
cmake -DCUDD_DIR=../cudd-3.0.0 .. && \
make -j`nproc`

# Run sta on entry
ENTRYPOINT ["OpenSTA/build/sta"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ following command builds a Docker image.

```
cd OpenSTA
docker build --file Dockerfile.ubuntu22.04 --tag opensta_ubuntu22.04 .
docker build --file Dockerfile.ubuntu24.04 --tag opensta_ubuntu24.04 .
or
docker build --file Dockerfile.centos7 --tag opensta_centos7 .
```
Expand Down
10 changes: 5 additions & 5 deletions cmake/FindTCL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ set(TCL_POSSIBLE_NAMES
tcl85 tcl8.5
)

# tcl lib path guesses.
# TCL lib path guesses.
if (NOT TCL_LIB_PATHS)
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
file(GLOB tcl_homebrew_libs
/opt/homebrew/Cellar/tcl-tk@8/*/lib
)
set(TCL_LIB_PATHS
#/opt/homebrew/Cellar/tcl-tk/9.0.3/lib
/opt/homebrew/Cellar/tcl-tk@8/8.6.18/lib
/opt/homebrew/Cellar/tcl-tk@8/8.6.17/lib
/opt/homebrew/Cellar/tcl-tk@8/8.6.16/lib
${tcl_homebrew_libs}
/opt/homebrew/opt/tcl-tk/lib /usr/local/lib)
set(TCL_NO_DEFAULT_PATH TRUE)
elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
Expand Down
10 changes: 5 additions & 5 deletions doc/ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ Release 3.0.1 2026/03/12
------------------------

Statistical timing (SSTA) with Liberty LVF (Liberty Variation Format)
models is now supported. Statistical timing uses a probaility
distribution to represent a delay or slew ranther than a single
models is now supported. Statistical timing uses a probability
distribution to represent a delay or slew rather than a single
number.

Normal and skew normal probability distributions are supported.

SSTA is enabled with the sta_pocv_mode variaable.
SSTA is enabled with the sta_pocv_mode variable.

set sta_pocv_mode scalar|normal|skew_normal

Expand All @@ -43,10 +43,10 @@ set with the sta_pocv_quantile variable.

The default value is 3 standard deviations, or sigma.

Use the variance field with report_checks or report_check_types to see
Use the variation field with report_checks or report_check_types to see
distribution parameters in timing reports.

A command file for analyzing a design with statisical timing with an
A command file for analyzing a design with statistical timing with an
LVF library is shown below.

read_liberty lvf_library.lib.gz
Expand Down
14 changes: 7 additions & 7 deletions doc/OpenSTA.fodt
Original file line number Diff line number Diff line change
Expand Up @@ -6639,15 +6639,15 @@
<text:p text:style-name="P17">This example can be found in <text:span text:style-name="T8">examples/</text:span><text:span text:style-name="T10">mcmm3</text:span><text:span text:style-name="T8">.tcl</text:span>.<text:line-break/><text:line-break/><text:span text:style-name="T6">In the example show above the SDC for the modes is in separate files. Alternatively, the SDC can be defined in the command file using the </text:span><text:span text:style-name="T13">set_mode</text:span><text:span text:style-name="T6"> command between SDC command groups.</text:span></text:p>
<text:p text:style-name="P18"><text:span text:style-name="T6">set_mode mode1<text:line-break/>create_clock -name m1_clk -period 1000 {clk1 clk2 clk3}<text:line-break/></text:span>set_input_delay -clock m1_clk 100 {in1 in2}<text:line-break/><text:line-break/><text:span text:style-name="T6">set_mode mode2<text:line-break/>create_clock -name m2_clk -period 500 {clk1 clk3}<text:line-break/></text:span>set_output_delay -clock m2_clk 100 out</text:p>
<text:h text:style-name="P19" text:outline-level="2"><text:bookmark-start text:name="__RefHeading___Toc42583_2528141652 Copy 1"/>Statistical Timing Analysis<text:bookmark-end text:name="__RefHeading___Toc42583_2528141652 Copy 1"/></text:h>
<text:p text:style-name="Body_20_first">OpenSTA also supports <text:span text:style-name="T14">statistical timing </text:span>.<text:span text:style-name="T14">anallysis with Liberty Variation Format (LVF) libraries. Statistical timing uses a probaility </text:span>distribution to represent a delay or slew ranther than a single number.</text:p>
<text:p text:style-name="P20"><text:soft-page-break/>Normal and skew normal probability distributions are supported. <text:s/>SSTA is enabled with the <text:span text:style-name="T12">sta_pocv_mode</text:span> variaable.</text:p>
<text:p text:style-name="Body_20_first">OpenSTA also supports <text:span text:style-name="T14">statistical timing </text:span><text:span text:style-name="T14">analysis with Liberty Variation Format (LVF) libraries. Statistical timing uses a probability </text:span>distribution to represent a delay or slew rather than a single number.</text:p>
<text:p text:style-name="P20"><text:soft-page-break/>Normal and skew normal probability distributions are supported. <text:s/>SSTA is enabled with the <text:span text:style-name="T12">sta_pocv_mode</text:span> variable.</text:p>
<text:p text:style-name="Example_20__20_indented">set sta_pocv_mode scalar|normal|skew_normal<text:line-break/><text:line-break/><text:span text:style-name="T15">scalar mode is for non-SSTA analysis<text:line-break/>normal mode uses gaussian normal distributions<text:line-break/>skew_normal mode is for skew normal LVF moment based distributions</text:span></text:p>
<text:p text:style-name="P20">The target quantile of a delay probability distribution (confidence level) is set with the <text:span text:style-name="T12">sta_pocv_quantile</text:span> variable.</text:p>
<text:p text:style-name="Example_20__20_indented"><text:span text:style-name="T16">set </text:span>sta_pocv_quantile &lt;float&gt;</text:p>
<text:p text:style-name="P20">The default value is 3 standard deviations, or sigma.</text:p>
<text:p text:style-name="P21"><text:span text:style-name="T16">Use the </text:span><text:span text:style-name="T12">variance</text:span> <text:span text:style-name="T16">field with the </text:span>report_checks <text:span text:style-name="T16">and</text:span> report_check_types <text:span text:style-name="T16">commands to see distribution parameters in timing reports.</text:span></text:p>
<text:p text:style-name="P22">A command file for analyzing a design with statisical timing is shown below.</text:p>
<text:p text:style-name="Example_20__20_indented"><text:soft-page-break/>read_liberty lvf_library.lib.gz<text:line-break/>read_verilog design.v<text:line-break/>link_design topcreate_clock -period 50 clk<text:line-break/>set_input_delay -clock clk 1 {in1 in2}<text:line-break/>set sta_pocv_mode skew_normal<text:line-break/>report_checks -fields {slew variation input_pin variation} -digits 3</text:p>
<text:p text:style-name="P21"><text:span text:style-name="T16">Use the </text:span><text:span text:style-name="T12">variation</text:span> <text:span text:style-name="T16">field with the </text:span>report_checks <text:span text:style-name="T16">and</text:span> report_check_types <text:span text:style-name="T16">commands to see distribution parameters in timing reports.</text:span></text:p>
<text:p text:style-name="P22">A command file for analyzing a design with statistical timing is shown below.</text:p>
<text:p text:style-name="Example_20__20_indented"><text:soft-page-break/>read_liberty lvf_library.lib.gz<text:line-break/>read_verilog design.v<text:line-break/>link_design topcreate_clock -period 50 clk<text:line-break/>set_input_delay -clock clk 1 {in1 in2}<text:line-break/>set sta_pocv_mode skew_normal<text:line-break/>report_checks -fields {slew variation input_pin} -digits 3</text:p>
<text:p text:style-name="Example_20__20_indented"><text:soft-page-break/><text:span text:style-name="T16">Startpoint: r2 (rising edge-triggered flip-flop clocked by clk)<text:line-break/>Endpoint: r3 (rising edge-triggered flip-flop clocked by clk)<text:line-break/>Path Group: clk<text:line-break/>Path Type: max<text:line-break/><text:line-break/> <text:s text:c="3"/>Slew <text:s text:c="3"/>Delay Variation <text:s text:c="4"/>Time <text:s text:c="2"/>Description<text:line-break/>---------------------------------------------------------------------------<text:line-break/> <text:s text:c="2"/>0.000 <text:s text:c="3"/>0.000 <text:s text:c="12"/>0.000 <text:s text:c="2"/>clock clk (rise edge)<text:line-break/> <text:s text:c="11"/>0.000 <text:s text:c="12"/>0.000 <text:s text:c="2"/>clock network delay (ideal)<text:line-break/> <text:s text:c="2"/>0.000 <text:s text:c="3"/>0.000 <text:s text:c="12"/>0.000 ^ r2/CK (FDPQ1)<text:line-break/> <text:s text:c="19"/>12.026 <text:s text:c="11"/>mean<text:line-break/> <text:s text:c="20"/>0.017 <text:s text:c="11"/>mean_shift<text:line-break/> <text:s text:c="20"/>0.366 <text:s text:c="11"/>std_dev<text:line-break/> <text:s text:c="20"/>0.000 <text:s text:c="11"/>skewness<text:line-break/> <text:s text:c="2"/>4.648 <text:s text:c="2"/>12.409 <text:s text:c="11"/>12.409 v r2/Q (FFQ1)<text:line-break/> <text:s text:c="2"/>4.648 <text:s text:c="3"/>0.000 <text:s text:c="11"/>12.409 v u1/A (BUF1)<text:line-break/> <text:s text:c="20"/>6.084 <text:s text:c="11"/>mean<text:line-break/> <text:s text:c="20"/>0.007 <text:s text:c="11"/>mean_shift<text:line-break/> <text:s text:c="20"/>0.188 <text:s text:c="11"/>std_dev<text:line-break/> <text:s text:c="20"/>0.000 <text:s text:c="11"/>skewness<text:line-break/> <text:s text:c="2"/>2.513 <text:s text:c="3"/>6.137 <text:s text:c="11"/>18.546 v u1/X (BUF1)<text:line-break/> <text:s text:c="2"/>2.513 <text:s text:c="3"/>0.000 <text:s text:c="11"/>18.546 v u2/A2 (AN21)<text:line-break/> <text:s text:c="20"/>6.447 <text:s text:c="11"/>mean<text:line-break/> <text:s text:c="20"/>0.008 <text:s text:c="11"/>mean_shift<text:line-break/> <text:s text:c="20"/>0.191 <text:s text:c="11"/>std_dev<text:line-break/> <text:s text:c="20"/>0.000 <text:s text:c="11"/>skewness<text:line-break/> <text:s text:c="2"/>2.565 <text:s text:c="3"/>6.497 <text:s text:c="11"/>25.043 v u2/X (AN21)<text:line-break/> <text:s text:c="2"/>2.565 <text:s text:c="3"/>0.000 <text:s text:c="11"/>25.043 v r3/D (FFQ1)<text:line-break/> <text:s text:c="28"/>25.043 <text:s text:c="2"/>data arrival time<text:line-break/></text:span><text:line-break/> <text:s text:c="2"/>0.000 <text:s text:c="2"/>50.000 <text:s text:c="11"/>50.000 <text:s text:c="2"/>clock clk (rise edge)<text:line-break/> <text:s text:c="11"/>0.000 <text:s text:c="11"/>50.000 <text:s text:c="2"/>clock network delay (ideal)<text:line-break/> <text:s text:c="11"/>0.000 <text:s text:c="11"/>50.000 <text:s text:c="2"/>clock reconvergence pessimism<text:line-break/> <text:s text:c="28"/>50.000 ^ r3/CK (FFQ1)<text:line-break/> <text:s text:c="10"/>-9.376 <text:s text:c="11"/>40.624 <text:s text:c="2"/>library setup time<text:line-break/> <text:s text:c="28"/>40.624 <text:s text:c="2"/>data required time<text:line-break/>---------------------------------------------------------------------------<text:line-break/> <text:s text:c="28"/>40.624 <text:s text:c="2"/>data required time<text:line-break/> <text:s text:c="27"/>-25.043 <text:s text:c="2"/>data arrival time<text:line-break/>---------------------------------------------------------------------------<text:line-break/> <text:s text:c="28"/>15.581 <text:s text:c="2"/>slack (MET)</text:p>
<text:p text:style-name="P23">The standard deviation for <text:span text:style-name="T14">n</text:span>ormal distributions is specified with the following liberty timing groups.</text:p>
<text:p text:style-name="P24"><text:soft-page-break/>ocv_sigma_cell_rise<text:line-break/>ocv_sigma_cell_fall<text:line-break/>ocv_sigma_rise_transition<text:line-break/>ocv_sigma_fall_transition<text:line-break/>ocv_sigma_rise_constraint<text:line-break/>ocv_sigma_fall_constraint</text:p>
Expand Down Expand Up @@ -9532,7 +9532,7 @@
<text:p text:style-name="P160">fields</text:p>
</table:table-cell>
<table:table-cell table:style-name="Table52.A2" office:value-type="string">
<text:p text:style-name="P151"><text:span text:style-name="Default_20_Paragraph_20_Font">List of </text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T12">capacitance|slew|input_pins|</text:span></text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T173">hierarc</text:span></text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T174">h</text:span></text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T173">i</text:span></text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T174">c</text:span></text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T173">al_pins|</text:span></text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T12">nets|fanout</text:span></text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T175">|src_attr</text:span></text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T176">|variance</text:span></text:span></text:p>
<text:p text:style-name="P151"><text:span text:style-name="Default_20_Paragraph_20_Font">List of </text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T12">capacitance|slew|input_pins|</text:span></text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T173">hierarc</text:span></text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T174">h</text:span></text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T173">i</text:span></text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T174">c</text:span></text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T173">al_pins|</text:span></text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T12">nets|fanout</text:span></text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T175">|src_attr</text:span></text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T176">|variation</text:span></text:span></text:p>
</table:table-cell>
</table:table-row>
<table:table-row table:style-name="Table52.1">
Expand Down Expand Up @@ -9611,7 +9611,7 @@
<text:p text:style-name="P167">fields</text:p>
</table:table-cell>
<table:table-cell table:style-name="Table59.A2" office:value-type="string">
<text:p text:style-name="P164"><text:span text:style-name="Default_20_Paragraph_20_Font">List of </text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T12">capacitance|slew|input_pins|</text:span></text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T173">hierarc</text:span></text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T174">h</text:span></text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T173">i</text:span></text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T174">c</text:span></text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T173">al_pins|</text:span></text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T12">nets|fanout</text:span></text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T175">|src_attr</text:span></text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T176">|variance</text:span></text:span></text:p>
<text:p text:style-name="P164"><text:span text:style-name="Default_20_Paragraph_20_Font">List of </text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T12">capacitance|slew|input_pins|</text:span></text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T173">hierarc</text:span></text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T174">h</text:span></text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T173">i</text:span></text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T174">c</text:span></text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T173">al_pins|</text:span></text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T12">nets|fanout</text:span></text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T175">|src_attr</text:span></text:span><text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T176">|variation</text:span></text:span></text:p>
</table:table-cell>
</table:table-row>
<table:table-row table:style-name="Table59.1">
Expand Down
Binary file modified doc/OpenSTA.pdf
Binary file not shown.
21 changes: 5 additions & 16 deletions graph/Graph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -384,13 +384,6 @@ Graph::makeWireEdge(const Pin *from_pin,
}
}

void
Graph::makeSceneAfter()
{
ap_count_ = dcalcAnalysisPtCount();
initSlews();
}

////////////////////////////////////////////////////////////////

Vertex *
Expand Down Expand Up @@ -782,17 +775,13 @@ Graph::removeDelayAnnotated(Edge *edge)

////////////////////////////////////////////////////////////////

// This only gets called if the analysis type changes from single
// to bc_wc/ocv or visa versa.
void
Graph::setDelayCount(DcalcAPIndex ap_count)
Graph::delayCountChanged()
{
if (ap_count != ap_count_) {
// Discard any existing delays.
removePeriodCheckAnnotations();
ap_count_ = ap_count;
initSlews();
}
ap_count_ = dcalcAnalysisPtCount();
// Discard any existing delays.
removePeriodCheckAnnotations();
initSlews();
}

void
Expand Down
Loading