OpenSTA/sdc/InputDrive.hh

118 lines
3.4 KiB
C++
Raw Normal View History

2018-09-28 17:54:21 +02:00
// OpenSTA, Static Timing Analyzer
2019-01-01 21:26:11 +01:00
// Copyright (c) 2019, 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/>.
#ifndef STA_INPUT_DRIVE_H
#define STA_INPUT_DRIVE_H
#include "DisallowCopyAssign.hh"
#include "LibertyClass.hh"
#include "NetworkClass.hh"
#include "MinMax.hh"
#include "RiseFallMinMax.hh"
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();
void setSlew(const TransRiseFallBoth *tr,
const MinMaxAll *min_max,
float slew);
void setDriveResistance(const TransRiseFallBoth *tr,
const MinMaxAll *min_max,
float res);
void driveResistance(const TransRiseFall *tr,
const MinMax *min_max,
float &res,
bool &exists);
bool hasDriveResistance(const TransRiseFall *tr,
const MinMax *min_max);
bool driveResistanceMinMaxEqual(const TransRiseFall *tr);
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,
const TransRiseFallBoth *tr,
const MinMaxAll *min_max);
void driveCell(const TransRiseFall *tr,
const MinMax *min_max,
LibertyCell *&cell,
LibertyPort *&from_port,
float *&from_slews,
LibertyPort *&to_port);
InputDriveCell *driveCell(const TransRiseFall *tr,
const MinMax *min_max);
bool hasDriveCell(const TransRiseFall *tr,
const MinMax *min_max);
// True if rise/fall/min/max drive cells are equal.
bool driveCellsEqual();
void slew(const TransRiseFall *tr,
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.
InputDriveCell *drive_cells_[TransRiseFall::index_count][MinMax::index_count];
};
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_;
float from_slews_[TransRiseFall::index_count];
LibertyPort *to_port_;
};
} // namespace
#endif