summaryrefslogtreecommitdiffstats
path: root/src/opt/fret/fretime.h
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2008-02-28 08:01:00 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2008-02-28 08:01:00 -0800
commitf65983c2c0810cfb933f696952325a81d2378987 (patch)
tree4e4ea6ec9da3b6906edd476a85d1d301352e1a02 /src/opt/fret/fretime.h
parent7d23cc522e416ae1f3d2d53292ef438d1a08b0d7 (diff)
downloadabc-f65983c2c0810cfb933f696952325a81d2378987.tar.gz
abc-f65983c2c0810cfb933f696952325a81d2378987.tar.bz2
abc-f65983c2c0810cfb933f696952325a81d2378987.zip
Version abc80228
Diffstat (limited to 'src/opt/fret/fretime.h')
-rw-r--r--src/opt/fret/fretime.h82
1 files changed, 57 insertions, 25 deletions
diff --git a/src/opt/fret/fretime.h b/src/opt/fret/fretime.h
index 167543ce..bbb79d26 100644
--- a/src/opt/fret/fretime.h
+++ b/src/opt/fret/fretime.h
@@ -27,7 +27,8 @@
// #define DEBUG_PRINT_FLOWS
// #define DEBUG_VISITED
// #define DEBUG_PREORDER
-// #define DEBUG_CHECK
+#define DEBUG_CHECK
+// #define DEBUG_PRINT_LEVELS
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
@@ -36,17 +37,18 @@
#define MAX_DIST 30000
// flags in Flow_Data structure...
-#define VISITED_E 0x01
-#define VISITED_R 0x02
+#define VISITED_E 0x001
+#define VISITED_R 0x002
#define VISITED (VISITED_E | VISITED_R)
-#define FLOW 0x04
-#define CROSS_BOUNDARY 0x08
-#define BLOCK 0x10
-#define INIT_0 0x20
-#define INIT_1 0x40
+#define FLOW 0x004
+#define CROSS_BOUNDARY 0x008
+#define BLOCK 0x010
+#define INIT_0 0x020
+#define INIT_1 0x040
#define INIT_CARE (INIT_0 | INIT_1)
-#define CONSERVATIVE 0x80
+#define CONSERVATIVE 0x080
#define BLOCK_OR_CONS (BLOCK | CONSERVATIVE)
+#define BIAS_NODE 0x100
typedef struct Flow_Data_t_ {
unsigned int mark : 16;
@@ -55,6 +57,7 @@ typedef struct Flow_Data_t_ {
Abc_Obj_t *pred;
/* unsigned int var; */
Abc_Obj_t *pInitObj;
+ Abc_Obj_t *pCopy;
Vec_Ptr_t *vNodes;
};
@@ -63,26 +66,30 @@ typedef struct Flow_Data_t_ {
} Flow_Data_t;
// useful macros for manipulating Flow_Data structure...
-#define FDATA( x ) ((Flow_Data_t *)Abc_ObjCopy(x))
-#define FSET( x, y ) ((Flow_Data_t *)Abc_ObjCopy(x))->mark |= y
-#define FUNSET( x, y ) ((Flow_Data_t *)Abc_ObjCopy(x))->mark &= ~y
-#define FTEST( x, y ) (((Flow_Data_t *)Abc_ObjCopy(x))->mark & y)
+#define FDATA( x ) (pManMR->pDataArray+Abc_ObjId(x))
+#define FSET( x, y ) FDATA(x)->mark |= y
+#define FUNSET( x, y ) FDATA(x)->mark &= ~y
+#define FTEST( x, y ) (FDATA(x)->mark & y)
#define FTIMEEDGES( x ) &(pManMR->vTimeEdges[Abc_ObjId( x )])
-static inline void FSETPRED(Abc_Obj_t *pObj, Abc_Obj_t *pPred) {
- assert(!Abc_ObjIsLatch(pObj)); // must preserve field to maintain init state linkage
- FDATA(pObj)->pred = pPred;
-}
-static inline Abc_Obj_t * FGETPRED(Abc_Obj_t *pObj) {
- return FDATA(pObj)->pred;
-}
+typedef struct NodeLag_T_ {
+ int id;
+ int lag;
+} NodeLag_t;
+typedef struct InitConstraint_t_ {
+ Abc_Obj_t *pBiasNode;
+
+ Vec_Int_t vNodes;
+ Vec_Int_t vLags;
+
+} InitConstraint_t;
typedef struct MinRegMan_t_ {
// problem description:
int maxDelay;
- bool fComputeInitState, fGuaranteeInitState;
+ bool fComputeInitState, fGuaranteeInitState, fBlockConst;
int nNodes, nLatches;
bool fForwardOnly, fBackwardOnly;
bool fConservTimingOnly;
@@ -99,24 +106,38 @@ typedef struct MinRegMan_t_ {
int fSolutionIsDc;
int constraintMask;
int iteration, subIteration;
+ Vec_Int_t *vLags;
// problem data
Vec_Int_t *vSinkDistHist;
Flow_Data_t *pDataArray;
Vec_Ptr_t *vTimeEdges;
Vec_Ptr_t *vExactNodes;
+ Vec_Ptr_t *vInitConstraints;
Abc_Ntk_t *pInitNtk;
Vec_Ptr_t *vNodes; // re-useable struct
-
+
+ NodeLag_t *pInitToOrig;
+ int sizeInitToOrig;
+
} MinRegMan_t ;
+extern MinRegMan_t *pManMR;
+
#define vprintf if (pManMR->fVerbose) printf
+static inline void FSETPRED(Abc_Obj_t *pObj, Abc_Obj_t *pPred) {
+ assert(!Abc_ObjIsLatch(pObj)); // must preserve field to maintain init state linkage
+ FDATA(pObj)->pred = pPred;
+}
+static inline Abc_Obj_t * FGETPRED(Abc_Obj_t *pObj) {
+ return FDATA(pObj)->pred;
+}
+
/*=== fretMain.c ==========================================================*/
-
-extern MinRegMan_t *pManMR;
-Abc_Ntk_t * Abc_FlowRetime_MinReg( Abc_Ntk_t * pNtk, int fVerbose, int fComputeInitState,
+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);
@@ -128,6 +149,15 @@ int Abc_FlowRetime_PushFlows( Abc_Ntk_t * pNtk, bool fVerbose );
bool Abc_FlowRetime_IsAcrossCut( Abc_Obj_t *pCur, Abc_Obj_t *pNext );
void Abc_FlowRetime_ClearFlows( bool fClearAll );
+int Abc_FlowRetime_GetLag( Abc_Obj_t *pObj );
+void Abc_FlowRetime_SetLag( Abc_Obj_t *pObj, int lag );
+
+void Abc_FlowRetime_UpdateLags( );
+
+void Abc_ObjPrintNeighborhood( Abc_Obj_t *pObj, int depth );
+
+Abc_Ntk_t * Abc_FlowRetime_NtkSilentRestrash( Abc_Ntk_t * pNtk, bool fCleanup );
+
/*=== fretFlow.c ==========================================================*/
int dfsplain_e( Abc_Obj_t *pObj, Abc_Obj_t *pPred );
@@ -150,6 +180,8 @@ void Abc_FlowRetime_SetupBackwardInit( Abc_Ntk_t * pNtk );
int Abc_FlowRetime_SolveBackwardInit( Abc_Ntk_t * pNtk );
void Abc_FlowRetime_ConstrainInit( );
+void Abc_FlowRetime_AddInitBias( );
+void Abc_FlowRetime_RemoveInitBias( );
/*=== fretTime.c ==========================================================*/