Skip to content

Commit 2355a48

Browse files
committed
rsz: Share latch data path helper
Move latchDataPath to OptimizerTypes so setup policies and target collection use one helper for latch-through path expansion. Remove the duplicate RepairTargetCollector member and SetupLegacyBase local helper while preserving the same latch D-side path handling. Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
1 parent db9596e commit 2355a48

5 files changed

Lines changed: 19 additions & 28 deletions

File tree

src/rsz/src/OptimizerTypes.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,16 @@ const sta::TimingArc* findMatchingTimingArc(const sta::TimingArc* reference,
195195
reference, candidate, ArcMatchMode::kExact, nullptr);
196196
}
197197

198+
const sta::Path* latchDataPath(const sta::PathExpanded& expanded,
199+
const sta::StaState*)
200+
{
201+
const sta::Path* d_path = nullptr;
202+
const sta::Path* q_path = nullptr;
203+
sta::Edge* d_q_edge = nullptr;
204+
expanded.latchPaths(d_path, q_path, d_q_edge);
205+
return d_path;
206+
}
207+
198208
bool Target::canBePathDriver() const
199209
{
200210
return (views & kPathDriverView) != 0 && driver_pin != nullptr

src/rsz/src/OptimizerTypes.hh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class Pin;
2727
class Pvt;
2828
class RiseFall;
2929
class Scene;
30+
class StaState;
3031
class TimingArc;
3132
class TimingArcSet;
3233
class Vertex;
@@ -132,6 +133,10 @@ struct SelectedArc
132133
const sta::TimingArc* findMatchingTimingArc(const sta::TimingArc* reference,
133134
const sta::TimingArcSet* candidate);
134135

136+
// Return the latch D-side path attached to an expanded latch-through path.
137+
const sta::Path* latchDataPath(const sta::PathExpanded& expanded,
138+
const sta::StaState* sta);
139+
135140
// One timing arc that can contribute to the driver's output slew merge for the
136141
// selected output transition. STA merges output slew across all such arcs
137142
// before the next stage consumes it.

src/rsz/src/RepairTargetCollector.cc

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -878,16 +878,6 @@ sta::Path* RepairTargetCollector::findWorstSlackPath(
878878
return sta_->vertexWorstSlackPath(endpoint, max_);
879879
}
880880

881-
const sta::Path* RepairTargetCollector::latchDataPath(
882-
const sta::PathExpanded& expanded) const
883-
{
884-
const sta::Path* d_path = nullptr;
885-
const sta::Path* q_path = nullptr;
886-
sta::Edge* d_q_edge = nullptr;
887-
expanded.latchPaths(d_path, q_path, d_q_edge);
888-
return d_path;
889-
}
890-
891881
void RepairTargetCollector::collectExpandedPathDriverTargets(
892882
const sta::Path* endpoint_path,
893883
const sta::PathExpanded& expanded,
@@ -945,7 +935,7 @@ std::vector<Target> RepairTargetCollector::collectPathDriverTargets(
945935
// A latch-through path starts at latch Q in OpenSTA, with the latch D path
946936
// stored as side context. Expand that D path separately so repair_timing can
947937
// optimize the logic that consumed the borrowed time.
948-
const sta::Path* d_path = latchDataPath(expanded);
938+
const sta::Path* d_path = latchDataPath(expanded, sta_);
949939
if (d_path != nullptr) {
950940
sta::PathExpanded d_expanded(d_path, sta_);
951941
collectExpandedPathDriverTargets(d_path, d_expanded, path_slack, targets);
@@ -1269,7 +1259,7 @@ set<const sta::Pin*> RepairTargetCollector::collectPinsByPathEndpoint(
12691259
}
12701260
}
12711261

1272-
const sta::Path* d_path = latchDataPath(expanded);
1262+
const sta::Path* d_path = latchDataPath(expanded, sta_);
12731263
if (d_path != nullptr) {
12741264
sta::PathExpanded d_expanded(d_path, sta_);
12751265
const size_t old_size = viol_pins.size();

src/rsz/src/RepairTargetCollector.hh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,6 @@ class RepairTargetCollector
286286
void sortByHeuristic(float load_delay_threshold = 0.0);
287287
std::map<const sta::Pin*, sta::Delay> getLocalTns() const;
288288
sta::Delay getLocalPinTns(const sta::Pin* pin) const;
289-
const sta::Path* latchDataPath(const sta::PathExpanded& expanded) const;
290289
void collectExpandedPathDriverTargets(const sta::Path* endpoint_path,
291290
const sta::PathExpanded& expanded,
292291
sta::Slack path_slack,

src/rsz/src/policy/SetupLegacyBase.cc

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,6 @@ using std::vector;
5353

5454
using utl::RSZ;
5555

56-
namespace {
57-
58-
const sta::Path* latchDataPath(const sta::PathExpanded& expanded)
59-
{
60-
const sta::Path* d_path = nullptr;
61-
const sta::Path* q_path = nullptr;
62-
sta::Edge* d_q_edge = nullptr;
63-
expanded.latchPaths(d_path, q_path, d_q_edge);
64-
return d_path;
65-
}
66-
67-
} // namespace
68-
6956
SetupLegacyBase::SetupLegacyBase(Resizer& resizer,
7057
MoveCommitter& committer,
7158
RepairSetupContext& setup_context,
@@ -470,7 +457,7 @@ bool SetupLegacyBase::makePinTargetOnPath(const sta::Pin* pin,
470457
return true;
471458
}
472459

473-
const sta::Path* d_path = latchDataPath(expanded);
460+
const sta::Path* d_path = latchDataPath(expanded, sta_);
474461
if (d_path == nullptr) {
475462
return false;
476463
}
@@ -797,7 +784,7 @@ bool SetupLegacyBase::repairPath(sta::Path* path,
797784
ranked_targets.emplace_back(std::move(target), load_delay.second);
798785
}
799786

800-
const sta::Path* d_path = latchDataPath(expanded);
787+
const sta::Path* d_path = latchDataPath(expanded, sta_);
801788
if (d_path != nullptr) {
802789
sta::PathExpanded d_expanded(d_path, sta_);
803790
const sta::Scene* d_corner = d_path->scene(sta_);

0 commit comments

Comments
 (0)