From 51185d8bbede696111a1fe7e01ef4e9419f65c43 Mon Sep 17 00:00:00 2001 From: James Cherry Date: Sat, 23 Sep 2023 15:12:13 -0700 Subject: [PATCH] parasitics const Signed-off-by: James Cherry --- include/sta/NullParasitics.hh | 4 ++-- include/sta/Parasitics.hh | 4 ++-- parasitics/ConcreteParasitics.cc | 14 +++++++------- parasitics/ConcreteParasitics.hh | 5 +++-- parasitics/ConcreteParasiticsPvt.hh | 2 +- parasitics/NullParasitics.cc | 4 ++-- parasitics/ReduceParasitics.cc | 16 ++++++++-------- parasitics/ReduceParasitics.hh | 4 ++-- 8 files changed, 27 insertions(+), 26 deletions(-) diff --git a/include/sta/NullParasitics.hh b/include/sta/NullParasitics.hh index 6022069b..5e475b43 100644 --- a/include/sta/NullParasitics.hh +++ b/include/sta/NullParasitics.hh @@ -103,7 +103,7 @@ public: const ParasiticAnalysisPt *ap); virtual ParasiticDeviceIterator *deviceIterator(Parasitic *) { return nullptr; } virtual ParasiticNodeIterator *nodeIterator(Parasitic *) { return nullptr; } - virtual bool includesPinCaps(Parasitic *parasitic) const; + virtual bool includesPinCaps(const Parasitic *parasitic) const; virtual void deleteParasiticNetwork(const Net *net, const ParasiticAnalysisPt *ap); virtual void deleteParasiticNetworks(const Net *net); @@ -132,7 +132,7 @@ public: virtual const char *name(const ParasiticNode *node); virtual const Pin *connectionPin(const ParasiticNode *node) const; - virtual ParasiticNode *findNode(Parasitic *parasitic, + virtual ParasiticNode *findNode(const Parasitic *parasitic, const Pin *pin) const; virtual float nodeGndCap(const ParasiticNode *node, const ParasiticAnalysisPt *ap) const; diff --git a/include/sta/Parasitics.hh b/include/sta/Parasitics.hh index d85fe31e..3129b916 100644 --- a/include/sta/Parasitics.hh +++ b/include/sta/Parasitics.hh @@ -160,7 +160,7 @@ public: const ParasiticAnalysisPt *ap) = 0; virtual void deleteParasiticNetworks(const Net *net) = 0; // True if the parasitic network caps include pin capacitances. - virtual bool includesPinCaps(Parasitic *parasitic) const = 0; + virtual bool includesPinCaps(const Parasitic *parasitic) const = 0; // Parasitic network component builders. // Make a subnode of the parasitic network net. virtual ParasiticNode *ensureParasiticNode(Parasitic *parasitic, @@ -207,7 +207,7 @@ public: virtual const char *name(const ParasiticNode *node) = 0; virtual const Pin *connectionPin(const ParasiticNode *node) const = 0; // Find the parasitic node connected to pin. - virtual ParasiticNode *findNode(Parasitic *parasitic, + virtual ParasiticNode *findNode(const Parasitic *parasitic, const Pin *pin) const = 0; // Node capacitance to ground. virtual float nodeGndCap(const ParasiticNode *node, diff --git a/parasitics/ConcreteParasitics.cc b/parasitics/ConcreteParasitics.cc index e778dc50..e9aa1fb7 100644 --- a/parasitics/ConcreteParasitics.cc +++ b/parasitics/ConcreteParasitics.cc @@ -771,7 +771,7 @@ ConcreteParasiticNetwork::ensureParasiticNode(const Net *net, } ConcreteParasiticNode * -ConcreteParasiticNetwork::findNode(const Pin *pin) +ConcreteParasiticNetwork::findNode(const Pin *pin) const { return pin_nodes_.findKey(pin); } @@ -1373,10 +1373,10 @@ ConcreteParasitics::deleteParasiticNetworks(const Net *net) } bool -ConcreteParasitics::includesPinCaps(Parasitic *parasitic) const +ConcreteParasitics::includesPinCaps(const Parasitic *parasitic) const { - ConcreteParasiticNetwork *cparasitic = - static_cast(parasitic); + const ConcreteParasiticNetwork *cparasitic = + static_cast(parasitic); return cparasitic->includesPinCaps(); } @@ -1513,11 +1513,11 @@ ConcreteParasitics::connectionPin(const ParasiticNode *node) const } ParasiticNode * -ConcreteParasitics::findNode(Parasitic *parasitic, +ConcreteParasitics::findNode(const Parasitic *parasitic, const Pin *pin) const { - ConcreteParasiticNetwork *cparasitic = - static_cast(parasitic); + const ConcreteParasiticNetwork *cparasitic = + static_cast(parasitic); return cparasitic->findNode(pin); } diff --git a/parasitics/ConcreteParasitics.hh b/parasitics/ConcreteParasitics.hh index 71ec9556..51495e57 100644 --- a/parasitics/ConcreteParasitics.hh +++ b/parasitics/ConcreteParasitics.hh @@ -119,7 +119,7 @@ public: virtual void deleteParasiticNetwork(const Net *net, const ParasiticAnalysisPt *ap); virtual void deleteParasiticNetworks(const Net *net); - virtual bool includesPinCaps(Parasitic *parasitic) const; + virtual bool includesPinCaps(const Parasitic *parasitic) const; virtual ParasiticNode *ensureParasiticNode(Parasitic *parasitic, const Net *net, int id); @@ -147,7 +147,8 @@ public: virtual const char *name(const ParasiticNode *node); virtual const Pin *connectionPin(const ParasiticNode *node) const; - virtual ParasiticNode *findNode(Parasitic *parasitic, const Pin *pin) const; + virtual ParasiticNode *findNode(const Parasitic *parasitic, + const Pin *pin) const; virtual float nodeGndCap(const ParasiticNode *node, const ParasiticAnalysisPt *ap) const; virtual ParasiticDeviceIterator * diff --git a/parasitics/ConcreteParasiticsPvt.hh b/parasitics/ConcreteParasiticsPvt.hh index 122b757b..93b3f57b 100644 --- a/parasitics/ConcreteParasiticsPvt.hh +++ b/parasitics/ConcreteParasiticsPvt.hh @@ -407,7 +407,7 @@ public: bool includesPinCaps() const { return includes_pin_caps_; } ConcreteParasiticNode *ensureParasiticNode(const Net *net, int id); - ConcreteParasiticNode *findNode(const Pin *pin); + ConcreteParasiticNode *findNode(const Pin *pin) const; ConcreteParasiticNode *ensureParasiticNode(const Pin *pin); virtual float capacitance() const; ConcreteParasiticPinNodeMap *pinNodes() { return &pin_nodes_; } diff --git a/parasitics/NullParasitics.cc b/parasitics/NullParasitics.cc index 203eebec..fbd2adfb 100644 --- a/parasitics/NullParasitics.cc +++ b/parasitics/NullParasitics.cc @@ -240,7 +240,7 @@ NullParasitics::makeParasiticNetwork(const Net *, } bool -NullParasitics::includesPinCaps(Parasitic *) const +NullParasitics::includesPinCaps(const Parasitic *) const { return false; } @@ -327,7 +327,7 @@ NullParasitics::connectionPin(const ParasiticNode *) const } ParasiticNode * -NullParasitics::findNode(Parasitic *, +NullParasitics::findNode(const Parasitic *, const Pin *) const { return nullptr; diff --git a/parasitics/ReduceParasitics.cc b/parasitics/ReduceParasitics.cc index 2f224312..be1b3093 100644 --- a/parasitics/ReduceParasitics.cc +++ b/parasitics/ReduceParasitics.cc @@ -280,7 +280,7 @@ class ReduceToPiElmore : public ReduceToPi { public: ReduceToPiElmore(StaState *sta); - void makePiElmore(Parasitic *parasitic_network, + void makePiElmore(const Parasitic *parasitic_network, const Pin *drvr_pin, ParasiticNode *drvr_node, float coupling_cap_factor, @@ -298,7 +298,7 @@ class ReduceToPiElmore : public ReduceToPi }; void -reduceToPiElmore(Parasitic *parasitic_network, +reduceToPiElmore(const Parasitic *parasitic_network, const Pin *drvr_pin, float coupling_cap_factor, const OperatingConditions *op_cond, @@ -332,7 +332,7 @@ ReduceToPiElmore::ReduceToPiElmore(StaState *sta) : } void -ReduceToPiElmore::makePiElmore(Parasitic *parasitic_network, +ReduceToPiElmore::makePiElmore(const Parasitic *parasitic_network, const Pin *drvr_pin, ParasiticNode *drvr_node, float coupling_cap_factor, @@ -400,12 +400,12 @@ class ReduceToPiPoleResidue2 : public ReduceToPi public: ReduceToPiPoleResidue2(StaState *sta); ~ReduceToPiPoleResidue2(); - void findPolesResidues(Parasitic *parasitic_network, + void findPolesResidues(const Parasitic *parasitic_network, Parasitic *pi_pole_residue, const Pin *drvr_pin, ParasiticNode *drvr_node, const ParasiticAnalysisPt *ap); - void makePiPoleResidue2(Parasitic *parasitic_network, + void makePiPoleResidue2(const Parasitic *parasitic_network, const Pin *drvr_pin, ParasiticNode *drvr_node, float coupling_cap_factor, @@ -466,7 +466,7 @@ ReduceToPiPoleResidue2::ReduceToPiPoleResidue2(StaState *sta) : // Three Moments of the Impulse Response", Proceedings of the 33rd // Design Automation Conference, 1996, pg 611-616. void -reduceToPiPoleResidue2(Parasitic *parasitic_network, +reduceToPiPoleResidue2(const Parasitic *parasitic_network, const Pin *drvr_pin, float coupling_cap_factor, const OperatingConditions *op_cond, @@ -494,7 +494,7 @@ reduceToPiPoleResidue2(Parasitic *parasitic_network, } void -ReduceToPiPoleResidue2::makePiPoleResidue2(Parasitic *parasitic_network, +ReduceToPiPoleResidue2::makePiPoleResidue2(const Parasitic *parasitic_network, const Pin *drvr_pin, ParasiticNode *drvr_node, float coupling_cap_factor, @@ -524,7 +524,7 @@ ReduceToPiPoleResidue2::~ReduceToPiPoleResidue2() } void -ReduceToPiPoleResidue2::findPolesResidues(Parasitic *parasitic_network, +ReduceToPiPoleResidue2::findPolesResidues(const Parasitic *parasitic_network, Parasitic *pi_pole_residue, const Pin *drvr_pin, ParasiticNode *drvr_node, diff --git a/parasitics/ReduceParasitics.hh b/parasitics/ReduceParasitics.hh index 65cc17c7..105e34b7 100644 --- a/parasitics/ReduceParasitics.hh +++ b/parasitics/ReduceParasitics.hh @@ -28,7 +28,7 @@ class StaState; // Reduce parasitic network to pi elmore model for drvr_pin. void -reduceToPiElmore(Parasitic *parasitic_network, +reduceToPiElmore(const Parasitic *parasitic_network, const Pin *drvr_pin, float coupling_cap_factor, const OperatingConditions *op_cond, @@ -40,7 +40,7 @@ reduceToPiElmore(Parasitic *parasitic_network, // Reduce parasitic network to pi and 2nd order pole/residue models // for drvr_pin. void -reduceToPiPoleResidue2(Parasitic *parasitic_network, +reduceToPiPoleResidue2(const Parasitic *parasitic_network, const Pin *drvr_pin, float coupling_cap_factor, const OperatingConditions *op_cond,