forked from The-OpenROAD-Project/OpenSTA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Genclks.hh
136 lines (124 loc) · 4.05 KB
/
Genclks.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
// 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 "Map.hh"
#include "Transition.hh"
#include "NetworkClass.hh"
#include "GraphClass.hh"
#include "SdcClass.hh"
#include "SearchClass.hh"
#include "StaState.hh"
namespace sta {
class GenclkInfo;
class BfsFwdIterator;
class BfsBkwdIterator;
class SearchPred;
class TagGroupBldr;
typedef std::pair<const Clock*,const Pin *> ClockPinPair;
class ClockPinPairLess
{
public:
bool operator()(const ClockPinPair &pair1,
const ClockPinPair &pair2) const;
};
typedef Map<Clock*, GenclkInfo*> GenclkInfoMap;
typedef Map<ClockPinPair, PathVertexRep*, ClockPinPairLess> GenclkSrcPathMap;
class Genclks : public StaState
{
public:
Genclks(StaState *sta);
~Genclks();
void clear();
void ensureInsertionDelays();
VertexSet *fanins(const Clock *clk);
void findLatchFdbkEdges(const Clock *clk);
EdgeSet *latchFdbkEdges(const Clock *clk);
void checkMaster(Clock *gclk);
void ensureMaster(Clock *gclk);
// Generated clock insertion delay.
Arrival insertionDelay(const Clock *clk,
const Pin *pin,
const RiseFall *rf,
const EarlyLate *early_late,
const PathAnalysisPt *path_ap) const;
// Generated clock source path for a clock path root.
void srcPath(Path *clk_path,
// Return value.
PathVertex &src_path) const;
// Generated clock source path.
void srcPath(const ClockEdge *clk_edge,
const Pin *src_pin,
const PathAnalysisPt *path_ap,
// Return value.
PathVertex &src_path) const;
void srcPath(const Clock *clk,
const Pin *src_pin,
const RiseFall *rf,
const PathAnalysisPt *path_ap,
// Return value.
PathVertex &src_path) const;
Vertex *srcPathVertex(const Pin *pin) const;
Level clkPinMaxLevel(const Clock *clk) const;
void copyGenClkSrcPaths(Vertex *vertex,
TagGroupBldr *tag_bldr);
private:
void findInsertionDelays();
GenclkInfo *genclkInfo(const Clock *gclk) const;
void clearSrcPaths();
void recordSrcPaths(Clock *gclk);
void findInsertionDelays(Clock *gclk);
void seedClkVertices(Clock *clk,
BfsBkwdIterator &iter,
VertexSet *fanins);
int srcPathIndex(const RiseFall *clk_rf,
const PathAnalysisPt *path_ap) const;
bool matchesSrcFilter(Path *path,
const Clock *gclk) const;
void seedSrcPins(Clock *gclk,
FilterPath *src_filter,
BfsFwdIterator &insert_iter);
void findSrcArrivals(Clock *gclk,
BfsFwdIterator &insert_iter,
GenclkInfo *genclk_info);
virtual FilterPath *makeSrcFilter(Clock *gclk);
void deleteGenClkInfo();
virtual Tag *makeTag(const Clock *gclk,
const Clock *master_clk,
const Pin *master_pin,
const RiseFall *rf,
FilterPath *src_filter,
const PathAnalysisPt *path_ap);
void seedSrcPins(Clock *clk,
BfsBkwdIterator &iter);
void findInsertionDelay(Clock *gclk);
GenclkInfo *makeGenclkInfo(Clock *gclk);
FilterPath *srcFilter(Clock *gclk);
void findFanin(Clock *gclk,
// Return value.
VertexSet *fanins);
void findLatchFdbkEdges(const Clock *clk,
GenclkInfo *genclk_info);
void findLatchFdbkEdges(Vertex *vertex,
Level gclk_level,
SearchPred &srch_pred,
VertexSet &path_vertices,
VertexSet &visited_vertices,
EdgeSet *&fdbk_edges);
bool found_insertion_delays_;
GenclkSrcPathMap genclk_src_paths_;
GenclkInfoMap genclk_info_map_;
};
} // namespace