ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
fretime.h
Go to the documentation of this file.
1
20
21#if !defined(RETIME_H_)
22#define RETIME_H_
23
24
25#include "base/abc/abc.h"
26#include "misc/vec/vec.h"
27
28
30
31
32// #define IGNORE_TIMING
33// #define DEBUG_PRINT_FLOWS
34// #define DEBUG_VISITED
35// #define DEBUG_PREORDER
36#define DEBUG_CHECK
37// #define DEBUG_PRINT_LEVELS
38
42
43#define MAX_DIST 30000
44
45// flags in Flow_Data structure...
46#define VISITED_E 0x001
47#define VISITED_R 0x002
48#define VISITED (VISITED_E | VISITED_R)
49#define FLOW 0x004
50#define CROSS_BOUNDARY 0x008
51#define BLOCK 0x010
52#define INIT_0 0x020
53#define INIT_1 0x040
54#define INIT_CARE (INIT_0 | INIT_1)
55#define CONSERVATIVE 0x080
56#define BLOCK_OR_CONS (BLOCK | CONSERVATIVE)
57#define BIAS_NODE 0x100
58
59
60#define MAX(a,b) ((a)>(b)?(a):(b))
61#define MIN(a,b) ((a)<(b)?(a):(b))
62
63
64typedef struct Flow_Data_t_ {
65 unsigned int mark : 16;
66
67 union {
69 /* unsigned int var; */
73 };
74
75 unsigned int e_dist : 16;
76 unsigned int r_dist : 16;
78
79// useful macros for manipulating Flow_Data structure...
80#define FDATA( x ) (pManMR->pDataArray+Abc_ObjId(x))
81#define FSET( x, y ) FDATA(x)->mark |= y
82#define FUNSET( x, y ) FDATA(x)->mark &= ~y
83#define FTEST( x, y ) (FDATA(x)->mark & y)
84#define FTIMEEDGES( x ) &(pManMR->vTimeEdges[Abc_ObjId( x )])
85
86typedef struct NodeLag_T_ {
87 int id;
88 int lag;
90
98
135
136extern MinRegMan_t *pManMR;
137
138#define vprintf if (pManMR->fVerbose) printf
139
140static inline void FSETPRED(Abc_Obj_t *pObj, Abc_Obj_t *pPred) {
141 assert(!Abc_ObjIsLatch(pObj)); // must preserve field to maintain init state linkage
142 FDATA(pObj)->pred = pPred;
143}
144static inline Abc_Obj_t * FGETPRED(Abc_Obj_t *pObj) {
145 return FDATA(pObj)->pred;
146}
147
148/*=== fretMain.c ==========================================================*/
149
150Abc_Ntk_t * Abc_FlowRetime_MinReg( Abc_Ntk_t * pNtk, int fVerbose,
151 int fComputeInitState, int fGuaranteeInitState, int fBlockConst,
152 int fForward, int fBackward, int nMaxIters,
153 int maxDelay, int fFastButConservative);
154
155void print_node(Abc_Obj_t *pObj);
156
158
159int Abc_FlowRetime_PushFlows( Abc_Ntk_t * pNtk, int fVerbose );
161void Abc_FlowRetime_ClearFlows( int fClearAll );
162
164void Abc_FlowRetime_SetLag( Abc_Obj_t *pObj, int lag );
165
167
168void Abc_ObjPrintNeighborhood( Abc_Obj_t *pObj, int depth );
169
171
172/*=== fretFlow.c ==========================================================*/
173
174int dfsplain_e( Abc_Obj_t *pObj, Abc_Obj_t *pPred );
175int dfsplain_r( Abc_Obj_t *pObj, Abc_Obj_t *pPred );
176
177void dfsfast_preorder( Abc_Ntk_t *pNtk );
178int dfsfast_e( Abc_Obj_t *pObj, Abc_Obj_t *pPred );
179int dfsfast_r( Abc_Obj_t *pObj, Abc_Obj_t *pPred );
180
181/*=== fretInit.c ==========================================================*/
182
184
186
189
192
196
197/*=== fretTime.c ==========================================================*/
198
201
203
207
208
209
211
212#endif
struct Abc_Obj_t_ Abc_Obj_t
Definition abc.h:116
struct Abc_Ntk_t_ Abc_Ntk_t
Definition abc.h:115
#define ABC_NAMESPACE_HEADER_END
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
pcover complement(pcube *T)
Definition compl.c:49
void Abc_ObjPrintNeighborhood(Abc_Obj_t *pObj, int depth)
Definition fretMain.c:1369
void Abc_FlowRetime_ClearFlows(int fClearAll)
Definition fretMain.c:1087
int Abc_FlowRetime_IsAcrossCut(Abc_Obj_t *pCur, Abc_Obj_t *pNext)
Definition fretMain.c:1054
void Abc_FlowRetime_UpdateLags()
Definition fretMain.c:1294
#define FDATA(x)
Definition fretime.h:80
void Abc_ObjBetterTransferFanout(Abc_Obj_t *pFrom, Abc_Obj_t *pTo, int complement)
Definition fretMain.c:1032
void Abc_FlowRetime_ConstrainExact(Abc_Obj_t *pObj)
Definition fretTime.c:407
int Abc_FlowRetime_SolveBackwardInit(Abc_Ntk_t *pNtk)
Definition fretInit.c:552
int dfsfast_e(Abc_Obj_t *pObj, Abc_Obj_t *pPred)
Definition fretFlow.c:210
int Abc_FlowRetime_GetLag(Abc_Obj_t *pObj)
Definition fretMain.c:1323
struct MinRegMan_t_ MinRegMan_t
struct NodeLag_T_ NodeLag_t
void Abc_FlowRetime_AddInitBias()
Definition fretInit.c:1218
MinRegMan_t * pManMR
Definition fretMain.c:52
int dfsplain_e(Abc_Obj_t *pObj, Abc_Obj_t *pPred)
Definition fretFlow.c:528
int Abc_FlowRetime_PushFlows(Abc_Ntk_t *pNtk, int fVerbose)
Definition fretMain.c:479
int dfsplain_r(Abc_Obj_t *pObj, Abc_Obj_t *pPred)
Definition fretFlow.c:617
void Abc_FlowRetime_ConstrainConserv(Abc_Ntk_t *pNtk)
Definition fretTime.c:90
int dfsfast_r(Abc_Obj_t *pObj, Abc_Obj_t *pPred)
Definition fretFlow.c:313
void Abc_FlowRetime_PrintInitStateInfo(Abc_Ntk_t *pNtk)
Definition fretInit.c:133
void Abc_FlowRetime_SetLag(Abc_Obj_t *pObj, int lag)
Definition fretMain.c:1342
void Abc_FlowRetime_RemoveInitBias()
Definition fretInit.c:1126
void Abc_FlowRetime_UpdateForwardInit(Abc_Ntk_t *pNtk)
Definition fretInit.c:163
int Abc_FlowRetime_RefineConstraints()
Definition fretTime.c:693
Abc_Ntk_t * Abc_FlowRetime_NtkSilentRestrash(Abc_Ntk_t *pNtk, int fCleanup)
Definition fretMain.c:1184
void Abc_FlowRetime_InitState(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition fretInit.c:75
void Abc_FlowRetime_UpdateBackwardInit(Abc_Ntk_t *pNtk)
Definition fretInit.c:665
struct Flow_Data_t_ Flow_Data_t
void Abc_FlowRetime_ConstrainInit()
Definition fretInit.c:1023
void print_node(Abc_Obj_t *pObj)
Definition fretMain.c:945
struct InitConstraint_t_ InitConstraint_t
void Abc_FlowRetime_InitTiming(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition fretTime.c:67
void Abc_FlowRetime_SetupBackwardInit(Abc_Ntk_t *pNtk)
Definition fretInit.c:489
Abc_Ntk_t * Abc_FlowRetime_MinReg(Abc_Ntk_t *pNtk, int fVerbose, int fComputeInitState, int fGuaranteeInitState, int fBlockConst, int fForward, int fBackward, int nMaxIters, int maxDelay, int fFastButConservative)
FUNCTION DEFINITIONS ///.
Definition fretMain.c:72
void Abc_FlowRetime_ConstrainExactAll(Abc_Ntk_t *pNtk)
Definition fretTime.c:584
void Abc_FlowRetime_FreeTiming(Abc_Ntk_t *pNtk)
Definition fretTime.c:617
void dfsfast_preorder(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition fretFlow.c:54
Abc_Obj_t * pInitObj
Definition fretime.h:70
Abc_Obj_t * pred
Definition fretime.h:68
unsigned int r_dist
Definition fretime.h:76
Vec_Ptr_t * vNodes
Definition fretime.h:72
unsigned int e_dist
Definition fretime.h:75
Abc_Obj_t * pCopy
Definition fretime.h:71
unsigned int mark
Definition fretime.h:65
Vec_Int_t vNodes
Definition fretime.h:94
Abc_Obj_t * pBiasNode
Definition fretime.h:92
Vec_Int_t vLags
Definition fretime.h:95
int nMaxIters
Definition fretime.h:107
Vec_Ptr_t * vTimeEdges
Definition fretime.h:125
Vec_Ptr_t * vInitConstraints
Definition fretime.h:127
int fIsForward
Definition fretime.h:114
int fComputeInitState
Definition fretime.h:103
Flow_Data_t * pDataArray
Definition fretime.h:124
int fBlockConst
Definition fretime.h:103
Abc_Ntk_t * pInitNtk
Definition fretime.h:128
int nPreRefine
Definition fretime.h:111
int nConservConstraints
Definition fretime.h:116
int fBackwardOnly
Definition fretime.h:105
int fForwardOnly
Definition fretime.h:105
int nExactConstraints
Definition fretime.h:116
int iteration
Definition fretime.h:119
NodeLag_t * pInitToOrig
Definition fretime.h:131
int sizeInitToOrig
Definition fretime.h:132
Vec_Ptr_t * vNodes
Definition fretime.h:129
int fConservTimingOnly
Definition fretime.h:106
int constraintMask
Definition fretime.h:118
Vec_Int_t * vSinkDistHist
Definition fretime.h:123
Vec_Ptr_t * vExactNodes
Definition fretime.h:126
int subIteration
Definition fretime.h:119
int fSolutionIsDc
Definition fretime.h:117
int fSinkDistTerminate
Definition fretime.h:115
int fGuaranteeInitState
Definition fretime.h:103
Abc_Ntk_t * pNtk
Definition fretime.h:109
Vec_Int_t * vLags
Definition fretime.h:120
int lag
Definition fretime.h:88
#define assert(ex)
Definition util_old.h:213
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42