forked from The-OpenROAD-Project/OpenSTA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
InputDrive.hh
111 lines (102 loc) · 3.39 KB
/
InputDrive.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
// OpenSTA, Static Timing Analyzer
// Copyright (c) 2023, Parallax Software, Inc.
//
// 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/>.
#pragma once
#include "MinMax.hh"
#include "LibertyClass.hh"
#include "NetworkClass.hh"
#include "RiseFallMinMax.hh"
namespace sta {
class InputDriveCell;
// Input drive description from
// set_driving_cell
// set_drive
// set_input_transition
class InputDrive
{
public:
explicit InputDrive();
~InputDrive();
void setSlew(const RiseFallBoth *rf,
const MinMaxAll *min_max,
float slew);
void setDriveResistance(const RiseFallBoth *rf,
const MinMaxAll *min_max,
float res);
void driveResistance(const RiseFall *rf,
const MinMax *min_max,
float &res,
bool &exists);
bool hasDriveResistance(const RiseFall *rf,
const MinMax *min_max);
bool driveResistanceMinMaxEqual(const RiseFall *rf);
void setDriveCell(const LibertyLibrary *library,
const LibertyCell *cell,
const LibertyPort *from_port,
float *from_slews,
const LibertyPort *to_port,
const RiseFallBoth *rf,
const MinMaxAll *min_max);
void driveCell(const RiseFall *rf,
const MinMax *min_max,
// Return values.
const LibertyCell *&cell,
const LibertyPort *&from_port,
float *&from_slews,
const LibertyPort *&to_port);
InputDriveCell *driveCell(const RiseFall *rf,
const MinMax *min_max);
bool hasDriveCell(const RiseFall *rf,
const MinMax *min_max);
// True if rise/fall/min/max drive cells are equal.
bool driveCellsEqual();
void slew(const RiseFall *rf,
const MinMax *min_max,
float &slew,
bool &exists);
RiseFallMinMax *slews() { return &slews_; }
private:
RiseFallMinMax slews_;
RiseFallMinMax drive_resistances_;
// Separate rise/fall/min/max drive cells.
InputDriveCell *drive_cells_[RiseFall::index_count][MinMax::index_count];
};
class InputDriveCell
{
public:
InputDriveCell(const LibertyLibrary *library,
const LibertyCell *cell,
const LibertyPort *from_port,
float *from_slews,
const LibertyPort *to_port);
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);
float *fromSlews() { return from_slews_; }
void setFromSlews(float *from_slews);
const LibertyPort *toPort() const { return to_port_; }
void setToPort(const LibertyPort *to_port);
bool equal(const InputDriveCell *drive) const;
private:
const LibertyLibrary *library_;
const LibertyCell *cell_;
const LibertyPort *from_port_;
float from_slews_[RiseFall::index_count];
const LibertyPort *to_port_;
};
} // namespace