forked from The-OpenROAD-Project/OpenSTA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathReportParasiticAnnotation.cc
132 lines (118 loc) · 4.05 KB
/
ReportParasiticAnnotation.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
// 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 "ReportParasiticAnnotation.hh"
#include "Report.hh"
#include "Network.hh"
#include "NetworkCmp.hh"
#include "PortDirection.hh"
#include "Graph.hh"
#include "Corner.hh"
#include "Parasitics.hh"
#include "DcalcAnalysisPt.hh"
#include "ArcDelayCalc.hh"
namespace sta {
class ReportParasiticAnnotation : public StaState
{
public:
ReportParasiticAnnotation(bool report_unannotated,
const Corner *corner,
StaState *sta);
void report();
private:
void reportAnnotationCounts();
void findCounts();
void findCounts(Instance *inst);
void findCounts(Net *net);
bool report_unannotated_;
const Corner *corner_;
const MinMax *min_max_;
const ParasiticAnalysisPt *parasitic_ap_;
PinSeq unannotated_;
PinSeq partially_annotated_;
};
void
reportParasiticAnnotation(bool report_unannotated,
const Corner *corner,
StaState *sta)
{
ReportParasiticAnnotation report_annotation(report_unannotated, corner, sta);
report_annotation.report();
}
ReportParasiticAnnotation::ReportParasiticAnnotation(bool report_unannotated,
const Corner *corner,
StaState *sta) :
StaState(sta),
report_unannotated_(report_unannotated),
corner_(corner),
min_max_(MinMax::max()),
parasitic_ap_(corner_->findParasiticAnalysisPt(min_max_))
{
}
void
ReportParasiticAnnotation::report()
{
findCounts();
reportAnnotationCounts();
}
void
ReportParasiticAnnotation::reportAnnotationCounts()
{
report_->reportLine("Found %zu unannotated drivers.", unannotated_.size());
if (report_unannotated_) {
sort(unannotated_, PinPathNameLess(network_));
for (const Pin *drvr_pin : unannotated_)
report_->reportLine(" %s", network_->pathName(drvr_pin));
}
report_->reportLine("Found %zu partially unannotated drivers.",
partially_annotated_.size());
if (report_unannotated_) {
sort(partially_annotated_, PinPathNameLess(network_));
for (const Pin *drvr_pin : partially_annotated_) {
report_->reportLine(" %s", network_->pathName(drvr_pin));
Parasitic *parasitic = parasitics_->findParasiticNetwork(drvr_pin, parasitic_ap_);
if (parasitic) {
PinSet unannotated_loads = parasitics_->unannotatedLoads(parasitic, drvr_pin);
for (const Pin *load_pin : unannotated_loads)
report_->reportLine(" %s", network_->pathName(load_pin));
}
}
}
}
void
ReportParasiticAnnotation::findCounts()
{
DcalcAnalysisPt *dcalc_ap = corner_->findDcalcAnalysisPt(min_max_);
VertexIterator vertex_iter(graph_);
while (vertex_iter.hasNext()) {
Vertex *vertex = vertex_iter.next();
Pin *pin = vertex->pin();
PortDirection *dir = network_->direction(pin);
if (vertex->isDriver(network_)
&& !dir->isInternal()) {
Parasitic *parasitic = parasitics_->findParasiticNetwork(pin, parasitic_ap_);
if (parasitic == nullptr)
parasitic = arc_delay_calc_->findParasitic(pin, RiseFall::rise(), dcalc_ap);
if (parasitic) {
PinSet unannotated_loads = parasitics_->unannotatedLoads(parasitic, pin);
if (unannotated_loads.size() > 0)
partially_annotated_.push_back(pin);
}
else
unannotated_.push_back(pin);
}
}
}
} // namespace