2022-10-02 03:45:22 +02:00
|
|
|
// OpenSTA, Static Timing Analyzer
|
2024-01-12 01:34:49 +01:00
|
|
|
// Copyright (c) 2024, Parallax Software, Inc.
|
2022-10-02 03:45:22 +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/>.
|
|
|
|
|
|
|
|
|
|
#include "ReportParasiticAnnotation.hh"
|
|
|
|
|
|
|
|
|
|
#include "Report.hh"
|
|
|
|
|
#include "Network.hh"
|
2022-12-26 00:46:48 +01:00
|
|
|
#include "NetworkCmp.hh"
|
2022-12-31 03:42:02 +01:00
|
|
|
#include "PortDirection.hh"
|
2022-10-02 03:45:22 +02:00
|
|
|
#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_;
|
2022-12-26 00:46:48 +01:00
|
|
|
const ParasiticAnalysisPt *parasitic_ap_;
|
|
|
|
|
PinSeq unannotated_;
|
|
|
|
|
PinSeq partially_annotated_;
|
2022-10-02 03:45:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
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()),
|
2022-12-26 00:46:48 +01:00
|
|
|
parasitic_ap_(corner_->findParasiticAnalysisPt(min_max_))
|
2022-10-02 03:45:22 +02:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
ReportParasiticAnnotation::report()
|
|
|
|
|
{
|
|
|
|
|
findCounts();
|
|
|
|
|
reportAnnotationCounts();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
ReportParasiticAnnotation::reportAnnotationCounts()
|
|
|
|
|
{
|
2022-12-26 00:46:48 +01:00
|
|
|
report_->reportLine("Found %lu unannotated drivers.", unannotated_.size());
|
2022-10-02 03:45:22 +02:00
|
|
|
if (report_unannotated_) {
|
2022-12-26 00:46:48 +01:00
|
|
|
sort(unannotated_, PinPathNameLess(network_));
|
2023-01-19 19:23:45 +01:00
|
|
|
for (const Pin *drvr_pin : unannotated_)
|
2022-12-26 00:46:48 +01:00
|
|
|
report_->reportLine(" %s", network_->pathName(drvr_pin));
|
2022-10-02 03:45:22 +02:00
|
|
|
}
|
|
|
|
|
|
2022-12-26 00:46:48 +01:00
|
|
|
report_->reportLine("Found %lu partially unannotated drivers.",
|
|
|
|
|
partially_annotated_.size());
|
2022-10-02 03:45:22 +02:00
|
|
|
if (report_unannotated_) {
|
2022-12-26 00:46:48 +01:00
|
|
|
sort(partially_annotated_, PinPathNameLess(network_));
|
2023-01-19 19:23:45 +01:00
|
|
|
for (const Pin *drvr_pin : partially_annotated_) {
|
2022-12-26 00:46:48 +01:00
|
|
|
report_->reportLine(" %s", network_->pathName(drvr_pin));
|
2022-10-02 03:45:22 +02:00
|
|
|
|
2022-12-26 00:46:48 +01:00
|
|
|
Parasitic *parasitic = parasitics_->findParasiticNetwork(drvr_pin, parasitic_ap_);
|
|
|
|
|
PinSet unannotated_loads = parasitics_->unannotatedLoads(parasitic, drvr_pin);
|
2023-01-19 19:23:45 +01:00
|
|
|
for (const Pin *load_pin : unannotated_loads)
|
2022-12-26 00:46:48 +01:00
|
|
|
report_->reportLine(" %s", network_->pathName(load_pin));
|
2022-10-02 03:45:22 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
ReportParasiticAnnotation::findCounts()
|
|
|
|
|
{
|
|
|
|
|
VertexIterator vertex_iter(graph_);
|
|
|
|
|
while (vertex_iter.hasNext()) {
|
|
|
|
|
Vertex *vertex = vertex_iter.next();
|
2022-12-31 03:42:02 +01:00
|
|
|
Pin *pin = vertex->pin();
|
|
|
|
|
PortDirection *dir = network_->direction(pin);
|
|
|
|
|
if (vertex->isDriver(network_)
|
|
|
|
|
&& !dir->isInternal()) {
|
|
|
|
|
Parasitic *parasitic = parasitics_->findParasiticNetwork(pin, parasitic_ap_);
|
2022-10-02 03:45:22 +02:00
|
|
|
if (parasitic) {
|
2022-12-31 03:42:02 +01:00
|
|
|
if (!parasitics_->checkAnnotation(parasitic, pin))
|
|
|
|
|
partially_annotated_.push_back(pin);
|
2022-10-02 03:45:22 +02:00
|
|
|
}
|
2022-12-26 00:46:48 +01:00
|
|
|
else
|
2022-12-31 03:42:02 +01:00
|
|
|
unannotated_.push_back(pin);
|
2022-10-02 03:45:22 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace
|