Commit aa7daf1e by Alan Mishchenko

Integrating sweeping information.

parent 3e59c102
...@@ -178,7 +178,7 @@ Gia_Man_t * Gia_ManFraigReduceGia( Gia_Man_t * p, int * pReprs ) ...@@ -178,7 +178,7 @@ Gia_Man_t * Gia_ManFraigReduceGia( Gia_Man_t * p, int * pReprs )
Gia_ManForEachObj( p, pObj, i ) Gia_ManForEachObj( p, pObj, i )
{ {
if ( Gia_ObjIsAnd(pObj) ) if ( Gia_ObjIsAnd(pObj) )
pObj->Value = Gia_ManAppendAnd( pNew, Gia_ObjFanin0CopyRepr(p, pObj, pReprs), Gia_ObjFanin1CopyRepr(p, pObj, pReprs) ); pObj->Value = Gia_ManHashAnd( pNew, Gia_ObjFanin0CopyRepr(p, pObj, pReprs), Gia_ObjFanin1CopyRepr(p, pObj, pReprs) );
else if ( Gia_ObjIsCi(pObj) ) else if ( Gia_ObjIsCi(pObj) )
pObj->Value = Gia_ManAppendCi( pNew ); pObj->Value = Gia_ManAppendCi( pNew );
else if ( Gia_ObjIsCo(pObj) ) else if ( Gia_ObjIsCo(pObj) )
...@@ -188,6 +188,15 @@ Gia_Man_t * Gia_ManFraigReduceGia( Gia_Man_t * p, int * pReprs ) ...@@ -188,6 +188,15 @@ Gia_Man_t * Gia_ManFraigReduceGia( Gia_Man_t * p, int * pReprs )
else assert( 0 ); else assert( 0 );
} }
Gia_ManHashStop( pNew ); Gia_ManHashStop( pNew );
/*
{
Gia_Man_t * pTemp;
Gia_ManPrintStats( pNew, 0, 0, 0 );
pNew = Gia_ManCleanup( pTemp = pNew );
Gia_ManStop( pTemp );
Gia_ManPrintStats( pNew, 0, 0, 0 );
}
*/
return pNew; return pNew;
} }
...@@ -210,17 +219,6 @@ int * Gia_ManFraigSelectReprs( Gia_Man_t * p, Gia_Man_t * pGia, int fVerbose ) ...@@ -210,17 +219,6 @@ int * Gia_ManFraigSelectReprs( Gia_Man_t * p, Gia_Man_t * pGia, int fVerbose )
int i, iLitGia, iLitGia2, iReprGia, fCompl; int i, iLitGia, iLitGia2, iReprGia, fCompl;
int nConsts = 0, nReprs = 0; int nConsts = 0, nReprs = 0;
pGia2Abc[0] = 0; pGia2Abc[0] = 0;
/*
Gia_ManForEachObj( p, pObj, i )
printf( "%d %d ", i, Gia_ObjValue(pObj) );
printf( "\n" );
printf( "\n" );
Gia_ManForEachObj( pGia, pObj, i )
printf( "%d %d ", i, Gia_ObjReprSelf(pGia, i) );
printf( "\n" );
printf( "\n" );
*/
Gia_ManSetPhase( pGia ); Gia_ManSetPhase( pGia );
Gia_ManForEachObj1( p, pObj, i ) Gia_ManForEachObj1( p, pObj, i )
{ {
...@@ -246,6 +244,8 @@ int * Gia_ManFraigSelectReprs( Gia_Man_t * p, Gia_Man_t * pGia, int fVerbose ) ...@@ -246,6 +244,8 @@ int * Gia_ManFraigSelectReprs( Gia_Man_t * p, Gia_Man_t * pGia, int fVerbose )
nConsts++; nConsts++;
else else
nReprs++; nReprs++;
assert( Abc_Lit2Var(pReprs[i]) < i );
// printf( "%d -> %d\n", i, Abc_Lit2Var(pReprs[i]) );
} }
} }
ABC_FREE( pGia2Abc ); ABC_FREE( pGia2Abc );
...@@ -308,9 +308,6 @@ Gia_Man_t * Gia_ManFraigSweep( Gia_Man_t * p, void * pPars ) ...@@ -308,9 +308,6 @@ Gia_Man_t * Gia_ManFraigSweep( Gia_Man_t * p, void * pPars )
pNew = Gia_ManDupWithHierarchy( p, NULL ); pNew = Gia_ManDupWithHierarchy( p, NULL );
if ( pNew == NULL ) if ( pNew == NULL )
return NULL; return NULL;
// normalizing AIG
pNew = Gia_ManDupNormalize( pTemp = pNew );
Gia_ManStop( pTemp );
// find global equivalences // find global equivalences
pNew->pManTime = p->pManTime; pNew->pManTime = p->pManTime;
pGia = Gia_ManDupWithBoxes( pNew, p->pAigExtra ); pGia = Gia_ManDupWithBoxes( pNew, p->pAigExtra );
...@@ -323,13 +320,6 @@ Gia_Man_t * Gia_ManFraigSweep( Gia_Man_t * p, void * pPars ) ...@@ -323,13 +320,6 @@ Gia_Man_t * Gia_ManFraigSweep( Gia_Man_t * p, void * pPars )
pNew = Gia_ManFraigReduceGia( pTemp = pNew, pReprs ); pNew = Gia_ManFraigReduceGia( pTemp = pNew, pReprs );
Gia_ManStop( pTemp ); Gia_ManStop( pTemp );
ABC_FREE( pReprs ); ABC_FREE( pReprs );
// order reduced AIG
pNew->pManTime = p->pManTime;
pNew = Gia_ManDupWithHierarchy( pTemp = pNew, NULL );
pTemp->pManTime = NULL;
Gia_ManStop( pTemp );
if ( pNew == NULL )
return NULL;
// derive new AIG // derive new AIG
assert( pNew->pManTime == NULL ); assert( pNew->pManTime == NULL );
assert( pNew->pAigExtra == NULL ); assert( pNew->pAigExtra == NULL );
......
...@@ -199,7 +199,7 @@ Vec_Int_t * Gia_ManDupFindOrderWithHie( Gia_Man_t * p ) ...@@ -199,7 +199,7 @@ Vec_Int_t * Gia_ManDupFindOrderWithHie( Gia_Man_t * p )
Gia_Obj_t * pObj; Gia_Obj_t * pObj;
int i, k, curCi, curCo; int i, k, curCi, curCo;
assert( p->pManTime != NULL ); assert( p->pManTime != NULL );
assert( Gia_ManIsNormalized( p ) ); // assert( Gia_ManIsNormalized( p ) );
// start trav IDs // start trav IDs
Gia_ManIncrementTravId( p ); Gia_ManIncrementTravId( p );
// start the array // start the array
...@@ -655,21 +655,22 @@ void * Gia_ManUpdateTimMan( Gia_Man_t * p, Vec_Int_t * vBoxPres ) ...@@ -655,21 +655,22 @@ void * Gia_ManUpdateTimMan( Gia_Man_t * p, Vec_Int_t * vBoxPres )
***********************************************************************/ ***********************************************************************/
Gia_Man_t * Gia_ManUpdateExtraAig( void * pTime, Gia_Man_t * pAig, Vec_Int_t * vBoxPres ) Gia_Man_t * Gia_ManUpdateExtraAig( void * pTime, Gia_Man_t * pAig, Vec_Int_t * vBoxPres )
{ {
Gia_Man_t * pNew; Gia_Man_t * pNew = NULL;
Vec_Int_t * vOutPres; Vec_Int_t * vOutPres;
Tim_Man_t * pManTime = (Tim_Man_t *)pTime; Tim_Man_t * pManTime = (Tim_Man_t *)pTime;
int i, k, curPo; int i, k, curPo = 0;
assert( Vec_IntSize(vBoxPres) == Tim_ManBoxNum(pManTime) ); assert( Vec_IntSize(vBoxPres) == Tim_ManBoxNum(pManTime) );
assert( Gia_ManPoNum(pAig) == Tim_ManCoNum(pManTime) - Tim_ManPoNum(pManTime) ); assert( Gia_ManPoNum(pAig) == Tim_ManCiNum(pManTime) - Tim_ManPiNum(pManTime) );
vOutPres = Vec_IntAlloc( 100 ); vOutPres = Vec_IntAlloc( 100 );
for ( curPo = i = 0; i < Tim_ManBoxNum(pManTime); i++, curPo += Tim_ManBoxInputNum(pManTime, i) ) for ( i = 0; i < Tim_ManBoxNum(pManTime); i++ )
if ( Vec_IntEntry(vBoxPres, i) ) {
for ( k = 0; k < Tim_ManBoxInputNum(pManTime, i); k++ ) for ( k = 0; k < Tim_ManBoxOutputNum(pManTime, i); k++ )
Vec_IntPush( vOutPres, curPo + k ); Vec_IntPush( vOutPres, Vec_IntEntry(vBoxPres, i) );
assert( curPo == Tim_ManCoNum(pManTime) - Tim_ManPoNum(pManTime) ); curPo += Tim_ManBoxOutputNum(pManTime, i);
for ( k = curPo; k < Tim_ManCoNum(pManTime); k++ ) }
Vec_IntPush( vOutPres, k ); assert( curPo == Gia_ManPoNum(pAig) );
pNew = Gia_ManDupOutputVec( pAig, vOutPres ); if ( Vec_IntSize(vOutPres) > 0 )
pNew = Gia_ManDupOutputVec( pAig, vOutPres );
Vec_IntFree( vOutPres ); Vec_IntFree( vOutPres );
return pNew; return pNew;
} }
......
...@@ -184,7 +184,7 @@ Tim_Man_t * Tim_ManTrim( Tim_Man_t * p, Vec_Int_t * vBoxPres ) ...@@ -184,7 +184,7 @@ Tim_Man_t * Tim_ManTrim( Tim_Man_t * p, Vec_Int_t * vBoxPres )
Tim_ManForEachCo( p, pObj, i ) Tim_ManForEachCo( p, pObj, i )
pObj->TravId = 0; pObj->TravId = 0;
// create new manager // create new manager
pNew = Tim_ManStart( p->nCis - nNewCis, p->nCos - nNewCos ); pNew = Tim_ManStart( nNewCis, nNewCos );
// copy box connectivity information // copy box connectivity information
memcpy( pNew->pCis, p->pCis, sizeof(Tim_Obj_t) * Tim_ManPiNum(p) ); memcpy( pNew->pCis, p->pCis, sizeof(Tim_Obj_t) * Tim_ManPiNum(p) );
memcpy( pNew->pCos, p->pCos, sizeof(Tim_Obj_t) * Tim_ManPoNum(p) ); memcpy( pNew->pCos, p->pCos, sizeof(Tim_Obj_t) * Tim_ManPoNum(p) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment