2018-09-28 17:54:21 +02:00
|
|
|
// OpenSTA, Static Timing Analyzer
|
2020-03-07 03:50:37 +01:00
|
|
|
// Copyright (c) 2020, Parallax Software, Inc.
|
2018-09-28 17:54:21 +02:00
|
|
|
//
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
// (at your option) any later version.
|
|
|
|
|
//
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
//
|
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
2020-04-05 23:53:44 +02:00
|
|
|
#include "PathEnumed.hh"
|
2020-04-05 20:35:51 +02:00
|
|
|
|
2020-04-05 23:53:44 +02:00
|
|
|
#include "Set.hh"
|
|
|
|
|
#include "Graph.hh"
|
|
|
|
|
#include "Corner.hh"
|
|
|
|
|
#include "Search.hh"
|
|
|
|
|
#include "Tag.hh"
|
|
|
|
|
#include "PathRef.hh"
|
2018-09-28 17:54:21 +02:00
|
|
|
|
|
|
|
|
namespace sta {
|
|
|
|
|
|
2019-11-11 17:38:25 +01:00
|
|
|
PathEnumed:: PathEnumed(VertexId vertex_id,
|
2018-09-28 17:54:21 +02:00
|
|
|
TagIndex tag_index,
|
|
|
|
|
Arrival arrival,
|
|
|
|
|
PathEnumed *prev_path,
|
|
|
|
|
TimingArc *prev_arc) :
|
|
|
|
|
Path(),
|
|
|
|
|
prev_path_(prev_path),
|
|
|
|
|
prev_arc_(prev_arc),
|
|
|
|
|
arrival_(arrival),
|
2019-11-11 17:38:25 +01:00
|
|
|
vertex_id_(vertex_id),
|
2018-09-28 17:54:21 +02:00
|
|
|
tag_index_(tag_index)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
deletePathEnumed(PathEnumed *path)
|
|
|
|
|
{
|
|
|
|
|
while (path) {
|
|
|
|
|
PathEnumed *prev = path->prevPathEnumed();
|
|
|
|
|
delete path;
|
|
|
|
|
path = prev;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
PathEnumed::setRef(PathRef *ref) const
|
|
|
|
|
{
|
|
|
|
|
ref->init(const_cast<PathEnumed*>(this));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Vertex *
|
|
|
|
|
PathEnumed::vertex(const StaState *sta) const
|
|
|
|
|
{
|
|
|
|
|
const Graph *graph = sta->graph();
|
2019-11-11 17:38:25 +01:00
|
|
|
return graph->vertex(vertex_id_);
|
2018-09-28 17:54:21 +02:00
|
|
|
}
|
|
|
|
|
|
2019-11-11 17:38:25 +01:00
|
|
|
VertexId
|
|
|
|
|
PathEnumed::vertexId(const StaState *) const
|
2018-09-28 17:54:21 +02:00
|
|
|
{
|
2019-11-11 17:38:25 +01:00
|
|
|
return vertex_id_;
|
2018-09-28 17:54:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Tag *
|
|
|
|
|
PathEnumed::tag(const StaState *sta) const
|
|
|
|
|
{
|
|
|
|
|
const Search *search = sta->search();
|
|
|
|
|
return search->tag(tag_index_);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
PathEnumed::setTag(Tag *tag)
|
|
|
|
|
{
|
|
|
|
|
tag_index_ = tag->index();
|
|
|
|
|
}
|
|
|
|
|
|
2019-11-11 23:30:19 +01:00
|
|
|
const RiseFall *
|
2018-09-28 17:54:21 +02:00
|
|
|
PathEnumed::transition(const StaState *sta) const
|
|
|
|
|
{
|
|
|
|
|
return tag(sta)->transition();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
PathEnumed::trIndex(const StaState *sta) const
|
|
|
|
|
{
|
|
|
|
|
return tag(sta)->trIndex();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PathAnalysisPt *
|
|
|
|
|
PathEnumed::pathAnalysisPt(const StaState *sta) const
|
|
|
|
|
{
|
|
|
|
|
const Corners *corners = sta->corners();
|
|
|
|
|
return corners->findPathAnalysisPt(pathAnalysisPtIndex(sta));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PathAPIndex
|
|
|
|
|
PathEnumed::pathAnalysisPtIndex(const StaState *sta) const
|
|
|
|
|
{
|
|
|
|
|
return tag(sta)->pathAPIndex();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Arrival
|
|
|
|
|
PathEnumed::arrival(const StaState *) const
|
|
|
|
|
{
|
|
|
|
|
return arrival_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
PathEnumed::setArrival(Arrival arrival,
|
|
|
|
|
const StaState *)
|
|
|
|
|
{
|
|
|
|
|
arrival_ = arrival;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const Required &
|
2020-12-14 02:21:35 +01:00
|
|
|
PathEnumed::required(const StaState *sta) const
|
2018-09-28 17:54:21 +02:00
|
|
|
{
|
|
|
|
|
// Required times are never needed for enumerated paths.
|
2020-12-20 19:21:50 +01:00
|
|
|
sta->report()->critical(251, "enumerated path required time");
|
2020-12-20 01:27:29 +01:00
|
|
|
return delay_zero;
|
2018-09-28 17:54:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
PathEnumed::setRequired(const Required &,
|
2020-12-14 02:21:35 +01:00
|
|
|
const StaState *sta)
|
2018-09-28 17:54:21 +02:00
|
|
|
{
|
|
|
|
|
// Required times are never needed for enumerated paths.
|
2020-12-20 19:21:50 +01:00
|
|
|
sta->report()->critical(252, "enumerated path required time");
|
2018-09-28 17:54:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Path *
|
|
|
|
|
PathEnumed::prevPath(const StaState *) const
|
|
|
|
|
{
|
|
|
|
|
return prev_path_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
PathEnumed::prevPath(const StaState *,
|
|
|
|
|
// Return values.
|
|
|
|
|
PathRef &prev_path,
|
|
|
|
|
TimingArc *&prev_arc) const
|
|
|
|
|
{
|
|
|
|
|
if (prev_path_) {
|
|
|
|
|
prev_path_->setRef(prev_path);
|
|
|
|
|
prev_arc = prev_arc_;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
prev_path.init();
|
2019-03-13 01:25:53 +01:00
|
|
|
prev_arc = nullptr;
|
2018-09-28 17:54:21 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TimingArc *
|
|
|
|
|
PathEnumed::prevArc(const StaState *) const
|
|
|
|
|
{
|
|
|
|
|
return prev_arc_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PathEnumed *
|
|
|
|
|
PathEnumed::prevPathEnumed() const
|
|
|
|
|
{
|
|
|
|
|
return prev_path_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
PathEnumed::setPrevPath(PathEnumed *prev)
|
|
|
|
|
{
|
|
|
|
|
prev_path_ = prev;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
PathEnumed::setPrevArc(TimingArc *arc)
|
|
|
|
|
{
|
|
|
|
|
prev_arc_ = arc;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace
|