Skip to content

Commit 98d801d

Browse files
committed
report paths in multiple matching groups resolves ascenium #145
Signed-off-by: James Cherry <[email protected]>
1 parent de0f544 commit 98d801d

File tree

14 files changed

+216
-108
lines changed

14 files changed

+216
-108
lines changed

include/sta/PathEnd.hh

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public:
6868
path_delay
6969
};
7070

71-
virtual PathEnd *copy() = 0;
71+
virtual PathEnd *copy() const = 0;
7272
virtual ~PathEnd();
7373
void deletePath();
7474
Path *path() { return path_; }
@@ -84,6 +84,8 @@ public:
8484
PathAPIndex pathIndex(const StaState *sta) const;
8585
virtual void reportShort(const ReportPath *report) const = 0;
8686
virtual void reportFull(const ReportPath *report) const = 0;
87+
PathGroup *pathGroup() const { return path_group_; }
88+
void setPathGroup(PathGroup *path_group);
8789

8890
// Predicates for PathEnd type.
8991
// Default methods overridden by respective types.
@@ -216,6 +218,7 @@ protected:
216218
PathDelay *path_delay,
217219
const StaState *sta);
218220
Path *path_;
221+
PathGroup *path_group_;
219222
};
220223

221224
class PathEndUnconstrained : public PathEnd
@@ -224,7 +227,7 @@ public:
224227
explicit PathEndUnconstrained(Path *path);
225228
virtual Type type() const;
226229
virtual const char *typeName() const;
227-
virtual PathEnd *copy();
230+
virtual PathEnd *copy() const;
228231
virtual void reportShort(const ReportPath *report) const;
229232
virtual void reportFull(const ReportPath *report) const;
230233
virtual bool isUnconstrained() const;
@@ -321,7 +324,7 @@ public:
321324
Path *clk_path,
322325
MultiCyclePath *mcp,
323326
const StaState *sta);
324-
virtual PathEnd *copy();
327+
virtual PathEnd *copy() const;
325328
virtual Type type() const;
326329
virtual const char *typeName() const;
327330
virtual void reportShort(const ReportPath *report) const;
@@ -367,7 +370,7 @@ public:
367370
virtual bool isCheck() const { return false; }
368371
virtual bool isLatchCheck() const { return true; }
369372
virtual PathDelay *pathDelay() const { return path_delay_; }
370-
virtual PathEnd *copy();
373+
virtual PathEnd *copy() const;
371374
Path *latchDisable();
372375
const Path *latchDisable() const;
373376
virtual void reportShort(const ReportPath *report) const;
@@ -428,7 +431,7 @@ public:
428431
Path *clk_path,
429432
MultiCyclePath *mcp,
430433
const StaState *sta);
431-
virtual PathEnd *copy();
434+
virtual PathEnd *copy() const;
432435
virtual Type type() const;
433436
virtual const char *typeName() const;
434437
virtual void reportShort(const ReportPath *report) const;
@@ -474,7 +477,7 @@ public:
474477
MultiCyclePath *mcp,
475478
ArcDelay margin,
476479
const StaState *sta);
477-
virtual PathEnd *copy();
480+
virtual PathEnd *copy() const;
478481
virtual Type type() const;
479482
virtual const char *typeName() const;
480483
virtual void reportShort(const ReportPath *report) const;
@@ -506,7 +509,7 @@ public:
506509
Path *data_clk_path,
507510
MultiCyclePath *mcp,
508511
const StaState *sta);
509-
virtual PathEnd *copy();
512+
virtual PathEnd *copy() const;
510513
virtual Type type() const;
511514
virtual const char *typeName() const;
512515
virtual void reportShort(const ReportPath *report) const;
@@ -560,7 +563,7 @@ public:
560563
Path *path,
561564
OutputDelay *output_delay,
562565
const StaState *sta);
563-
virtual PathEnd *copy();
566+
virtual PathEnd *copy() const;
564567
virtual Type type() const;
565568
virtual const char *typeName() const;
566569
virtual void reportShort(const ReportPath *report) const;

include/sta/PathGroup.hh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ class PathEndVisitor;
4040
typedef PathEndSeq::Iterator PathGroupIterator;
4141
typedef Map<const Clock*, PathGroup*> PathGroupClkMap;
4242
typedef Map<const char*, PathGroup*, CharPtrLess> PathGroupNamedMap;
43+
typedef std::vector<PathGroup*> PathGroupSeq;
44+
typedef std::vector<std::string> StdStringSeq;
4345

