Skip to content

Commit 4527254

Browse files
authored
Merge pull request #348 from The-OpenROAD-Project-staging/sta_latest_from_parallaxsw_tidy_0416
Sta latest from parallaxsw tidy 0416
2 parents e71e5d7 + 7fe56cc commit 4527254

392 files changed

Lines changed: 4849 additions & 5973 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clang-tidy

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
Checks: >
2+
clang-diagnostic-*,
3+
clang-analyzer-*,
4+
-clang-analyzer-core.NonNullParamChecker,
5+
-clang-analyzer-core.CallAndMessage,
6+
-clang-analyzer-core.uninitialized.UndefReturn,
7+
-clang-analyzer-cplusplus.NewDeleteLeaks,
8+
-clang-analyzer-optin.performance.Padding,
9+
readability-*,
10+
-readability-identifier-naming,
11+
-readability-braces-around-statements,
12+
-readability-convert-member-functions-to-static,
13+
-readability-else-after-return,
14+
-readability-function-cognitive-complexity,
15+
-readability-inconsistent-ifelse-braces,
16+
-readability-identifier-length,
17+
-readability-implicit-bool-conversion,
18+
-readability-isolate-declaration,
19+
-readability-magic-numbers,
20+
-readability-make-member-function-const,
21+
-readability-math-missing-parentheses,
22+
-readability-named-parameter,
23+
-readability-qualified-auto,
24+
-readability-redundant-access-specifiers,
25+
-readability-simplify-boolean-expr,
26+
-readability-static-definition-in-anonymous-namespace,
27+
-readability-suspicious-call-argument,
28+
-readability-uppercase-literal-suffix,
29+
-readability-use-anyofallof,
30+
google-*,
31+
-google-readability-avoid-underscore-in-googletest-name,
32+
-google-readability-braces-around-statements,
33+
-google-readability-casting,
34+
-google-readability-todo,
35+
-google-runtime-references,
36+
-google-explicit-constructor,
37+
performance-*,
38+
-performance-enum-size,
39+
bugprone-*,
40+
-bugprone-branch-clone,
41+
-bugprone-easily-swappable-parameters,
42+
-bugprone-exception-escape,
43+
-bugprone-macro-parentheses,
44+
-bugprone-move-forwarding-reference,
45+
-bugprone-narrowing-conversions,
46+
-bugprone-suspicious-missing-comma,
47+
-bugprone-throwing-static-initialization,
48+
modernize-*,
49+
-modernize-avoid-bind,
50+
-modernize-avoid-c-arrays,
51+
-modernize-concat-nested-namespaces,
52+
-modernize-macro-to-enum,
53+
-modernize-pass-by-value,
54+
-modernize-raw-string-literal,
55+
-modernize-return-braced-init-list,
56+
-modernize-use-auto,
57+
-modernize-use-nodiscard,
58+
-modernize-use-trailing-return-type,
59+
-modernize-use-transparent-functors,
60+
misc-*,
61+
-misc-const-correctness,
62+
-misc-multiple-inheritance,
63+
-misc-no-recursion,
64+
-misc-non-private-member-variables-in-classes,
65+
-misc-redundant-expression,
66+
-misc-unused-parameters,
67+
-misc-use-anonymous-namespace,
68+
-misc-use-internal-linkage,
69+
-misc-include-cleaner
70+
71+
# Only report diagnostics in headers under this tree (app/, include/sta/, build-generated
72+
# headers, etc.).
73+
# Excludes system and third-party paths such as /opt/local/include.
74+
HeaderFilterRegex: '.*/(app|cmake|dcalc|graph|liberty|network|parasitics|power|sdc|sdf|search|spice|tcl|util|verilog|include/sta|build/include/sta)/.*'
75+
76+
# util/gzstream.hh
77+
# util/FlexDisableRegister.hh
78+
# Bison-generated parser headers (build/{Liberty,Verilog,...}Parse.hh)
79+
ExcludeHeaderFilterRegex: '(.*/)?(gzstream\.hh|FlexDisableRegister\.hh|(Liberty|Verilog|Sdf|Spef|Saif|LibExpr)Parse\.hh)$'
80+
FormatStyle: none

