mirror of
https://github.com/The-OpenROAD-Project/OpenSTA.git
synced 2026-09-03 03:43:12 +02:00
2.0.10
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include "Report.hh"
|
||||
#include "Debug.hh"
|
||||
#include "Error.hh"
|
||||
#include "Mutex.hh"
|
||||
#include "Set.hh"
|
||||
#include "MinMax.hh"
|
||||
#include "Network.hh"
|
||||
@@ -124,7 +125,7 @@ ConcreteParasitic::setElmore(const Pin *,
|
||||
Parasitic *
|
||||
ConcreteParasitic::findPoleResidue(const Pin *) const
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -137,19 +138,19 @@ ConcreteParasitic::setPoleResidue(const Pin *,
|
||||
ParasiticDeviceIterator *
|
||||
ConcreteParasitic::deviceIterator()
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ParasiticNodeIterator *
|
||||
ConcreteParasitic::nodeIterator()
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
ConcreteElmore::ConcreteElmore() :
|
||||
loads_(NULL)
|
||||
loads_(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -179,7 +180,7 @@ void
|
||||
ConcreteElmore::setElmore(const Pin *load_pin,
|
||||
float elmore)
|
||||
{
|
||||
if (loads_ == NULL)
|
||||
if (loads_ == nullptr)
|
||||
loads_ = new ConcreteElmoreLoadMap;
|
||||
(*loads_)[load_pin] = elmore;
|
||||
}
|
||||
@@ -420,7 +421,7 @@ ConcretePiPoleResidue::ConcretePiPoleResidue(float c2,
|
||||
float rpi,
|
||||
float c1) :
|
||||
ConcretePi(c2, rpi, c1),
|
||||
load_pole_residue_(NULL)
|
||||
load_pole_residue_(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -472,7 +473,7 @@ ConcretePiPoleResidue::findPoleResidue(const Pin *load_pin) const
|
||||
if (load_pole_residue_)
|
||||
return load_pole_residue_->findKey(load_pin);
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -480,10 +481,10 @@ ConcretePiPoleResidue::setPoleResidue(const Pin *load_pin,
|
||||
ComplexFloatSeq *poles,
|
||||
ComplexFloatSeq *residues)
|
||||
{
|
||||
if (load_pole_residue_ == NULL)
|
||||
if (load_pole_residue_ == nullptr)
|
||||
load_pole_residue_ = new ConcretePoleResidueMap;
|
||||
ConcretePoleResidue *pole_residue = load_pole_residue_->findKey(load_pin);
|
||||
if (pole_residue == NULL) {
|
||||
if (pole_residue == nullptr) {
|
||||
pole_residue = new ConcretePoleResidue(poles, residues);
|
||||
(*load_pole_residue_)[load_pin] = pole_residue;
|
||||
}
|
||||
@@ -592,7 +593,7 @@ ConcreteParasiticResistor::otherNode(ParasiticNode *node) const
|
||||
else if (node == other_node_)
|
||||
return node_;
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -642,7 +643,7 @@ ConcreteCouplingCapInt::otherNode(ParasiticNode *node) const
|
||||
else if (node == other_node_)
|
||||
return node_;
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -670,7 +671,7 @@ ConcreteCouplingCapExtNode(const char *name,
|
||||
ParasiticNode *
|
||||
ConcreteCouplingCapExtNode::otherNode(ParasiticNode *) const
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -695,7 +696,7 @@ ConcreteCouplingCapExtPin(const char *name,
|
||||
ParasiticNode *
|
||||
ConcreteCouplingCapExtPin::otherNode(ParasiticNode *) const
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -817,7 +818,7 @@ ConcreteParasiticNetwork::ensureParasiticNode(Net *net,
|
||||
{
|
||||
NetId net_id(net, id);
|
||||
ConcreteParasiticSubNode *node = sub_nodes_.findKey(&net_id);
|
||||
if (node == NULL) {
|
||||
if (node == nullptr) {
|
||||
node = new ConcreteParasiticSubNode(net, id);
|
||||
sub_nodes_[new NetId(net, id)] = node;
|
||||
max_node_id_ = max((int) max_node_id_, id);
|
||||
@@ -856,7 +857,7 @@ ConcreteParasiticNode *
|
||||
ConcreteParasiticNetwork::ensureParasiticNode(const Pin *pin)
|
||||
{
|
||||
ConcreteParasiticPinNode *node = pin_nodes_.findKey(pin);
|
||||
if (node == NULL) {
|
||||
if (node == nullptr) {
|
||||
node = new ConcreteParasiticPinNode(pin);
|
||||
pin_nodes_[pin] = node;
|
||||
}
|
||||
@@ -886,10 +887,10 @@ makeConcreteParasitics(StaState *sta)
|
||||
|
||||
ConcreteParasitics::ConcreteParasitics(StaState *sta) :
|
||||
Parasitics(sta),
|
||||
lumped_elmore_maps_(NULL),
|
||||
pi_elmore_maps_(NULL),
|
||||
pi_pole_residue_maps_(NULL),
|
||||
parasitic_network_maps_(NULL)
|
||||
lumped_elmore_maps_(nullptr),
|
||||
pi_elmore_maps_(nullptr),
|
||||
pi_pole_residue_maps_(nullptr),
|
||||
parasitic_network_maps_(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -901,10 +902,10 @@ ConcreteParasitics::~ConcreteParasitics()
|
||||
bool
|
||||
ConcreteParasitics::haveParasitics()
|
||||
{
|
||||
return lumped_elmore_maps_ != NULL
|
||||
|| pi_elmore_maps_ != NULL
|
||||
|| pi_pole_residue_maps_ != NULL
|
||||
|| parasitic_network_maps_ != NULL;
|
||||
return lumped_elmore_maps_ != nullptr
|
||||
|| pi_elmore_maps_ != nullptr
|
||||
|| pi_pole_residue_maps_ != nullptr
|
||||
|| parasitic_network_maps_ != nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -924,7 +925,7 @@ ConcreteParasitics::clear()
|
||||
}
|
||||
}
|
||||
delete lumped_elmore_maps_;
|
||||
lumped_elmore_maps_ = NULL;
|
||||
lumped_elmore_maps_ = nullptr;
|
||||
}
|
||||
|
||||
if (pi_elmore_maps_) {
|
||||
@@ -939,7 +940,7 @@ ConcreteParasitics::clear()
|
||||
}
|
||||
}
|
||||
delete pi_elmore_maps_;
|
||||
pi_elmore_maps_ = NULL;
|
||||
pi_elmore_maps_ = nullptr;
|
||||
}
|
||||
|
||||
if (pi_pole_residue_maps_) {
|
||||
@@ -954,7 +955,7 @@ ConcreteParasitics::clear()
|
||||
}
|
||||
}
|
||||
delete pi_pole_residue_maps_;
|
||||
pi_pole_residue_maps_ = NULL;
|
||||
pi_pole_residue_maps_ = nullptr;
|
||||
}
|
||||
|
||||
if (parasitic_network_maps_) {
|
||||
@@ -969,7 +970,7 @@ ConcreteParasitics::clear()
|
||||
}
|
||||
}
|
||||
delete parasitic_network_maps_;
|
||||
parasitic_network_maps_ = NULL;
|
||||
parasitic_network_maps_ = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1083,7 +1084,7 @@ ConcreteParasitics::deleteParasitic(const Pin *drvr_pin,
|
||||
// not require an analysis pt.
|
||||
if (ap) {
|
||||
int ap_index = parasiticAnalysisPtIndex(ap, tr);
|
||||
lock_.writeLock();
|
||||
UniqueLock lock(lock_);
|
||||
if (cparasitic->isLumpedElmore())
|
||||
(*lumped_elmore_maps_)[ap_index]->eraseKey(drvr_pin);
|
||||
else if (cparasitic->isPiElmore() && pi_elmore_maps_)
|
||||
@@ -1094,7 +1095,6 @@ ConcreteParasitics::deleteParasitic(const Pin *drvr_pin,
|
||||
const Net *net = network_->net(drvr_pin);
|
||||
(*parasitic_network_maps_)[ap_index]->eraseKey(net);
|
||||
}
|
||||
lock_.unlock();
|
||||
}
|
||||
delete cparasitic;
|
||||
}
|
||||
@@ -1277,9 +1277,8 @@ ConcreteParasitics::hasLumpedElmore(const Pin *drvr_pin,
|
||||
{
|
||||
if (lumped_elmore_maps_ && ap) {
|
||||
int ap_index = parasiticAnalysisPtIndex(ap, tr);
|
||||
lock_.readLock();
|
||||
UniqueLock lock(lock_);
|
||||
bool exists = (*lumped_elmore_maps_)[ap_index]->hasKey(drvr_pin);
|
||||
lock_.unlock();
|
||||
return exists;
|
||||
}
|
||||
else
|
||||
@@ -1293,13 +1292,12 @@ ConcreteParasitics::findLumpedElmore(const Pin *drvr_pin,
|
||||
{
|
||||
if (ap && lumped_elmore_maps_) {
|
||||
int ap_index = parasiticAnalysisPtIndex(ap, tr);
|
||||
lock_.readLock();
|
||||
UniqueLock lock(lock_);
|
||||
Parasitic *parasitic = (*lumped_elmore_maps_)[ap_index]->findKey(drvr_pin);
|
||||
lock_.unlock();
|
||||
return parasitic;
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Parasitic *
|
||||
@@ -1309,8 +1307,8 @@ ConcreteParasitics::makeLumpedElmore(const Pin *drvr_pin,
|
||||
const ParasiticAnalysisPt *ap)
|
||||
{
|
||||
int ap_index = parasiticAnalysisPtIndex(ap, tr);
|
||||
lock_.writeLock();
|
||||
if (lumped_elmore_maps_ == NULL) {
|
||||
UniqueLock lock(lock_);
|
||||
if (lumped_elmore_maps_ == nullptr) {
|
||||
lumped_elmore_maps_ = new ConcreteLumpedElmoreMapSeq(mapSize());
|
||||
ParasiticAnalysisPtIterator ap_iter(corners_);
|
||||
while (ap_iter.hasNext()) {
|
||||
@@ -1332,7 +1330,6 @@ ConcreteParasitics::makeLumpedElmore(const Pin *drvr_pin,
|
||||
lumped_elmore = new ConcreteLumpedElmore(cap);
|
||||
(*(*lumped_elmore_maps_)[ap_index])[drvr_pin] = lumped_elmore;
|
||||
}
|
||||
lock_.unlock();
|
||||
return lumped_elmore;
|
||||
}
|
||||
|
||||
@@ -1343,14 +1340,13 @@ ConcreteParasitics::deleteLumpedElmore(const Pin *drvr_pin,
|
||||
{
|
||||
if (ap && lumped_elmore_maps_) {
|
||||
int ap_index = parasiticAnalysisPtIndex(ap, tr);
|
||||
lock_.writeLock();
|
||||
UniqueLock lock(lock_);
|
||||
ConcreteLumpedElmore *lumped_elmore =
|
||||
(*lumped_elmore_maps_)[ap_index]->findKey(drvr_pin);
|
||||
if (lumped_elmore) {
|
||||
(*lumped_elmore_maps_)[ap_index]->eraseKey(drvr_pin);
|
||||
delete lumped_elmore;
|
||||
}
|
||||
lock_.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1370,13 +1366,12 @@ ConcreteParasitics::hasPiElmore(const Pin *drvr_pin,
|
||||
{
|
||||
if (ap && pi_elmore_maps_) {
|
||||
int ap_index = parasiticAnalysisPtIndex(ap, tr);
|
||||
lock_.readLock();
|
||||
UniqueLock lock(lock_);
|
||||
bool exists = (*pi_elmore_maps_)[ap_index]->hasKey(drvr_pin);
|
||||
if (!exists && tr == TransRiseFall::fall()) {
|
||||
ap_index = parasiticAnalysisPtIndex(ap, TransRiseFall::rise());
|
||||
exists = (*pi_elmore_maps_)[ap_index]->hasKey(drvr_pin);
|
||||
}
|
||||
lock_.unlock();
|
||||
return exists;
|
||||
}
|
||||
else
|
||||
@@ -1390,17 +1385,16 @@ ConcreteParasitics::findPiElmore(const Pin *drvr_pin,
|
||||
{
|
||||
if (ap && pi_elmore_maps_) {
|
||||
int ap_index = parasiticAnalysisPtIndex(ap, tr);
|
||||
lock_.readLock();
|
||||
UniqueLock lock(lock_);
|
||||
Parasitic *parasitic = (*pi_elmore_maps_)[ap_index]->findKey(drvr_pin);
|
||||
if (parasitic == NULL && tr == TransRiseFall::fall()) {
|
||||
if (parasitic == nullptr && tr == TransRiseFall::fall()) {
|
||||
ap_index = parasiticAnalysisPtIndex(ap, TransRiseFall::rise());
|
||||
parasitic = (*pi_elmore_maps_)[ap_index]->findKey(drvr_pin);
|
||||
}
|
||||
lock_.unlock();
|
||||
return parasitic;
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Parasitic *
|
||||
@@ -1412,8 +1406,8 @@ ConcreteParasitics::makePiElmore(const Pin *drvr_pin,
|
||||
float c1)
|
||||
{
|
||||
int ap_index = parasiticAnalysisPtIndex(ap, tr);
|
||||
lock_.writeLock();
|
||||
if (pi_elmore_maps_ == NULL) {
|
||||
UniqueLock lock(lock_);
|
||||
if (pi_elmore_maps_ == nullptr) {
|
||||
pi_elmore_maps_ = new ConcretePiElmoreMapSeq(mapSize());
|
||||
ParasiticAnalysisPtIterator ap_iter(corners_);
|
||||
while (ap_iter.hasNext()) {
|
||||
@@ -1434,7 +1428,6 @@ ConcreteParasitics::makePiElmore(const Pin *drvr_pin,
|
||||
pi_elmore = new ConcretePiElmore(c2, rpi, c1);
|
||||
(*(*pi_elmore_maps_)[ap_index])[drvr_pin] = pi_elmore;
|
||||
}
|
||||
lock_.unlock();
|
||||
return pi_elmore;
|
||||
}
|
||||
|
||||
@@ -1445,14 +1438,13 @@ ConcreteParasitics::deletePiElmore(const Pin *drvr_pin,
|
||||
{
|
||||
if (ap && pi_elmore_maps_) {
|
||||
int ap_index = parasiticAnalysisPtIndex(ap, tr);
|
||||
lock_.writeLock();
|
||||
UniqueLock lock(lock_);
|
||||
ConcretePiElmore *pi_elmore =
|
||||
(*pi_elmore_maps_)[ap_index]->findKey(drvr_pin);
|
||||
if (pi_elmore) {
|
||||
(*pi_elmore_maps_)[ap_index]->eraseKey(drvr_pin);
|
||||
delete pi_elmore;
|
||||
}
|
||||
lock_.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1522,13 +1514,12 @@ ConcreteParasitics::hasPiPoleResidue(const Pin *drvr_pin,
|
||||
{
|
||||
if (ap && pi_pole_residue_maps_) {
|
||||
int ap_index = parasiticAnalysisPtIndex(ap, tr);
|
||||
lock_.readLock();
|
||||
UniqueLock lock(lock_);
|
||||
bool exists = (*pi_pole_residue_maps_)[ap_index]->hasKey(drvr_pin);
|
||||
if (!exists && tr == TransRiseFall::fall()) {
|
||||
ap_index = parasiticAnalysisPtIndex(ap, TransRiseFall::rise());
|
||||
exists = (*pi_pole_residue_maps_)[ap_index]->hasKey(drvr_pin);
|
||||
}
|
||||
lock_.unlock();
|
||||
return exists;
|
||||
}
|
||||
else
|
||||
@@ -1542,17 +1533,16 @@ ConcreteParasitics::findPiPoleResidue(const Pin *drvr_pin,
|
||||
{
|
||||
if (ap && pi_pole_residue_maps_) {
|
||||
int ap_index = parasiticAnalysisPtIndex(ap, tr);
|
||||
lock_.readLock();
|
||||
UniqueLock lock(lock_);
|
||||
Parasitic *parasitic = (*pi_pole_residue_maps_)[ap_index]->findKey(drvr_pin);
|
||||
if (parasitic == NULL && tr == TransRiseFall::fall()) {
|
||||
if (parasitic == nullptr && tr == TransRiseFall::fall()) {
|
||||
ap_index = parasiticAnalysisPtIndex(ap, TransRiseFall::rise());
|
||||
parasitic = (*pi_pole_residue_maps_)[ap_index]->findKey(drvr_pin);
|
||||
}
|
||||
lock_.unlock();
|
||||
return parasitic;
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Parasitic *
|
||||
@@ -1564,8 +1554,8 @@ ConcreteParasitics::makePiPoleResidue(const Pin *drvr_pin,
|
||||
float c1)
|
||||
{
|
||||
int ap_index = parasiticAnalysisPtIndex(ap, tr);
|
||||
lock_.writeLock();
|
||||
if (pi_pole_residue_maps_ == NULL) {
|
||||
UniqueLock lock(lock_);
|
||||
if (pi_pole_residue_maps_ == nullptr) {
|
||||
pi_pole_residue_maps_ = new ConcretePiPoleResidueMapSeq(mapSize());
|
||||
ParasiticAnalysisPtIterator ap_iter(corners_);
|
||||
while (ap_iter.hasNext()) {
|
||||
@@ -1587,7 +1577,6 @@ ConcreteParasitics::makePiPoleResidue(const Pin *drvr_pin,
|
||||
pi_pole_residue = new ConcretePiPoleResidue(c2, rpi, c1);
|
||||
(*(*pi_pole_residue_maps_)[ap_index])[drvr_pin] = pi_pole_residue;
|
||||
}
|
||||
lock_.unlock();
|
||||
return pi_pole_residue;
|
||||
}
|
||||
|
||||
@@ -1662,9 +1651,8 @@ ConcreteParasitics::hasParasiticNetwork(const Net *net,
|
||||
{
|
||||
if (ap && parasitic_network_maps_) {
|
||||
int ap_index = parasiticNetworkAnalysisPtIndex(ap);
|
||||
lock_.readLock();
|
||||
UniqueLock lock(lock_);
|
||||
bool exists = (*parasitic_network_maps_)[ap_index]->hasKey(net);
|
||||
lock_.unlock();
|
||||
return exists;
|
||||
}
|
||||
else
|
||||
@@ -1678,18 +1666,17 @@ ConcreteParasitics::findParasiticNetwork(const Pin *pin,
|
||||
if (ap && parasitic_network_maps_) {
|
||||
int ap_index = parasiticNetworkAnalysisPtIndex(ap);
|
||||
ConcreteParasiticNetworkMap *parasitics = (*parasitic_network_maps_)[ap_index];
|
||||
lock_.readLock();
|
||||
Parasitic *parasitic = NULL;
|
||||
UniqueLock lock(lock_);
|
||||
Parasitic *parasitic = nullptr;
|
||||
if (parasitics->size()) {
|
||||
// Only call findParasiticNet if parasitics exist.
|
||||
Net *net = findParasiticNet(pin);
|
||||
parasitic = parasitics->findKey(net);
|
||||
}
|
||||
lock_.unlock();
|
||||
return parasitic;
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Parasitic *
|
||||
@@ -1698,8 +1685,8 @@ ConcreteParasitics::makeParasiticNetwork(Net *net,
|
||||
const ParasiticAnalysisPt *ap)
|
||||
{
|
||||
int ap_index = parasiticNetworkAnalysisPtIndex(ap);
|
||||
lock_.writeLock();
|
||||
if (parasitic_network_maps_ == NULL) {
|
||||
UniqueLock lock(lock_);
|
||||
if (parasitic_network_maps_ == nullptr) {
|
||||
parasitic_network_maps_ = new ConcreteParasiticNetworkMapSeq(mapSize());
|
||||
ParasiticAnalysisPtIterator ap_iter(corners_);
|
||||
while (ap_iter.hasNext()) {
|
||||
@@ -1715,11 +1702,10 @@ ConcreteParasitics::makeParasiticNetwork(Net *net,
|
||||
|
||||
ConcreteParasiticNetwork *parasitic =
|
||||
(*parasitic_network_maps_)[ap_index]->findKey(net);
|
||||
if (parasitic == NULL) {
|
||||
if (parasitic == nullptr) {
|
||||
parasitic = new ConcreteParasiticNetwork(includes_pin_caps);
|
||||
(*(*parasitic_network_maps_)[ap_index])[net] = parasitic;
|
||||
}
|
||||
lock_.unlock();
|
||||
return parasitic;
|
||||
}
|
||||
|
||||
@@ -1729,14 +1715,13 @@ ConcreteParasitics::deleteParasiticNetwork(const Net *net,
|
||||
{
|
||||
if (ap && parasitic_network_maps_) {
|
||||
int ap_index = parasiticNetworkAnalysisPtIndex(ap);
|
||||
lock_.writeLock();
|
||||
UniqueLock lock(lock_);
|
||||
ConcreteParasiticNetwork *parasitic =
|
||||
(*parasitic_network_maps_)[ap_index]->findKey(net);
|
||||
if (parasitic) {
|
||||
(*parasitic_network_maps_)[ap_index]->eraseKey(net);
|
||||
delete parasitic;
|
||||
}
|
||||
lock_.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1877,7 +1862,7 @@ ConcreteParasitics::connectionPin(const ParasiticNode *node) const
|
||||
return pin_node->pin();
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ParasiticNode *
|
||||
@@ -1967,14 +1952,14 @@ ConcreteParasitics::reduceTo(Parasitic *parasitic,
|
||||
const ParasiticAnalysisPt *ap)
|
||||
{
|
||||
switch (reduce_to) {
|
||||
case reduce_parasitics_to_pi_elmore:
|
||||
case ReduceParasiticsTo::pi_elmore:
|
||||
reduceToPiElmore(parasitic, net, tr, op_cond, corner, cnst_min_max, ap);
|
||||
break;
|
||||
case reduce_parasitics_to_pi_pole_residue2:
|
||||
case ReduceParasiticsTo::pi_pole_residue2:
|
||||
reduceToPiPoleResidue2(parasitic, net, tr, op_cond, corner,
|
||||
cnst_min_max, ap);
|
||||
break;
|
||||
case reduce_parasitics_to_none:
|
||||
case ReduceParasiticsTo::none:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
#ifndef STA_CONCRETE_PARASITICS_H
|
||||
#define STA_CONCRETE_PARASITICS_H
|
||||
|
||||
#include <mutex>
|
||||
#include "Map.hh"
|
||||
#include "Set.hh"
|
||||
#include "MinMax.hh"
|
||||
#include "ReadWriteLock.hh"
|
||||
#include "EstimateParasitics.hh"
|
||||
#include "Parasitics.hh"
|
||||
|
||||
@@ -244,7 +244,7 @@ protected:
|
||||
ConcretePiElmoreMapSeq *pi_elmore_maps_;
|
||||
ConcretePiPoleResidueMapSeq *pi_pole_residue_maps_;
|
||||
ConcreteParasiticNetworkMapSeq *parasitic_network_maps_;
|
||||
mutable ReadWriteLock lock_;
|
||||
mutable std::mutex lock_;
|
||||
|
||||
using EstimateParasitics::estimatePiElmore;
|
||||
friend class ConcreteLumpedElmore;
|
||||
|
||||
@@ -343,7 +343,7 @@ public:
|
||||
ConcreteParasiticNode *node,
|
||||
float cap);
|
||||
virtual bool isCouplingCap() const { return true; }
|
||||
virtual ConcreteParasiticNode *node2() const { return NULL; }
|
||||
virtual ConcreteParasiticNode *node2() const { return nullptr; }
|
||||
virtual void replaceNode(ConcreteParasiticNode *from_node,
|
||||
ConcreteParasiticNode *to_node);
|
||||
};
|
||||
|
||||
@@ -46,26 +46,26 @@ EstimateParasitics::estimatePiElmore(const Pin *drvr_pin,
|
||||
float wireload_cap, wireload_res;
|
||||
wireload->findWireload(fanout, op_cond, wireload_cap, wireload_res);
|
||||
|
||||
WireloadTree tree = wire_load_unknown_tree;
|
||||
WireloadTree tree = WireloadTree::unknown;
|
||||
if (op_cond)
|
||||
tree = op_cond->wireloadTree();
|
||||
switch (tree) {
|
||||
case wire_load_worst_case_tree:
|
||||
case WireloadTree::worst_case:
|
||||
estimatePiElmoreWorst(drvr_pin, wireload_cap, wireload_res,
|
||||
fanout, net_pin_cap, tr, op_cond, corner,
|
||||
min_max, sta,
|
||||
c2, rpi, c1, elmore_res,
|
||||
elmore_cap, elmore_use_load_cap);
|
||||
break;
|
||||
case wire_load_unknown_tree:
|
||||
case wire_load_balanced_tree:
|
||||
case WireloadTree::balanced:
|
||||
case WireloadTree::unknown:
|
||||
estimatePiElmoreBalanced(drvr_pin, wireload_cap, wireload_res,
|
||||
fanout, net_pin_cap, tr, op_cond,
|
||||
corner, min_max,sta,
|
||||
c2, rpi, c1, elmore_res,
|
||||
elmore_cap, elmore_use_load_cap);
|
||||
break;
|
||||
case wire_load_best_case_tree:
|
||||
case WireloadTree::best_case:
|
||||
estimatePiElmoreBest(drvr_pin, wireload_cap, net_pin_cap, tr,
|
||||
op_cond, corner, min_max,
|
||||
c2, rpi, c1, elmore_res, elmore_cap,
|
||||
|
||||
@@ -82,7 +82,7 @@ NullParasitics::findLumpedElmore(const Pin *,
|
||||
const TransRiseFall *,
|
||||
const ParasiticAnalysisPt *) const
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -97,7 +97,7 @@ NullParasitics::makeLumpedElmore(const Pin *,
|
||||
const TransRiseFall *,
|
||||
const ParasiticAnalysisPt *)
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -120,7 +120,7 @@ NullParasitics::findPiElmore(const Pin *,
|
||||
const TransRiseFall *,
|
||||
const ParasiticAnalysisPt *) const
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Parasitic *
|
||||
@@ -131,7 +131,7 @@ NullParasitics::makePiElmore(const Pin *,
|
||||
float,
|
||||
float)
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -220,7 +220,7 @@ NullParasitics::findPiPoleResidue(const Pin *,
|
||||
const TransRiseFall *,
|
||||
const ParasiticAnalysisPt *) const
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Parasitic *
|
||||
@@ -231,14 +231,14 @@ NullParasitics::makePiPoleResidue(const Pin *,
|
||||
float,
|
||||
float)
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Parasitic *
|
||||
NullParasitics::findPoleResidue(const Parasitic *,
|
||||
const Pin *) const
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -280,7 +280,7 @@ Parasitic *
|
||||
NullParasitics::findParasiticNetwork(const Pin *,
|
||||
const ParasiticAnalysisPt *) const
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -294,7 +294,7 @@ NullParasitics::makeParasiticNetwork(Net *,
|
||||
bool,
|
||||
const ParasiticAnalysisPt *)
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -314,14 +314,14 @@ NullParasitics::ensureParasiticNode(Parasitic *,
|
||||
Net *,
|
||||
int)
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ParasiticNode *
|
||||
NullParasitics::ensureParasiticNode(Parasitic *,
|
||||
const Pin *)
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -370,20 +370,20 @@ NullParasitics::makeResistor(const char *,
|
||||
const char *
|
||||
NullParasitics::name(const ParasiticNode *)
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const Pin *
|
||||
NullParasitics::connectionPin(const ParasiticNode *) const
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ParasiticNode *
|
||||
NullParasitics::findNode(Parasitic *,
|
||||
const Pin *) const
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
float
|
||||
@@ -414,7 +414,7 @@ NullParasitics::isCouplingCap(const ParasiticDevice *) const
|
||||
const char *
|
||||
NullParasitics::name(const ParasiticDevice *) const
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
float
|
||||
@@ -427,20 +427,20 @@ NullParasitics::value(const ParasiticDevice *,
|
||||
ParasiticNode *
|
||||
NullParasitics::node1(const ParasiticDevice *) const
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ParasiticNode *
|
||||
NullParasitics::node2(const ParasiticDevice *) const
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ParasiticNode *
|
||||
NullParasitics::otherNode(const ParasiticDevice *,
|
||||
ParasiticNode *) const
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -475,7 +475,7 @@ NullParasitics::reduceToPiElmore(Parasitic *,
|
||||
const MinMax *,
|
||||
const ParasiticAnalysisPt *)
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -497,7 +497,7 @@ NullParasitics::reduceToPiPoleResidue2(Parasitic *,
|
||||
const MinMax *,
|
||||
const ParasiticAnalysisPt *)
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Parasitic *
|
||||
@@ -511,7 +511,7 @@ NullParasitics::estimatePiElmore(const Pin *,
|
||||
const MinMax *,
|
||||
const ParasiticAnalysisPt *)
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -126,8 +126,8 @@ public:
|
||||
makeParasiticNetwork(Net *net,
|
||||
bool pin_cap_included,
|
||||
const ParasiticAnalysisPt *ap);
|
||||
virtual ParasiticDeviceIterator *deviceIterator(Parasitic *) { return NULL; }
|
||||
virtual ParasiticNodeIterator *nodeIterator(Parasitic *) { return NULL; }
|
||||
virtual ParasiticDeviceIterator *deviceIterator(Parasitic *) { return nullptr; }
|
||||
virtual ParasiticNodeIterator *nodeIterator(Parasitic *) { return nullptr; }
|
||||
virtual bool includesPinCaps(Parasitic *parasitic) const;
|
||||
virtual void deleteParasiticNetwork(const Net *net,
|
||||
const ParasiticAnalysisPt *ap);
|
||||
|
||||
+12
-12
@@ -51,17 +51,17 @@ Parasitics::findParasiticNet(const Pin *pin) const
|
||||
Net *net = network_->net(pin);
|
||||
// Pins on the top level instance may not have nets.
|
||||
// Use the net connected to the pin's terminal.
|
||||
if (net == NULL && network_->isTopLevelPort(pin)) {
|
||||
if (net == nullptr && network_->isTopLevelPort(pin)) {
|
||||
Term *term = network_->term(pin);
|
||||
if (term)
|
||||
return network_->net(term);
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
if (net)
|
||||
return network_->highestConnectedNet(net);
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -102,20 +102,20 @@ Parasitics::makeWireloadNetwork(const Pin *drvr_pin,
|
||||
float wireload_cap, wireload_res;
|
||||
wireload->findWireload(fanout, op_cond, wireload_cap, wireload_res);
|
||||
|
||||
WireloadTree tree = wire_load_balanced_tree;
|
||||
WireloadTree tree = WireloadTree::balanced;
|
||||
if (op_cond)
|
||||
tree = op_cond->wireloadTree();
|
||||
switch (tree) {
|
||||
case wire_load_worst_case_tree:
|
||||
case WireloadTree::worst_case:
|
||||
makeWireloadNetworkWorst(parasitic, drvr_pin, wireload_cap,
|
||||
wireload_res, fanout, ap);
|
||||
break;
|
||||
case wire_load_balanced_tree:
|
||||
case WireloadTree::balanced:
|
||||
makeWireloadNetworkBalanced(parasitic, drvr_pin, wireload_cap,
|
||||
wireload_res, fanout, ap);
|
||||
break;
|
||||
case wire_load_unknown_tree:
|
||||
case wire_load_best_case_tree:
|
||||
case WireloadTree::best_case:
|
||||
case WireloadTree::unknown:
|
||||
makeWireloadNetworkBest(parasitic, drvr_pin, wireload_cap,
|
||||
wireload_res, fanout, ap);
|
||||
break;
|
||||
@@ -136,7 +136,7 @@ Parasitics::makeWireloadNetworkWorst(Parasitic *parasitic,
|
||||
ParasiticNode *drvr_node = ensureParasiticNode(parasitic, drvr_pin);
|
||||
Net *net = network_->net(drvr_pin);
|
||||
ParasiticNode *load_node = ensureParasiticNode(parasitic, net, 0);
|
||||
makeResistor(NULL, drvr_node, load_node, wireload_res, ap);
|
||||
makeResistor(nullptr, drvr_node, load_node, wireload_res, ap);
|
||||
parasitics_->incrCap(load_node, wireload_cap, ap);
|
||||
PinConnectedPinIterator *load_iter =
|
||||
network_->connectedPinIterator(drvr_pin);
|
||||
@@ -145,7 +145,7 @@ Parasitics::makeWireloadNetworkWorst(Parasitic *parasitic,
|
||||
if (load_pin != drvr_pin
|
||||
&& network_->isLoad(load_pin)) {
|
||||
ParasiticNode *load_node1 = ensureParasiticNode(parasitic, load_pin);
|
||||
makeResistor(NULL, load_node, load_node1, 0.0, ap);
|
||||
makeResistor(nullptr, load_node, load_node1, 0.0, ap);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -168,7 +168,7 @@ Parasitics::makeWireloadNetworkBest(Parasitic *parasitic,
|
||||
if (load_pin != drvr_pin
|
||||
&& network_->isLoad(load_pin)) {
|
||||
ParasiticNode *load_node1 = ensureParasiticNode(parasitic, load_pin);
|
||||
makeResistor(NULL, drvr_node, load_node1, 0.0, ap);
|
||||
makeResistor(nullptr, drvr_node, load_node1, 0.0, ap);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -193,7 +193,7 @@ Parasitics::makeWireloadNetworkBalanced(Parasitic *parasitic,
|
||||
if (load_pin != drvr_pin
|
||||
&& network_->isLoad(load_pin)) {
|
||||
ParasiticNode *load_node1 = ensureParasiticNode(parasitic, load_pin);
|
||||
makeResistor(NULL, drvr_node, load_node1, fanout_res, ap);
|
||||
makeResistor(nullptr, drvr_node, load_node1, fanout_res, ap);
|
||||
parasitics_->incrCap(load_node1, fanout_cap, ap);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,11 +25,7 @@ class ParasiticDevice;
|
||||
class ParasiticNode;
|
||||
class ParasiticAnalysisPt;
|
||||
|
||||
typedef enum {
|
||||
reduce_parasitics_to_pi_elmore,
|
||||
reduce_parasitics_to_pi_pole_residue2,
|
||||
reduce_parasitics_to_none
|
||||
} ReduceParasiticsTo;
|
||||
enum class ReduceParasiticsTo { pi_elmore, pi_pole_residue2, none };
|
||||
|
||||
} // namespace
|
||||
#endif
|
||||
|
||||
@@ -80,10 +80,10 @@ protected:
|
||||
ReduceToPi::ReduceToPi(StaState *sta) :
|
||||
StaState(sta),
|
||||
coupling_cap_multiplier_(1.0),
|
||||
tr_(NULL),
|
||||
op_cond_(NULL),
|
||||
corner_(NULL),
|
||||
cnst_min_max_(NULL)
|
||||
tr_(nullptr),
|
||||
op_cond_(nullptr),
|
||||
corner_(nullptr),
|
||||
cnst_min_max_(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -401,7 +401,7 @@ private:
|
||||
|
||||
ReduceToPiPoleResidue2::ReduceToPiPoleResidue2(StaState *sta) :
|
||||
ReduceToPi(sta),
|
||||
moments_(NULL)
|
||||
moments_(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
+17
-17
@@ -117,13 +117,13 @@ SpefReader::SpefReader(const char *filename,
|
||||
delimiter_('\0'),
|
||||
bus_brkt_left_('\0'),
|
||||
bus_brkt_right_('\0'),
|
||||
net_(NULL),
|
||||
net_(nullptr),
|
||||
report_(report),
|
||||
network_(network),
|
||||
parasitics_(parasitics),
|
||||
triple_index_(0),
|
||||
design_flow_(NULL),
|
||||
parasitic_(NULL)
|
||||
design_flow_(nullptr),
|
||||
parasitic_(nullptr)
|
||||
{
|
||||
ap->setCouplingCapFactor(coupling_cap_factor);
|
||||
}
|
||||
@@ -133,7 +133,7 @@ SpefReader::~SpefReader()
|
||||
if (design_flow_) {
|
||||
deleteContents(design_flow_);
|
||||
delete design_flow_;
|
||||
design_flow_ = NULL;
|
||||
design_flow_ = nullptr;
|
||||
}
|
||||
|
||||
SpefNameMap::Iterator map_iter(name_map_);
|
||||
@@ -202,7 +202,7 @@ SpefReader::getChars(char *buf,
|
||||
{
|
||||
char *status = gzgets(stream_, buf, max_size);
|
||||
if (status == Z_NULL)
|
||||
result = 0; // YY_NULL
|
||||
result = 0; // YY_nullptr
|
||||
else
|
||||
result = static_cast<int>(strlen(buf));
|
||||
}
|
||||
@@ -214,7 +214,7 @@ SpefReader::getChars(char *buf,
|
||||
{
|
||||
char *status = gzgets(stream_, buf, max_size);
|
||||
if (status == Z_NULL)
|
||||
result = 0; // YY_NULL
|
||||
result = 0; // YY_nullptr
|
||||
else
|
||||
result = strlen(buf);
|
||||
}
|
||||
@@ -358,7 +358,7 @@ SpefReader::findPin(char *name)
|
||||
const char *port_name = delim + 1;
|
||||
if (inst) {
|
||||
pin = network_->findPin(inst, port_name);
|
||||
if (pin == NULL)
|
||||
if (pin == nullptr)
|
||||
warn("pin %s not found.\n", name);
|
||||
}
|
||||
else
|
||||
@@ -366,7 +366,7 @@ SpefReader::findPin(char *name)
|
||||
}
|
||||
else {
|
||||
pin = findPortPinRelative(name);
|
||||
if (pin == NULL)
|
||||
if (pin == nullptr)
|
||||
warn("pin %s not found.\n", name);
|
||||
}
|
||||
}
|
||||
@@ -380,7 +380,7 @@ SpefReader::findNet(char *name)
|
||||
name = nameMapLookup(name);
|
||||
if (name) {
|
||||
net = findNetRelative(name);
|
||||
if (net == NULL)
|
||||
if (net == nullptr)
|
||||
warn("net %s not found.\n", name);
|
||||
}
|
||||
return net;
|
||||
@@ -473,7 +473,7 @@ SpefReader::dspfFinish()
|
||||
// Checking "should" be done by report_annotated_parasitics.
|
||||
if (!quiet_)
|
||||
parasitics_->check(parasitic_);
|
||||
if (reduce_to_ != reduce_parasitics_to_none) {
|
||||
if (reduce_to_ != ReduceParasiticsTo::none) {
|
||||
TransRiseFallIterator tr_iter;
|
||||
while (tr_iter.hasNext()) {
|
||||
TransRiseFall *tr = tr_iter.next();
|
||||
@@ -497,7 +497,7 @@ SpefReader::findParasiticNode(char *name)
|
||||
int ext_node_id;
|
||||
Pin *ext_pin;
|
||||
findParasiticNode(name, node, ext_net, ext_node_id, ext_pin);
|
||||
if (node == NULL
|
||||
if (node == nullptr
|
||||
&& (ext_net || ext_pin))
|
||||
warn("%s not connected to net %s.\n", name, network_->pathName(net_));
|
||||
return node;
|
||||
@@ -621,8 +621,8 @@ SpefReader::makeCouplingCap(int id,
|
||||
char *node_name2,
|
||||
float cap)
|
||||
{
|
||||
const char *name = NULL;
|
||||
const char *name_tmp = NULL;
|
||||
const char *name = nullptr;
|
||||
const char *name_tmp = nullptr;
|
||||
if (keep_device_names_)
|
||||
// Prepend device type because OA uses one namespace for all devices.
|
||||
name = name_tmp = stringPrint("C%d", id);
|
||||
@@ -635,14 +635,14 @@ SpefReader::makeCouplingCap(int id,
|
||||
findParasiticNode(node_name2, node2, ext_net2, ext_node_id2, ext_pin2);
|
||||
if (node1 && node2)
|
||||
parasitics_->makeCouplingCap(name, node1, node2, cap, ap_);
|
||||
if (node1 && node2 == NULL) {
|
||||
if (node1 && node2 == nullptr) {
|
||||
if (ext_net2)
|
||||
parasitics_->makeCouplingCap(name, node1, ext_net2, ext_node_id2,
|
||||
cap, ap_);
|
||||
else if (ext_pin2)
|
||||
parasitics_->makeCouplingCap(name, node1, ext_pin2, cap, ap_);
|
||||
}
|
||||
else if (node1 == NULL && node2) {
|
||||
else if (node1 == nullptr && node2) {
|
||||
if (ext_net1)
|
||||
parasitics_->makeCouplingCap(name, node2, ext_net1, ext_node_id1,
|
||||
cap, ap_);
|
||||
@@ -662,8 +662,8 @@ SpefReader::makeResistor(int id,
|
||||
ParasiticNode *node2 = findParasiticNode(node_name2);
|
||||
if (node1 && node2) {
|
||||
float res1 = res->value(triple_index_) * res_scale_;
|
||||
const char *name = NULL;
|
||||
const char *name_tmp = NULL;
|
||||
const char *name = nullptr;
|
||||
const char *name_tmp = nullptr;
|
||||
if (keep_device_names_)
|
||||
// Prepend device type because OA uses one namespace for all devices.
|
||||
name = name_tmp = stringPrint("R%d", id);
|
||||
|
||||
Reference in New Issue
Block a user