forked from The-OpenROAD-Project/OpenSTA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTag.hh
168 lines (152 loc) · 4.35 KB
/
Tag.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
// OpenSTA, Static Timing Analyzer
// Copyright (c) 2019, 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/>.
#ifndef STA_TAG_H
#define STA_TAG_H
#include "DisallowCopyAssign.hh"
#include "Vector.hh"
#include "Set.hh"
#include "SearchClass.hh"
#include "SdcClass.hh"
#include "Transition.hh"
#include "PathRef.hh"
namespace sta {
// Tags are used to distinguish multiple paths that hold
// arrival/required times on a vertex.
//
// Each tag corresponds to a different path on the vertex thru a
// set of exceptions.
//
// Clock paths are distinguished from non-clock paths using separate
// tags. This is because clocks pins can also have input arrivals wrt
// other clocks.
//
// When common clock reconvergence pessimism removal is enabled the
// tag ClkInfo includes the last clock driver pin so that distinct
// paths are used for paths from different sources of min/max clock
// arrivals.
class Tag
{
public:
Tag(TagIndex index,
int tr_index,
PathAPIndex path_ap_index,
ClkInfo *clk_info,
bool is_clk,
InputDelay *input_delay,
bool is_segment_start,
ExceptionStateSet *states,
bool own_states,
const StaState *sta);
~Tag();
const char *asString(const StaState *sta) const;
const char *asString(bool report_index,
const StaState *sta) const;
ClkInfo *clkInfo() const { return clk_info_; }
bool isClock() const { return is_clk_; }
ClockEdge *clkEdge() const;
Clock *clock() const;
const Pin *clkSrc() const;
int trIndex() const { return tr_index_; }
const RiseFall *transition() const;
PathAnalysisPt *pathAnalysisPt(const StaState *sta) const;
PathAPIndex pathAPIndex() const { return path_ap_index_; }
TagIndex index() const { return index_; }
ExceptionStateSet *states() const { return states_; }
void setStates(ExceptionStateSet *states);
bool isGenClkSrcPath() const;
Clock *genClkSrcPathClk(const StaState *sta) const;
// Input delay at search startpoint (not propagated).
InputDelay *inputDelay() const { return input_delay_; }
bool isLoop() const { return is_loop_; }
bool isFilter() const { return is_filter_; }
bool isSegmentStart() const { return is_segment_start_; }
size_t hash() const { return hash_; }
size_t matchHash(bool match_crpr_clk_pin) const;
protected:
void findHash();
private:
DISALLOW_COPY_AND_ASSIGN(Tag);
ClkInfo *clk_info_;
InputDelay *input_delay_;
ExceptionStateSet *states_;
size_t hash_;
size_t match_hash_;
bool is_clk_:1;
bool is_filter_:1;
bool is_loop_:1;
bool is_segment_start_:1;
// Indicates that states_ is owned by the tag.
bool own_states_:1;
TagIndex index_:tag_index_bits;
unsigned int tr_index_:RiseFall::index_bit_count;
unsigned int path_ap_index_:path_ap_index_bit_count;
};
class TagLess
{
public:
bool operator()(const Tag *tag1,
const Tag *tag2) const;
};
class TagIndexLess
{
public:
bool operator()(const Tag *tag1,
const Tag *tag2) const;
};
class TagHash
{
public:
size_t operator()(const Tag *tag);
};
class TagEqual
{
public:
bool operator()(const Tag *tag1,
const Tag *tag2);
};
int
tagCmp(const Tag *tag1,
const Tag *tag2,
bool cmp_rf);
// Match tag clock edge, clock driver and exception states but not clk info.
bool
tagMatch(const Tag *tag1,
const Tag *tag2,
const StaState *sta);
bool
tagMatch(const Tag *tag1,
const Tag *tag2,
bool match_crpr_clk_pin,
const StaState *sta);
bool
tagStateEqual(const Tag *tag1,
const Tag *tag2);
bool
tagMatchNoCrpr(const Tag *tag1,
const Tag *tag2);
int
tagMatchCmp(const Tag *tag1,
const Tag *tag2,
bool match_clk_clk_pin,
const StaState *sta);
bool
tagMatchNoPathAp(const Tag *tag1,
const Tag *tag2);
bool
tagMatchCrpr(const Tag *tag1,
const Tag *tag2);
} // namespace
#endif