Skip to content

Commit 5fbd2a1

Browse files
committed
Graph::slew/arcDelay rm static
Signed-off-by: James Cherry <cherry@parallaxsw.com>
1 parent fbd1710 commit 5fbd2a1

8 files changed

Lines changed: 36 additions & 45 deletions

File tree

dcalc/GraphDelayCalc.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ GraphDelayCalc::seedNoDrvrSlew(Vertex *drvr_vertex,
504504
ArcDelayCalc *arc_delay_calc)
505505
{
506506
DcalcAPIndex ap_index = scene->dcalcAnalysisPtIndex(min_max);
507-
Slew slew(default_slew);
507+
Slew slew = default_slew;
508508
// Top level bidirect driver uses load slew unless
509509
// bidirect instance paths are disabled.
510510
if (bidirectDrvrSlewFromLoad(drvr_pin)) {
@@ -744,7 +744,7 @@ GraphDelayCalc::loadSlewsChanged(DrvrLoadSlews &load_slews_prev,
744744
Vertex *load_vertex = graph_->pinLoadVertex(pin);
745745
SlewSeq &slews_prev = load_slews_prev[index];;
746746
for (size_t i = 0; i < slew_count; i++) {
747-
const Slew &slew = graph_->slew(load_vertex, i);
747+
const Slew slew = graph_->slew(load_vertex, i);
748748
if (!delayEqual(slew, slews_prev[i], this))
749749
return true;
750750
}
@@ -1216,13 +1216,13 @@ GraphDelayCalc::annotateDelaySlew(Edge *edge,
12161216
Vertex *drvr_vertex = edge->to(graph_);
12171217
const RiseFall *drvr_rf = arc->toEdge()->asRiseFall();
12181218
// Merge slews.
1219-
const Slew &drvr_slew = graph_->slew(drvr_vertex, drvr_rf, ap_index);
1219+
const Slew drvr_slew = graph_->slew(drvr_vertex, drvr_rf, ap_index);
12201220
if (delayGreater(gate_slew, drvr_slew, min_max, this)
12211221
&& !drvr_vertex->slewAnnotated(drvr_rf, min_max)
12221222
&& !edge->role()->isLatchDtoQ())
12231223
graph_->setSlew(drvr_vertex, drvr_rf, ap_index, gate_slew);
12241224
if (!graph_->arcDelayAnnotated(edge, arc, ap_index)) {
1225-
const ArcDelay &prev_gate_delay = graph_->arcDelay(edge,arc,ap_index);
1225+
const ArcDelay prev_gate_delay = graph_->arcDelay(edge,arc,ap_index);
12261226
float gate_delay1 = delayAsFloat(gate_delay);
12271227
float prev_gate_delay1 = delayAsFloat(prev_gate_delay);
12281228
if (prev_gate_delay1 == 0.0
@@ -1267,12 +1267,12 @@ GraphDelayCalc::annotateLoadDelays(Vertex *drvr_vertex,
12671267
if (!load_vertex->slewAnnotated(drvr_rf, min_max)) {
12681268
if (drvr_vertex->slewAnnotated(drvr_rf, min_max)) {
12691269
// Copy the driver slew to the load if it is annotated.
1270-
const Slew &drvr_slew = graph_->slew(drvr_vertex,drvr_rf,ap_index);
1270+
const Slew drvr_slew = graph_->slew(drvr_vertex,drvr_rf,ap_index);
12711271
graph_->setSlew(load_vertex, drvr_rf, ap_index, drvr_slew);
12721272
load_changed = true;
12731273
}
12741274
else {
1275-
const Slew &slew = graph_->slew(load_vertex, drvr_rf, ap_index);
1275+
const Slew slew = graph_->slew(load_vertex, drvr_rf, ap_index);
12761276
if (!merge
12771277
|| delayGreater(load_slew, slew, min_max, this)) {
12781278
graph_->setSlew(load_vertex, drvr_rf, ap_index, load_slew);
@@ -1600,7 +1600,7 @@ GraphDelayCalc::findCheckEdgeDelays(Edge *edge,
16001600
if (!graph_->arcDelayAnnotated(edge, arc, ap_index)) {
16011601
const Slew &from_slew = checkEdgeClkSlew(from_vertex, from_rf,
16021602
scene, min_max);
1603-
const Slew &to_slew = graph_->slew(to_vertex, to_rf, ap_index);
1603+
const Slew to_slew = graph_->slew(to_vertex, to_rf, ap_index);
16041604
debugPrint(debug_, "delay_calc", 3,
16051605
" %s %s -> %s %s (%s) scene:%s/%s",
16061606
arc_set->from()->name(),
@@ -1682,7 +1682,7 @@ GraphDelayCalc::reportDelayCalc(const Edge *edge,
16821682
if (role->isTimingCheck()) {
16831683
const Slew &from_slew = checkEdgeClkSlew(from_vertex, from_rf, scene, min_max);
16841684
DcalcAPIndex slew_index = scene->dcalcAnalysisPtIndex(min_max);
1685-
const Slew &to_slew = graph_->slew(to_vertex, to_rf, slew_index);
1685+
const Slew to_slew = graph_->slew(to_vertex, to_rf, slew_index);
16861686
const ClkNetwork *clk_network = scene->mode()->clkNetwork();
16871687
bool from_ideal_clk = clk_network->isIdealClock(from_vertex);
16881688
const char *from_slew_annotation = from_ideal_clk ? " (ideal clock)" : nullptr;

graph/Graph.cc

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ Graph::gateEdgeArc(const Pin *in_pin,
577577

578578
////////////////////////////////////////////////////////////////
579579

580-
const Slew &
580+
Slew
581581
Graph::slew(const Vertex *vertex,
582582
const RiseFall *rf,
583583
DcalcAPIndex ap_index)
@@ -588,14 +588,11 @@ Graph::slew(const Vertex *vertex,
588588
const Slew *slews = std::bit_cast<const Slew*>(slews_flt);
589589
return slews[slew_index];
590590
}
591-
else {
592-
static Slew slew;
593-
slew = slews_flt[slew_index];
594-
return slew;
595-
}
591+
else
592+
return slews_flt[slew_index];
596593
}
597594

598-
const Slew &
595+
Slew
599596
Graph::slew(const Vertex *vertex,
600597
size_t index)
601598
{
@@ -604,11 +601,8 @@ Graph::slew(const Vertex *vertex,
604601
const Slew *slews = std::bit_cast<const Slew*>(slews_flt);
605602
return slews[index];
606603
}
607-
else {
608-
static Slew slew;
609-
slew = slews_flt[index];
610-
return slew;
611-
}
604+
else
605+
return slews_flt[index];
612606
}
613607

614608
void
@@ -677,7 +671,7 @@ Graph::deleteEdge(Edge *edge)
677671
edges_->destroy(edge);
678672
}
679673

680-
const ArcDelay &
674+
ArcDelay
681675
Graph::arcDelay(const Edge *edge,
682676
const TimingArc *arc,
683677
DcalcAPIndex ap_index) const
@@ -689,9 +683,7 @@ Graph::arcDelay(const Edge *edge,
689683
}
690684
else {
691685
const float *delays = edge->arcDelays();
692-
static ArcDelay delay;
693-
delay = delays[index];
694-
return delay;
686+
return delays[index];
695687
}
696688
}
697689

@@ -712,7 +704,7 @@ Graph::setArcDelay(Edge *edge,
712704
}
713705
}
714706

715-
const ArcDelay &
707+
ArcDelay
716708
Graph::wireArcDelay(const Edge *edge,
717709
const RiseFall *rf,
718710
DcalcAPIndex ap_index)
@@ -724,9 +716,7 @@ Graph::wireArcDelay(const Edge *edge,
724716
}
725717
else {
726718
const float *delays = edge->arcDelays();
727-
static ArcDelay delay;
728-
delay = delays[index];
729-
return delay;
719+
return delays[index];
730720
}
731721
}
732722

include/sta/Graph.hh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ public:
9191
// Reported slew are the same as those in the liberty tables.
9292
// reported_slews = measured_slews / slew_derate_from_library
9393
// Measured slews are between slew_lower_threshold and slew_upper_threshold.
94-
const Slew &slew(const Vertex *vertex,
95-
const RiseFall *rf,
96-
DcalcAPIndex ap_index);
97-
const Slew &slew(const Vertex *vertex,
98-
size_t index);
94+
Slew slew(const Vertex *vertex,
95+
const RiseFall *rf,
96+
DcalcAPIndex ap_index);
97+
Slew slew(const Vertex *vertex,
98+
size_t index);
9999
void setSlew(Vertex *vertex,
100100
const RiseFall *rf,
101101
DcalcAPIndex ap_index,
@@ -124,17 +124,17 @@ public:
124124
Edge *&edge,
125125
const TimingArc *&arc) const;
126126

127-
const ArcDelay &arcDelay(const Edge *edge,
128-
const TimingArc *arc,
129-
DcalcAPIndex ap_index) const;
127+
ArcDelay arcDelay(const Edge *edge,
128+
const TimingArc *arc,
129+
DcalcAPIndex ap_index) const;
130130
void setArcDelay(Edge *edge,
131131
const TimingArc *arc,
132132
DcalcAPIndex ap_index,
133133
const ArcDelay &delay);
134134
// Alias for arcDelays using library wire arcs.
135-
const ArcDelay &wireArcDelay(const Edge *edge,
136-
const RiseFall *rf,
137-
DcalcAPIndex ap_index);
135+
ArcDelay wireArcDelay(const Edge *edge,
136+
const RiseFall *rf,
137+
DcalcAPIndex ap_index);
138138
void setWireArcDelay(Edge *edge,
139139
const RiseFall *rf,
140140
DcalcAPIndex ap_index,

include/sta/Path.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public:
103103
const Required &required() const {return required_; }
104104
void setRequired(const Required &required);
105105
Slack slack(const StaState *sta) const;
106-
const Slew &slew(const StaState *sta) const;
106+
const Slew slew(const StaState *sta) const;
107107
// This takes the same time as prevPath and prevArc combined.
108108
Path *prevPath() const;
109109
void setPrevPath(Path *prev_path);

include/sta/Sta.hh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,9 +1142,9 @@ public:
11421142
const SceneSeq &scenes,
11431143
const MinMax *min_max);
11441144

1145-
const ArcDelay &arcDelay(Edge *edge,
1146-
TimingArc *arc,
1147-
DcalcAPIndex ap_index);
1145+
const ArcDelay arcDelay(Edge *edge,
1146+
TimingArc *arc,
1147+
DcalcAPIndex ap_index);
11481148
// True if the timing arc has been back-annotated.
11491149
bool arcDelayAnnotated(Edge *edge,
11501150
TimingArc *arc,

search/Path.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ Path::pathAnalysisPtIndex(const StaState *sta) const
330330
return scene(sta)->pathIndex(minMax(sta));
331331
}
332332

333-
const Slew &
333+
const Slew
334334
Path::slew(const StaState *sta) const
335335
{
336336
DcalcAPIndex slew_index = scene(sta)->dcalcAnalysisPtIndex(minMax(sta));

search/Sta.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3622,7 +3622,7 @@ Sta::setIncrementalDelayTolerance(float tol)
36223622
graph_delay_calc_->setIncrementalDelayTolerance(tol);
36233623
}
36243624

3625-
const ArcDelay&
3625+
const ArcDelay
36263626
Sta::arcDelay(Edge *edge,
36273627
TimingArc *arc,
36283628
DcalcAPIndex ap_index)

tcl/Util.tcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ define_cmd_args "user_run_time" {}
267267

268268
# Write run time statistics to filename.
269269
proc write_stats { filename } {
270+
puts "stats $filename"
270271
if { ![catch {open $filename w} stream] } {
271272
puts $stream "[elapsed_run_time] [user_run_time] [memory_usage]"
272273
close $stream

0 commit comments

Comments
 (0)