51 Vec_Int_t * vLeaves, * vTruth, * vVisited, * vLeavesBest;
58 int * pLutClass, Counter = 0;
62 printf(
"Resynthesis is not performed when nodes have more than 4 inputs.\n" );
66 vLeaves = Vec_IntAlloc( 0 );
67 vTruth = Vec_IntAlloc( (1<<16) );
68 vVisited = Vec_IntAlloc( 0 );
69 vLeavesBest = Vec_IntAlloc( 4 );
76 Gia_ManConst0(
p)->Value = 0;
79 pNew->
pName = Abc_UtilStrsav(
p->pName );
80 pNew->
pSpec = Abc_UtilStrsav(
p->pSpec );
85 if ( Gia_ObjIsCi(pObj) )
87 pObj->
Value = Gia_ManAppendCi( pNew );
89 Gia_ObjSetLevel( pNew, Gia_ObjFromLit(pNew, Gia_ObjValue(pObj)), Gia_ObjLevel(
p, pObj) );
91 else if ( Gia_ObjIsCo(pObj) )
93 pObj->
Value = Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
95 else if ( Gia_ObjIsLut(
p, i) )
99 Vec_IntClear( vLeaves );
101 Vec_IntPush( vLeaves, iFan );
103 Vec_IntPush( vLeaves, 0 );
110 Vec_IntWriteEntry( vLeaves, k, Gia_ObjValue(pFanin) != ~0 ? Gia_ObjValue(pFanin) : 0 );
113 if ( Gia_ManTruthIsConst0(pTruth, Vec_IntSize(vLeaves)) )
115 else if ( Gia_ManTruthIsConst1(pTruth, Vec_IntSize(vLeaves)) )
130 if ( fVerbose && Gia_ManAndNum(pNew) != Gia_ManAndNum(pTemp) )
131 printf(
"Gia_ManMapShrink4() node reduction after sweep %6d -> %6d.\n", Gia_ManAndNum(pTemp), Gia_ManAndNum(pNew) );
135 Vec_IntFree( vLeaves );
136 Vec_IntFree( vTruth );
137 Vec_IntFree( vVisited );
138 Vec_IntFree( vLeavesBest );
141 printf(
"Total gain in AIG nodes = %d. ", Gia_ManObjNum(
p)-Gia_ManObjNum(pNew) );
142 ABC_PRT(
"Total runtime", Abc_Clock() - clk );
#define ABC_CALLOC(type, num)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
void Dar_LibPrepare(int nSubgraphs)
ABC_NAMESPACE_IMPL_START int Dar_LibEvalBuild(Gia_Man_t *p, Vec_Int_t *vCut, unsigned uTruth, int fKeepLevel, Vec_Int_t *vLeavesBest)
DECLARATIONS ///.
Gia_Man_t * Gia_ManMapShrink4(Gia_Man_t *p, int fKeepLevel, int fVerbose)
FUNCTION DEFINITIONS ///.
void Gia_ManStop(Gia_Man_t *p)
unsigned * Gia_ManConvertAigToTruth(Gia_Man_t *p, Gia_Obj_t *pRoot, Vec_Int_t *vLeaves, Vec_Int_t *vTruth, Vec_Int_t *vVisited)
int Gia_ManHasDangling(Gia_Man_t *p)
void Gia_ManSetRegNum(Gia_Man_t *p, int nRegs)
void Gia_ManHashAlloc(Gia_Man_t *p)
Gia_Man_t * Gia_ManStart(int nObjsMax)
FUNCTION DEFINITIONS ///.
struct Gia_Obj_t_ Gia_Obj_t
#define Gia_LutForEachFanin(p, i, iFan, k)
void Gia_ManFillValue(Gia_Man_t *p)
struct Gia_Man_t_ Gia_Man_t
#define Gia_ManForEachObj1(p, pObj, i)
#define Gia_ManForEachObjVec(vVec, p, pObj, i)
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
void Gia_ManCleanTruth(Gia_Man_t *p)
int Gia_ManLutSizeMax(Gia_Man_t *p)
void Gia_ManCleanLevels(Gia_Man_t *p, int Size)
void Gia_ManSetPhase(Gia_Man_t *p)
void Gia_ManHashStop(Gia_Man_t *p)