Sta::vertexRequired

This commit is contained in:
James Cherry 2021-03-27 17:46:35 -07:00
parent 80a89105a6
commit 6aad0b073c
5 changed files with 84 additions and 87 deletions

View File

@ -123,6 +123,11 @@ public:
const RiseFall *rf,
const MinMax *min_max,
const StaState *sta);
VertexPathIterator(Vertex *vertex,
const RiseFall *rf,
const PathAnalysisPt *path_ap,
const MinMax *min_max,
const StaState *sta);
virtual ~VertexPathIterator();
virtual bool hasNext();
virtual PathVertex *next();

View File

@ -946,28 +946,16 @@ public:
VertexPathIterator *vertexPathIterator(Vertex *vertex,
const RiseFall *rf,
const MinMax *min_max);
void
vertexWorstArrivalPath(Vertex *vertex,
const RiseFall *rf,
const MinMax *min_max,
// Return value.
PathRef &worst_path);
void
vertexWorstArrivalPath(Vertex *vertex,
const MinMax *min_max,
// Return value.
PathRef &worst_path);
void
vertexWorstSlackPath(Vertex *vertex,
const MinMax *min_max,
// Return value.
PathRef &worst_path);
void
vertexWorstSlackPath(Vertex *vertex,
const RiseFall *rf,
const MinMax *min_max,
// Return value.
PathRef &worst_path);
PathRef vertexWorstArrivalPath(Vertex *vertex,
const RiseFall *rf,
const MinMax *min_max);
PathRef vertexWorstArrivalPath(Vertex *vertex,
const MinMax *min_max);
PathRef vertexWorstSlackPath(Vertex *vertex,
const MinMax *min_max);
PathRef vertexWorstSlackPath(Vertex *vertex,
const RiseFall *rf,
const MinMax *min_max);
// The following arrival/required/slack functions incrementally
// update timing to the level of the vertex. They do NOT do multiple
@ -983,6 +971,9 @@ public:
const PathAnalysisPt *path_ap);
Required vertexRequired(Vertex *vertex,
const MinMax *min_max);
Required vertexRequired(Vertex *vertex,
const RiseFall *rf,
const MinMax *min_max);
// Min/max across all clock tags.
Required vertexRequired(Vertex *vertex,
const RiseFall *rf,
@ -1283,6 +1274,11 @@ protected:
const ClockEdge *clk_edge,
const PathAnalysisPt *path_ap);
void findRequired(Vertex *vertex);
Required vertexRequired(Vertex *vertex,
const RiseFall *rf,
const ClockEdge *clk_edge,
const PathAnalysisPt *path_ap,
const MinMax *min_max);
void connectDrvrPinAfter(Vertex *vertex);
void connectLoadPinAfter(Vertex *vertex);
Path *latchEnablePath(Path *q_path,

View File

@ -542,6 +542,24 @@ VertexPathIterator::VertexPathIterator(Vertex *vertex,
}
}
VertexPathIterator::VertexPathIterator(Vertex *vertex,
const RiseFall *rf,
const PathAnalysisPt *path_ap,
const MinMax *min_max,
const StaState *sta) :
search_(sta->search()),
vertex_(vertex),
rf_(rf),
path_ap_(path_ap),
min_max_(min_max)
{
TagGroup *tag_group = search_->tagGroup(vertex);
if (tag_group) {
arrival_iter_.init(tag_group->arrivalMap());
findNext();
}
}
VertexPathIterator::~VertexPathIterator()
{
}

View File

@ -2677,13 +2677,12 @@ Sta::vertexPathIterator(Vertex *vertex,
return new VertexPathIterator(vertex, rf, min_max, this);
}
void
PathRef
Sta::vertexWorstArrivalPath(Vertex *vertex,
const RiseFall *rf,
const MinMax *min_max,
// Return value.
PathRef &worst_path)
const MinMax *min_max)
{
PathRef worst_path;
Arrival worst_arrival = min_max->initValue();
VertexPathIterator path_iter(vertex, rf, min_max, this);
while (path_iter.hasNext()) {
@ -2695,35 +2694,22 @@ Sta::vertexWorstArrivalPath(Vertex *vertex,
worst_path.init(path);
}
}
return worst_path;
}
void
PathRef
Sta::vertexWorstArrivalPath(Vertex *vertex,
const MinMax *min_max,
// Return value.
PathRef &worst_path)
const MinMax *min_max)
{
Arrival worst_arrival = min_max->initValue();
VertexPathIterator path_iter(vertex, this);
while (path_iter.hasNext()) {
PathVertex *path = path_iter.next();
Arrival arrival = path->arrival(this);
if (path->minMax(this) == min_max
&& !path->tag(this)->isGenClkSrcPath()
&& delayGreater(arrival, worst_arrival, min_max, this)) {
worst_arrival = arrival;
worst_path.init(path);
}
}
return vertexWorstArrivalPath(vertex, nullptr, min_max);
}
void
PathRef
Sta::vertexWorstSlackPath(Vertex *vertex,
const RiseFall *rf,
const MinMax *min_max,
// Return value.
PathRef &worst_path)
const MinMax *min_max)
{
PathRef worst_path;
Slack min_slack = MinMax::min()->initValue();
VertexPathIterator path_iter(vertex, rf, min_max, this);
while (path_iter.hasNext()) {
@ -2735,28 +2721,15 @@ Sta::vertexWorstSlackPath(Vertex *vertex,
worst_path.init(path);
}
}
return worst_path;
}
void
PathRef
Sta::vertexWorstSlackPath(Vertex *vertex,
const MinMax *min_max,
// Return value.
PathRef &worst_path)
const MinMax *min_max)
{
Slack min_slack = MinMax::min()->initValue();
VertexPathIterator path_iter(vertex, this);
while (path_iter.hasNext()) {
PathVertex *path = path_iter.next();
if (path->minMax(this) == min_max
&& !path->tag(this)->isGenClkSrcPath()) {
Slack slack = path->slack(this);
if (delayLess(slack, min_slack, this)) {
min_slack = slack;
worst_path.init(path);
}
}
}
return vertexWorstSlackPath(vertex, nullptr, min_max);
}
Arrival
@ -2795,19 +2768,15 @@ Required
Sta::vertexRequired(Vertex *vertex,
const MinMax *min_max)
{
findRequired(vertex);
const MinMax *req_min_max = min_max->opposite();
Required required = req_min_max->initValue();
VertexPathIterator path_iter(vertex, this);
while (path_iter.hasNext()) {
const Path *path = path_iter.next();
if (path->minMax(this) == min_max) {
const Required path_required = path->required(this);
if (delayGreater(path_required, required, req_min_max, this))
required = path_required;
}
}
return required;
return vertexRequired(vertex, nullptr, clk_edge_wildcard, nullptr, min_max);
}
Required
Sta::vertexRequired(Vertex *vertex,
const RiseFall *rf,
const MinMax *min_max)
{
return vertexRequired(vertex, rf, clk_edge_wildcard, nullptr, min_max);
}
Required
@ -2815,7 +2784,7 @@ Sta::vertexRequired(Vertex *vertex,
const RiseFall *rf,
const PathAnalysisPt *path_ap)
{
return vertexRequired(vertex, rf, clk_edge_wildcard, path_ap);
return vertexRequired(vertex, rf, clk_edge_wildcard, path_ap, nullptr);
}
Required
@ -2823,17 +2792,29 @@ Sta::vertexRequired(Vertex *vertex,
const RiseFall *rf,
const ClockEdge *clk_edge,
const PathAnalysisPt *path_ap)
{
return vertexRequired(vertex, rf, clk_edge, path_ap, nullptr);
}
Required
Sta::vertexRequired(Vertex *vertex,
const RiseFall *rf,
const ClockEdge *clk_edge,
const PathAnalysisPt *path_ap,
const MinMax *min_max)
{
findRequired(vertex);
const MinMax *min_max = path_ap->pathMinMax()->opposite();
Required required = min_max->initValue();
VertexPathIterator path_iter(vertex, rf, path_ap, this);
const MinMax *req_min_max = min_max
? min_max->opposite()
: path_ap->pathMinMax()->opposite();
Required required = req_min_max->initValue();
VertexPathIterator path_iter(vertex, rf, path_ap, min_max, this);
while (path_iter.hasNext()) {
const Path *path = path_iter.next();
const Required path_required = path->required(this);
if ((clk_edge == clk_edge_wildcard
|| path->clkEdge(search_) == clk_edge)
&& delayGreater(path_required, required, min_max, this))
&& delayGreater(path_required, required, req_min_max, this))
required = path_required;
}
return required;

View File

@ -4657,8 +4657,7 @@ vertex_worst_arrival_path(Vertex *vertex,
const MinMax *min_max)
{
Sta *sta = Sta::sta();
PathRef path;
sta->vertexWorstArrivalPath(vertex, min_max, path);
PathRef path = sta->vertexWorstArrivalPath(vertex, min_max);
if (!path.isNull())
return new PathRef(path);
else
@ -4671,8 +4670,7 @@ vertex_worst_arrival_path_rf(Vertex *vertex,
MinMax *min_max)
{
Sta *sta = Sta::sta();
PathRef path;
sta->vertexWorstArrivalPath(vertex, rf, min_max, path);
PathRef path = sta->vertexWorstArrivalPath(vertex, rf, min_max);
if (!path.isNull())
return new PathRef(path);
else
@ -4684,8 +4682,7 @@ vertex_worst_slack_path(Vertex *vertex,
const MinMax *min_max)
{
Sta *sta = Sta::sta();
PathRef path;
sta->vertexWorstSlackPath(vertex, min_max, path);
PathRef path = sta->vertexWorstSlackPath(vertex, min_max);
if (!path.isNull())
return new PathRef(path);
else