forked from The-OpenROAD-Project/OpenSTA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPathEnumed.cc
184 lines (159 loc) · 3.5 KB
/
PathEnumed.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
// OpenSTA, Static Timing Analyzer
// Copyright (c) 2024, Parallax Software, Inc.
//
// 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/>.
#include "PathEnumed.hh"
#include "Set.hh"
#include "Graph.hh"
#include "Corner.hh"
#include "Search.hh"
#include "Tag.hh"
#include "PathRef.hh"
namespace sta {
PathEnumed:: PathEnumed(VertexId vertex_id,
TagIndex tag_index,
Arrival arrival,
PathEnumed *prev_path,
TimingArc *prev_arc) :
Path(),
prev_path_(prev_path),
prev_arc_(prev_arc),
arrival_(arrival),
vertex_id_(vertex_id),
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();
return graph->vertex(vertex_id_);
}
VertexId
PathEnumed::vertexId(const StaState *) const
{
return vertex_id_;
}
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();
}
const RiseFall *
PathEnumed::transition(const StaState *sta) const
{
return tag(sta)->transition();
}
int
PathEnumed::trIndex(const StaState *sta) const
{
return tag(sta)->rfIndex();
}
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 &
PathEnumed::required(const StaState *sta) const
{
// Required times are never needed for enumerated paths.
sta->report()->critical(1380, "enumerated path required time");
return delay_zero;
}
void
PathEnumed::setRequired(const Required &,
const StaState *sta)
{
// Required times are never needed for enumerated paths.
sta->report()->critical(1381, "enumerated path required time");
}
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();
prev_arc = nullptr;
}
}
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