2018-09-28 17:54:21 +02:00
|
|
|
// OpenSTA, Static Timing Analyzer
|
2024-01-12 01:34:49 +01:00
|
|
|
// Copyright (c) 2024, 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
|
2022-01-04 18:17:08 +01:00
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2018-09-28 17:54:21 +02:00
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
//
|
|
|
|
|
// You should have received a copy of the GNU General Public License
|
2022-01-04 18:17:08 +01:00
|
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2018-09-28 17:54:21 +02:00
|
|
|
|
2020-04-05 23:53:44 +02:00
|
|
|
#include "LinearModel.hh"
|
2020-04-05 20:35:51 +02:00
|
|
|
|
2020-04-05 23:53:44 +02:00
|
|
|
#include "Units.hh"
|
|
|
|
|
#include "Liberty.hh"
|
2018-09-28 17:54:21 +02:00
|
|
|
|
|
|
|
|
namespace sta {
|
|
|
|
|
|
2023-11-19 18:04:45 +01:00
|
|
|
GateLinearModel::GateLinearModel(LibertyCell *cell,
|
|
|
|
|
float intrinsic,
|
2018-09-28 17:54:21 +02:00
|
|
|
float resistance) :
|
2023-11-19 18:04:45 +01:00
|
|
|
GateTimingModel(cell),
|
2018-09-28 17:54:21 +02:00
|
|
|
intrinsic_(intrinsic),
|
|
|
|
|
resistance_(resistance)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2023-11-19 18:04:45 +01:00
|
|
|
GateLinearModel::gateDelay(const Pvt *,
|
2018-09-28 17:54:21 +02:00
|
|
|
float,
|
|
|
|
|
float load_cap,
|
2019-01-27 08:03:01 +01:00
|
|
|
bool,
|
2018-09-28 17:54:21 +02:00
|
|
|
// return values
|
2018-11-26 18:15:52 +01:00
|
|
|
ArcDelay &gate_delay,
|
|
|
|
|
Slew &drvr_slew) const
|
2018-09-28 17:54:21 +02:00
|
|
|
{
|
|
|
|
|
gate_delay = intrinsic_ + resistance_ * load_cap;
|
|
|
|
|
drvr_slew = 0.0;
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-24 23:15:57 +01:00
|
|
|
string
|
2023-11-19 18:04:45 +01:00
|
|
|
GateLinearModel::reportGateDelay(const Pvt *,
|
2018-09-28 17:54:21 +02:00
|
|
|
float,
|
|
|
|
|
float load_cap,
|
2019-01-27 08:03:01 +01:00
|
|
|
bool,
|
2023-03-24 23:15:57 +01:00
|
|
|
int digits) const
|
2018-09-28 17:54:21 +02:00
|
|
|
{
|
2023-11-19 18:04:45 +01:00
|
|
|
const LibertyLibrary *library = cell_->libertyLibrary();
|
2018-09-28 17:54:21 +02:00
|
|
|
const Units *units = library->units();
|
|
|
|
|
const Unit *time_unit = units->timeUnit();
|
|
|
|
|
const Unit *res_unit = units->resistanceUnit();
|
|
|
|
|
const Unit *cap_unit = units->capacitanceUnit();
|
2023-03-24 23:15:57 +01:00
|
|
|
string result = "Delay = ";
|
|
|
|
|
result += time_unit->asString(intrinsic_, digits);
|
|
|
|
|
result += " + ";
|
|
|
|
|
result += res_unit->asString(resistance_, digits);
|
|
|
|
|
result += " * ";
|
|
|
|
|
result += cap_unit->asString(load_cap, digits);
|
|
|
|
|
result += " = ";
|
2018-09-28 17:54:21 +02:00
|
|
|
float delay = intrinsic_ + resistance_ * load_cap;
|
2023-03-24 23:15:57 +01:00
|
|
|
result += time_unit->asString(delay, digits);
|
|
|
|
|
return result;
|
2018-09-28 17:54:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float
|
2023-11-19 18:04:45 +01:00
|
|
|
GateLinearModel::driveResistance(const Pvt *) const
|
2018-09-28 17:54:21 +02:00
|
|
|
{
|
|
|
|
|
return resistance_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
GateLinearModel::setIsScaled(bool)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-19 18:04:45 +01:00
|
|
|
CheckLinearModel::CheckLinearModel(LibertyCell *cell,
|
|
|
|
|
float intrinsic) :
|
|
|
|
|
CheckTimingModel(cell),
|
2018-09-28 17:54:21 +02:00
|
|
|
intrinsic_(intrinsic)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-07 21:44:04 +01:00
|
|
|
ArcDelay
|
2023-11-19 18:04:45 +01:00
|
|
|
CheckLinearModel::checkDelay(const Pvt *,
|
2018-09-28 17:54:21 +02:00
|
|
|
float,
|
|
|
|
|
float,
|
2018-11-26 18:15:52 +01:00
|
|
|
float,
|
2024-01-07 21:44:04 +01:00
|
|
|
bool) const
|
2018-09-28 17:54:21 +02:00
|
|
|
{
|
2024-01-07 21:44:04 +01:00
|
|
|
return intrinsic_;
|
2018-09-28 17:54:21 +02:00
|
|
|
}
|
|
|
|
|
|
2023-03-24 23:15:57 +01:00
|
|
|
string
|
2023-11-19 18:04:45 +01:00
|
|
|
CheckLinearModel::reportCheckDelay(const Pvt *,
|
2018-09-28 17:54:21 +02:00
|
|
|
float,
|
|
|
|
|
const char *,
|
|
|
|
|
float,
|
|
|
|
|
float,
|
2019-01-27 08:03:01 +01:00
|
|
|
bool,
|
2023-03-24 23:15:57 +01:00
|
|
|
int digits) const
|
2018-09-28 17:54:21 +02:00
|
|
|
{
|
2023-11-19 18:04:45 +01:00
|
|
|
const LibertyLibrary *library = cell_->libertyLibrary();
|
2018-09-28 17:54:21 +02:00
|
|
|
const Units *units = library->units();
|
|
|
|
|
const Unit *time_unit = units->timeUnit();
|
2023-03-24 23:15:57 +01:00
|
|
|
string result = "Check = ";
|
|
|
|
|
result += time_unit->asString(intrinsic_, digits);
|
|
|
|
|
return result;
|
2018-09-28 17:54:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
CheckLinearModel::setIsScaled(bool)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace
|