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 "MinMax.hh"
|
|
|
|
|
#include "LibertyClass.hh"
|
|
|
|
|
#include "NetworkClass.hh"
|
|
|
|
|
#include "RiseFallMinMax.hh"
|
2018-09-28 17:54:21 +02:00
|
|
|
|
|
|
|
|
namespace sta {
|
|
|
|
|
|
|
|
|
|
class InputDriveCell;
|
|
|
|
|
|
|
|
|
|
// Input drive description from
|
|
|
|
|
// set_driving_cell
|
|
|
|
|
// set_drive
|
|
|
|
|
// set_input_transition
|
|
|
|
|
class InputDrive
|
|
|
|
|
{
|
|
|
|
|
public:
|
2019-03-13 01:25:53 +01:00
|
|
|
explicit InputDrive();
|
2018-09-28 17:54:21 +02:00
|
|
|
~InputDrive();
|
2019-11-11 23:30:19 +01:00
|
|
|
void setSlew(const RiseFallBoth *rf,
|
2018-09-28 17:54:21 +02:00
|
|
|
const MinMaxAll *min_max,
|
|
|
|
|
float slew);
|
2019-11-11 23:30:19 +01:00
|
|
|
void setDriveResistance(const RiseFallBoth *rf,
|
2018-09-28 17:54:21 +02:00
|
|
|
const MinMaxAll *min_max,
|
|
|
|
|
float res);
|
2019-11-11 23:30:19 +01:00
|
|
|
void driveResistance(const RiseFall *rf,
|
2018-09-28 17:54:21 +02:00
|
|
|
const MinMax *min_max,
|
|
|
|
|
float &res,
|
|
|
|
|
bool &exists);
|
2019-11-11 23:30:19 +01:00
|
|
|
bool hasDriveResistance(const RiseFall *rf,
|
2018-09-28 17:54:21 +02:00
|
|
|
const MinMax *min_max);
|
2019-11-11 23:30:19 +01:00
|
|
|
bool driveResistanceMinMaxEqual(const RiseFall *rf);
|
2019-02-16 21:07:59 +01:00
|
|
|
void setDriveCell(LibertyLibrary *library,
|
|
|
|
|
LibertyCell *cell,
|
2018-09-28 17:54:21 +02:00
|
|
|
LibertyPort *from_port,
|
|
|
|
|
float *from_slews,
|
|
|
|
|
LibertyPort *to_port,
|
2019-11-11 23:30:19 +01:00
|
|
|
const RiseFallBoth *rf,
|
2018-09-28 17:54:21 +02:00
|
|
|
const MinMaxAll *min_max);
|
2019-11-11 23:30:19 +01:00
|
|
|
void driveCell(const RiseFall *rf,
|
2018-09-28 17:54:21 +02:00
|
|
|
const MinMax *min_max,
|
|
|
|
|
LibertyCell *&cell,
|
|
|
|
|
LibertyPort *&from_port,
|
|
|
|
|
float *&from_slews,
|
|
|
|
|
LibertyPort *&to_port);
|
2019-11-11 23:30:19 +01:00
|
|
|
InputDriveCell *driveCell(const RiseFall *rf,
|
2018-09-28 17:54:21 +02:00
|
|
|
const MinMax *min_max);
|
2019-11-11 23:30:19 +01:00
|
|
|
bool hasDriveCell(const RiseFall *rf,
|
2018-09-28 17:54:21 +02:00
|
|
|
const MinMax *min_max);
|
|
|
|
|
// True if rise/fall/min/max drive cells are equal.
|
|
|
|
|
bool driveCellsEqual();
|
2019-11-11 23:30:19 +01:00
|
|
|
void slew(const RiseFall *rf,
|
2018-09-28 17:54:21 +02:00
|
|
|
const MinMax *min_max,
|
|
|
|
|
float &slew,
|
|
|
|
|
bool &exists);
|
|
|
|
|
RiseFallMinMax *slews() { return &slews_; }
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(InputDrive);
|
|
|
|
|
|
|
|
|
|
RiseFallMinMax slews_;
|
|
|
|
|
RiseFallMinMax drive_resistances_;
|
|
|
|
|
// Separate rise/fall/min/max drive cells.
|
2019-11-11 23:30:19 +01:00
|
|
|
InputDriveCell *drive_cells_[RiseFall::index_count][MinMax::index_count];
|
2018-09-28 17:54:21 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class InputDriveCell
|
|
|
|
|
{
|
|
|
|
|
public:
|
2019-02-16 21:07:59 +01:00
|
|
|
InputDriveCell(LibertyLibrary *library,
|
|
|
|
|
LibertyCell *cell,
|
2018-09-28 17:54:21 +02:00
|
|
|
LibertyPort *from_port,
|
|
|
|
|
float *from_slews,
|
|
|
|
|
LibertyPort *to_port);
|
2019-02-16 21:07:59 +01:00
|
|
|
LibertyLibrary *library() const { return library_; }
|
|
|
|
|
void setLibrary(LibertyLibrary *library);
|
2018-09-28 17:54:21 +02:00
|
|
|
LibertyCell *cell() const { return cell_; }
|
|
|
|
|
void setCell(LibertyCell *cell);
|
|
|
|
|
LibertyPort *fromPort() const { return from_port_; }
|
|
|
|
|
void setFromPort(LibertyPort *from_port);
|
|
|
|
|
float *fromSlews() { return from_slews_; }
|
|
|
|
|
void setFromSlews(float *from_slews);
|
|
|
|
|
LibertyPort *toPort() const { return to_port_; }
|
|
|
|
|
void setToPort(LibertyPort *to_port);
|
|
|
|
|
bool equal(InputDriveCell *drive) const;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(InputDriveCell);
|
|
|
|
|
|
2019-02-16 21:07:59 +01:00
|
|
|
LibertyLibrary *library_;
|
2018-09-28 17:54:21 +02:00
|
|
|
LibertyCell *cell_;
|
|
|
|
|
LibertyPort *from_port_;
|
2019-11-11 23:30:19 +01:00
|
|
|
float from_slews_[RiseFall::index_count];
|
2018-09-28 17:54:21 +02:00
|
|
|
LibertyPort *to_port_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace
|