Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
ef2b48c
[#80124] wip: saving timing clk/output paths
magancarz Jul 9, 2025
79a395c
[#80124] wip: saving clk-pin timing paths
magancarz Jul 9, 2025
7eb4fbc
[#80124] prototype of printing timing paths vertices
magancarz Jul 10, 2025
410af1a
[#80124] save simple setuphold timing paths to liberty
magancarz Jul 10, 2025
ba22596
[#80124] add extracting timing path slack and data arrival time values
magancarz Jul 10, 2025
a8b75f0
[#80124] wip: exporting slack, data arrival time and data required ti…
magancarz Jul 11, 2025
f1a44e9
[#80124] add distinction between data arrival and data required paths
magancarz Jul 11, 2025
3927b9a
[#80124] add saving data required path
magancarz Jul 11, 2025
78f7379
[#80124] separate setup/hold timing path infos
magancarz Jul 11, 2025
5957010
[#80124] wip: clk-output timing paths
magancarz Jul 14, 2025
c3723d6
[#80124] change the way of saving worst slack timing path so OpenSTA …
magancarz Jul 15, 2025
d6545d1
[#80124] test extracting worst slack path slack value from liberty
magancarz Jul 15, 2025
3c961a6
Revert "[#80124] change the way of saving worst slack timing path so …
magancarz Jul 16, 2025
3370910
[#80124] save timing paths in a subgroup
magancarz Jul 16, 2025
0f25115
[#80124] clean up timing path merging code
magancarz Jul 16, 2025
db69391
[#80124] make timing paths saving more universal
magancarz Jul 16, 2025
0d3af03
[#80124] save timing paths time values as floats
magancarz Jul 16, 2025
35ed864
[#80124] save read timing paths values to TimingArcAttrs
magancarz Jul 16, 2025
90eb7d7
[#80478] add initial version of saving register - output timing paths
magancarz Jul 16, 2025
2579756
[#80124] save vertices arrival time
magancarz Jul 16, 2025
70264fb
[#80124] wip: saving combinational timing paths
magancarz Jul 16, 2025
58ea43f
[#80124] fetch design clock to calculate combinational path slack
magancarz Jul 17, 2025
56d9f9a
[#80124] add reading delay and combinational paths
magancarz Jul 18, 2025
fe1a0cc
[#80124] wip: using previously exported timing paths in timing checks
magancarz Jul 18, 2025
710150f
[#80124] convert loaded timing path parameters to correct time unit
magancarz Jul 18, 2025
d011da5
[#80124] wip: save data required path margin for now
magancarz Jul 18, 2025
589d454
[#80124] add test files
magancarz Jul 18, 2025
4e0f5ab
[#80124] wip: comparing exported timing paths with calculated delays
magancarz Jul 18, 2025
59beb73
[#80124] add cell data paths information while reporting paths
magancarz Jul 21, 2025
91968bc
[#80124] wip: working on reporting from and to cell timing paths
magancarz Jul 21, 2025
5f2bf7c
[#80791] wip: display timing paths: add more info
magancarz Jul 22, 2025
040c318
[#80124] fix calculating slack for register - output timing paths
magancarz Jul 22, 2025
694e5f1
[#80791] move common report timing path code to a function
magancarz Jul 22, 2025
ff89eb6
[#80791] save worst slack timing path vertices transitions
magancarz Jul 23, 2025
88a0e45
[#80791] print timing paths vertices transitions
magancarz Jul 23, 2025
4fa415d
Revert "[#80124] wip: comparing exported timing paths with calculated…
magancarz Jul 23, 2025
9ef1c09
[#80124] fix exported timing path vertex transition
magancarz Jul 23, 2025
7d037b1
[#80791] initial version for including timing path vertices
magancarz Jul 23, 2025
aed1f45
[#80124] add saving rise and fall worst timing paths separately
magancarz Jul 23, 2025
dbf7d45
Revert "[#80124] wip: using previously exported timing paths in timin…
magancarz Jul 24, 2025
766b278
[#80124] change name of timing paths group to paths
magancarz Jul 24, 2025
d86f92a
[#80124] update liberty reader to parse rise and fall timing paths
magancarz Jul 24, 2025
0d72d24
[#80791] update reporting paths to use rise/fall timing paths from li…
magancarz Jul 24, 2025
4ecad50
[#80124] update example files for timing paths
magancarz Jul 24, 2025
d82ebfa
[#80791] add timing arcs sanity guards
magancarz Jul 24, 2025
eb8d49f
[#80791] remove unnecessary dash line from report
magancarz Jul 24, 2025
f3dc1e4
[#80791] add example files for timing paths and report checks
magancarz Jul 24, 2025
aed8f1b
[#80791] restore base example files
magancarz Jul 24, 2025
61905fe
[#80124] clean up timing paths extraction code
magancarz Jul 24, 2025
c6e39f9
[#80124] clean up timing paths writing and reading code
magancarz Jul 24, 2025
cb19380
[#80791] change way of accessing path end check arc
magancarz Jul 24, 2025
dedb604
[#80791] take exported timing paths into reported paths data arrival …
magancarz Jul 24, 2025
de52429
[#80791] add example with comb cell in the middle
magancarz Jul 24, 2025
069dc07
[#80791] fix mid comb case while unwrapping timing paths
magancarz Jul 25, 2025
0d7fe4f
[#80791] remove unused files
magancarz Jul 25, 2025
7921259
[#80791] omit saving instance timing arc if not valid
magancarz Jul 25, 2025
e28fab3
[#80791] fix write_timing_model_scalar test
magancarz Jul 25, 2025
62b73f5
[#80124] add tests for dff and comb cells
magancarz Jul 25, 2025
3f49b20
[#80791] fix unwrapping last instance and clean up forwarding code
magancarz Jul 25, 2025
bba55fb
[#80791] add timing_cell_complex test
magancarz Jul 25, 2025
af5e57c
[#80791] wip: inlining timing path vertices in json reported paths
magancarz Jul 25, 2025
abde3c3
[#80124] add saving slew, capacitance, pin, cell, instance and net
magancarz Jul 28, 2025
4a2de2a
[#80124] add saving if pin is a driver
magancarz Jul 28, 2025
95731db
[#80791] add displaying cap, slew and net fields
magancarz Jul 28, 2025
1951e82
[#80124] use timing paths names from one place
magancarz Jul 28, 2025
5807696
[#80124] take net and instance names from proper networks
magancarz Jul 28, 2025
794eb7e
[#80791] use exported timing path's parameters while exporting to json
magancarz Jul 28, 2025
cb13d89
[#80791] wip: working on target clk path
magancarz Jul 28, 2025
03f888e
[#80791] use rise/fall from vertex
magancarz Jul 28, 2025
d271b8c
[#80791] add more example files
magancarz Jul 29, 2025
4c52d9f
[#80791] remove unused variables
magancarz Jul 29, 2025
11c81f8
[#80791] use data required path when reporting clock path in json format
magancarz Jul 29, 2025
fcc38bd
[#80791] use startpoint and endpoint from timing paths
magancarz Jul 29, 2025
d8beede
[#80791] update test files
magancarz Jul 29, 2025
c889caa
[#80791] update ReportPath's pathStartpoint and pathEndpoint function…
magancarz Jul 29, 2025
4b114e2
[#80791] update report_json1 test files
magancarz Jul 29, 2025
b1b8f30
[#80791] use previous path arrival when inlining vertices in json format
magancarz Jul 29, 2025
89ff251
[#80791] remove unused files
magancarz Jul 30, 2025
1c4823c
[#80791] use slack merging instead of setting
magancarz Jul 30, 2025
c89a622
[#80791] clean up the code and add more complexity to the timing_cell…
magancarz Jul 30, 2025
dc2e77c
[#80791] add timing_cell_complex_json test
magancarz Jul 30, 2025
6f768a3
[#80791] fix cases of misaligned tabs/spaces
magancarz Jul 30, 2025
9598c95
[#80124] resolve some of the suggestions
magancarz Aug 1, 2025
34ffdfd
[#81462] apply test files style suggestions
magancarz Aug 5, 2025
09773ca
[#81462] remove nangate lib from test directory and use asap7_small i…
magancarz Aug 5, 2025
bc6cb8c
[#81462] add comment to indicate custom Liberty attrs/groups
magancarz Aug 5, 2025
35ea741
[#81462] revert using inlined vertices as startpoints/endpoints
magancarz Aug 5, 2025
e106810
[#81462] use CombinationalTimingPath in register-output case
magancarz Aug 5, 2025
84c51c0
[#81462] clean up saving timing paths and checking if timing paths ar…
magancarz Aug 6, 2025
f32e62f
[#81462] add flag for enabling/disabling exporting timing paths
magancarz Aug 6, 2025
58c2f2e
[#81462] add CDC test for timing paths
magancarz Aug 6, 2025
ac223d0
[#81462] simplify skipping unwrapped cell pins
magancarz Aug 6, 2025
72d5148
[#81462] wip: internal paths: iterate over reg2reg internal paths and…
magancarz Aug 6, 2025
ea6150a
[#81462] wip: internal paths: add saving worst internal path to liberty
magancarz Aug 6, 2025
c1beec2
[#81462] wip: internal paths: add testing example
magancarz Aug 6, 2025
bdce3ad
[#81462] wip: internal paths: start timing path from DFF clock vertex
magancarz Aug 6, 2025
fe4452e
[#81462] wip: internal paths: save worst paths for minmax/risefall cases
magancarz Aug 6, 2025
bb1fdfc
[#81462] wip: internal paths: create register input/output pins pairs
magancarz Aug 7, 2025
948acae
[#81462] wip: internal paths: fix writing multiple internal paths
magancarz Aug 7, 2025
686dba7
[#81462] wip: internal paths: add reading cell reg2reg worst timing p…
magancarz Aug 7, 2025
7ecbc30
[#81462] internal paths: fix target transition type filter
magancarz Aug 7, 2025
07eedd4
[#81462] take in consideration if clock is propagated
magancarz Aug 8, 2025
4e84342
[#81462] wip: testing propagated clock timing paths
magancarz Aug 8, 2025
29c717b
[#81462] update test ground truth files
magancarz Aug 8, 2025
b5c06ef
[#81462] wip: traversing and displaying worst internal paths
magancarz Aug 11, 2025
194e752
[#81462] internal paths: improve reporting worst internal paths
magancarz Aug 11, 2025
4199131
[#81462] internal paths: sort path ends and internal paths by slack w…
magancarz Aug 11, 2025
c23d14d
[#81462] internal paths: save path group name
magancarz Aug 12, 2025
cc59021
[#81462] internal paths: save path type
magancarz Aug 12, 2025
2ce9f99
[#81462] internal paths: wip: merging path ends and internal paths by…
magancarz Aug 12, 2025
beb4861
[#81462] internal paths: wip: choose correct path group for internal …
magancarz Aug 12, 2025
f35ea4f
[#81462] rebase and fix tests segfaults
magancarz Aug 18, 2025
06e208a
[#81462] add groups flag to finding internal paths
magancarz Aug 18, 2025
a47b3f2
[#81462] check if timing path group is present in groups set
magancarz Aug 18, 2025
81c46a8
[#81462] add default option for matching timing path groups
magancarz Aug 18, 2025
12e8b52
[#81462] prepare for extracting n-worst timing paths
magancarz Aug 18, 2025
e4de8c4
[#81462] add flag for specifying internal path count written to Liberty
magancarz Aug 18, 2025
28d0fb7
[#81462] save n worst internal timing paths
magancarz Aug 18, 2025
69206e5
[#81462] parse multiple timing paths per cell
magancarz Aug 19, 2025
4cbe3ff
[#81462] add reporting path group and type for internal paths
magancarz Aug 19, 2025
b83c26f
[#81462] add reporting internal timing path in the short form
magancarz Aug 19, 2025
58ece1d
[#81462] add reporting internal timing path in the end form
magancarz Aug 19, 2025
750e95a
[#81462] add reporting internal timing path in the summary form
magancarz Aug 19, 2025
78d683b
[#81462] add reporting internal timing path in the slack only form
magancarz Aug 19, 2025
8670cd3
[#81462] add reporting internal timing path in the json form
magancarz Aug 19, 2025
b2e6316
[#81462] take into consideration if any previous path was reported
magancarz Aug 19, 2025
737d8f6
[#81462] resolve compiler warning and fix json reporting of internal …
magancarz Aug 19, 2025
616d8d5
[#81462] resolve compile warnings, temporary fix cleared out args and…
magancarz Aug 19, 2025
62af20d
[#81462] update timing_cell_complex_json correct file
magancarz Aug 19, 2025
1e5cfa3
[#81462] update report_checks comment
magancarz Aug 20, 2025
82d11b2
[#81462] test the integration of internal paths and fix occurring pro…
magancarz Aug 20, 2025
9584dde
[#81462] dont throw error in case of unrecognized arg
magancarz Aug 20, 2025
d7e9baa
[#81462] add test for reporting internal paths
magancarz Aug 20, 2025
9254305
[#81462] update internal paths example
magancarz Aug 20, 2025
f2f8308
[#81462] add saving separated clock source path from data arrival path
magancarz Aug 20, 2025
04ca142
[#81462] add loading source clock paths and display them in JSON format
magancarz Aug 20, 2025
9aa8670
[#81462] update test files and fix minor bugs
magancarz Aug 22, 2025
33815ce
[#81462] fix non propagated source clock paths
magancarz Aug 22, 2025
3e1ced3
[#81462] wip: moving paths merging code to Search
magancarz Aug 22, 2025
27c3207
[#81462] working paths merging in its own command
magancarz Aug 25, 2025
03dd44a
[#81462] fix segfault caused by empty path ends
magancarz Aug 25, 2025
ed5f1f8
[#81462] rename function for finding internal paths
magancarz Aug 25, 2025
ef5e94d
[#81462] remove dead code and add improvements after self review
magancarz Aug 25, 2025
34d681f
[#81462] resolve unknown args error
magancarz Aug 25, 2025
f40b7ab
[#81462] remove unused flags from parse_report_path_options
magancarz Aug 25, 2025
cddf60d
[#81462] add comment explaining copied args
magancarz Aug 25, 2025
d970626
[#81462] wip: reporting sorted path ends and internal timing paths
magancarz Aug 25, 2025
fddc787
[#81462] move dedup by word functionality to a function
magancarz Aug 26, 2025
0307f60
[#81462] use existing path ends reporting functionality
magancarz Aug 26, 2025
8e07039
[#81462] add reporting sorted path ends and internal paths if needed
magancarz Aug 26, 2025
5e1a733
[#81462] remove resizing path ends array after sorting
magancarz Aug 26, 2025
9d2c6da
[#81462] handle dedup_by_word flag when reporting path ends along wit…
magancarz Aug 26, 2025
21c9a8d
[#81462] remove duplicate current_index increments
magancarz Aug 26, 2025
fb75885
[#81462] report basic clock info
magancarz Aug 26, 2025
3105b3d
[#81462] fix build error
magancarz Aug 26, 2025
119dd45
[#81462] clean up code
magancarz Aug 26, 2025
527dc9e
[#81462] export clock delay to liberty
magancarz Aug 26, 2025
fb2dc6f
[#81462] delete temp examples
magancarz Aug 26, 2025
12ee4bc
[#81462] export source clock path arrival
magancarz Aug 26, 2025
14afc87
[#81462] resolve typos and indents
magancarz Aug 26, 2025
3614122
[#81462] style fixes
magancarz Aug 26, 2025
a5639a5
[#81462] change the name of report_paths function
magancarz Aug 26, 2025
611f85f
[#82535] dont delete from/thrus/to in case of unknown args
magancarz Aug 27, 2025
426143e
[#82535] remove unused find_internal_timing_paths flags and omit sear…
magancarz Aug 27, 2025
3694a57
[#82535] fix typo in timing_paths_propagated_clock test
magancarz Aug 27, 2025
47a9a36
[#82535] report target clock info in the correct order
magancarz Aug 27, 2025
d77c0ec
[#82535] wip: saving source clock and target clock info separately
magancarz Aug 27, 2025
e9d4aa8
[#82535] fix ReportPath indents
magancarz Aug 27, 2025
8a01b8f
[#82535] add reporting more info about target clock path
magancarz Aug 28, 2025
17c7ff5
[#82535] report more clock info
magancarz Aug 28, 2025
36889ea
[#82535] divide clock report test to full and full_clock_expanded for…
magancarz Aug 29, 2025
707f64a
[#82535] clean up unused timing paths variables
magancarz Aug 29, 2025
91e6639
[#82535] fix indent
magancarz Aug 29, 2025
3d83cea
[#82535] add guards for possible not found clock
magancarz Aug 29, 2025
3e5a636
[#82535] remove unused flags
magancarz Aug 29, 2025
94d2d5d
[#82535] iterate through imported liberty cells to find register-regi…
magancarz Aug 29, 2025
6a0a6ad
[#82535] rename PathsContainer to PathsStitch
magancarz Aug 29, 2025
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
10 changes: 10 additions & 0 deletions include/sta/Liberty.hh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "Transition.hh"
#include "Delay.hh"
#include "LibertyClass.hh"
#include "TimingArc.hh"

namespace sta {

Expand Down Expand Up @@ -561,6 +562,13 @@ public:
const char *userFunctionClass() const;
void setUserFunctionClass(const char *user_function_class);

void addInternalTimingPath(InputRegisterTimingPath timing_path,
const MinMax *min_max,
const RiseFall *rise_fall);
const std::vector<InputRegisterTimingPath> &getInternalTimingPaths(const MinMax *min_max,
const RiseFall *rise_fall) const;
bool hasInternalTimingPaths() const;

protected:
void addPort(ConcretePort *port);
void setHasInternalPorts(bool has_internal);
Expand Down Expand Up @@ -652,6 +660,8 @@ protected:
std::mutex waveform_lock_;
std::string footprint_;
std::string user_function_class_;
float worst_slack_{std::numeric_limits<float>::max()};
std::array<std::array<std::vector<InputRegisterTimingPath>, 2>, 2> internal_timing_paths_;

private:
friend class LibertyLibrary;
Expand Down
3 changes: 2 additions & 1 deletion include/sta/LibertyWriter.hh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class StaState;
void
writeLiberty(LibertyLibrary *lib,
const char *filename,
StaState *sta);
StaState *sta,
bool write_timing_paths);

} // namespace
7 changes: 7 additions & 0 deletions include/sta/PathGroup.hh
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,15 @@ public:
PathGroup *findPathGroup(const Clock *clock,
const MinMax *min_max) const;
PathGroup *pathGroup(const PathEnd *path_end) const;
PathGroup *pathDelayGroup(const MinMax *min_max) const { return path_delay_[min_max->index()]; }
PathGroup *gatedClkGroup(const MinMax *min_max) const { return gated_clk_[min_max->index()]; }
PathGroup *asyncGroup(const MinMax *min_max) const { return async_[min_max->index()]; }
PathGroup *unconstrainedGroup(const MinMax *min_max) const { return unconstrained_[min_max->index()]; }
static bool isGroupPathName(const char *group_name);
static const char *pathDelayPathGroupName() { return path_delay_group_name_; }
static const char *gatedClkPathGroupName() { return gated_clk_group_name_; }
static const char *asyncPathGroupName() { return async_group_name_; }
static const char *unconstrainedPathGroupName() { return unconstrained_group_name_; }

protected:
void makeGroupPathEnds(ExceptionTo *to,
Expand Down
21 changes: 21 additions & 0 deletions include/sta/Search.hh
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ public:
void visitStartpoints(VertexVisitor *visitor);
void visitEndpoints(VertexVisitor *visitor);
bool havePathGroups() const;
const PathGroups *pathGroups() const { return path_groups_; }
PathGroup *findPathGroup(const char *name,
const MinMax *min_max) const;
PathGroup *findPathGroup(const Clock *clk,
Expand Down Expand Up @@ -411,6 +412,19 @@ public:
void checkPrevPaths() const;
void deletePaths(Vertex *vertex);

InternalPathSeq findInternalTimingPaths(const MinMaxAll *delay_min_max,
const RiseFallBoth *transition_rise_fall,
float slack_min,
float slack_max,
bool sort_by_slack,
PathGroupNameSet *groups,
unsigned int path_count);

PathsStitch mergePaths(const PathEndSeq *path_ends,
const InternalPathSeq *timing_paths,
bool sort_by_slack,
unsigned int path_count);

protected:
void init(StaState *sta);
void initVars();
Expand Down Expand Up @@ -582,6 +596,13 @@ protected:
void clockDomains(const Vertex *vertex,
// Return value.
ClockSet &clks) const;
bool isSlackInsideSearchingBounds(float slack, float min_slack, float max_slack) const;
bool isMatchingSearchedPathGroups(const char *path_group, PathGroupNameSet *group_names) const;
PathGroup *findPathGroupForInternalPath(const InputRegisterTimingPath *timing_path) const;
void mergePathsBySlack(
PathEndSeq &input_path_ends, InternalPathSeq &input_internal_paths,
PathEndSeq &filtered_path_ends, InternalPathSeq &filtered_internal_paths,
unsigned int group_path_count) const;

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

Expand Down
45 changes: 45 additions & 0 deletions include/sta/SearchClass.hh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "Delay.hh"
#include "NetworkClass.hh"
#include "GraphClass.hh"
#include "TimingArc.hh"

namespace sta {

Expand Down Expand Up @@ -113,6 +114,8 @@ typedef Vector<MinPeriodCheck*> MinPeriodCheckSeq;
typedef Vector<MaxSkewCheck*> MaxSkewCheckSeq;
typedef StringSet PathGroupNameSet;
typedef Vector<PathEnd*> PathEndSeq;
typedef Vector<const InputRegisterTimingPath*> InternalPathSeq;
typedef std::set<const InputRegisterTimingPath*> InternalPathSet;
typedef Vector<Arrival> ArrivalSeq;
typedef Map<Vertex*, size_t> VertexPathCountMap;
typedef Map<Tag*, size_t, TagMatchLess> PathIndexMap;
Expand All @@ -136,6 +139,48 @@ enum class ReportDeduplicationMode { none,
keep_different
};

class PathsStitch
{
public:
PathsStitch() = default;

PathsStitch(
PathEndSeq path_ends,
InternalPathSeq internal_timing_paths,
bool sorted_by_slack)
: path_ends_{std::move(path_ends)},
internal_timing_paths_{std::move(internal_timing_paths)},
sorted_by_slack_{sorted_by_slack},
num_of_paths_{static_cast<unsigned int>(path_ends_.size() + internal_timing_paths_.size())} {}

PathsStitch(
PathEndSeq path_ends,
bool sorted_by_slack)
: path_ends_{std::move(path_ends)},
sorted_by_slack_{sorted_by_slack},
num_of_paths_{static_cast<unsigned int>(path_ends_.size())} {}

PathsStitch(
InternalPathSeq internal_timing_paths,
bool sorted_by_slack)
: internal_timing_paths_{std::move(internal_timing_paths)},
sorted_by_slack_{sorted_by_slack},
num_of_paths_{static_cast<unsigned int>(internal_timing_paths_.size())} {}

bool hasPathEnds() const { return !path_ends_.empty(); }
const PathEndSeq &pathEnds() const { return path_ends_; }
bool hasInternalPaths() const { return !internal_timing_paths_.empty(); }
const InternalPathSeq &internalPaths() const { return internal_timing_paths_; }
bool sortedBySlack() const { return sorted_by_slack_; }
unsigned int size() const { return num_of_paths_; }

private:
PathEndSeq path_ends_{};
InternalPathSeq internal_timing_paths_{};
bool sorted_by_slack_{false};
unsigned int num_of_paths_{0};
};

static const TagIndex tag_index_bit_count = 28;
static const TagIndex tag_index_max = (1 << tag_index_bit_count) - 1;
static const TagIndex tag_index_null = tag_index_max;
Expand Down
18 changes: 17 additions & 1 deletion include/sta/Sta.hh
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,17 @@ public:
bool removal,
bool clk_gating_setup,
bool clk_gating_hold);
InternalPathSeq findInternalTimingPaths(const MinMaxAll *delay_min_max,
const RiseFallBoth *transition_rise_fall,
float slack_min,
float slack_max,
bool sort_by_slack,
PathGroupNameSet *groups,
int path_count);
PathsStitch mergePaths(const PathEndSeq *path_ends,
const InternalPathSeq *timing_paths,
bool sort_by_slack,
unsigned int path_count);
void setReportPathFormat(ReportPathFormat format);
void setReportPathFieldOrder(StringSeq *field_names);
void setReportPathFields(bool report_input_pin,
Expand All @@ -862,8 +873,11 @@ public:
PathEnd *prev_end);
void reportPathEnd(PathEnd *end);
void reportPathEnds(PathEndSeq *ends);
void reportPaths(const PathsStitch *paths_stitch);
ReportPath *reportPath() { return report_path_; }
void reportPath(const Path *path);
void reportPath(const InputRegisterTimingPath *internal_path);
void reportPaths(const InternalPathSeq *internal_paths);

// Report clk skews for clks.
void reportClkSkew(ConstClockSeq &clks,
Expand Down Expand Up @@ -1249,7 +1263,9 @@ public:
const char *cell_name,
const char *filename,
const Corner *corner,
const bool scalar);
const bool scalar,
const bool paths,
const int internal_path_count);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fix indentation


// Find equivalent cells in equiv_libs.
// Optionally add mappings for cells in map_libs.
Expand Down
120 changes: 120 additions & 0 deletions include/sta/TimingArc.hh
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@
#pragma once

#include <memory>
#include <unordered_map>
#include <limits>

#include "Vector.hh"
#include "Transition.hh"
#include "Delay.hh"
#include "LibertyClass.hh"
#include "TimingRole.hh"

namespace sta {

Expand Down Expand Up @@ -93,6 +96,90 @@ timingTypeScaleFactorType(TimingType type);

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

struct TimingPathVertex
{
std::string instance;
std::string cell;
std::string pin;
std::string net;
std::string transition;
float arrival;
float slew;
float capacitance;
bool is_driver;
};

struct TimingPath
{
std::string name{};
std::vector<TimingPathVertex> vertices{};
float time{0.0f};
const RiseFall* rise_fall;

struct Names
{
static constexpr std::array<const char*, 2> DATA_ARRIVAL{"rise_data_arrival", "fall_data_arrival"};
static constexpr std::array<const char*, 2> DATA_REQUIRED{"rise_data_required", "fall_data_required"};
static constexpr std::array<const char*, 2> CLOCKED_OUTPUT{"rise_clocked_output", "fall_clocked_output"};
static constexpr std::array<const char*, 2> COMBINATIONAL{"rise_combinational", "fall_combinational"};
static constexpr std::array<const char*, 2> SOURCE_CLOCK{"rise_source_clock", "fall_source_clock"};
};

inline static const std::unordered_map<const TimingRole*, std::array<const char*, 2>> ROLE_PATH_MAPPINGS =
{
{TimingRole::regClkToQ(), Names::CLOCKED_OUTPUT},
{TimingRole::combinational(), Names::COMBINATIONAL},
{TimingRole::setup(), Names::DATA_ARRIVAL},
{TimingRole::hold(), Names::DATA_ARRIVAL}
};

bool isDataArrivalPath() const;
bool isDataRequiredPath() const;
bool isSourceClockPath() const;
};

struct InputRegisterTimingPath
{
float slack{std::numeric_limits<float>::max()};
float crpr{std::numeric_limits<float>::max()};
float clk_arrival{std::numeric_limits<float>::max()};
float library_setup_time{std::numeric_limits<float>::max()};
float path_delay{std::numeric_limits<float>::max()};
bool has_path_delay{false};
bool is_source_clock_propagated{false};
bool is_target_clock_propagated{false};
std::string cell_name{};
std::string path_group_name{};
std::string path_type{};
std::string type{};
const RiseFall *source_clock_transition{nullptr};
std::string source_clock_name{};
float source_clk_time{std::numeric_limits<float>::max()};
float source_clk_arrival{std::numeric_limits<float>::max()};
const RiseFall *target_clock_transition{nullptr};
std::string target_clock_name{};
float target_clk_delay{std::numeric_limits<float>::max()};
float target_clk_time{std::numeric_limits<float>::max()};
float target_clk_offset{std::numeric_limits<float>::max()};
float target_clk_mcp_adjustment{std::numeric_limits<float>::max()};
float target_clk_insertion_delay{std::numeric_limits<float>::max()};
float target_clk_insertion_offset{std::numeric_limits<float>::max()};
float target_clk_non_inter_uncertainty{std::numeric_limits<float>::max()};
float target_clk_uncertainty{std::numeric_limits<float>::max()};
TimingPath source_clock_path{};
TimingPath data_arrival_path{};
TimingPath data_required_path{};
};

struct CombinationalTimingPath
{
float slack{std::numeric_limits<float>::max()};
TimingPath source_clock_path{};
TimingPath combinational_delay_path{};
};

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

class TimingArcAttrs
{
public:
Expand Down Expand Up @@ -120,6 +207,11 @@ public:
TimingModel *model);
float ocvArcDepth() const { return ocv_arc_depth_; }
void setOcvArcDepth(float depth);
void setSlack(float slack);
void mergeSlack(float slack);
void addTimingPath(TimingPath timing_path);
float slack() const { return slack_; }
const std::unordered_map<std::string, TimingPath>& timingPaths() const { return timing_paths_; }

protected:
TimingType timing_type_;
Expand All @@ -132,6 +224,8 @@ protected:
const char *mode_value_;
float ocv_arc_depth_;
TimingModel *models_[RiseFall::index_count];
float slack_{std::numeric_limits<float>::max()};
std::unordered_map<std::string, TimingPath> timing_paths_;
};

// A timing arc set is a group of related timing arcs between from/to
Expand Down Expand Up @@ -184,6 +278,10 @@ public:
const char *sdfCondEnd() const { return attrs_->sdfCondEnd(); }
const char *modeName() const { return attrs_->modeName(); }
const char *modeValue() const { return attrs_->modeValue(); }
float slack() const { return attrs_->slack(); }
bool hasTimingPaths() const { return !attrs_->timingPaths().empty(); }
const std::unordered_map<std::string, TimingPath>& timingPaths() const { return attrs_->timingPaths(); }

// Timing arc set index in cell.
TimingArcIndex index() const { return index_; }
bool isDisabledConstraint() const { return is_disabled_constraint_; }
Expand Down Expand Up @@ -281,3 +379,25 @@ private:
};

} // namespace

namespace std {

template<>
struct less<sta::InputRegisterTimingPath>
{
bool operator()(const sta::InputRegisterTimingPath &first, const sta::InputRegisterTimingPath &second) const
{
return first.slack < second.slack;
}
};

template<>
struct less<const sta::InputRegisterTimingPath*>
{
bool operator()(const sta::InputRegisterTimingPath *first, const sta::InputRegisterTimingPath *second) const
{
return first->slack < second->slack;
}
};

}
Loading