Skip to content

Commit

Permalink
merge ConcreteElmore into ConcretePiElmore
Browse files Browse the repository at this point in the history
Signed-off-by: James Cherry <[email protected]>
  • Loading branch information
jjcherry56 committed Jun 2, 2023
1 parent 36fce30 commit 3b2c6e1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 60 deletions.
60 changes: 19 additions & 41 deletions parasitics/ConcreteParasitics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -144,44 +144,6 @@ ConcreteParasitic::nodeIterator()

////////////////////////////////////////////////////////////////

ConcreteElmore::ConcreteElmore() :
loads_(nullptr)
{
}

ConcreteElmore::~ConcreteElmore()
{
delete loads_;
}

void
ConcreteElmore::findElmore(const Pin *load_pin,
float &elmore,
bool &exists) const
{
if (loads_)
loads_->findKey(load_pin, elmore, exists);
else
exists = false;
}

void
ConcreteElmore::deleteLoad(const Pin *load_pin)
{
loads_->erase(load_pin);
}

void
ConcreteElmore::setElmore(const Pin *load_pin,
float elmore)
{
if (loads_ == nullptr)
loads_ = new ConcreteElmoreLoadMap;
(*loads_)[load_pin] = elmore;
}

////////////////////////////////////////////////////////////////

ConcretePi::ConcretePi(float c2,
float rpi,
float c1) :
Expand Down Expand Up @@ -230,8 +192,13 @@ ConcretePiElmore::ConcretePiElmore(float c2,
float rpi,
float c1) :
ConcretePi(c2, rpi, c1),
ConcreteElmore()
loads_(nullptr)
{
}

ConcretePiElmore::~ConcretePiElmore()
{
delete loads_;
}

float
Expand Down Expand Up @@ -273,14 +240,25 @@ ConcretePiElmore::findElmore(const Pin *load_pin,
float &elmore,
bool &exists) const
{
ConcreteElmore::findElmore(load_pin, elmore, exists);
if (loads_)
loads_->findKey(load_pin, elmore, exists);
else
exists = false;
}

void
ConcretePiElmore::setElmore(const Pin *load_pin,
float elmore)
{
ConcreteElmore::setElmore(load_pin, elmore);
if (loads_ == nullptr)
loads_ = new ConcreteElmoreLoadMap;
(*loads_)[load_pin] = elmore;
}

void
ConcretePiElmore::deleteLoad(const Pin *load_pin)
{
loads_->erase(load_pin);
}

////////////////////////////////////////////////////////////////
Expand Down
24 changes: 5 additions & 19 deletions parasitics/ConcreteParasiticsPvt.hh
Original file line number Diff line number Diff line change
Expand Up @@ -82,24 +82,6 @@ public:
virtual ParasiticNodeIterator *nodeIterator();
};

class ConcreteElmore
{
public:
void findElmore(const Pin *load_pin,
float &elmore,
bool &exists) const;
void deleteLoad(const Pin *load_pin);
void setElmore(const Pin *load_pin,
float elmore);

protected:
ConcreteElmore();
virtual ~ConcreteElmore();

private:
ConcreteElmoreLoadMap *loads_;
};

// Pi model for a driver pin.
class ConcretePi
{
Expand All @@ -126,13 +108,13 @@ protected:

// Pi model for a driver pin and the elmore delay to each load.
class ConcretePiElmore : public ConcretePi,
public ConcreteElmore,
public ConcreteParasitic
{
public:
ConcretePiElmore(float c2,
float rpi,
float c1);
virtual ~ConcretePiElmore();
virtual bool isPiElmore() const { return true; }
virtual bool isPiModel() const { return true; }
virtual float capacitance() const;
Expand All @@ -143,6 +125,10 @@ public:
virtual void findElmore(const Pin *load_pin, float &elmore,
bool &exists) const;
virtual void setElmore(const Pin *load_pin, float elmore);
void deleteLoad(const Pin *load_pin);

private:
ConcreteElmoreLoadMap *loads_;
};

// PiElmore from wireload model estimate.
Expand Down

0 comments on commit 3b2c6e1

Please sign in to comment.