Files
OpenSTA/include/sta/InputDrive.hh
T

121 lines
4.2 KiB
C++
Raw Normal View History

2018-09-28 08:54:21 -07:00
// OpenSTA, Static Timing Analyzer
2026-03-10 13:21:17 -07:00
// Copyright (c) 2026, Parallax Software, Inc.
2018-09-28 08:54:21 -07: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 10:17:08 -07:00
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2018-09-28 08:54:21 -07:00
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
2022-01-04 10:17:08 -07:00
// along with this program. If not, see <https://www.gnu.org/licenses/>.
2025-01-21 18:54:33 -07:00
//
// The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software.
//
// Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
//
// This notice may not be removed or altered from any source distribution.
2018-09-28 08:54:21 -07:00
2020-02-15 17:13:16 -07:00
#pragma once
2018-09-28 08:54:21 -07:00
2020-04-05 14:53:44 -07:00
#include "LibertyClass.hh"
2026-04-15 09:38:10 -07:00
#include "MinMax.hh"
2020-04-05 14:53:44 -07:00
#include "NetworkClass.hh"
#include "RiseFallMinMax.hh"
2026-04-15 09:38:10 -07:00
#include "SdcClass.hh"
2018-09-28 08:54:21 -07:00
namespace sta {
class InputDriveCell;
// Input drive description from
// set_driving_cell
// set_drive
// set_input_transition
class InputDrive
{
public:
2026-01-03 16:59:35 -08:00
InputDrive();
2018-09-28 08:54:21 -07:00
~InputDrive();
2019-11-11 15:30:19 -07:00
void setSlew(const RiseFallBoth *rf,
2026-01-03 16:59:35 -08:00
const MinMaxAll *min_max,
float slew);
2019-11-11 15:30:19 -07:00
void setDriveResistance(const RiseFallBoth *rf,
2026-01-03 16:59:35 -08:00
const MinMaxAll *min_max,
float res);
2019-11-11 15:30:19 -07:00
void driveResistance(const RiseFall *rf,
2026-01-03 16:59:35 -08:00
const MinMax *min_max,
float &res,
bool &exists) const;
2019-11-11 15:30:19 -07:00
bool hasDriveResistance(const RiseFall *rf,
2026-01-03 16:59:35 -08:00
const MinMax *min_max) const;
2025-02-01 14:53:28 -08:00
bool driveResistanceMinMaxEqual(const RiseFall *rf) const;
2023-01-19 11:23:45 -07:00
void setDriveCell(const LibertyLibrary *library,
2026-01-03 16:59:35 -08:00
const LibertyCell *cell,
const LibertyPort *from_port,
2026-04-15 09:38:10 -07:00
const DriveCellSlews &from_slews,
2026-01-03 16:59:35 -08:00
const LibertyPort *to_port,
const RiseFallBoth *rf,
const MinMaxAll *min_max);
2019-11-11 15:30:19 -07:00
void driveCell(const RiseFall *rf,
2026-01-03 16:59:35 -08:00
const MinMax *min_max,
// Return values.
2026-01-03 16:59:35 -08:00
const LibertyCell *&cell,
const LibertyPort *&from_port,
2026-04-15 09:38:10 -07:00
const DriveCellSlews *&from_slews,
2026-01-03 16:59:35 -08:00
const LibertyPort *&to_port) const;
2019-11-11 15:30:19 -07:00
InputDriveCell *driveCell(const RiseFall *rf,
2026-01-03 16:59:35 -08:00
const MinMax *min_max) const;
2019-11-11 15:30:19 -07:00
bool hasDriveCell(const RiseFall *rf,
2026-01-03 16:59:35 -08:00
const MinMax *min_max) const;
2018-09-28 08:54:21 -07:00
// True if rise/fall/min/max drive cells are equal.
2025-02-01 14:53:28 -08:00
bool driveCellsEqual() const;
2019-11-11 15:30:19 -07:00
void slew(const RiseFall *rf,
2026-01-03 16:59:35 -08:00
const MinMax *min_max,
float &slew,
bool &exists) const;
2025-02-01 14:53:28 -08:00
const RiseFallMinMax *slews() const { return &slews_; }
2018-09-28 08:54:21 -07:00
private:
RiseFallMinMax slews_;
RiseFallMinMax drive_resistances_;
// Separate rise/fall/min/max drive cells.
2019-11-11 15:30:19 -07:00
InputDriveCell *drive_cells_[RiseFall::index_count][MinMax::index_count];
2018-09-28 08:54:21 -07:00
};
class InputDriveCell
{
public:
2023-01-19 11:23:45 -07:00
InputDriveCell(const LibertyLibrary *library,
2026-01-03 16:59:35 -08:00
const LibertyCell *cell,
const LibertyPort *from_port,
2026-04-15 09:38:10 -07:00
const DriveCellSlews &from_slews,
2026-01-03 16:59:35 -08:00
const LibertyPort *to_port);
2023-01-19 11:23:45 -07:00
const LibertyLibrary *library() const { return library_; }
void setLibrary(const LibertyLibrary *library);
const LibertyCell *cell() const { return cell_; }
void setCell(const LibertyCell *cell);
const LibertyPort *fromPort() const { return from_port_; }
void setFromPort(const LibertyPort *from_port);
2026-04-15 09:38:10 -07:00
const DriveCellSlews &fromSlews() const { return from_slews_; }
void setFromSlews(const DriveCellSlews &from_slews);
2023-01-19 11:23:45 -07:00
const LibertyPort *toPort() const { return to_port_; }
void setToPort(const LibertyPort *to_port);
bool equal(const InputDriveCell *drive) const;
2018-09-28 08:54:21 -07:00
private:
2023-01-19 11:23:45 -07:00
const LibertyLibrary *library_;
const LibertyCell *cell_;
const LibertyPort *from_port_;
2026-04-15 09:38:10 -07:00
DriveCellSlews from_slews_;
2023-01-19 11:23:45 -07:00
const LibertyPort *to_port_;
2018-09-28 08:54:21 -07:00
};
2026-04-13 14:58:16 -07:00
} // namespace sta