21 #ifndef __NWK_abc_opt_nwk_h
22 #define __NWK_abc_opt_nwk_h
171 static inline int Nwk_ManTimeEqual(
float f1,
float f2,
float Eps ) {
return (f1 < f2 + Eps) && (f2 < f1 + Eps); }
172 static inline int Nwk_ManTimeLess(
float f1,
float f2,
float Eps ) {
return (f1 < f2 + Eps); }
173 static inline int Nwk_ManTimeMore(
float f1,
float f2,
float Eps ) {
return (f1 + Eps > f2); }
179 #define Nwk_ManForEachCi( p, pObj, i ) \
180 Vec_PtrForEachEntry( Nwk_Obj_t *, p->vCis, pObj, i )
181 #define Nwk_ManForEachCo( p, pObj, i ) \
182 Vec_PtrForEachEntry( Nwk_Obj_t *, p->vCos, pObj, i )
183 #define Nwk_ManForEachPi( p, pObj, i ) \
184 Vec_PtrForEachEntry( Nwk_Obj_t *, p->vCis, pObj, i ) \
185 if ( !Nwk_ObjIsPi(pObj) ) {} else
186 #define Nwk_ManForEachPo( p, pObj, i ) \
187 Vec_PtrForEachEntry( Nwk_Obj_t *, p->vCos, pObj, i ) \
188 if ( !Nwk_ObjIsPo(pObj) ) {} else
189 #define Nwk_ManForEachObj( p, pObj, i ) \
190 for ( i = 0; (i < Vec_PtrSize(p->vObjs)) && (((pObj) = (Nwk_Obj_t *)Vec_PtrEntry(p->vObjs, i)), 1); i++ ) \
191 if ( pObj == NULL ) {} else
192 #define Nwk_ManForEachNode( p, pObj, i ) \
193 for ( i = 0; (i < Vec_PtrSize(p->vObjs)) && (((pObj) = (Nwk_Obj_t *)Vec_PtrEntry(p->vObjs, i)), 1); i++ ) \
194 if ( (pObj) == NULL || !Nwk_ObjIsNode(pObj) ) {} else
195 #define Nwk_ManForEachLatch( p, pObj, i ) \
196 for ( i = 0; (i < Vec_PtrSize(p->vObjs)) && (((pObj) = (Nwk_Obj_t *)Vec_PtrEntry(p->vObjs, i)), 1); i++ ) \
197 if ( (pObj) == NULL || !Nwk_ObjIsLatch(pObj) ) {} else
199 #define Nwk_ObjForEachFanin( pObj, pFanin, i ) \
200 for ( i = 0; (i < (int)(pObj)->nFanins) && ((pFanin) = (pObj)->pFanio[i]); i++ )
201 #define Nwk_ObjForEachFanout( pObj, pFanout, i ) \
202 for ( i = 0; (i < (int)(pObj)->nFanouts) && ((pFanout) = (pObj)->pFanio[(pObj)->nFanins+i]); i++ )
205 #define Nwk_ManForEachPiSeq( p, pObj, i ) \
206 Vec_PtrForEachEntryStop( Nwk_Obj_t *, p->vCis, pObj, i, (p)->nTruePis )
207 #define Nwk_ManForEachPoSeq( p, pObj, i ) \
208 Vec_PtrForEachEntryStop( Nwk_Obj_t *, p->vCos, pObj, i, (p)->nTruePos )
209 #define Nwk_ManForEachLoSeq( p, pObj, i ) \
210 for ( i = 0; (i < (p)->nLatches) && (((pObj) = (Nwk_Obj_t *)Vec_PtrEntry(p->vCis, i+(p)->nTruePis)), 1); i++ )
211 #define Nwk_ManForEachLiSeq( p, pObj, i ) \
212 for ( i = 0; (i < (p)->nLatches) && (((pObj) = (Nwk_Obj_t *)Vec_PtrEntry(p->vCos, i+(p)->nTruePos)), 1); i++ )
213 #define Nwk_ManForEachLiLoSeq( p, pObjLi, pObjLo, i ) \
214 for ( i = 0; (i < (p)->nLatches) && (((pObjLi) = Nwk_ManCo(p, i+(p)->nTruePos)), 1) \
215 && (((pObjLo) = Nwk_ManCi(p, i+(p)->nTruePis)), 1); i++ )
int Tim_ManBoxForCi(Tim_Man_t *p, int iCo)
ABC_DLL int Nwk_ObjFindFanout(Nwk_Obj_t *pObj, Nwk_Obj_t *pFanout)
static Nwk_Obj_t * Nwk_ManCo(Nwk_Man_t *p, int i)
ABC_DLL int Nwk_ManLevelBackup(Nwk_Man_t *pNtk)
static int Nwk_ObjIsCi(Nwk_Obj_t *p)
ABC_DLL Aig_Man_t * Nwk_ManSpeedup(Nwk_Man_t *pNtk, int fUseLutLib, int Percentage, int Degree, int fVerbose, int fVeryVerbose)
static Nwk_Obj_t * Nwk_ManCi(Nwk_Man_t *p, int i)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
ABC_DLL void Nwk_ManDeleteNode_rec(Nwk_Obj_t *pObj)
static int Nwk_ObjFanoutNum(Nwk_Obj_t *p)
ABC_DLL void Nwk_ManCleanMarks(Nwk_Man_t *pNtk)
ABC_DLL int Nwk_ManLevel(Nwk_Man_t *pNtk)
ABC_DLL int Nwk_ManVerifyLevel(Nwk_Man_t *pNtk)
ABC_DLL Vec_Ptr_t * Nwk_ManRetimeCutForward(Nwk_Man_t *pMan, int nLatches, int fVerbose)
ABC_DLL int Nwk_ManPoNum(Nwk_Man_t *pNtk)
ABC_DLL void Nwk_ManDeleteNode(Nwk_Obj_t *pObj)
static int Nwk_ManLatchNum(Nwk_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
ABC_DLL void Nwk_ObjTransferFanout(Nwk_Obj_t *pNodeFrom, Nwk_Obj_t *pNodeTo)
static int Nwk_ManTimeLess(float f1, float f2, float Eps)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
typedefABC_NAMESPACE_HEADER_START struct Nwk_Obj_t_ Nwk_Obj_t
INCLUDES ///.
ABC_DLL void Nwk_ManPrintStats(Nwk_Man_t *p, If_LibLut_t *pLutLib, int fSaveBest, int fDumpResult, int fPower, Ntl_Man_t *pNtl)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static float Nwk_ObjSlack(Nwk_Obj_t *pObj)
ABC_DLL Nwk_Obj_t * Nwk_ManCreateBox(Nwk_Man_t *pMan, int nFanins, int nFanouts)
ABC_DLL Vec_Ptr_t * Nwk_ManDfsReverse(Nwk_Man_t *pNtk)
int Tim_ManBoxForCo(Tim_Man_t *p, int iCi)
static void Nwk_ObjSetSlack(Nwk_Obj_t *pObj, float Time)
static void Nwk_ObjSetTravId(Nwk_Obj_t *pObj, int TravId)
ABC_DLL void Nwk_ManFree(Nwk_Man_t *p)
ABC_DLL int Nwk_ObjMffcLabel(Nwk_Obj_t *pNode)
static int Nwk_ObjId(Nwk_Obj_t *p)
static int Nwk_ObjIsPi(Nwk_Obj_t *p)
ABC_DLL void Nwk_ManDelayTracePrint(Nwk_Man_t *pNtk)
ABC_DLL void Nwk_ManDumpBlif(Nwk_Man_t *pNtk, char *pFileName, Vec_Ptr_t *vCiNames, Vec_Ptr_t *vCoNames)
ABC_DLL int Nwk_NodeCompareLevelsIncrease(Nwk_Obj_t **pp1, Nwk_Obj_t **pp2)
ABC_DLL int Nwk_ManGetAigNodeNum(Nwk_Man_t *pNtk)
ABC_DLL void Nwk_ObjReplace(Nwk_Obj_t *pNodeOld, Nwk_Obj_t *pNodeNew)
static int Vec_PtrSize(Vec_Ptr_t *p)
ABC_DLL void Nwk_ManSupportSum(Nwk_Man_t *pNtk)
ABC_DLL int Nwk_ManLevelMax(Nwk_Man_t *pNtk)
ABC_DLL void Nwk_ManUpdate(Nwk_Obj_t *pObj, Nwk_Obj_t *pObjNew, Vec_Vec_t *vLevels)
static int Nwk_ObjFaninNum(Nwk_Obj_t *p)
ABC_DLL int Nwk_ObjFindFanin(Nwk_Obj_t *pObj, Nwk_Obj_t *pFanin)
ABC_DLL Vec_Vec_t * Nwk_ManLevelize(Nwk_Man_t *pNtk)
ABC_DLL Vec_Ptr_t * Nwk_ManRetimeCutBackward(Nwk_Man_t *pMan, int nLatches, int fVerbose)
ABC_DLL Nwk_Obj_t * Nwk_ManCreateLatch(Nwk_Man_t *pMan)
ABC_DLL void Nwk_ObjCollectFanouts(Nwk_Obj_t *pNode, Vec_Ptr_t *vNodes)
static void Nwk_ObjSetTravIdCurrent(Nwk_Obj_t *pObj)
typedefABC_NAMESPACE_HEADER_START struct Ntl_Man_t_ Ntl_Man_t
INCLUDES ///.
ABC_DLL int Nwk_NodeCompareLevelsDecrease(Nwk_Obj_t **pp1, Nwk_Obj_t **pp2)
ABC_DLL int Nwk_ManVerifyTiming(Nwk_Man_t *pNtk)
ABC_DLL void Nwk_ManMinimumBase(Nwk_Man_t *pNtk, int fVerbose)
ABC_DLL float Nwl_ManComputeTotalSwitching(Nwk_Man_t *pNtk)
static float Nwk_ObjArrival(Nwk_Obj_t *pObj)
ABC_DLL Vec_Ptr_t * Nwk_ManDfs(Nwk_Man_t *pNtk)
ABC_DLL void Nwk_ObjPrint(Nwk_Obj_t *pObj)
ABC_DLL Aig_Man_t * Nwk_ManStrash(Nwk_Man_t *pNtk)
static int Nwk_ObjIsLo(Nwk_Obj_t *p)
ABC_DLL void Nwk_ManBidecResyn(Nwk_Man_t *pNtk, int fVerbose)
ABC_DLL Nwk_Man_t * Nwk_MappingIf(Aig_Man_t *p, Tim_Man_t *pManTime, If_Par_t *pPars)
static int Nwk_ObjIsCo(Nwk_Obj_t *p)
static int Nwk_ObjIsTravIdCurrent(Nwk_Obj_t *pObj)
static int Nwk_ObjIsLatch(Nwk_Obj_t *p)
ABC_DLL int Nwk_ManPiNum(Nwk_Man_t *pNtk)
ABC_DLL Nwk_Man_t * Nwk_ManAlloc()
DECLARATIONS ///.
ABC_DLL void Nwk_ManDelayTraceSortPins(Nwk_Obj_t *pNode, int *pPinPerm, float *pPinDelays)
static int Nwk_ObjIsPo(Nwk_Obj_t *p)
static int Nwk_ObjIsNone(Nwk_Obj_t *p)
static void Nwk_ObjSetTravIdPrevious(Nwk_Obj_t *pObj)
ABC_DLL Nwk_Obj_t * Nwk_ManCreateCo(Nwk_Man_t *pMan)
ABC_DLL void Nwk_ManIncrementTravId(Nwk_Man_t *pNtk)
DECLARATIONS ///.
ABC_DLL Vec_Ptr_t * Nwk_ManDeriveRetimingCut(Aig_Man_t *p, int fForward, int fVerbose)
FUNCTION DECLARATIONS ///.
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
ABC_DLL Hop_Obj_t * Nwk_NodeIfNodeResyn(Bdc_Man_t *p, Hop_Man_t *pHop, Hop_Obj_t *pRoot, int nVars, Vec_Int_t *vTruth, unsigned *puCare, float dProb)
FUNCTION DEFINITIONS ///.
#define ABC_NAMESPACE_HEADER_END
static int Nwk_ObjIsNode(Nwk_Obj_t *p)
ABC_DLL int Nwk_ManVerifyTopoOrder(Nwk_Man_t *pNtk)
DECLARATIONS ///.
ABC_DLL int Nwk_ManGetFaninMax(Nwk_Man_t *pNtk)
static int Nwk_ManCiNum(Nwk_Man_t *p)
MACRO DEFINITIONS ///.
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
static int Nwk_ObjPioNum(Nwk_Obj_t *p)
ABC_DLL int Nwk_ManCheck(Nwk_Man_t *p)
DECLARATIONS ///.
ABC_DLL void Nwk_ObjCollectFanins(Nwk_Obj_t *pNode, Vec_Ptr_t *vNodes)
DECLARATIONS ///.
ABC_DLL Nwk_Obj_t * Nwk_ManCreateCi(Nwk_Man_t *pMan, int nFanouts)
static void Nwk_ObjSetArrival(Nwk_Obj_t *pObj, float Time)
ABC_DLL void Nwk_ManRemoveDupFanins(Nwk_Man_t *pNtk, int fVerbose)
static void Nwk_ObjSetLevel(Nwk_Obj_t *pObj, int Level)
static int Nwk_ManTimeEqual(float f1, float f2, float Eps)
static Nwk_Obj_t * Nwk_ObjFanin(Nwk_Obj_t *p, int i)
static int Nwk_ManObjNumMax(Nwk_Man_t *p)
static int Nwk_ObjIsTravIdPrevious(Nwk_Obj_t *pObj)
ABC_DLL float Nwk_ManDelayTraceLut(Nwk_Man_t *pNtk)
ABC_DLL void Nwk_ObjDeleteFanin(Nwk_Obj_t *pObj, Nwk_Obj_t *pFanin)
ABC_DLL void Nwk_ManPrintFanioNew(Nwk_Man_t *pNtk)
ABC_DLL int Nwk_ManGetTotalFanins(Nwk_Man_t *pNtk)
ABC_DLL Vec_Ptr_t * Nwk_ManDfsNodes(Nwk_Man_t *pNtk, Nwk_Obj_t **ppNodes, int nNodes)
static int Nwk_ManNodeNum(Nwk_Man_t *p)
static Nwk_Obj_t * Nwk_ObjFanin0(Nwk_Obj_t *p)
static int Nwk_ObjLevel(Nwk_Obj_t *pObj)
ABC_DLL void Nwk_ObjAddFanin(Nwk_Obj_t *pObj, Nwk_Obj_t *pFanin)
static int Nwk_ObjIsLi(Nwk_Obj_t *p)
typedefABC_NAMESPACE_HEADER_START struct Tim_Man_t_ Tim_Man_t
INCLUDES ///.
static float Nwk_ObjRequired(Nwk_Obj_t *pObj)
static Nwk_Obj_t * Nwk_ObjFanout0(Nwk_Obj_t *p)
ABC_DLL Vec_Ptr_t * Nwk_ManSupportNodes(Nwk_Man_t *pNtk, Nwk_Obj_t **ppNodes, int nNodes)
static Nwk_Obj_t * Nwk_ObjFanout(Nwk_Obj_t *p, int i)
static void Nwk_ObjSetRequired(Nwk_Obj_t *pObj, float Time)
typedefABC_NAMESPACE_HEADER_START struct Hop_Man_t_ Hop_Man_t
INCLUDES ///.
static int Nwk_ManTimeMore(float f1, float f2, float Eps)
ABC_DLL void Nwk_ObjPatchFanin(Nwk_Obj_t *pObj, Nwk_Obj_t *pFaninOld, Nwk_Obj_t *pFaninNew)
static Nwk_Obj_t * Nwk_ManObj(Nwk_Man_t *p, int i)
static int Nwk_ManCoNum(Nwk_Man_t *p)
ABC_DLL Nwk_Obj_t * Nwk_ManCreateNode(Nwk_Man_t *pMan, int nFanins, int nFanouts)