FUNCTION DEFINITIONS ///.
50{
51 Vec_Int_t * vLeaves, * vTruth, * vVisited, * vLeavesBest;
54 unsigned * pTruth;
55 int i, k, iFan;
57
58 int * pLutClass, Counter = 0;
61 {
62 printf( "Resynthesis is not performed when nodes have more than 4 inputs.\n" );
63 return NULL;
64 }
66 vLeaves = Vec_IntAlloc( 0 );
67 vTruth = Vec_IntAlloc( (1<<16) );
68 vVisited = Vec_IntAlloc( 0 );
69 vLeavesBest = Vec_IntAlloc( 4 );
70
72
76 Gia_ManConst0(
p)->Value = 0;
77
79 pNew->
pName = Abc_UtilStrsav(
p->pName );
80 pNew->
pSpec = Abc_UtilStrsav(
p->pSpec );
84 {
85 if ( Gia_ObjIsCi(pObj) )
86 {
87 pObj->
Value = Gia_ManAppendCi( pNew );
89 Gia_ObjSetLevel( pNew, Gia_ObjFromLit(pNew, Gia_ObjValue(pObj)), Gia_ObjLevel(
p, pObj) );
90 }
91 else if ( Gia_ObjIsCo(pObj) )
92 {
93 pObj->
Value = Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
94 }
95 else if ( Gia_ObjIsLut(
p, i) )
96 {
97 Counter++;
98
99 Vec_IntClear( vLeaves );
101 Vec_IntPush( vLeaves, iFan );
102 for ( ; k < 4; k++ )
103 Vec_IntPush( vLeaves, 0 );
104
106
108 {
109
110 Vec_IntWriteEntry( vLeaves, k, Gia_ObjValue(pFanin) != ~0 ? Gia_ObjValue(pFanin) : 0 );
111 }
112
113 if ( Gia_ManTruthIsConst0(pTruth, Vec_IntSize(vLeaves)) )
115 else if ( Gia_ManTruthIsConst1(pTruth, Vec_IntSize(vLeaves)) )
117 else
118 {
121 }
122 }
123 }
124
126
128 {
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) );
133 }
135 Vec_IntFree( vLeaves );
136 Vec_IntFree( vTruth );
137 Vec_IntFree( vVisited );
138 Vec_IntFree( vLeavesBest );
139 if ( fVerbose )
140 {
141 printf(
"Total gain in AIG nodes = %d. ", Gia_ManObjNum(
p)-Gia_ManObjNum(pNew) );
142 ABC_PRT(
"Total runtime", Abc_Clock() - clk );
143 }
145 return pNew;
146}
#define ABC_CALLOC(type, num)
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 ///.
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)