Tag::clkInfo const

Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
James Cherry 2025-09-16 15:30:16 -07:00
parent 8580cfd813
commit 17cf87b4c6
19 changed files with 135 additions and 131 deletions

View File

@ -41,7 +41,7 @@ class Path
{ {
public: public:
Path(); Path();
Path(Path *path); Path(const Path *path);
Path(Vertex *vertex, Path(Vertex *vertex,
Tag *tag, Tag *tag,
const StaState *sta); const StaState *sta);
@ -89,7 +89,7 @@ public:
TagIndex tagIndex(const StaState *sta) const; TagIndex tagIndex(const StaState *sta) const;
void setTag(Tag *tag); void setTag(Tag *tag);
size_t pathIndex(const StaState *sta) const; size_t pathIndex(const StaState *sta) const;
ClkInfo *clkInfo(const StaState *sta) const; const ClkInfo *clkInfo(const StaState *sta) const;
const ClockEdge *clkEdge(const StaState *sta) const; const ClockEdge *clkEdge(const StaState *sta) const;
const Clock *clock(const StaState *sta) const; const Clock *clock(const StaState *sta) const;
bool isClock(const StaState *sta) const; bool isClock(const StaState *sta) const;

View File

@ -64,7 +64,7 @@ class CheckCrpr;
class Genclks; class Genclks;
class Corner; class Corner;
typedef Set<ClkInfo*, ClkInfoLess> ClkInfoSet; typedef Set<const ClkInfo*, ClkInfoLess> ClkInfoSet;
typedef UnorderedSet<Tag*, TagHash, TagEqual> TagSet; typedef UnorderedSet<Tag*, TagHash, TagEqual> TagSet;
typedef UnorderedSet<TagGroup*, TagGroupHash, TagGroupEqual> TagGroupSet; typedef UnorderedSet<TagGroup*, TagGroupHash, TagGroupEqual> TagGroupSet;
typedef Map<Vertex*, Slack> VertexSlackMap; typedef Map<Vertex*, Slack> VertexSlackMap;
@ -158,7 +158,7 @@ public:
// Clock arrival respecting ideal clock insertion delay and latency. // Clock arrival respecting ideal clock insertion delay and latency.
Arrival clkPathArrival(const Path *clk_path) const; Arrival clkPathArrival(const Path *clk_path) const;
Arrival clkPathArrival(const Path *clk_path, Arrival clkPathArrival(const Path *clk_path,
ClkInfo *clk_info, const ClkInfo *clk_info,
const ClockEdge *clk_edge, const ClockEdge *clk_edge,
const MinMax *min_max, const MinMax *min_max,
const PathAnalysisPt *path_ap) const; const PathAnalysisPt *path_ap) const;
@ -244,7 +244,7 @@ public:
const RiseFall *from_rf, const RiseFall *from_rf,
const Clock *clk, const Clock *clk,
const RiseFall *clk_rf, const RiseFall *clk_rf,
ClkInfo *clk_info, const ClkInfo *clk_info,
const Pin *to_pin, const Pin *to_pin,
const RiseFall *to_rf, const RiseFall *to_rf,
const MinMax *min_max, const MinMax *min_max,
@ -263,9 +263,9 @@ public:
bool arc_delay_min_max_eq, bool arc_delay_min_max_eq,
const MinMax *min_max, const MinMax *min_max,
const PathAnalysisPt *path_ap); const PathAnalysisPt *path_ap);
ClkInfo *thruClkInfo(Path *from_path, const ClkInfo *thruClkInfo(Path *from_path,
Vertex *from_vertex, Vertex *from_vertex,
ClkInfo *from_clk_info, const ClkInfo *from_clk_info,
bool from_is_clk, bool from_is_clk,
Edge *edge, Edge *edge,
Vertex *to_vertex, Vertex *to_vertex,
@ -274,7 +274,7 @@ public:
bool arc_delay_min_max_eq, bool arc_delay_min_max_eq,
const MinMax *min_max, const MinMax *min_max,
const PathAnalysisPt *path_ap); const PathAnalysisPt *path_ap);
ClkInfo *clkInfoWithCrprClkPath(ClkInfo *from_clk_info, const ClkInfo *clkInfoWithCrprClkPath(const ClkInfo *from_clk_info,
Path *from_path, Path *from_path,
const PathAnalysisPt *path_ap); const PathAnalysisPt *path_ap);
void seedClkArrivals(const Pin *pin, void seedClkArrivals(const Pin *pin,
@ -323,7 +323,7 @@ public:
Tag *findTag(const RiseFall *rf, Tag *findTag(const RiseFall *rf,
const PathAnalysisPt *path_ap, const PathAnalysisPt *path_ap,
ClkInfo *tag_clk, const ClkInfo *tag_clk,
bool is_clk, bool is_clk,
InputDelay *input_delay, InputDelay *input_delay,
bool is_segment_start, bool is_segment_start,
@ -331,7 +331,7 @@ public:
bool own_states); bool own_states);
void reportTags() const; void reportTags() const;
void reportClkInfos() const; void reportClkInfos() const;
virtual ClkInfo *findClkInfo(const ClockEdge *clk_edge, const ClkInfo *findClkInfo(const ClockEdge *clk_edge,
const Pin *clk_src, const Pin *clk_src,
bool is_propagated, bool is_propagated,
const Pin *gen_clk_src, const Pin *gen_clk_src,
@ -342,7 +342,7 @@ public:
ClockUncertainties *uncertainties, ClockUncertainties *uncertainties,
const PathAnalysisPt *path_ap, const PathAnalysisPt *path_ap,
Path *crpr_clk_path); Path *crpr_clk_path);
ClkInfo *findClkInfo(const ClockEdge *clk_edge, const ClkInfo *findClkInfo(const ClockEdge *clk_edge,
const Pin *clk_src, const Pin *clk_src,
bool is_propagated, bool is_propagated,
Arrival insertion, Arrival insertion,
@ -515,13 +515,13 @@ protected:
const Pin *from_pin, const Pin *from_pin,
const RiseFall *from_rf, const RiseFall *from_rf,
bool from_is_clk, bool from_is_clk,
ClkInfo *from_clk_info, const ClkInfo *from_clk_info,
const Pin *to_pin, const Pin *to_pin,
const RiseFall *to_rf, const RiseFall *to_rf,
bool to_is_clk, bool to_is_clk,
bool to_is_reg_clk, bool to_is_reg_clk,
bool to_is_segment_start, bool to_is_segment_start,
ClkInfo *to_clk_info, const ClkInfo *to_clk_info,
InputDelay *to_input_delay, InputDelay *to_input_delay,
const MinMax *min_max, const MinMax *min_max,
const PathAnalysisPt *path_ap); const PathAnalysisPt *path_ap);

View File

@ -322,8 +322,8 @@ MinPulseWidthCheck::closePath(const StaState *sta) const
const RiseFall *open_rf = open_path_->transition(sta); const RiseFall *open_rf = open_path_->transition(sta);
const RiseFall *close_rf = open_rf->opposite(); const RiseFall *close_rf = open_rf->opposite();
Tag *open_tag = open_path_->tag(sta); Tag *open_tag = open_path_->tag(sta);
ClkInfo *open_clk_info = open_tag->clkInfo(); const ClkInfo *open_clk_info = open_tag->clkInfo();
ClkInfo close_clk_info(open_clk_info->clkEdge()->opposite(), const ClkInfo close_clk_info(open_clk_info->clkEdge()->opposite(),
open_clk_info->clkSrc(), open_clk_info->clkSrc(),
open_clk_info->isPropagated(), open_clk_info->isPropagated(),
open_clk_info->genClkSrc(), open_clk_info->genClkSrc(),
@ -394,7 +394,7 @@ const ClockEdge *
MinPulseWidthCheck::closeClkEdge(const StaState *sta) const MinPulseWidthCheck::closeClkEdge(const StaState *sta) const
{ {
Tag *open_tag = open_path_->tag(sta); Tag *open_tag = open_path_->tag(sta);
ClkInfo *open_clk_info = open_tag->clkInfo(); const ClkInfo *open_clk_info = open_tag->clkInfo();
return open_clk_info->clkEdge()->opposite(); return open_clk_info->clkEdge()->opposite();
} }

View File

@ -47,7 +47,7 @@ ClkInfo::ClkInfo(const ClockEdge *clk_edge,
float latency, float latency,
ClockUncertainties *uncertainties, ClockUncertainties *uncertainties,
PathAPIndex path_ap_index, PathAPIndex path_ap_index,
Path *crpr_clk_path, const Path *crpr_clk_path,
const StaState *sta) : const StaState *sta) :
clk_edge_(clk_edge), clk_edge_(clk_edge),
clk_src_(clk_src), clk_src_(clk_src),
@ -254,6 +254,7 @@ ClkInfo::equal(const ClkInfo *clk_info1,
|| Path::equal(clk_info1->crprClkPathRaw(), || Path::equal(clk_info1->crprClkPathRaw(),
clk_info2->crprClkPathRaw(), clk_info2->crprClkPathRaw(),
sta)) sta))
// || clk_info1->crprClkVertexId(sta) == clk_info2->crprClkVertexId(sta))
&& ((uncertainties1 == nullptr && ((uncertainties1 == nullptr
&& uncertainties2 == nullptr) && uncertainties2 == nullptr)
|| (uncertainties1 && uncertainties2 || (uncertainties1 && uncertainties2

View File

@ -46,7 +46,7 @@ public:
float latency, float latency,
ClockUncertainties *uncertainties, ClockUncertainties *uncertainties,
PathAPIndex path_ap_index, PathAPIndex path_ap_index,
Path *crpr_clk_path, const Path *crpr_clk_path,
const StaState *sta); const StaState *sta);
~ClkInfo(); ~ClkInfo();
std::string to_string(const StaState *sta) const; std::string to_string(const StaState *sta) const;

View File

@ -293,7 +293,7 @@ ClkDelays::insertionDelay(Path *clk_path,
const ClockEdge *clk_edge = clk_path->clkEdge(sta); const ClockEdge *clk_edge = clk_path->clkEdge(sta);
const Clock *clk = clk_edge->clock(); const Clock *clk = clk_edge->clock();
const RiseFall *clk_rf = clk_edge->transition(); const RiseFall *clk_rf = clk_edge->transition();
ClkInfo *clk_info = clk_path->clkInfo(sta); const ClkInfo *clk_info = clk_path->clkInfo(sta);
const Pin *src_pin = clk_info->clkSrc(); const Pin *src_pin = clk_info->clkSrc();
const PathAnalysisPt *path_ap = clk_path->pathAnalysisPt(sta); const PathAnalysisPt *path_ap = clk_path->pathAnalysisPt(sta);
const MinMax *min_max = clk_path->minMax(sta); const MinMax *min_max = clk_path->minMax(sta);

View File

@ -56,7 +56,7 @@ CheckCrpr::CheckCrpr(StaState *sta) :
// Find the maximum possible crpr (clock min/max delta delay) for a // Find the maximum possible crpr (clock min/max delta delay) for a
// path from it's ClkInfo. // path from it's ClkInfo.
Arrival Arrival
CheckCrpr::maxCrpr(ClkInfo *clk_info) CheckCrpr::maxCrpr(const ClkInfo *clk_info)
{ {
const Path *crpr_clk_path = clk_info->crprClkPath(this); const Path *crpr_clk_path = clk_info->crprClkPath(this);
if (crpr_clk_path) { if (crpr_clk_path) {
@ -126,8 +126,8 @@ CheckCrpr::checkCrpr1(const Path *src_path,
crpr = 0.0; crpr = 0.0;
crpr_pin = nullptr; crpr_pin = nullptr;
const Tag *src_tag = src_path->tag(this); const Tag *src_tag = src_path->tag(this);
ClkInfo *src_clk_info = src_tag->clkInfo(); const ClkInfo *src_clk_info = src_tag->clkInfo();
ClkInfo *tgt_clk_info = tgt_clk_path->tag(this)->clkInfo(); const ClkInfo *tgt_clk_info = tgt_clk_path->tag(this)->clkInfo();
const Clock *src_clk = src_clk_info->clock(); const Clock *src_clk = src_clk_info->clock();
const Clock *tgt_clk = tgt_clk_info->clock(); const Clock *tgt_clk = tgt_clk_info->clock();
const Path *src_clk_path = nullptr; const Path *src_clk_path = nullptr;
@ -246,7 +246,7 @@ ConstPathSeq
CheckCrpr::genClkSrcPaths(const Path *path) CheckCrpr::genClkSrcPaths(const Path *path)
{ {
ConstPathSeq gclk_paths; ConstPathSeq gclk_paths;
ClkInfo *clk_info = path->clkInfo(this); const ClkInfo *clk_info = path->clkInfo(this);
const ClockEdge *clk_edge = clk_info->clkEdge(); const ClockEdge *clk_edge = clk_info->clkEdge();
const Pin *clk_src = clk_info->clkSrc(); const Pin *clk_src = clk_info->clkSrc();
PathAnalysisPt *path_ap = path->pathAnalysisPt(this); PathAnalysisPt *path_ap = path->pathAnalysisPt(this);
@ -350,7 +350,7 @@ CheckCrpr::outputDelayCrpr1(const Path *src_path,
{ {
crpr = 0.0; crpr = 0.0;
crpr_pin = nullptr; crpr_pin = nullptr;
ClkInfo *src_clk_info = src_path->tag(this)->clkInfo(); const ClkInfo *src_clk_info = src_path->tag(this)->clkInfo();
const Clock *tgt_clk = tgt_clk_edge->clock(); const Clock *tgt_clk = tgt_clk_edge->clock();
const Clock *src_clk = src_path->clock(this); const Clock *src_clk = src_path->clock(this);
if (src_clk && tgt_clk if (src_clk && tgt_clk

View File

@ -39,7 +39,7 @@ public:
explicit CheckCrpr(StaState *sta); explicit CheckCrpr(StaState *sta);
// Find the maximum possible crpr (clock min/max delta delay) for path. // Find the maximum possible crpr (clock min/max delta delay) for path.
Arrival maxCrpr(ClkInfo *clk_info); Arrival maxCrpr(const ClkInfo *clk_info);
// Timing check CRPR. // Timing check CRPR.
Crpr checkCrpr(const Path *src_clk_path, Crpr checkCrpr(const Path *src_clk_path,
const Path *tgt_clk_path); const Path *tgt_clk_path);

View File

@ -711,12 +711,12 @@ Genclks::makeTag(const Clock *gclk,
state = state->nextState(); state = state->nextState();
ExceptionStateSet *states = new ExceptionStateSet(); ExceptionStateSet *states = new ExceptionStateSet();
states->insert(state); states->insert(state);
ClkInfo *clk_info = search_->findClkInfo(master_clk->edge(master_rf), const ClkInfo *clk_info = search_->findClkInfo(master_clk->edge(master_rf),
master_pin, true, nullptr, true, master_pin, true, nullptr, true,
nullptr, insert, 0.0, nullptr, nullptr, insert, 0.0, nullptr,
path_ap, nullptr); path_ap, nullptr);
return search_->findTag(master_rf, path_ap, clk_info, false, nullptr, false, return search_->findTag(master_rf, path_ap, clk_info, false,
states, true); nullptr, false, states, true);
} }
class GenClkArrivalSearchPred : public EvalPred class GenClkArrivalSearchPred : public EvalPred

View File

@ -331,7 +331,7 @@ Latches::latchOutArrival(const Path *data_path,
tgt_clk_path_ap, this); tgt_clk_path_ap, this);
while (enable_iter.hasNext()) { while (enable_iter.hasNext()) {
Path *enable_path = enable_iter.next(); Path *enable_path = enable_iter.next();
ClkInfo *en_clk_info = enable_path->clkInfo(this); const ClkInfo *en_clk_info = enable_path->clkInfo(this);
const ClockEdge *en_clk_edge = en_clk_info->clkEdge(); const ClockEdge *en_clk_edge = en_clk_info->clkEdge();
if (enable_path->isClock(this)) { if (enable_path->isClock(this)) {
ExceptionPath *excpt = exceptionTo(data_path, en_clk_edge); ExceptionPath *excpt = exceptionTo(data_path, en_clk_edge);
@ -353,7 +353,7 @@ Latches::latchOutArrival(const Path *data_path,
// Tag switcheroo - data passing thru gets latch enable tag. // Tag switcheroo - data passing thru gets latch enable tag.
// States and path ap come from Q, everything else from enable. // States and path ap come from Q, everything else from enable.
Path *crpr_clk_path = crprActive() ? enable_path : nullptr; Path *crpr_clk_path = crprActive() ? enable_path : nullptr;
ClkInfo *q_clk_info = const ClkInfo *q_clk_info =
search_->findClkInfo(en_clk_edge, search_->findClkInfo(en_clk_edge,
en_clk_info->clkSrc(), en_clk_info->clkSrc(),
en_clk_info->isPropagated(), en_clk_info->isPropagated(),

View File

@ -49,7 +49,7 @@ Path::Path() :
{ {
} }
Path::Path(Path *path) : Path::Path(const Path *path) :
prev_path_(path ? path->prev_path_ : nullptr), prev_path_(path ? path->prev_path_ : nullptr),
arrival_(path ? path->arrival_ : 0.0), arrival_(path ? path->arrival_ : 0.0),
required_(path ? path->required_ : 0.0), required_(path ? path->required_ : 0.0),
@ -279,7 +279,7 @@ Path::pathIndex(const StaState *sta) const
return this - paths; return this - paths;
} }
ClkInfo * const ClkInfo *
Path::clkInfo(const StaState *sta) const Path::clkInfo(const StaState *sta) const
{ {
return tag(sta)->clkInfo(); return tag(sta)->clkInfo();

View File

@ -330,7 +330,7 @@ PathEnd::checkTgtClkDelay(const Path *tgt_clk_path,
const MinMax *min_max = tgt_clk_path->minMax(sta); const MinMax *min_max = tgt_clk_path->minMax(sta);
const EarlyLate *early_late = check_role->tgtClkEarlyLate(); const EarlyLate *early_late = check_role->tgtClkEarlyLate();
const PathAnalysisPt *tgt_path_ap = tgt_clk_path->pathAnalysisPt(sta); const PathAnalysisPt *tgt_path_ap = tgt_clk_path->pathAnalysisPt(sta);
ClkInfo *clk_info = tgt_clk_path->clkInfo(sta); const ClkInfo *clk_info = tgt_clk_path->clkInfo(sta);
const Pin *tgt_src_pin = clk_info->clkSrc(); const Pin *tgt_src_pin = clk_info->clkSrc();
const Clock *tgt_clk = tgt_clk_edge->clock(); const Clock *tgt_clk = tgt_clk_edge->clock();
const RiseFall *tgt_clk_rf = tgt_clk_edge->transition(); const RiseFall *tgt_clk_rf = tgt_clk_edge->transition();
@ -560,14 +560,14 @@ PathEndClkConstrained::sourceClkOffset(const ClockEdge *src_clk_edge,
Arrival Arrival
PathEndClkConstrained::sourceClkLatency(const StaState *sta) const PathEndClkConstrained::sourceClkLatency(const StaState *sta) const
{ {
ClkInfo *clk_info = path_->clkInfo(sta); const ClkInfo *clk_info = path_->clkInfo(sta);
return clk_info->latency(); return clk_info->latency();
} }
Arrival Arrival
PathEndClkConstrained::sourceClkInsertionDelay(const StaState *sta) const PathEndClkConstrained::sourceClkInsertionDelay(const StaState *sta) const
{ {
ClkInfo *clk_info = path_->clkInfo(sta); const ClkInfo *clk_info = path_->clkInfo(sta);
return clk_info->insertion(); return clk_info->insertion();
} }
@ -1033,7 +1033,7 @@ PathEndCheck::sourceClkDelay(const StaState *sta) const
PathExpanded expanded(path_, sta); PathExpanded expanded(path_, sta);
const Path *src_clk_path = expanded.clkPath(); const Path *src_clk_path = expanded.clkPath();
if (src_clk_path) { if (src_clk_path) {
ClkInfo *src_clk_info = path_->tag(sta)->clkInfo(); const ClkInfo *src_clk_info = path_->tag(sta)->clkInfo();
if (src_clk_info->isPropagated()) { if (src_clk_info->isPropagated()) {
// Propagated clock. Propagated arrival is seeded with insertion delay. // Propagated clock. Propagated arrival is seeded with insertion delay.
Arrival clk_arrival = src_clk_path->arrival(); Arrival clk_arrival = src_clk_path->arrival();
@ -1280,7 +1280,7 @@ PathEndLatchCheck::targetClkWidth(const StaState *sta) const
const Search *search = sta->search(); const Search *search = sta->search();
Arrival disable_arrival = search->clkPathArrival(disable_path_); Arrival disable_arrival = search->clkPathArrival(disable_path_);
Arrival enable_arrival = search->clkPathArrival(clk_path_); Arrival enable_arrival = search->clkPathArrival(clk_path_);
ClkInfo *enable_clk_info = clk_path_->clkInfo(sta); const ClkInfo *enable_clk_info = clk_path_->clkInfo(sta);
if (enable_clk_info->isPulseClk()) if (enable_clk_info->isPulseClk())
return disable_arrival - enable_arrival; return disable_arrival - enable_arrival;
else { else {

View File

@ -644,7 +644,7 @@ PathEnum::updatePathHeadDelays(PathSeq &paths,
Path *after_div) Path *after_div)
{ {
Tag *prev_tag = after_div->tag(this); Tag *prev_tag = after_div->tag(this);
ClkInfo *prev_clk_info = prev_tag->clkInfo(); const ClkInfo *prev_clk_info = prev_tag->clkInfo();
Arrival prev_arrival = search_->clkPathArrival(after_div); Arrival prev_arrival = search_->clkPathArrival(after_div);
int path_idx_max = paths.size() - 1; int path_idx_max = paths.size() - 1;
// paths[0] is the path endpoint // paths[0] is the path endpoint

View File

@ -2112,7 +2112,7 @@ ReportPath::reportSrcClkAndPath(const Path *path,
else if (clk_used_as_data else if (clk_used_as_data
&& pathFromGenPropClk(path, path->minMax(this))) { && pathFromGenPropClk(path, path->minMax(this))) {
reportClkLine(clk, clk_name.c_str(), clk_end_rf, clk_time, min_max); reportClkLine(clk, clk_name.c_str(), clk_end_rf, clk_time, min_max);
ClkInfo *clk_info = path->tag(search_)->clkInfo(); const ClkInfo *clk_info = path->tag(search_)->clkInfo();
if (clk_info->isPropagated()) if (clk_info->isPropagated())
reportClkSrcLatency(clk_insertion, clk_time, early_late); reportClkSrcLatency(clk_insertion, clk_time, early_late);
reportPath1(path, expanded, true, time_offset); reportPath1(path, expanded, true, time_offset);
@ -2259,7 +2259,7 @@ ReportPath::tgtClkInsertionOffet(const Path *clk_path,
const EarlyLate *early_late, const EarlyLate *early_late,
const PathAnalysisPt *path_ap) const const PathAnalysisPt *path_ap) const
{ {
ClkInfo *clk_info = clk_path->clkInfo(this); const ClkInfo *clk_info = clk_path->clkInfo(this);
const Pin *src_pin = clk_info->clkSrc(); const Pin *src_pin = clk_info->clkSrc();
const ClockEdge *clk_edge = clk_info->clkEdge(); const ClockEdge *clk_edge = clk_info->clkEdge();
const Clock *clk = clk_edge->clock(); const Clock *clk = clk_edge->clock();
@ -2278,7 +2278,7 @@ bool
ReportPath::pathFromGenPropClk(const Path *clk_path, ReportPath::pathFromGenPropClk(const Path *clk_path,
const EarlyLate *early_late) const const EarlyLate *early_late) const
{ {
ClkInfo *clk_info = clk_path->tag(search_)->clkInfo(); const ClkInfo *clk_info = clk_path->tag(search_)->clkInfo();
const ClockEdge *clk_edge = clk_info->clkEdge(); const ClockEdge *clk_edge = clk_info->clkEdge();
if (clk_edge) { if (clk_edge) {
const Clock *clk = clk_edge->clock(); const Clock *clk = clk_edge->clock();
@ -2393,7 +2393,7 @@ ReportPath::reportGenClkSrcPath1(const Clock *clk,
const Path *src_path = search_->genclks()->srcPath(clk, clk_pin, const Path *src_path = search_->genclks()->srcPath(clk, clk_pin,
clk_rf, insert_ap); clk_rf, insert_ap);
if (src_path) { if (src_path) {
ClkInfo *src_clk_info = src_path->clkInfo(this); const ClkInfo *src_clk_info = src_path->clkInfo(this);
const ClockEdge *src_clk_edge = src_clk_info->clkEdge(); const ClockEdge *src_clk_edge = src_clk_info->clkEdge();
const Clock *src_clk = src_clk_info->clock(); const Clock *src_clk = src_clk_info->clock();
if (src_clk) { if (src_clk) {

View File

@ -589,7 +589,7 @@ void
Search::deleteFilterClkInfos() Search::deleteFilterClkInfos()
{ {
for (auto itr = clk_info_set_->cbegin(); itr != clk_info_set_->cend(); ) { for (auto itr = clk_info_set_->cbegin(); itr != clk_info_set_->cend(); ) {
ClkInfo *clk_info = *itr; const ClkInfo *clk_info = *itr;
if (clk_info->crprPathRefsFilter()) { if (clk_info->crprPathRefsFilter()) {
itr = clk_info_set_->erase(itr); itr = clk_info_set_->erase(itr);
delete clk_info; delete clk_info;
@ -1324,7 +1324,7 @@ ArrivalVisitor::visitFromToPath(const Pin * /* from_pin */,
from_tag->to_string(this).c_str()); from_tag->to_string(this).c_str());
debugPrint(debug_, "search", 3, " to tag : %s", debugPrint(debug_, "search", 3, " to tag : %s",
to_tag->to_string(this).c_str()); to_tag->to_string(this).c_str());
ClkInfo *to_clk_info = to_tag->clkInfo(); const ClkInfo *to_clk_info = to_tag->clkInfo();
bool to_is_clk = to_tag->isClock(); bool to_is_clk = to_tag->isClock();
Path *match; Path *match;
size_t path_index; size_t path_index;
@ -1361,7 +1361,7 @@ ArrivalVisitor::pruneCrprArrivals()
for (auto path_itr = path_index_map.cbegin(); path_itr != path_index_map.cend(); ) { for (auto path_itr = path_index_map.cbegin(); path_itr != path_index_map.cend(); ) {
Tag *tag = path_itr->first; Tag *tag = path_itr->first;
size_t path_index = path_itr->second; size_t path_index = path_itr->second;
ClkInfo *clk_info = tag->clkInfo(); const ClkInfo *clk_info = tag->clkInfo();
bool deleted_tag = false; bool deleted_tag = false;
if (!tag->isClock() if (!tag->isClock()
&& clk_info->hasCrprClkPin()) { && clk_info->hasCrprClkPin()) {
@ -1370,7 +1370,7 @@ ArrivalVisitor::pruneCrprArrivals()
Path *path_no_crpr = tag_bldr_no_crpr_->tagMatchPath(tag); Path *path_no_crpr = tag_bldr_no_crpr_->tagMatchPath(tag);
if (path_no_crpr) { if (path_no_crpr) {
Arrival max_arrival = path_no_crpr->arrival(); Arrival max_arrival = path_no_crpr->arrival();
ClkInfo *clk_info_no_crpr = path_no_crpr->clkInfo(this); const ClkInfo *clk_info_no_crpr = path_no_crpr->clkInfo(this);
Arrival max_crpr = crpr->maxCrpr(clk_info_no_crpr); Arrival max_crpr = crpr->maxCrpr(clk_info_no_crpr);
Arrival max_arrival_max_crpr = (min_max == MinMax::max()) Arrival max_arrival_max_crpr = (min_max == MinMax::max())
? max_arrival - max_crpr ? max_arrival - max_crpr
@ -1608,7 +1608,7 @@ Search::seedClkArrival(const Pin *pin,
// Propagate liberty "pulse_clock" transition to transitive fanout. // Propagate liberty "pulse_clock" transition to transitive fanout.
LibertyPort *port = network_->libertyPort(pin); LibertyPort *port = network_->libertyPort(pin);
const RiseFall *pulse_clk_sense = (port ? port->pulseClkSense() : nullptr); const RiseFall *pulse_clk_sense = (port ? port->pulseClkSense() : nullptr);
ClkInfo *clk_info = findClkInfo(clk_edge, pin, is_propagated, nullptr, false, const ClkInfo *clk_info = findClkInfo(clk_edge, pin, is_propagated, nullptr, false,
pulse_clk_sense, insertion, latency, pulse_clk_sense, insertion, latency,
uncertainties, path_ap, nullptr); uncertainties, path_ap, nullptr);
// Only false_paths -from apply to clock tree pins. // Only false_paths -from apply to clock tree pins.
@ -1650,7 +1650,7 @@ Search::clkDataTag(const Pin *pin,
if (sdc_->exceptionFromStates(pin, rf, clk, rf, min_max, states)) { if (sdc_->exceptionFromStates(pin, rf, clk, rf, min_max, states)) {
bool is_propagated = (clk->isPropagated() bool is_propagated = (clk->isPropagated()
|| sdc_->isPropagatedClock(pin)); || sdc_->isPropagatedClock(pin));
ClkInfo *clk_info = findClkInfo(clk_edge, pin, is_propagated, const ClkInfo *clk_info = findClkInfo(clk_edge, pin, is_propagated,
insertion, path_ap); insertion, path_ap);
return findTag(rf, path_ap, clk_info, false, nullptr, false, states, true); return findTag(rf, path_ap, clk_info, false, nullptr, false, states, true);
} }
@ -1886,7 +1886,7 @@ Search::inputDelayRefPinArrival(Path *ref_path,
{ {
Clock *clk = clk_edge->clock(); Clock *clk = clk_edge->clock();
if (clk->isPropagated()) { if (clk->isPropagated()) {
ClkInfo *clk_info = ref_path->clkInfo(this); const ClkInfo *clk_info = ref_path->clkInfo(this);
ref_arrival = delayAsFloat(ref_path->arrival()); ref_arrival = delayAsFloat(ref_path->arrival());
ref_insertion = delayAsFloat(clk_info->insertion()); ref_insertion = delayAsFloat(clk_info->insertion());
ref_latency = clk_info->latency(); ref_latency = clk_info->latency();
@ -2009,7 +2009,7 @@ Search::inputDelayTag(const Pin *pin,
ExceptionStateSet *states = nullptr; ExceptionStateSet *states = nullptr;
Tag *tag = nullptr; Tag *tag = nullptr;
if (sdc_->exceptionFromStates(pin,rf,clk,clk_rf,min_max,states)) { if (sdc_->exceptionFromStates(pin,rf,clk,clk_rf,min_max,states)) {
ClkInfo *clk_info = findClkInfo(clk_edge, clk_pin, is_propagated, nullptr, const ClkInfo *clk_info = findClkInfo(clk_edge, clk_pin, is_propagated, nullptr,
false, nullptr, clk_insertion, clk_latency, false, nullptr, clk_insertion, clk_latency,
clk_uncertainties, path_ap, nullptr); clk_uncertainties, path_ap, nullptr);
tag = findTag(rf, path_ap, clk_info, false, input_delay, is_segment_start, tag = findTag(rf, path_ap, clk_info, false, input_delay, is_segment_start,
@ -2017,7 +2017,7 @@ Search::inputDelayTag(const Pin *pin,
} }
if (tag) { if (tag) {
ClkInfo *clk_info = tag->clkInfo(); const ClkInfo *clk_info = tag->clkInfo();
// Check for state changes on existing tag exceptions (pending -thru pins). // Check for state changes on existing tag exceptions (pending -thru pins).
tag = mutateTag(tag, pin, rf, false, clk_info, tag = mutateTag(tag, pin, rf, false, clk_info,
pin, rf, false, false, is_segment_start, clk_info, pin, rf, false, false, is_segment_start, clk_info,
@ -2149,7 +2149,7 @@ PathVisitor::visitFromPath(const Pin *from_pin,
{ {
const TimingRole *role = edge->role(); const TimingRole *role = edge->role();
Tag *from_tag = from_path->tag(this); Tag *from_tag = from_path->tag(this);
ClkInfo *from_clk_info = from_tag->clkInfo(); const ClkInfo *from_clk_info = from_tag->clkInfo();
Tag *to_tag = nullptr; Tag *to_tag = nullptr;
const ClockEdge *clk_edge = from_clk_info->clkEdge(); const ClockEdge *clk_edge = from_clk_info->clkEdge();
const Clock *clk = from_clk_info->clock(); const Clock *clk = from_clk_info->clock();
@ -2219,7 +2219,7 @@ PathVisitor::visitFromPath(const Pin *from_pin,
// passed thru reg/latch D->Q edges. // passed thru reg/latch D->Q edges.
&& from_tag->isClock())) { && from_tag->isClock())) {
const RiseFall *clk_rf = clk_edge ? clk_edge->transition() : nullptr; const RiseFall *clk_rf = clk_edge ? clk_edge->transition() : nullptr;
ClkInfo *to_clk_info = from_clk_info; const ClkInfo *to_clk_info = from_clk_info;
if (from_clk_info->crprClkPath(this) == nullptr if (from_clk_info->crprClkPath(this) == nullptr
|| network_->direction(to_pin)->isInternal()) || network_->direction(to_pin)->isInternal())
to_clk_info = search_->clkInfoWithCrprClkPath(from_clk_info, to_clk_info = search_->clkInfoWithCrprClkPath(from_clk_info,
@ -2302,7 +2302,7 @@ PathVisitor::visitFromPath(const Pin *from_pin,
Arrival Arrival
Search::clkPathArrival(const Path *clk_path) const Search::clkPathArrival(const Path *clk_path) const
{ {
ClkInfo *clk_info = clk_path->clkInfo(this); const ClkInfo *clk_info = clk_path->clkInfo(this);
const ClockEdge *clk_edge = clk_info->clkEdge(); const ClockEdge *clk_edge = clk_info->clkEdge();
const PathAnalysisPt *path_ap = clk_path->pathAnalysisPt(this); const PathAnalysisPt *path_ap = clk_path->pathAnalysisPt(this);
const MinMax *min_max = path_ap->pathMinMax(); const MinMax *min_max = path_ap->pathMinMax();
@ -2311,7 +2311,7 @@ Search::clkPathArrival(const Path *clk_path) const
Arrival Arrival
Search::clkPathArrival(const Path *clk_path, Search::clkPathArrival(const Path *clk_path,
ClkInfo *clk_info, const ClkInfo *clk_info,
const ClockEdge *clk_edge, const ClockEdge *clk_edge,
const MinMax *min_max, const MinMax *min_max,
const PathAnalysisPt *path_ap) const const PathAnalysisPt *path_ap) const
@ -2336,7 +2336,7 @@ Search::clkPathArrival(const Path *clk_path,
Arrival Arrival
Search::pathClkPathArrival(const Path *path) const Search::pathClkPathArrival(const Path *path) const
{ {
ClkInfo *clk_info = path->clkInfo(this); const ClkInfo *clk_info = path->clkInfo(this);
if (clk_info->isPropagated()) { if (clk_info->isPropagated()) {
const Path *src_clk_path = pathClkPathArrival1(path); const Path *src_clk_path = pathClkPathArrival1(path);
if (src_clk_path) if (src_clk_path)
@ -2391,7 +2391,7 @@ Search::fromUnclkedInputTag(const Pin *pin,
ExceptionStateSet *states = nullptr; ExceptionStateSet *states = nullptr;
if (sdc_->exceptionFromStates(pin, rf, nullptr, nullptr, min_max, states) if (sdc_->exceptionFromStates(pin, rf, nullptr, nullptr, min_max, states)
&& (!require_exception || states)) { && (!require_exception || states)) {
ClkInfo *clk_info = findClkInfo(nullptr, nullptr, false, 0.0, path_ap); const ClkInfo *clk_info = findClkInfo(nullptr, nullptr, false, 0.0, path_ap);
return findTag(rf, path_ap, clk_info, false, nullptr, return findTag(rf, path_ap, clk_info, false, nullptr,
is_segment_start, states, true); is_segment_start, states, true);
} }
@ -2403,7 +2403,7 @@ Search::fromRegClkTag(const Pin *from_pin,
const RiseFall *from_rf, const RiseFall *from_rf,
const Clock *clk, const Clock *clk,
const RiseFall *clk_rf, const RiseFall *clk_rf,
ClkInfo *clk_info, const ClkInfo *clk_info,
const Pin *to_pin, const Pin *to_pin,
const RiseFall *to_rf, const RiseFall *to_rf,
const MinMax *min_max, const MinMax *min_max,
@ -2421,8 +2421,8 @@ Search::fromRegClkTag(const Pin *from_pin,
} }
// Insert from_path as ClkInfo crpr_clk_path. // Insert from_path as ClkInfo crpr_clk_path.
ClkInfo * const ClkInfo *
Search::clkInfoWithCrprClkPath(ClkInfo *from_clk_info, Search::clkInfoWithCrprClkPath(const ClkInfo *from_clk_info,
Path *from_path, Path *from_path,
const PathAnalysisPt *path_ap) const PathAnalysisPt *path_ap)
{ {
@ -2454,7 +2454,7 @@ Search::thruTag(Tag *from_tag,
Vertex *to_vertex = edge->to(graph_); Vertex *to_vertex = edge->to(graph_);
const Pin *to_pin = to_vertex->pin(); const Pin *to_pin = to_vertex->pin();
const RiseFall *from_rf = from_tag->transition(); const RiseFall *from_rf = from_tag->transition();
ClkInfo *from_clk_info = from_tag->clkInfo(); const ClkInfo *from_clk_info = from_tag->clkInfo();
bool to_is_reg_clk = to_vertex->isRegClk(); bool to_is_reg_clk = to_vertex->isRegClk();
Tag *to_tag = mutateTag(from_tag, from_pin, from_rf, false, from_clk_info, Tag *to_tag = mutateTag(from_tag, from_pin, from_rf, false, from_clk_info,
to_pin, to_rf, false, to_is_reg_clk, false, to_pin, to_rf, false, to_is_reg_clk, false,
@ -2479,7 +2479,7 @@ Search::thruClkTag(Path *from_path,
Vertex *to_vertex = edge->to(graph_); Vertex *to_vertex = edge->to(graph_);
const Pin *to_pin = to_vertex->pin(); const Pin *to_pin = to_vertex->pin();
const RiseFall *from_rf = from_tag->transition(); const RiseFall *from_rf = from_tag->transition();
ClkInfo *from_clk_info = from_tag->clkInfo(); const ClkInfo *from_clk_info = from_tag->clkInfo();
bool from_is_clk = from_tag->isClock(); bool from_is_clk = from_tag->isClock();
bool to_is_reg_clk = to_vertex->isRegClk(); bool to_is_reg_clk = to_vertex->isRegClk();
const TimingRole *role = edge->role(); const TimingRole *role = edge->role();
@ -2487,7 +2487,8 @@ Search::thruClkTag(Path *from_path,
&& to_propagates_clk && to_propagates_clk
&& (role->isWire() && (role->isWire()
|| role == TimingRole::combinational())); || role == TimingRole::combinational()));
ClkInfo *to_clk_info = thruClkInfo(from_path, from_vertex, from_clk_info, from_is_clk, const ClkInfo *to_clk_info = thruClkInfo(from_path, from_vertex,
from_clk_info, from_is_clk,
edge, to_vertex, to_pin, to_is_clk, edge, to_vertex, to_pin, to_is_clk,
arc_delay_min_max_eq, min_max, path_ap); arc_delay_min_max_eq, min_max, path_ap);
Tag *to_tag = mutateTag(from_tag,from_pin,from_rf,from_is_clk,from_clk_info, Tag *to_tag = mutateTag(from_tag,from_pin,from_rf,from_is_clk,from_clk_info,
@ -2496,10 +2497,10 @@ Search::thruClkTag(Path *from_path,
return to_tag; return to_tag;
} }
ClkInfo * const ClkInfo *
Search::thruClkInfo(Path *from_path, Search::thruClkInfo(Path *from_path,
Vertex *from_vertex, Vertex *from_vertex,
ClkInfo *from_clk_info, const ClkInfo *from_clk_info,
bool from_is_clk, bool from_is_clk,
Edge *edge, Edge *edge,
Vertex *to_vertex, Vertex *to_vertex,
@ -2596,11 +2597,13 @@ Search::thruClkInfo(Path *from_path,
} }
if (changed) { if (changed) {
ClkInfo *to_clk_info = findClkInfo(from_clk_edge, from_clk_info->clkSrc(), const ClkInfo *to_clk_info = findClkInfo(from_clk_edge,
from_clk_info->clkSrc(),
to_clk_prop, gen_clk_src, to_clk_prop, gen_clk_src,
from_clk_info->isGenClkSrcPath(), from_clk_info->isGenClkSrcPath(),
to_pulse_sense, to_insertion, to_latency, to_pulse_sense, to_insertion, to_latency,
to_uncertainties, path_ap, to_crpr_clk_path); to_uncertainties, path_ap,
to_crpr_clk_path);
return to_clk_info; return to_clk_info;
} }
return from_clk_info; return from_clk_info;
@ -2612,13 +2615,13 @@ Search::mutateTag(Tag *from_tag,
const Pin *from_pin, const Pin *from_pin,
const RiseFall *from_rf, const RiseFall *from_rf,
bool from_is_clk, bool from_is_clk,
ClkInfo *from_clk_info, const ClkInfo *from_clk_info,
const Pin *to_pin, const Pin *to_pin,
const RiseFall *to_rf, const RiseFall *to_rf,
bool to_is_clk, bool to_is_clk,
bool to_is_reg_clk, bool to_is_reg_clk,
bool to_is_segment_start, bool to_is_segment_start,
ClkInfo *to_clk_info, const ClkInfo *to_clk_info,
InputDelay *to_input_delay, InputDelay *to_input_delay,
const MinMax *min_max, const MinMax *min_max,
const PathAnalysisPt *path_ap) const PathAnalysisPt *path_ap)
@ -2965,7 +2968,7 @@ Search::tagCount() const
Tag * Tag *
Search::findTag(const RiseFall *rf, Search::findTag(const RiseFall *rf,
const PathAnalysisPt *path_ap, const PathAnalysisPt *path_ap,
ClkInfo *clk_info, const ClkInfo *clk_info,
bool is_clk, bool is_clk,
InputDelay *input_delay, InputDelay *input_delay,
bool is_segment_start, bool is_segment_start,
@ -3035,17 +3038,17 @@ Search::reportTags() const
void void
Search::reportClkInfos() const Search::reportClkInfos() const
{ {
Vector<ClkInfo*> clk_infos; Vector<const ClkInfo*> clk_infos;
// set -> vector for sorting. // set -> vector for sorting.
for (ClkInfo *clk_info : *clk_info_set_) for (const ClkInfo *clk_info : *clk_info_set_)
clk_infos.push_back(clk_info); clk_infos.push_back(clk_info);
sort(clk_infos, ClkInfoLess(this)); sort(clk_infos, ClkInfoLess(this));
for (ClkInfo *clk_info : clk_infos) for (const ClkInfo *clk_info : clk_infos)
report_->reportLine("%s", clk_info->to_string(this).c_str()); report_->reportLine("%s", clk_info->to_string(this).c_str());
report_->reportLine("%zu clk infos", clk_info_set_->size()); report_->reportLine("%zu clk infos", clk_info_set_->size());
} }
ClkInfo * const ClkInfo *
Search::findClkInfo(const ClockEdge *clk_edge, Search::findClkInfo(const ClockEdge *clk_edge,
const Pin *clk_src, const Pin *clk_src,
bool is_propagated, bool is_propagated,
@ -3062,7 +3065,7 @@ Search::findClkInfo(const ClockEdge *clk_edge,
pulse_clk_sense, insertion, latency, uncertainties, pulse_clk_sense, insertion, latency, uncertainties,
path_ap->index(), crpr_clk_path, this); path_ap->index(), crpr_clk_path, this);
LockGuard lock(clk_info_lock_); LockGuard lock(clk_info_lock_);
ClkInfo *clk_info = clk_info_set_->findKey(&probe); const ClkInfo *clk_info = clk_info_set_->findKey(&probe);
if (clk_info == nullptr) { if (clk_info == nullptr) {
clk_info = new ClkInfo(clk_edge, clk_src, clk_info = new ClkInfo(clk_edge, clk_src,
is_propagated, gen_clk_src, gen_clk_src_path, is_propagated, gen_clk_src, gen_clk_src_path,
@ -3073,7 +3076,7 @@ Search::findClkInfo(const ClockEdge *clk_edge,
return clk_info; return clk_info;
} }
ClkInfo * const ClkInfo *
Search::findClkInfo(const ClockEdge *clk_edge, Search::findClkInfo(const ClockEdge *clk_edge,
const Pin *clk_src, const Pin *clk_src,
bool is_propagated, bool is_propagated,

View File

@ -2881,7 +2881,7 @@ Sta::vertexArrival(Vertex *vertex,
while (path_iter.hasNext()) { while (path_iter.hasNext()) {
Path *path = path_iter.next(); Path *path = path_iter.next();
const Arrival &path_arrival = path->arrival(); const Arrival &path_arrival = path->arrival();
ClkInfo *clk_info = path->clkInfo(search_); const ClkInfo *clk_info = path->clkInfo(search_);
if ((clk_edge == clk_edge_wildcard if ((clk_edge == clk_edge_wildcard
|| clk_info->clkEdge() == clk_edge) || clk_info->clkEdge() == clk_edge)
&& !clk_info->isGenClkSrcPath() && !clk_info->isGenClkSrcPath()

View File

@ -41,7 +41,7 @@ namespace sta {
Tag::Tag(TagIndex index, Tag::Tag(TagIndex index,
int rf_index, int rf_index,
PathAPIndex path_ap_index, PathAPIndex path_ap_index,
ClkInfo *clk_info, const ClkInfo *clk_info,
bool is_clk, bool is_clk,
InputDelay *input_delay, InputDelay *input_delay,
bool is_segment_start, bool is_segment_start,
@ -305,8 +305,8 @@ Tag::cmp(const Tag *tag1,
if (tag1 == tag2) if (tag1 == tag2)
return 0; return 0;
ClkInfo *clk_info1 = tag1->clkInfo(); const ClkInfo *clk_info1 = tag1->clkInfo();
ClkInfo *clk_info2 = tag2->clkInfo(); const ClkInfo *clk_info2 = tag2->clkInfo();
int clk_cmp = ClkInfo::cmp(clk_info1, clk_info2, sta); int clk_cmp = ClkInfo::cmp(clk_info1, clk_info2, sta);
if (clk_cmp != 0) if (clk_cmp != 0)
return clk_cmp; return clk_cmp;

View File

@ -54,7 +54,7 @@ public:
Tag(TagIndex index, Tag(TagIndex index,
int rf_index, int rf_index,
PathAPIndex path_ap_index, PathAPIndex path_ap_index,
ClkInfo *clk_info, const ClkInfo *clk_info,
bool is_clk, bool is_clk,
InputDelay *input_delay, InputDelay *input_delay,
bool is_segment_start, bool is_segment_start,
@ -66,7 +66,7 @@ public:
std::string to_string(bool report_index, std::string to_string(bool report_index,
bool report_rf_min_max, bool report_rf_min_max,
const StaState *sta) const; const StaState *sta) const;
ClkInfo *clkInfo() const { return clk_info_; } const ClkInfo *clkInfo() const { return clk_info_; }
bool isClock() const { return is_clk_; } bool isClock() const { return is_clk_; }
const ClockEdge *clkEdge() const; const ClockEdge *clkEdge() const;
const Clock *clock() const; const Clock *clock() const;
@ -126,7 +126,7 @@ protected:
const Tag *tag2); const Tag *tag2);
private: private:
ClkInfo *clk_info_; const ClkInfo *clk_info_;
InputDelay *input_delay_; InputDelay *input_delay_;
ExceptionStateSet *states_; ExceptionStateSet *states_;
size_t hash_; size_t hash_;

View File

@ -162,7 +162,7 @@ VisitPathEnds::visitCheckEnd(const Pin *pin,
tgt_clk_path_ap, this); tgt_clk_path_ap, this);
while (tgt_clk_path_iter.hasNext()) { while (tgt_clk_path_iter.hasNext()) {
Path *tgt_clk_path = tgt_clk_path_iter.next(); Path *tgt_clk_path = tgt_clk_path_iter.next();
ClkInfo *tgt_clk_info = tgt_clk_path->clkInfo(this); const ClkInfo *tgt_clk_info = tgt_clk_path->clkInfo(this);
const ClockEdge *tgt_clk_edge = tgt_clk_path->clkEdge(this); const ClockEdge *tgt_clk_edge = tgt_clk_path->clkEdge(this);
const Clock *tgt_clk = tgt_clk_path->clock(this); const Clock *tgt_clk = tgt_clk_path->clock(this);
const Pin *tgt_pin = tgt_clk_vertex->pin(); const Pin *tgt_pin = tgt_clk_vertex->pin();