summaryrefslogtreecommitdiffstats
path: root/src/opt/fret/fretime.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/opt/fret/fretime.h')
-rw-r--r--src/opt/fret/fretime.h99
1 files changed, 62 insertions, 37 deletions
diff --git a/src/opt/fret/fretime.h b/src/opt/fret/fretime.h
index f12bd30b..167543ce 100644
--- a/src/opt/fret/fretime.h
+++ b/src/opt/fret/fretime.h
@@ -23,7 +23,7 @@
#include "abc.h"
-#define IGNORE_TIMING
+// #define IGNORE_TIMING
// #define DEBUG_PRINT_FLOWS
// #define DEBUG_VISITED
// #define DEBUG_PREORDER
@@ -45,49 +45,29 @@
#define INIT_0 0x20
#define INIT_1 0x40
#define INIT_CARE (INIT_0 | INIT_1)
+#define CONSERVATIVE 0x80
+#define BLOCK_OR_CONS (BLOCK | CONSERVATIVE)
-typedef struct Untimed_Flow_Data_t_ {
- unsigned int mark : 8;
+typedef struct Flow_Data_t_ {
+ unsigned int mark : 16;
union {
Abc_Obj_t *pred;
/* unsigned int var; */
Abc_Obj_t *pInitObj;
+ Vec_Ptr_t *vNodes;
};
unsigned int e_dist : 16;
unsigned int r_dist : 16;
-} Untimed_Flow_Data_t;
-
-typedef struct Timed_Flow_Data_t_ {
- unsigned int mark : 8;
-
- union {
- Abc_Obj_t *pred;
- Vec_Ptr_t *vTimeInEdges;
- /* unsigned int var; */
- Abc_Obj_t *pInitObj;
- };
-
- unsigned int e_dist : 16;
- unsigned int r_dist : 16;
-
- Vec_Ptr_t vTimeEdges;
-
-} Timed_Flow_Data_t;
-
-#if defined(IGNORE_TIMING)
-typedef Untimed_Flow_Data_t Flow_Data_t;
-#else
-typedef Timed_Flow_Data_t Flow_Data_t;
-#endif
+} 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 FTIMEEDGES( x ) &(((Timed_Flow_Data_t *)Abc_ObjCopy(x))->vTimeEdges)
+#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
@@ -97,21 +77,56 @@ static inline Abc_Obj_t * FGETPRED(Abc_Obj_t *pObj) {
return FDATA(pObj)->pred;
}
+
+typedef struct MinRegMan_t_ {
+
+ // problem description:
+ int maxDelay;
+ bool fComputeInitState, fGuaranteeInitState;
+ int nNodes, nLatches;
+ bool fForwardOnly, fBackwardOnly;
+ bool fConservTimingOnly;
+ int nMaxIters;
+ bool fVerbose;
+ Abc_Ntk_t *pNtk;
+
+ int nPreRefine;
+
+ // problem state
+ bool fIsForward;
+ bool fSinkDistTerminate;
+ int nExactConstraints, nConservConstraints;
+ int fSolutionIsDc;
+ int constraintMask;
+ int iteration, subIteration;
+
+ // problem data
+ Vec_Int_t *vSinkDistHist;
+ Flow_Data_t *pDataArray;
+ Vec_Ptr_t *vTimeEdges;
+ Vec_Ptr_t *vExactNodes;
+ Abc_Ntk_t *pInitNtk;
+ Vec_Ptr_t *vNodes; // re-useable struct
+
+} MinRegMan_t ;
+
+#define vprintf if (pManMR->fVerbose) printf
+
/*=== fretMain.c ==========================================================*/
+
+extern MinRegMan_t *pManMR;
Abc_Ntk_t * Abc_FlowRetime_MinReg( Abc_Ntk_t * pNtk, int fVerbose, int fComputeInitState,
int fForward, int fBackward, int nMaxIters,
- int maxDelay);
+ int maxDelay, int fFastButConservative);
void print_node(Abc_Obj_t *pObj);
void Abc_ObjBetterTransferFanout( Abc_Obj_t * pFrom, Abc_Obj_t * pTo, int compl );
-extern int fIsForward;
-extern int fSinkDistTerminate;
-extern Vec_Int_t *vSinkDistHist;
-extern int maxDelayCon;
-extern int fComputeInitState;
+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 );
/*=== fretFlow.c ==========================================================*/
@@ -132,9 +147,19 @@ void Abc_FlowRetime_UpdateForwardInit( Abc_Ntk_t * pNtk );
void Abc_FlowRetime_UpdateBackwardInit( Abc_Ntk_t * pNtk );
void Abc_FlowRetime_SetupBackwardInit( Abc_Ntk_t * pNtk );
-void Abc_FlowRetime_SolveBackwardInit( Abc_Ntk_t * pNtk );
+int Abc_FlowRetime_SolveBackwardInit( Abc_Ntk_t * pNtk );
+
+void Abc_FlowRetime_ConstrainInit( );
+
+/*=== fretTime.c ==========================================================*/
+
+void Abc_FlowRetime_InitTiming( Abc_Ntk_t *pNtk );
+void Abc_FlowRetime_FreeTiming( Abc_Ntk_t *pNtk );
+
+bool Abc_FlowRetime_RefineConstraints( );
-extern Abc_Ntk_t *pInitNtk;
-extern int fSolutionIsDc;
+void Abc_FlowRetime_ConstrainConserv( Abc_Ntk_t * pNtk );
+void Abc_FlowRetime_ConstrainExact( Abc_Obj_t * pObj );
+void Abc_FlowRetime_ConstrainExactAll( Abc_Ntk_t * pNtk );
#endif