2018-09-28 17:54:21 +02:00
|
|
|
// OpenSTA, Static Timing Analyzer
|
2020-03-07 03:50:37 +01:00
|
|
|
// Copyright (c) 2020, Parallax Software, Inc.
|
2018-09-28 17:54:21 +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/>.
|
|
|
|
|
|
2020-02-16 01:13:16 +01:00
|
|
|
#pragma once
|
2018-09-28 17:54:21 +02:00
|
|
|
|
2020-04-05 23:53:44 +02:00
|
|
|
#include "DisallowCopyAssign.hh"
|
|
|
|
|
#include "LibertyClass.hh"
|
|
|
|
|
#include "Transition.hh"
|
2018-09-28 17:54:21 +02:00
|
|
|
|
|
|
|
|
namespace sta {
|
|
|
|
|
|
|
|
|
|
class InternalPowerAttrs;
|
|
|
|
|
class InternalPowerModel;
|
|
|
|
|
|
|
|
|
|
class InternalPowerAttrs
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
InternalPowerAttrs();
|
2018-12-05 23:18:41 +01:00
|
|
|
virtual ~InternalPowerAttrs();
|
|
|
|
|
void deleteContents();
|
2018-09-28 17:54:21 +02:00
|
|
|
FuncExpr *when() const { return when_; }
|
|
|
|
|
FuncExpr *&whenRef() { return when_; }
|
2019-11-11 23:30:19 +01:00
|
|
|
void setModel(RiseFall *rf,
|
2018-09-28 17:54:21 +02:00
|
|
|
InternalPowerModel *model);
|
2019-11-11 23:30:19 +01:00
|
|
|
InternalPowerModel *model(RiseFall *rf) const;
|
2018-11-26 18:15:52 +01:00
|
|
|
const char *relatedPgPin() const { return related_pg_pin_; }
|
|
|
|
|
void setRelatedPgPin(const char *related_pg_pin);
|
2018-09-28 17:54:21 +02:00
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
FuncExpr *when_;
|
2019-11-11 23:30:19 +01:00
|
|
|
InternalPowerModel *models_[RiseFall::index_count];
|
2018-11-26 18:15:52 +01:00
|
|
|
const char *related_pg_pin_;
|
2018-09-28 17:54:21 +02:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(InternalPowerAttrs);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class InternalPower
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
InternalPower(LibertyCell *cell,
|
|
|
|
|
LibertyPort *port,
|
|
|
|
|
LibertyPort *related_port,
|
|
|
|
|
InternalPowerAttrs *attrs);
|
|
|
|
|
~InternalPower();
|
|
|
|
|
LibertyCell *libertyCell() const;
|
|
|
|
|
LibertyPort *port() const { return port_; }
|
|
|
|
|
LibertyPort *relatedPort() const { return related_port_; }
|
|
|
|
|
FuncExpr *when() const { return when_; }
|
2018-11-26 18:15:52 +01:00
|
|
|
const char *relatedPgPin() const { return related_pg_pin_; }
|
2019-11-11 23:30:19 +01:00
|
|
|
float power(RiseFall *rf,
|
2018-09-28 17:54:21 +02:00
|
|
|
const Pvt *pvt,
|
|
|
|
|
float in_slew,
|
|
|
|
|
float load_cap);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
LibertyPort *port_;
|
|
|
|
|
LibertyPort *related_port_;
|
|
|
|
|
FuncExpr *when_;
|
2018-11-26 18:15:52 +01:00
|
|
|
const char *related_pg_pin_;
|
2019-11-11 23:30:19 +01:00
|
|
|
InternalPowerModel *models_[RiseFall::index_count];
|
2018-09-28 17:54:21 +02:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(InternalPower);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class InternalPowerModel
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit InternalPowerModel(TableModel *model);
|
|
|
|
|
~InternalPowerModel();
|
|
|
|
|
float power(const LibertyCell *cell,
|
|
|
|
|
const Pvt *pvt,
|
|
|
|
|
float in_slew,
|
|
|
|
|
float load_cap) const;
|
|
|
|
|
void reportPower(const LibertyCell *cell,
|
|
|
|
|
const Pvt *pvt,
|
|
|
|
|
float in_slew,
|
|
|
|
|
float load_cap,
|
|
|
|
|
int digits,
|
|
|
|
|
string *result) const;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void findAxisValues(float in_slew,
|
|
|
|
|
float load_cap,
|
|
|
|
|
// Return values.
|
|
|
|
|
float &axis_value1,
|
|
|
|
|
float &axis_value2,
|
|
|
|
|
float &axis_value3) const;
|
|
|
|
|
float axisValue(TableAxis *axis,
|
|
|
|
|
float in_slew,
|
|
|
|
|
float load_cap) const;
|
|
|
|
|
bool checkAxes(const TableModel *model);
|
|
|
|
|
bool checkAxis(TableAxis *axis);
|
|
|
|
|
|
|
|
|
|
TableModel *model_;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(InternalPowerModel);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace
|