4446
// A collection of PathEnds grouped and sorted for reporting.
4547
class PathGroup
@@ -133,9 +135,9 @@ public:
133135
const MinMax *min_max) const;
134136
PathGroup *findPathGroup(const Clock *clock,
135137
const MinMax *min_max) const;
136-
PathGroup *pathGroup(const PathEnd *path_end) const;
137-
static std::string pathGroupName(const PathEnd *path_end,
138-
const StaState *sta);
138+
PathGroupSeq pathGroups(const PathEnd *path_end) const;
139+
static StdStringSeq pathGroupNames(const PathEnd *path_end,
140+
const StaState *sta);
139141
static const char *asyncPathGroupName() { return async_group_name_; }
140142
static const char *pathDelayGroupName() { return path_delay_group_name_; }
141143
static const char *gatedClkGroupName() { return gated_clk_group_name_; }
@@ -179,8 +181,6 @@ protected:
179181
const MinMax *min_max);
180182
bool reportGroup(const char *group_name,
181183
PathGroupNameSet *group_names) const;
182-
static GroupPath *groupPathTo(const PathEnd *path_end,
183-
const StaState *sta);
184184

185185
int group_path_count_;
186186
int endpoint_path_count_;

include/sta/Sdc.hh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,12 @@ public:
996996
const MinMax *min_max,
997997
bool match_min_max_exactly,
998998
bool require_to_pin) const;
999+
void groupPathsTo(const Pin *pin,
1000+
const RiseFall *rf,
1001+
const ClockEdge *clk_edge,
1002+
const MinMax *min_max,
1003+
// Return value.
1004+
ExceptionPathSeq &group_paths) const;
9991005
bool isCompleteTo(ExceptionState *state,
10001006
const Pin *pin,
10011007
const RiseFall *rf,
@@ -1164,6 +1170,13 @@ protected:
11641170
// Return values.
11651171
ExceptionPath *&hi_priority_exception,
11661172
int &hi_priority) const;
1173+
void groupPathsTo(const ExceptionPathSet *to_exceptions,
1174+
const Pin *pin,
1175+
const RiseFall *rf,
1176+
const ClockEdge *clk_edge,
1177+
const MinMax *min_max,
1178+
// Return value.
1179+
ExceptionPathSeq &group_paths) const;
11671180
void makeLoopPath(ExceptionThruSeq *thrus);
11681181
void makeLoopException(const Pin *loop_input_pin,
11691182
const Pin *loop_pin,

include/sta/Search.hh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ typedef Map<Vertex*, Slack> VertexSlackMap;
7171
typedef Vector<VertexSlackMap> VertexSlackMapSeq;
7272
typedef Vector<WorstSlacks> WorstSlacksSeq;
7373
typedef std::vector<DelayDbl> DelayDblSeq;
74+
typedef Vector<ExceptionPath*> ExceptionPathSeq;
75+
typedef std::vector<PathGroup*> PathGroupSeq;
7476

7577
class Search : public StaState
7678
{
@@ -165,7 +167,7 @@ public:
165167
// Clock arrival at the path source/launch point.
166168
Arrival pathClkPathArrival(const Path *path) const;
167169

168-
PathGroup *pathGroup(const PathEnd *path_end) const;
170+
PathGroupSeq pathGroups(const PathEnd *path_end) const;
169171
void deletePathGroups();
170172
void makePathGroups(int group_path_count,
171173
int endpoint_path_count,
@@ -187,6 +189,7 @@ public:
187189
const MinMax *min_max,
188190
bool match_min_max_exactly,
189191
bool require_to_pin) const;
192+
ExceptionPathSeq groupPathsTo(const PathEnd *path_end) const;
190193
FilterPath *filter() const { return filter_; }
191194
void deleteFilter();
192195
void deleteFilteredArrivals();

sdc/Sdc.cc

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5362,6 +5362,8 @@ Sdc::exceptionThruStates(const ExceptionPathSet *exceptions,
53625362
}
53635363
}
53645364

5365+
////////////////////////////////////////////////////////////////
5366+
53655367
void
53665368
Sdc::exceptionTo(ExceptionPathType type,
53675369
const Pin *pin,
@@ -5484,6 +5486,47 @@ Sdc::isCompleteTo(ExceptionState *state,
54845486

54855487
////////////////////////////////////////////////////////////////
54865488

5489+
void
5490+
Sdc::groupPathsTo(const Pin *pin,
5491+
const RiseFall *rf,
5492+
const ClockEdge *clk_edge,
5493+
const MinMax *min_max,
5494+
// Return value.
5495+
ExceptionPathSeq &group_paths) const
5496+
{
5497+
if (!first_to_inst_exceptions_.empty()) {
5498+
Instance *inst = network_->instance(pin);
5499+
groupPathsTo(first_to_inst_exceptions_.findKey(inst), pin, rf,
5500+
clk_edge, min_max, group_paths);
5501+
}
5502+
if (!first_to_pin_exceptions_.empty())
5503+
groupPathsTo(first_to_pin_exceptions_.findKey(pin), pin, rf,
5504+
clk_edge, min_max, group_paths);
5505+
if (clk_edge && !first_to_clk_exceptions_.empty())
5506+
groupPathsTo(first_to_clk_exceptions_.findKey(clk_edge->clock()),
5507+
pin, rf, clk_edge, min_max, group_paths);
5508+
}
5509+
5510+
void
5511+
Sdc::groupPathsTo(const ExceptionPathSet *to_exceptions,
5512+
const Pin *pin,
5513+
const RiseFall *rf,
5514+
const ClockEdge *clk_edge,
5515+
const MinMax *min_max,
5516+
// Return value.
5517+
ExceptionPathSeq &group_paths) const
5518+
{
5519+
if (to_exceptions) {
5520+
for (ExceptionPath *exception : *to_exceptions) {
5521+
if (exception->isGroupPath()
5522+
&& exceptionMatchesTo(exception, pin, rf, clk_edge, min_max, true, false))
5523+
group_paths.push_back(exception);
5524+
}
5525+
}
5526+
}
5527+
5528+
////////////////////////////////////////////////////////////////
5529+
54875530
Wireload *
54885531
Sdc::wireload(const MinMax *min_max)
54895532
{

search/Path.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ Path::isClock(const StaState *sta) const
306306
const MinMax *
307307
Path::minMax(const StaState *sta) const
308308
{
309-
return pathAnalysisPt(sta)->pathMinMax();
309+
return tag(sta)->minMax(sta);
310310
}
311311

312312
PathAPIndex

search/PathEnd.cc

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
namespace sta {
5050

5151
PathEnd::PathEnd(Path *path) :
52-
path_(path)
52+
path_(path),
53+
path_group_(nullptr)
5354
{
5455
}
5556

@@ -65,6 +66,12 @@ PathEnd::setPath(Path *path)
6566
path_ = path;
6667
}
6768

69+
void
70+
PathEnd::setPathGroup(PathGroup *path_group)
71+
{
72+
path_group_ = path_group;
73+
}
74+
6875
Vertex *
6976
PathEnd::vertex(const StaState *sta) const
7077
{
@@ -454,7 +461,7 @@ PathEndUnconstrained::PathEndUnconstrained(Path *path) :
454461
}
455462

456463
PathEnd *
457-
PathEndUnconstrained::copy()
464+
PathEndUnconstrained::copy() const
458465
{
459466
return new PathEndUnconstrained(path_);
460467
}
@@ -955,7 +962,7 @@ PathEndCheck::PathEndCheck(Path *path,
955962
}
956963

957964
PathEnd *
958-
PathEndCheck::copy()
965+
PathEndCheck::copy() const
959966
{
960967
return new PathEndCheck(path_, check_arc_, check_edge_,
961968
clk_path_, mcp_, crpr_, crpr_valid_);
@@ -1126,7 +1133,7 @@ PathEndLatchCheck::PathEndLatchCheck(Path *path,
11261133
}
11271134

11281135
PathEnd *
1129-
PathEndLatchCheck::copy()
1136+
PathEndLatchCheck::copy() const
11301137
{
11311138
return new PathEndLatchCheck(path_, check_arc_, check_edge_,
11321139
clk_path_, disable_path_, mcp_, path_delay_,
@@ -1346,7 +1353,7 @@ PathEndOutputDelay::PathEndOutputDelay(OutputDelay *output_delay,
13461353
}
13471354

13481355
PathEnd *
1349-
PathEndOutputDelay::copy()
1356+
PathEndOutputDelay::copy() const
13501357
{
13511358
return new PathEndOutputDelay(output_delay_, path_, clk_path_,
13521359
mcp_, crpr_, crpr_valid_);
@@ -1552,7 +1559,7 @@ PathEndGatedClock::PathEndGatedClock(Path *gating_ref,
15521559
}
15531560

15541561
PathEnd *
1555-
PathEndGatedClock::copy()
1562+
PathEndGatedClock::copy() const
15561563
{
15571564
return new PathEndGatedClock(path_, clk_path_, check_role_,
15581565
mcp_, margin_, crpr_, crpr_valid_);
@@ -1668,7 +1675,7 @@ PathEndDataCheck::PathEndDataCheck(DataCheck *check,
16681675
}
16691676

16701677
PathEnd *
1671-
PathEndDataCheck::copy()
1678+
PathEndDataCheck::copy() const
16721679
{
16731680
return new PathEndDataCheck(check_, path_, data_clk_path_,
16741681
clk_path_, mcp_, crpr_, crpr_valid_);
@@ -1825,7 +1832,7 @@ PathEndPathDelay::PathEndPathDelay(PathDelay *path_delay,
18251832
}
18261833

18271834
PathEnd *
1828-
PathEndPathDelay::copy()
1835+
PathEndPathDelay::copy() const
18291836
{
18301837
return new PathEndPathDelay(path_delay_, path_, clk_path_,
18311838
check_arc_, check_edge_, output_delay_,

0 commit comments

Comments
 (0)