forked from The-OpenROAD-Project/OpenSTA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NetworkClass.hh
170 lines (149 loc) · 4.08 KB
/
NetworkClass.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
// 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 <cstdint>
#include "Set.hh"
#include "Vector.hh"
#include "Iterator.hh"
namespace sta {
class Network;
class NetworkEdit;
class NetworkReader;
class Library;
class Cell;
class Port;
class PortDirection;
class Instance;
class Pin;
class Term;
class Net;
class ConstantPinIterator;
class ViewType;
class LibertyLibrary;
typedef Iterator<Library*> LibraryIterator;
typedef Iterator<LibertyLibrary*> LibertyLibraryIterator;
typedef Vector<Cell*> CellSeq;
typedef Vector<const Port*> PortSeq;
typedef Iterator<Port*> CellPortIterator;
typedef Iterator<Port*> CellPortBitIterator;
typedef Iterator<Port*> PortMemberIterator;
typedef Vector<const Pin*> PinSeq;
typedef Vector<const Instance*> InstanceSeq;
typedef Vector<const Net*> NetSeq;
typedef Iterator<Instance*> InstanceChildIterator;
typedef Iterator<Pin*> InstancePinIterator;
typedef Iterator<Net*> InstanceNetIterator;
typedef Iterator<Instance*> LeafInstanceIterator;
typedef Iterator<Net*> NetIterator;
typedef Iterator<const Pin*> NetPinIterator;
typedef Iterator<Term*> NetTermIterator;
typedef Iterator<const Pin*> ConnectedPinIterator;
typedef ConnectedPinIterator NetConnectedPinIterator;
typedef ConnectedPinIterator PinConnectedPinIterator;
typedef uint32_t ObjectId;
enum class LogicValue : unsigned { zero, one, unknown, rise, fall };
class CellIdLess
{
public:
CellIdLess(const Network *network);
bool operator()(const Cell *cell1,
const Cell *cell2) const;
private:
const Network *network_;
};
class PortIdLess
{
public:
PortIdLess(const Network *network);
bool operator()(const Port *port1,
const Port *port2) const;
private:
const Network *network_;
};
class InstanceIdLess
{
public:
InstanceIdLess(const Network *network);
bool operator()(const Instance *inst1,
const Instance *inst2) const;
private:
const Network *network_;
};
class PinIdLess
{
public:
PinIdLess(const Network *network);
bool operator()(const Pin *pin1,
const Pin *pin2) const;
private:
const Network *network_;
};
class PinIdHash
{
public:
PinIdHash(const Network *network);
size_t operator()(const Pin *pin) const;
private:
const Network *network_;
};
class NetIdLess
{
public:
NetIdLess(const Network *network);
bool operator()(const Net *net1,
const Net *net2) const;
private:
const Network *network_;
};
////////////////////////////////////////////////////////////////
class CellSet : public Set<const Cell*, CellIdLess>
{
public:
CellSet(const Network *network);
};
class PortSet : public Set<const Port*, PortIdLess>
{
public:
PortSet(const Network *network);
};
class InstanceSet : public Set<const Instance*, InstanceIdLess>
{
public:
InstanceSet();
InstanceSet(const Network *network);
static int compare(const InstanceSet *set1,
const InstanceSet *set2,
const Network *network);
};
class PinSet : public Set<const Pin*, PinIdLess>
{
public:
PinSet();
PinSet(const Network *network);
static int compare(const PinSet *set1,
const PinSet *set2,
const Network *network);
};
class NetSet : public Set<const Net*, NetIdLess>
{
public:
NetSet();
NetSet(const Network *network);
static int compare(const NetSet *set1,
const NetSet *set2,
const Network *network);
};
} // namespace