68{
70 int i, iFrame0, iFrame;
71 int nTotal = 0, nRemoved = 0;
73 abctime clk, clkTotal = Abc_Clock();
75 assert(
p->vGateClasses != NULL );
76 vGScopy = Vec_IntDup(
p->vGateClasses );
77 if ( nFrameMax == 0 )
79 else
80 iFrame0 = nFrameMax - 1;
81 while ( 1 )
82 {
83 int fChanges = 0;
85 {
87 continue;
88 if ( !Gia_ObjIsInGla(
p, pObj) )
89 continue;
90 if ( pObj == Gia_ObjFanin0( Gia_ManPo(
p, 0) ) )
91 continue;
92 if ( Gia_ObjIsAnd(pObj) )
93 {
94 if ( Gia_ObjIsInGla(
p, Gia_ObjFanin0(pObj)) && Gia_ObjIsInGla(
p, Gia_ObjFanin1(pObj)) )
95 continue;
96 }
97 if ( Gia_ObjIsRo(
p, pObj) )
98 {
99 if ( Gia_ObjIsInGla(
p, Gia_ObjFanin0(Gia_ObjRoToRi(
p, pObj))) )
100 continue;
101 }
102 clk = Abc_Clock();
103 printf(
"%5d : ",
nTotal );
104 printf( "Obj =%7d ", i );
105 Gia_ObjRemFromGla(
p, pObj );
107 if ( nFrameMax )
108 assert( iFrame <= nFrameMax );
109 else
110 assert( iFrame <= iFrame0 );
111 printf( "Frame =%6d ", iFrame );
112 if ( iFrame < iFrame0 )
113 {
115 Gia_ObjAddToGla(
p, pObj );
116 printf( " " );
117 }
118 else
119 {
120 fChanges = 1;
121 nRemoved++;
122 printf( "Removing " );
123 Vec_IntWriteEntry( vGScopy, Gia_ObjId(
p, pObj), 0 );
124 }
125 Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
127
128 Vec_IntFreeP( &
p->vGateClasses );
129 p->vGateClasses = Vec_IntDup(vGScopy);
130 }
131 if ( !fChanges )
132 break;
133 }
135 Vec_IntFree( vGScopy );
136 printf(
"Tried = %d. ",
nTotal );
137 printf(
"Removed = %d. (%.2f %%) ", nRemoved, 100.0 * nRemoved / Vec_IntCountPositive(
p->vGateClasses) );
138 Abc_PrintTime( 1, "Time", Abc_Clock() - clkTotal );
139 return NULL;
140}
int Gia_IterTryImprove(Gia_Man_t *p, int nTimeOut, int iFrame0)
FUNCTION DEFINITIONS ///.
int nTotal
DECLARATIONS ///.
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
struct Gia_Obj_t_ Gia_Obj_t
#define Gia_ManForEachObj1(p, pObj, i)
void Gia_ManCleanMark0(Gia_Man_t *p)