InternalPower::related_pg_port string->port
Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
parent
4689eecacd
commit
4c157f46ee
|
|
@ -43,7 +43,7 @@ class InternalPower
|
|||
public:
|
||||
InternalPower(LibertyPort *port,
|
||||
LibertyPort *related_port,
|
||||
const std::string &related_pg_pin,
|
||||
LibertyPort *related_pg_pin,
|
||||
const std::shared_ptr<FuncExpr> &when,
|
||||
InternalPowerModels &models);
|
||||
//InternalPower(InternalPower &&other) noexcept;
|
||||
|
|
@ -51,7 +51,7 @@ public:
|
|||
LibertyPort *port() const { return port_; }
|
||||
LibertyPort *relatedPort() const { return related_port_; }
|
||||
FuncExpr *when() const { return when_.get(); }
|
||||
const std::string &relatedPgPin() const { return related_pg_pin_; }
|
||||
LibertyPort *relatedPgPin() const { return related_pg_pin_; }
|
||||
float power(const RiseFall *rf,
|
||||
const Pvt *pvt,
|
||||
float in_slew,
|
||||
|
|
@ -61,7 +61,7 @@ public:
|
|||
protected:
|
||||
LibertyPort *port_;
|
||||
LibertyPort *related_port_;
|
||||
std::string related_pg_pin_;
|
||||
LibertyPort *related_pg_pin_;
|
||||
std::shared_ptr<FuncExpr> when_;
|
||||
InternalPowerModels models_;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -587,7 +587,7 @@ public:
|
|||
TimingArcAttrsPtr attrs);
|
||||
void makeInternalPower(LibertyPort *port,
|
||||
LibertyPort *related_port,
|
||||
const std::string &related_pg_pin,
|
||||
LibertyPort *related_pg_pin,
|
||||
const std::shared_ptr<FuncExpr> &when,
|
||||
InternalPowerModels &models);
|
||||
void makeLeakagePower(LibertyPort *related_pg_port,
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ namespace sta {
|
|||
|
||||
InternalPower::InternalPower(LibertyPort *port,
|
||||
LibertyPort *related_port,
|
||||
const std::string &related_pg_pin,
|
||||
LibertyPort *related_pg_pin,
|
||||
const std::shared_ptr<FuncExpr> &when,
|
||||
InternalPowerModels &models) :
|
||||
port_(port),
|
||||
|
|
|
|||
|
|
@ -1265,7 +1265,7 @@ LibertyCell::makeTimingArcSet(LibertyPort *from,
|
|||
void
|
||||
LibertyCell::makeInternalPower(LibertyPort *port,
|
||||
LibertyPort *related_port,
|
||||
const std::string &related_pg_pin,
|
||||
LibertyPort *related_pg_pin,
|
||||
const std::shared_ptr<FuncExpr> &when,
|
||||
InternalPowerModels &models)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2865,6 +2865,9 @@ LibertyReader::makeInternalPowers(LibertyPort *port,
|
|||
InternalPowerGroup *power_group)
|
||||
{
|
||||
int line = power_group->line();
|
||||
const std::string &related_pg_pin_name = power_group->relatedPgPin();
|
||||
LibertyPort *related_pg_pin = cell_->findLibertyPort(related_pg_pin_name.c_str());
|
||||
|
||||
StringSeq *related_port_names = power_group->relatedPortNames();
|
||||
if (related_port_names) {
|
||||
for (const char *related_port_name : *related_port_names) {
|
||||
|
|
@ -2872,12 +2875,12 @@ LibertyReader::makeInternalPowers(LibertyPort *port,
|
|||
if (related_port_iter.hasNext()) {
|
||||
debugPrint(debug_, "liberty", 2, " power %s -> %s",
|
||||
related_port_name, port->name());
|
||||
makeInternalPowers(port, related_port_name, related_port_iter, power_group);
|
||||
makeInternalPowers(port, related_port_name, related_port_iter,
|
||||
related_pg_pin, power_group);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
const std::string &related_pg_pin = power_group->relatedPgPin();
|
||||
if (port->hasMembers()) {
|
||||
LibertyPortMemberIterator bit_iter(port);
|
||||
while (bit_iter.hasNext()) {
|
||||
|
|
@ -2896,9 +2899,9 @@ void
|
|||
LibertyReader::makeInternalPowers(LibertyPort *port,
|
||||
const char *related_port_name,
|
||||
PortNameBitIterator &related_port_iter,
|
||||
LibertyPort *related_pg_pin,
|
||||
InternalPowerGroup *power_group)
|
||||
{
|
||||
const std::string &related_pg_pin = power_group->relatedPgPin();
|
||||
const auto &when = power_group->when();
|
||||
InternalPowerModels &models = power_group->models();
|
||||
if (related_port_iter.size() == 1 && !port->hasMembers()) {
|
||||
|
|
|
|||
|
|
@ -423,6 +423,7 @@ public:
|
|||
virtual void makeInternalPowers(LibertyPort *port,
|
||||
const char *related_port_name,
|
||||
PortNameBitIterator &related_port_iter,
|
||||
LibertyPort *related_pg_pin,
|
||||
InternalPowerGroup *power_group);
|
||||
|
||||
// AOCV attributes.
|
||||
|
|
|
|||
|
|
@ -1176,7 +1176,7 @@ Power::findInputInternalPower(const Pin *pin,
|
|||
Vertex *vertex = graph_->pinLoadVertex(pin);
|
||||
float internal = 0.0;
|
||||
for (const InternalPower *pwr : internal_pwrs) {
|
||||
const char *related_pg_pin = pwr->relatedPgPin().c_str();
|
||||
LibertyPort *related_pg_pin = pwr->relatedPgPin();
|
||||
float energy = 0.0;
|
||||
int rf_count = 0;
|
||||
for (const RiseFall *rf : RiseFall::range()) {
|
||||
|
|
@ -1214,7 +1214,7 @@ Power::findInputInternalPower(const Pin *pin,
|
|||
duty,
|
||||
energy,
|
||||
port_internal,
|
||||
related_pg_pin ? related_pg_pin : "no pg_pin");
|
||||
related_pg_pin ? related_pg_pin->name() : "no pg_pin");
|
||||
internal += port_internal;
|
||||
}
|
||||
result.incrInternal(internal);
|
||||
|
|
@ -1313,14 +1313,14 @@ Power::findOutputInternalPower(const LibertyPort *to_port,
|
|||
const LibertyPort *to_scene_port = to_port->scenePort(scene, min_max);
|
||||
FuncExpr *func = to_port->function();
|
||||
|
||||
map<const char*, float, StringLessIf> pg_duty_sum;
|
||||
std::map<LibertyPort*, float> pg_duty_sum;
|
||||
for (const InternalPower *pwr : scene_cell->internalPowers(to_scene_port)) {
|
||||
const LibertyPort *from_scene_port = pwr->relatedPort();
|
||||
if (from_scene_port) {
|
||||
const Pin *from_pin = findLinkPin(inst, from_scene_port);
|
||||
float from_density = findActivity(from_pin).density();
|
||||
float duty = findInputDuty(inst, func, pwr);
|
||||
const char *related_pg_pin = pwr->relatedPgPin().c_str();
|
||||
LibertyPort *related_pg_pin = pwr->relatedPgPin();
|
||||
// Note related_pg_pin may be null.
|
||||
pg_duty_sum[related_pg_pin] += from_density * duty;
|
||||
}
|
||||
|
|
@ -1331,7 +1331,7 @@ Power::findOutputInternalPower(const LibertyPort *to_port,
|
|||
float internal = 0.0;
|
||||
for (const InternalPower *pwr : scene_cell->internalPowers(to_scene_port)) {
|
||||
FuncExpr *when = pwr->when();
|
||||
const char *related_pg_pin = pwr->relatedPgPin().c_str();
|
||||
LibertyPort *related_pg_pin = pwr->relatedPgPin();
|
||||
float duty = findInputDuty(inst, func, pwr);
|
||||
Vertex *from_vertex = nullptr;
|
||||
bool positive_unate = true;
|
||||
|
|
@ -1378,7 +1378,7 @@ Power::findOutputInternalPower(const LibertyPort *to_port,
|
|||
weight,
|
||||
energy,
|
||||
port_internal,
|
||||
related_pg_pin ? related_pg_pin : "no pg_pin");
|
||||
related_pg_pin ? related_pg_pin->name() : "no pg_pin");
|
||||
internal += port_internal;
|
||||
}
|
||||
result.incrInternal(internal);
|
||||
|
|
@ -1517,13 +1517,13 @@ Power::findLeakagePower(const Instance *inst,
|
|||
LibertyCell *scene_cell = cell->sceneCell(scene, MinMax::max());
|
||||
std::map<LibertyPort*, LeakageSummary> leakage_summaries;
|
||||
Sim *sim = scene->mode()->sim();
|
||||
for (const LeakagePower &leak : scene_cell->leakagePowers()) {
|
||||
LibertyPort *pg_port = leak.relatedPgPort();
|
||||
for (const LeakagePower &pwr : scene_cell->leakagePowers()) {
|
||||
LibertyPort *pg_port = pwr.relatedPgPort();
|
||||
if (pg_port == nullptr
|
||||
|| pg_port->pwrGndType() == PwrGndType::primary_power) {
|
||||
LeakageSummary &sum = leakage_summaries[pg_port];
|
||||
float leakage = leak.power();
|
||||
FuncExpr *when = leak.when();
|
||||
float leakage = pwr.power();
|
||||
FuncExpr *when = pwr.when();
|
||||
if (when) {
|
||||
LogicValue when_value = sim->evalExpr(when, inst);
|
||||
if (when_value == LogicValue::one) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue