73 p->nRegsMax = nPartSize;
127 int nRegsCur, nRegsMax = -1;
130 if ( p->pfUsedRegs[i] )
135 nRegsCur += !p->pfUsedRegs[iReg];
136 if ( nRegsMax < nRegsCur )
160 int iVarFree, iVarSupp, iVarBest = -1, i, k;
172 if ( p->pfPartVars[iVarSupp] )
174 nNewVars += 1 + 3 * p->pfUsedRegs[iVarSupp];
180 if ( nNewVarsBest > nNewVars )
182 nNewVarsBest = nNewVars;
203 int RetValue, iVar, i;
206 if ( !p->pfUsedRegs[iReg] )
208 p->pfUsedRegs[iReg] = 1;
214 assert( p->pfPartVars[iReg] );
219 assert( !p->pfPartVars[iReg] );
221 p->pfPartVars[iReg] = 1;
227 if ( p->pfPartVars[iVar] )
229 p->pfPartVars[iVar] = 1;
253 int nOffset, iReg, i, k;
267 if ( vGroupNew == NULL )
272 if ( vGroupNew == NULL )
276 if ( vOnehotsPart == NULL )
287 if ( vOnehotsPart && fVerbose )
289 printf(
"Partition contains %d groups of 1-hot registers: { ",
Vec_PtrSize(vOnehotsPart) );
314 int nOffset, iOut, i;
315 int nCountPis, nCountRegs;
336 nCountPis = nCountRegs = 0;
343 *pnCountPis = nCountPis;
345 *pnCountRegs = nCountRegs;
386 pMapBack[pObjNew->
Id] = pObj->
Id;
394 pMapBack[pObjNew->
Id] = pObj->
Id;
396 *ppMapBack = pMapBack;
419 int iSeed, iNext, i, k;
435 for ( k = 0;
Vec_IntSize(p->vRegs) < p->nRegsMax; k++ )
453 printf(
"Part %3d SUMMARY: Free = %4d. Total = %4d. Ratio = %6.2f. Unique = %4d.\n", i,
458 vResult = p->vParts; p->vParts = NULL;
479 if ( nOverSize >= nPartSize )
481 printf(
"Overlap size (%d) is more or equal than the partition size (%d).\n", nOverSize, nPartSize );
482 printf(
"Adjusting it to be equal to half of the partition size.\n" );
483 nOverSize = nPartSize/2;
485 assert( nOverSize < nPartSize );
487 for ( Counter = 0; Counter <
Aig_ManRegNum(pAig); Counter -= nOverSize )
490 for ( i = 0; i < nPartSize; i++, Counter++ )
518 if ( nOverSize >= nPartSize )
520 printf(
"Overlap size (%d) is more or equal than the partition size (%d).\n", nOverSize, nPartSize );
521 printf(
"Adjusting it to be equal to half of the partition size.\n" );
522 nOverSize = nPartSize/2;
524 assert( nOverSize < nPartSize );
525 for ( Counter = 0; Counter <
Vec_IntSize(vDomain); Counter -= nOverSize )
528 for ( i = 0; i < nPartSize; i++, Counter++ )
594 printf(
"Latch %d: ", Counter );
596 printf(
"%d=%d \n", Counter,
Vec_PtrSize(vLos)-nPrev );
Aig_Obj_t * Aig_ObjCreateCo(Aig_Man_t *p, Aig_Obj_t *pDriver)
Vec_Ptr_t * Aig_ManSupportsRegisters(Aig_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
static Vec_Int_t * Vec_IntDup(Vec_Int_t *pVec)
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Vec_Ptr_t * Aig_ManRegPartitionSimple(Aig_Man_t *pAig, int nPartSize, int nOverSize)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Aig_ManPre_t * Aig_ManRegManStart(Aig_Man_t *pAig, int nPartSize)
FUNCTION DEFINITIONS ///.
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static int Aig_ObjIsTravIdCurrent(Aig_Man_t *p, Aig_Obj_t *pObj)
Vec_Ptr_t * Aig_ManRegPartitionLinear(Aig_Man_t *pAig, int nPartSize)
static void Vec_FltFree(Vec_Flt_t *p)
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
Aig_Man_t * Aig_ManStart(int nNodesMax)
DECLARATIONS ///.
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
static Aig_Obj_t * Aig_Regular(Aig_Obj_t *p)
Aig_Obj_t * Aig_ObjCreateCi(Aig_Man_t *p)
DECLARATIONS ///.
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
static Vec_Flt_t * Vec_FltAlloc(int nCap)
FUNCTION DEFINITIONS ///.
#define ABC_ALLOC(type, num)
void Aig_ManPartDivide(Vec_Ptr_t *vResult, Vec_Int_t *vDomain, int nPartSize, int nOverSize)
static Aig_Obj_t * Aig_ObjFanin1(Aig_Obj_t *pObj)
static int Vec_PtrSize(Vec_Ptr_t *p)
static void Vec_VecFree(Vec_Vec_t *p)
static void Aig_ObjSetTravIdCurrent(Aig_Man_t *p, Aig_Obj_t *pObj)
static void Vec_FltPush(Vec_Flt_t *p, float Entry)
int Aig_ManRegFindBestVar(Aig_ManPre_t *p)
Aig_Obj_t * Aig_And(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
void Aig_ManIncrementTravId(Aig_Man_t *p)
DECLARATIONS ///.
static void Vec_FltClear(Vec_Flt_t *p)
static int Aig_ObjIsNode(Aig_Obj_t *pObj)
static int Aig_ManCoNum(Aig_Man_t *p)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static Aig_Obj_t * Aig_ManCi(Aig_Man_t *p, int i)
Vec_Ptr_t * Aig_ManDfsNodes(Aig_Man_t *p, Aig_Obj_t **ppNodes, int nNodes)
static int Vec_IntEntry(Vec_Int_t *p, int i)
static int Aig_ManCiNum(Aig_Man_t *p)
#define ABC_NAMESPACE_IMPL_END
static Aig_Obj_t * Aig_ObjChild1Copy(Aig_Obj_t *pObj)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
static Aig_Obj_t * Aig_ObjChild0Copy(Aig_Obj_t *pObj)
Vec_Ptr_t * Aig_ManRegPartitionTraverse(Aig_Man_t *p)
void Aig_ManRegPartitionTraverse_rec(Aig_Man_t *p, Aig_Obj_t *pObj, Vec_Ptr_t *vLos)
void Aig_ManRegPartitionAdd(Aig_ManPre_t *p, int iReg)
void Ioa_WriteAiger(Aig_Man_t *pMan, char *pFileName, int fWriteSymbols, int fCompact)
static int Vec_IntRemove(Vec_Int_t *p, int Entry)
static int Aig_ManObjNumMax(Aig_Man_t *p)
void Aig_ManRegManStop(Aig_ManPre_t *p)
static void Aig_ObjSetTravIdPrevious(Aig_Man_t *p, Aig_Obj_t *pObj)
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
#define ABC_NAMESPACE_IMPL_START
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
static Aig_Obj_t * Aig_ManCo(Aig_Man_t *p, int i)
static int Aig_ManRegNum(Aig_Man_t *p)
static int Vec_IntSize(Vec_Int_t *p)
Vec_Ptr_t * Aig_ManRegProjectOnehots(Aig_Man_t *pAig, Aig_Man_t *pPart, Vec_Ptr_t *vOnehots, int fVerbose)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
typedefABC_NAMESPACE_IMPL_START struct Aig_ManPre_t_ Aig_ManPre_t
DECLARATIONS ///.
int Aig_ManRegFindSeed(Aig_ManPre_t *p)
#define Aig_ManForEachLoSeq(p, pObj, i)
typedefABC_NAMESPACE_HEADER_START struct Vec_Flt_t_ Vec_Flt_t
INCLUDES ///.
Vec_Ptr_t * Aig_ManRegPartitionSmart(Aig_Man_t *pAig, int nPartSize)
#define ABC_INFINITY
MACRO DEFINITIONS ///.
#define Aig_ManForEachLiSeq(p, pObj, i)
Aig_Man_t * Aig_ManRegCreatePart(Aig_Man_t *pAig, Vec_Int_t *vPart, int *pnCountPis, int *pnCountRegs, int **ppMapBack)
static void Vec_IntFree(Vec_Int_t *p)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
static int Aig_ObjIsCi(Aig_Obj_t *pObj)
static void Vec_IntClear(Vec_Int_t *p)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
static void ** Vec_PtrArray(Vec_Ptr_t *p)
#define Aig_ManForEachPiSeq(p, pObj, i)
SEQUENTIAL ITERATORS ///.
static void Vec_PtrFree(Vec_Ptr_t *p)