86 static inline int Rtm_InitWordsNum(
int nLats ) {
return (nLats >> 4) + ((nLats & 15) > 0); }
87 static inline int Rtm_InitGetTwo(
unsigned *
p,
int i ) {
return (p[i>>4] >> ((i & 15)<<1)) & 3; }
88 static inline void Rtm_InitSetTwo(
unsigned *
p,
int i,
int val ) { p[i>>4] |= (val << ((i & 15)<<1)); }
89 static inline void Rtm_InitXorTwo(
unsigned *
p,
int i,
int val ) { p[i>>4] ^= (val << ((i & 15)<<1)); }
121 #define Rtm_ManForEachPi( p, pObj, i ) \
122 Vec_PtrForEachEntry( Rtm_Obj_t *, p->vPis, pObj, i )
124 #define Rtm_ManForEachPo( p, pObj, i ) \
125 Vec_PtrForEachEntry( Rtm_Obj_t *, p->vPos, pObj, i )
127 #define Rtm_ManForEachObj( p, pObj, i ) \
128 Vec_PtrForEachEntry( Rtm_Obj_t *, p->vObjs, pObj, i )
130 #define Rtm_ObjForEachFanin( pObj, pFanin, i ) \
131 for ( i = 0; i < (int)(pObj)->nFanins && ((pFanin = Rtm_ObjFanin(pObj, i)), 1); i++ )
133 #define Rtm_ObjForEachFanout( pObj, pFanout, i ) \
134 for ( i = 0; i < (int)(pObj)->nFanouts && ((pFanout = Rtm_ObjFanout(pObj, i)), 1); i++ )
136 #define Rtm_ObjForEachFaninEdge( pObj, pEdge, i ) \
137 for ( i = 0; i < (int)(pObj)->nFanins && ((pEdge = Rtm_ObjEdge(pObj, i)), 1); i++ )
139 #define Rtm_ObjForEachFanoutEdge( pObj, pEdge, i ) \
140 for ( i = 0; i < (int)(pObj)->nFanouts && ((pEdge = Rtm_ObjFanoutEdge(pObj, i)), 1); i++ )
202 nWords = (pEdge->
nLats + 1) >> 4;
233 *pE = (*pE >> 2) | (Val << 30);
260 *pB = (*pB << 2) | Val;
280 printf(
"%d : ", (
int)pEdge->
nLats );
352 int nLatchMax = 0, i, k;
385 pObj->
Type = (int)(nFanins == 1 && nFanouts == 0);
387 pObj->
Temp = nFanouts;
438 if ( pEdge->
nLats == 0 )
459 if ( pEdge->
nLats == 0 )
604 Counter += pObjRtm->
fAuto;
658 Counter += pObjRtm->
fAuto;
734 if ( pObjRtm->
pCopy )
740 if ( pEdge->
nLats == 0 )
749 pRes =
Aig_And( pNew, pRes, pFanin );
771 int i, k, m, Val, nLatches, * pLatches;
779 nLatches += pEdge->
nLats;
788 for ( i = 0; i < nLatches; i++ )
800 if ( pEdge->
nLats == 0 )
803 for ( m = 0; m < (int)pEdge->
nLats; m++ )
809 pObjNew =
Aig_ManCi( pNew, pLatches[2*pObjRtm->
Id + k] + m );
819 printf(
"Rtm_ManToAig: The network check has failed.\n" );
841 int i, k, nAutos, Degree, DegreeMax = 0;
857 printf(
"Detected %d autonomous objects. ", nAutos );
914 if ( Degree > nStepsMax )
935 if ( Degree > nStepsMax )
946 printf(
"Performed %d %s latch moves of max depth %d and max latch count %d.\n",
948 printf(
"Memory usage = %d. ", pRtm->
nExtraCur );
Aig_Obj_t * Aig_ObjCreateCo(Aig_Man_t *p, Aig_Obj_t *pDriver)
Rtm_Init_t
DECLARATIONS ///.
static void Rtm_ObjTransferToBig(Rtm_Man_t *p, Rtm_Edg_t *pEdge)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
ABC_DLL int Aig_ManCheck(Aig_Man_t *p)
FUNCTION DECLARATIONS ///.
Aig_Obj_t * Rtm_ManToAig_rec(Aig_Man_t *pNew, Rtm_Man_t *pRtm, Rtm_Obj_t *pObjRtm, int *pLatches)
static Rtm_Init_t Rtm_ObjRemFirst1(Rtm_Edg_t *pEdge)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Aig_Man_t * Rtm_ManToAig(Rtm_Man_t *pRtm)
#define Rtm_ManForEachPo(p, pObj, i)
static int Aig_ManObjNum(Aig_Man_t *p)
#define Rtm_ManForEachObj(p, pObj, i)
#define ABC_REALLOC(type, obj, num)
static void Rtm_ObjAddFirst1(Rtm_Edg_t *pEdge, Rtm_Init_t Val)
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
Rtm_Man_t * Rtm_ManAlloc(Aig_Man_t *p)
Aig_Man_t * Aig_ManStart(int nNodesMax)
DECLARATIONS ///.
char * Aig_MmFlexEntryFetch(Aig_MmFlex_t *p, int nBytes)
void Rtm_ObjMarkAutoBwd_rec(Rtm_Obj_t *pObj)
static void Rtm_ObjAddFirst2(Rtm_Man_t *p, Rtm_Edg_t *pEdge, Rtm_Init_t Val)
static Rtm_Init_t Rtm_ObjGetLast(Rtm_Man_t *p, Rtm_Edg_t *pEdge)
Aig_Obj_t * Aig_ObjCreateCi(Aig_Man_t *p)
DECLARATIONS ///.
Rtm_Obj_t * Rtm_ObjAlloc(Rtm_Man_t *pRtm, int nFanins, int nFanouts)
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
static Rtm_Init_t Rtm_ObjGetFirst1(Rtm_Edg_t *pEdge)
static void Rtm_ObjAddFirst(Rtm_Man_t *p, Rtm_Edg_t *pEdge, Rtm_Init_t Val)
#define ABC_ALLOC(type, num)
#define Rtm_ObjForEachFanin(pObj, pFanin, i)
static abctime Abc_Clock()
static int Abc_MaxInt(int a, int b)
static Aig_Obj_t * Aig_ObjFanin1(Aig_Obj_t *pObj)
static int Vec_PtrSize(Vec_Ptr_t *p)
int Rtm_ObjGetDegreeFwd(Rtm_Obj_t *pObj)
static void Rtm_InitSetTwo(unsigned *p, int i, int val)
Aig_Obj_t * Aig_And(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
#define Rtm_ObjForEachFanout(pObj, pFanout, i)
static int Rtm_InitWordsNum(int nLats)
static int Aig_ManBufNum(Aig_Man_t *p)
void Rtm_ManFree(Rtm_Man_t *p)
static Rtm_Init_t Rtm_InitNotCond(Rtm_Init_t Val, int c)
static int Aig_ManCoNum(Aig_Man_t *p)
static void Rtm_ObjTransferToSmall(Rtm_Man_t *p, Rtm_Edg_t *pEdge)
FUNCTION DEFINITIONS ///.
static void Rtm_ObjAddLast2(Rtm_Man_t *p, Rtm_Edg_t *pEdge, Rtm_Init_t Val)
void Rtm_ObjRetimeFwd(Rtm_Man_t *pRtm, Rtm_Obj_t *pObj)
static Rtm_Init_t Rtm_InitAnd(Rtm_Init_t ValA, Rtm_Init_t ValB)
#define Aig_ManForEachNode(p, pObj, i)
Aig_Man_t * Aig_ManReduceLaches(Aig_Man_t *p, int fVerbose)
#define Rtm_ObjForEachFanoutEdge(pObj, pEdge, i)
void Rtm_PrintEdge(Rtm_Man_t *p, Rtm_Edg_t *pEdge)
static void Rtm_ObjAddLast1(Rtm_Edg_t *pEdge, Rtm_Init_t Val)
void Aig_ManSetRegNum(Aig_Man_t *p, int nRegs)
static Aig_Obj_t * Aig_ManCi(Aig_Man_t *p, int i)
#define Aig_ManForEachLiLoSeq(p, pObjLi, pObjLo, k)
static Rtm_Init_t Rtm_InitNot(Rtm_Init_t Val)
static void Rtm_ObjAddLast(Rtm_Man_t *p, Rtm_Edg_t *pEdge, Rtm_Init_t Val)
static int Aig_ManCiNum(Aig_Man_t *p)
#define ABC_NAMESPACE_IMPL_END
#define Rtm_ManForEachPi(p, pObj, i)
#define Rtm_ObjForEachFaninEdge(pObj, pEdge, i)
static Rtm_Init_t Rtm_ObjGetOne2(Rtm_Man_t *p, Rtm_Edg_t *pEdge, int i)
static Rtm_Init_t Rtm_ObjGetFirst2(Rtm_Man_t *p, Rtm_Edg_t *pEdge)
int Rtm_ManLatchMax(Rtm_Man_t *p)
struct Rtm_Obj_t_ Rtm_Obj_t
static Rtm_Obj_t * Rtm_ObjFanout(Rtm_Obj_t *pObj, int i)
static Rtm_Obj_t * Rtm_ObjFanin(Rtm_Obj_t *pObj, int i)
static Rtm_Edg_t * Rtm_ObjEdge(Rtm_Obj_t *pObj, int i)
int Rtm_ObjCheckRetimeFwd(Rtm_Obj_t *pObj)
Rtm_Man_t * Rtm_ManFromAig(Aig_Man_t *p)
static int Aig_ObjFaninC0(Aig_Obj_t *pObj)
static void Rtm_InitXorTwo(unsigned *p, int i, int val)
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
#define ABC_NAMESPACE_IMPL_START
static int Rtm_InitGetTwo(unsigned *p, int i)
static Rtm_Init_t Rtm_ObjGetLast2(Rtm_Man_t *p, Rtm_Edg_t *pEdge)
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
static int Aig_ManRegNum(Aig_Man_t *p)
int Rtm_ObjCheckRetimeBwd(Rtm_Obj_t *pObj)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
void Rtm_ObjMarkAutoFwd_rec(Rtm_Obj_t *pObj)
int Rtm_ManMarkAutoBwd(Rtm_Man_t *pRtm)
Aig_MmFlex_t * Aig_MmFlexStart()
static Rtm_Init_t Rtm_ObjGetOne1(Rtm_Edg_t *pEdge, int i)
Aig_Man_t * Rtm_ManRetime(Aig_Man_t *p, int fForward, int nStepsMax, int fVerbose)
static Rtm_Init_t Rtm_ObjGetLast1(Rtm_Edg_t *pEdge)
void Aig_MmFlexStop(Aig_MmFlex_t *p, int fVerbose)
static Rtm_Init_t Rtm_ObjGetFirst(Rtm_Man_t *p, Rtm_Edg_t *pEdge)
#define Aig_ManForEachLoSeq(p, pObj, i)
void Rtm_ObjRetimeBwd(Rtm_Man_t *pRtm, Rtm_Obj_t *pObj)
static Rtm_Init_t Rtm_ObjGetOne(Rtm_Man_t *p, Rtm_Edg_t *pEdge, int i)
static int Aig_ObjFaninC1(Aig_Obj_t *pObj)
int Rtm_ObjGetDegreeBwd(Rtm_Obj_t *pObj)
static Rtm_Init_t Rtm_ObjRemLast1(Rtm_Edg_t *pEdge)
static Rtm_Init_t Rtm_ObjRemFirst2(Rtm_Man_t *p, Rtm_Edg_t *pEdge)
static Rtm_Init_t Rtm_ObjRemLast2(Rtm_Man_t *p, Rtm_Edg_t *pEdge)
#define Aig_ManForEachLiSeq(p, pObj, i)
static Rtm_Init_t Rtm_ObjRemLast(Rtm_Man_t *p, Rtm_Edg_t *pEdge)
static Rtm_Init_t Rtm_ObjRemFirst(Rtm_Man_t *p, Rtm_Edg_t *pEdge)
static Rtm_Edg_t * Rtm_ObjFanoutEdge(Rtm_Obj_t *pObj, int i)
int Rtm_ManMarkAutoFwd(Rtm_Man_t *pRtm)
void Rtm_ObjAddFanin(Rtm_Obj_t *pObj, Rtm_Obj_t *pFanin, int fCompl)
static Aig_Obj_t * Aig_NotCond(Aig_Obj_t *p, int c)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
#define Aig_ManForEachPoSeq(p, pObj, i)
char * Abc_UtilStrsav(char *s)
int Aig_ManCleanup(Aig_Man_t *p)
#define Aig_ManForEachPiSeq(p, pObj, i)
SEQUENTIAL ITERATORS ///.
static void Vec_PtrFree(Vec_Ptr_t *p)
static void Rtm_ObjTransferToBigger(Rtm_Man_t *p, Rtm_Edg_t *pEdge)