48 if ( Gia_ObjIsTravIdCurrentId(
p, iObj) )
50 Gia_ObjSetTravIdCurrentId(
p, iObj);
51 pObj = Gia_ManObj(
p, iObj );
52 if ( Gia_ObjIsAnd(pObj) )
54 if ( Gia_ObjIsAnd(pObj) )
70 Gia_ObjFanin0(pObj)->fMark0 = 1;
76 if ( Gia_ObjIsCi(pObj) )
78 if ( Gia_ObjIsAnd(pObj) && !Gia_ObjIsTravIdCurrentId(
p, i) )
80 Gia_ObjFanin0(pObj)->fMark0 = 1;
81 if ( Gia_ObjIsAnd(pObj) )
82 Gia_ObjFanin1(pObj)->fMark0 = 1;
86 *pvPis = Vec_IntAlloc( 1000 );
87 *pvPos = Vec_IntAlloc( 1000 );
88 *pvAnds = Vec_IntAlloc( 1000 );
91 if ( !Gia_ObjIsTravIdCurrentId(
p, i) )
93 if ( Gia_ObjIsCi(pObj) )
94 Vec_IntPush( *pvPis, i );
96 Vec_IntPush( *pvPos, i );
97 if ( Gia_ObjIsAnd(pObj) )
98 Vec_IntPush( *pvAnds, i );
122 pNew =
Gia_ManStart( Vec_IntSize(vPis) + Vec_IntSize(vPos) + Vec_IntSize(vAnds) + 1 );
123 pNew->
pName = Abc_UtilStrsav(
p->pName );
124 Gia_ManConst0(
p)->Value = 0;
126 pObj->
Value = Gia_ManAppendCi( pNew );
128 pObj->
Value = Gia_ManAppendAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
130 Gia_ManAppendCo( pNew, pObj->
Value );
133 Vec_IntFree( vAnds );
144 pNew =
Gia_ManStart( Gia_ManObjNum(
p) - Vec_IntSize(vAnds) + Gia_ManAndNum(pWin) );
145 pNew->
pName = Abc_UtilStrsav(
p->pName );
146 pNew->
pSpec = Abc_UtilStrsav(
p->pSpec );
148 Gia_ManConst0(
p)->Value = 0;
150 pObj->
Value = Gia_ManAppendCi( pNew );
151 Gia_ManConst0(pWin)->Value = 0;
153 pObj->
Value = Gia_ManObj(
p, Vec_IntEntry(vPis, i))->Value;
159 Gia_ManObj(
p, Vec_IntEntry(vPos, i) )->Value = Gia_ObjFanin0Copy(pObj);
161 if ( !Gia_ObjIsTravIdCurrentId(
p, i) )
164 Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
169 Vec_IntFree( vAnds );
190 vOuts = Vec_IntAlloc( 1000 );
191 if ( Gia_ManHasMapping(
p) )
193 int i, k, iFan, nLevels = 0;
194 int * pLevels =
ABC_CALLOC(
int, Gia_ManObjNum(
p) );
198 pLevels[i] = Abc_MaxInt( pLevels[i], pLevels[iFan] );
200 nLevels = Abc_MaxInt( nLevels, pLevels[i] );
203 LevelMax = (int)((1.0 - 0.01 * nTimeWindow) * nLevels);
204 if ( nLevels < LevelMax )
205 printf(
"The maximum mapped level (%d) is less than the target level (%d).\n", nLevels, LevelMax );
207 if ( pLevels[Gia_ObjFaninId0p(
p, pObj)] >= LevelMax )
208 Vec_IntPush( vOuts, i );
215 LevelMax = (int)((1.0 - 0.01 * nTimeWindow) * nLevels);
216 if ( nLevels < LevelMax )
217 printf(
"The maximum AIG level (%d) is less than the target level (%d).\n", nLevels, LevelMax );
219 if ( Gia_ObjLevel(
p, pObj) >= LevelMax )
220 Vec_IntPush( vOuts, i );
240 assert( !LevelMax != !nTimeWindow );
243 printf(
"Collected %d outputs to extract.\n", Vec_IntSize(vOuts) );
244 if ( Vec_IntSize(vOuts) == 0 )
246 Vec_IntFree( vOuts );
250 Vec_IntFree( vOuts );
269 assert( !LevelMax != !nTimeWindow );
272 printf(
"Collected %d outputs to extract.\n", Vec_IntSize(vOuts) );
273 if ( Vec_IntSize(vOuts) == 0 )
275 Vec_IntFree( vOuts );
283 Vec_IntFree( vOuts );
302 assert( !LevelMax != !nTimeWindow );
305 printf(
"Collected %d outputs to extract.\n", Vec_IntSize(vOuts) );
306 if ( Vec_IntSize(vOuts) == 0 )
308 Vec_IntFree( vOuts );
316 Vec_IntFree( vOuts );
#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 ///.
Gia_Man_t * Gia_ManPerformSopBalanceWin(Gia_Man_t *p, int LevelMax, int nTimeWindow, int nCutNum, int nRelaxRatio, int fVerbose)
Vec_Int_t * Gia_ManFindLatest(Gia_Man_t *p, int LevelMax, int nTimeWindow)
Gia_Man_t * Gia_ManPerformDsdBalanceWin(Gia_Man_t *p, int LevelMax, int nTimeWindow, int nLutSize, int nCutNum, int nRelaxRatio, int fVerbose)
Gia_Man_t * Gia_ManExtractWindow(Gia_Man_t *p, int LevelMax, int nTimeWindow, int fVerbose)
ABC_NAMESPACE_IMPL_START void Gia_ManHighlight_rec(Gia_Man_t *p, int iObj)
DECLARATIONS ///.
Gia_Man_t * Gia_ManExtractWin(Gia_Man_t *p, Vec_Int_t *vOuts, int fPoOnly)
void Gia_ManPrepareWin(Gia_Man_t *p, Vec_Int_t *vOuts, Vec_Int_t **pvPis, Vec_Int_t **pvPos, Vec_Int_t **pvAnds, int fPoOnly)
Gia_Man_t * Gia_ManInsertWin(Gia_Man_t *p, Vec_Int_t *vOuts, Gia_Man_t *pWin)
void Gia_ManStop(Gia_Man_t *p)
Gia_Man_t * Gia_ManDup(Gia_Man_t *p)
#define Gia_ManForEachAnd(p, pObj, i)
#define Gia_ManForEachCoVec(vVec, p, pObj, i)
void Gia_ManHashAlloc(Gia_Man_t *p)
#define Gia_ManForEachLut(p, i)
Gia_Man_t * Gia_ManStart(int nObjsMax)
FUNCTION DEFINITIONS ///.
struct Gia_Obj_t_ Gia_Obj_t
#define Gia_LutForEachFanin(p, i, iFan, k)
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)
Gia_Man_t * Gia_ManPerformDsdBalance(Gia_Man_t *p, int nLutSize, int nCutNum, int nRelaxRatio, int fVerbose)
void Gia_ManCleanMark0(Gia_Man_t *p)
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
void Gia_ManIncrementTravId(Gia_Man_t *p)
#define Gia_ManForEachCo(p, pObj, i)
#define Gia_ManForEachCi(p, pObj, i)
void Gia_ManHashStop(Gia_Man_t *p)
int Gia_ManLevelNum(Gia_Man_t *p)
Gia_Man_t * Gia_ManPerformSopBalance(Gia_Man_t *p, int nCutNum, int nRelaxRatio, int fVerbose)