.cursor/rules/cpp-coding-standards.mdc

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,29 @@ alwaysApply: false
3131

3232
- C++ source: `.cc`
3333
- C++ headers: `.hh`
34+
35+
## Include order
36+
37+
Sort `#include` lines **lexicographically by the path inside** `<>`
38+
or `""` (case-sensitive). Separate **groups** with a single blank line.
39+
40+
### Translation units (`*.cc`)
41+
42+
1. **Primary header(s)** for this file only:
43+
- `#include "Stem.hh"` where `Stem` matches the basename of the `.cc` file (e.g. `Foo.cc` → `Foo.hh`).
44+
- If the file uses a paired private header, include `#include "StemPvt.hh"` **immediately after** `Stem.hh` (e.g. `MakeTimingModel.cc` → `MakeTimingModel.hh` then `MakeTimingModelPvt.hh`).
45+
- Do **not** pull in other headers just because their names share a prefix with `Stem` (e.g. `SearchClass.hh` is not a “primary” include for `Search.cc`; it belongs in the project group below).
46+
47+
2. **System / standard library** headers: `#include <...>` lines, sorted alphabetically.
48+
49+
3. **All other project** headers: `#include "..."` lines, sorted alphabetically (including `search/Crpr.hh`-style paths and includes from `liberty/`, etc.).
50+
51+
If a **comment or special block** intentionally splits the include list (e.g. a third-party note before `#include "cudd.h"`), keep that structure; sort only within each contiguous run of `#include` lines unless merging groups is clearly safe.
52+
53+
### Headers (`*.hh`)
54+
55+
After `#pragma once` (and the file’s license block, if present):
56+
57+
1. **System** `#include <...>` lines, sorted alphabetically.
58+
59+
2. **Project** `#include "..."` lines, sorted alphabetically.

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ jobs:
5454
name: artifact
5555
path: |
5656
build/install/*
57+
retention-days: 1
5758

5859
- name: Upload Test Result
5960
uses: actions/upload-artifact@v7

CMakeLists.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# OpenSTA, Static Timing Analyzer
2-
# Copyright (c) 2025, Parallax Software, Inc.
2+
# Copyright (c) 2026, Parallax Software, Inc.
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by
@@ -222,7 +222,6 @@ set(STA_SOURCE
222222
util/Error.cc
223223
util/Fuzzy.cc
224224
util/Hash.cc
225-
util/Machine.cc
226225
util/MinMax.cc
227226
util/PatternMatch.cc
228227
util/Report.cc
@@ -239,6 +238,16 @@ set(STA_SOURCE
239238
verilog/VerilogWriter.cc
240239
)
241240

241+
if(APPLE)
242+
list(APPEND STA_SOURCE util/MachineApple.cc)
243+
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
244+
list(APPEND STA_SOURCE util/MachineLinux.cc)
245+
elseif(WIN32)
246+
list(APPEND STA_SOURCE util/MachineWin32.cc)
247+
else()
248+
list(APPEND STA_SOURCE util/MachineUnknown.cc)
249+
endif()
250+
242251
# Source files.
243252
set(STA_TCL_FILES
244253
tcl/Init.tcl

app/StaMain.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,4 @@ unencode(const char *inits[])
148148
return unencoded;
149149
}
150150

151-
} // namespace
151+
} // namespace sta

cmake/FindTCL.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
# searching OSX system directories before unix directories.
2424

2525
set(TCL_POSSIBLE_NAMES
26+
#tcl90 tcl9.0
2627
tcl87 tcl8.7
2728
tcl86 tcl8.6
2829
tcl85 tcl8.5
@@ -32,6 +33,7 @@ set(TCL_POSSIBLE_NAMES
3233
if (NOT TCL_LIB_PATHS)
3334
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
3435
set(TCL_LIB_PATHS
36+
#/opt/homebrew/Cellar/tcl-tk/9.0.3/lib
3537
/opt/homebrew/Cellar/tcl-tk@8/8.6.17/lib
3638
/opt/homebrew/Cellar/tcl-tk@8/8.6.16/lib
3739
/opt/homebrew/opt/tcl-tk/lib /usr/local/lib)

dcalc/ArcDcalcWaveforms.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@
2222
//
2323
// This notice may not be removed or altered from any source distribution.
2424

25-
#include <memory>
26-
2725
#include "ArcDcalcWaveforms.hh"
2826

29-
#include "Report.hh"
30-
#include "Liberty.hh"
31-
#include "Network.hh"
32-
#include "Graph.hh"
27+
#include <memory>
28+
3329
#include "ArcDelayCalc.hh"
30+
#include "Graph.hh"
3431
#include "GraphDelayCalc.hh"
32+
#include "Liberty.hh"
33+
#include "Network.hh"
34+
#include "Report.hh"
3535

3636
namespace sta {
3737

@@ -83,4 +83,4 @@ ArcDcalcWaveforms::inputWaveform(ArcDcalcArg &dcalc_arg,
8383
return Waveform();
8484
}
8585

86-
} // namespace
86+
} // namespace sta

dcalc/ArcDcalcWaveforms.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@ protected:
5151
const StaState *sta);
5252
};
5353

54-
} // namespace
54+
} // namespace sta
5555

dcalc/ArcDelayCalc.cc

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
#include <cstdlib>
2828
#include <string>
2929

30-
#include "StringUtil.hh"
31-
#include "Units.hh"
30+
#include "Graph.hh"
3231
#include "Liberty.hh"
33-
#include "TimingArc.hh"
3432
#include "Network.hh"
35-
#include "Graph.hh"
33+
#include "StringUtil.hh"
34+
#include "TimingArc.hh"
35+
#include "Units.hh"
3636

3737
namespace sta {
3838

@@ -135,7 +135,7 @@ ArcDcalcArg::ArcDcalcArg(const Pin *in_pin,
135135
const Pin *drvr_pin,
136136
Edge *edge,
137137
const TimingArc *arc,
138-
const Slew in_slew,
138+
Slew in_slew,
139139
float load_cap,
140140
const Parasitic *parasitic) :
141141
in_pin_(in_pin),
@@ -165,17 +165,7 @@ ArcDcalcArg::ArcDcalcArg(const Pin *in_pin,
165165
{
166166
}
167167

168-
ArcDcalcArg::ArcDcalcArg(const ArcDcalcArg &arg) :
169-
in_pin_(arg.in_pin_),
170-
drvr_pin_(arg.drvr_pin_),
171-
edge_(arg.edge_),
172-
arc_(arg.arc_),
173-
in_slew_(arg.in_slew_),
174-
load_cap_(arg.load_cap_),
175-
parasitic_(arg.parasitic_),
176-
input_delay_(arg.input_delay_)
177-
{
178-
}
168+
ArcDcalcArg::ArcDcalcArg(const ArcDcalcArg &arg) = default;
179169

180170
const RiseFall *
181171
ArcDcalcArg::inEdge() const
@@ -305,4 +295,4 @@ ArcDcalcResult::setLoadSlew(size_t load_idx,
305295
load_slews_[load_idx] = load_slew;
306296
}
307297

308-
} // namespace
298+
} // namespace sta

dcalc/Arnoldi.hh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class arnoldi1
4545
public:
4646
arnoldi1() { order=0; n=0; d=nullptr; e=nullptr; U=nullptr; ctot=0.0; sqc=0.0; }
4747
~arnoldi1();
48-
double elmore(int term_index);
48+
double elmore(int k);
4949

5050
//
5151
// calculate poles/residues for given rdrive
@@ -70,12 +70,12 @@ class rcmodel : public ConcreteParasitic,
7070
{
7171
public:
7272
rcmodel();
73-
virtual ~rcmodel();
74-
virtual float capacitance() const;
75-
virtual PinSet unannotatedLoads(const Pin *drvr_pin,
76-
const Parasitics *parasitics) const;
73+
~rcmodel() override;
74+
float capacitance() const override;
75+
PinSet unannotatedLoads(const Pin *drvr_pin,
76+
const Parasitics *parasitics) const override;
7777

78-
const Pin **pinV; // [n]
78+
const Pin **pinV{nullptr}; // [n]
7979
};
8080

8181
struct timing_table
@@ -86,4 +86,4 @@ struct timing_table
8686
float in_slew;
8787
};
8888

89-
} // namespace
89+
} // namespace sta

0 commit comments

Comments
 (0)