Skip to content

Commit e7d3608

Browse files
committed
Fixed combo loop in choice computation.
1 parent 15151c5 commit e7d3608

File tree

2 files changed

+48
-4
lines changed

2 files changed

+48
-4
lines changed

src/aig/gia/giaDup.c

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6272,6 +6272,40 @@ Gia_Man_t * Gia_ManDupFanouts( Gia_Man_t * p )
62726272
return pNew;
62736273
}
62746274

6275+
/**Function*************************************************************
6276+
6277+
Synopsis []
6278+
6279+
Description []
6280+
6281+
SideEffects []
6282+
6283+
SeeAlso []
6284+
6285+
***********************************************************************/
6286+
void Gia_ManDupChoicesMarkTfi_rec( Gia_Man_t * pGia, int iObj )
6287+
{
6288+
if ( Gia_ObjIsTravIdCurrentId(pGia, iObj) )
6289+
return;
6290+
Gia_ObjSetTravIdCurrentId(pGia, iObj);
6291+
Gia_Obj_t * pObj = Gia_ManObj(pGia, iObj);
6292+
if ( !Gia_ObjIsAnd(pObj) )
6293+
return;
6294+
Gia_ManDupChoicesMarkTfi_rec( pGia, Gia_ObjFaninId0(pObj, iObj) );
6295+
Gia_ManDupChoicesMarkTfi_rec( pGia, Gia_ObjFaninId1(pObj, iObj) );
6296+
Gia_Obj_t * pSibl = Gia_ObjSiblObj( pGia, iObj );
6297+
if ( pSibl ) Gia_ManDupChoicesMarkTfi_rec( pGia, Gia_ObjId(pGia, pSibl) );
6298+
}
6299+
int Gia_ManDupChoicesCheckOverlap( Gia_Man_t * pGia, int iObj, int iFan0, int iFan1 )
6300+
{
6301+
Gia_ManIncrementTravId( pGia );
6302+
Gia_ManDupChoicesMarkTfi_rec( pGia, Gia_ObjFaninId0(Gia_ManObj(pGia, iObj), iObj) );
6303+
Gia_ManDupChoicesMarkTfi_rec( pGia, Gia_ObjFaninId1(Gia_ManObj(pGia, iObj), iObj) );
6304+
if ( Gia_ObjIsTravIdCurrentId(pGia, iFan0) || Gia_ObjIsTravIdCurrentId(pGia, iFan1) )
6305+
return 1;
6306+
return 0;
6307+
}
6308+
62756309
/**Function*************************************************************
62766310
62776311
Synopsis [Reorders choice nodes.]
@@ -6288,14 +6322,24 @@ void Gia_ManPrintChoices( Gia_Man_t * p )
62886322
Gia_Obj_t * pObj; int i;
62896323
Gia_ManForEachAnd( p, pObj, i )
62906324
if ( p->pSibls[i] )
6291-
printf( "%d -> %d\n", i, p->pSibls[i] );
6325+
printf( "%d -> %d ", i, p->pSibls[i] );
62926326
}
62936327
void Gia_ManReorderChoices_rec( Gia_Man_t * pNew, Gia_Man_t * p, Gia_Obj_t * pObj )
62946328
{
62956329
if ( ~pObj->Value )
62966330
return;
62976331
assert( Gia_ObjIsAnd(pObj) );
6298-
Gia_Obj_t * pSibl = Gia_ObjSiblObj(p, Gia_ObjId(p, pObj));
6332+
int ObjId = Gia_ObjId(p, pObj);
6333+
Gia_Obj_t * pSibl = Gia_ObjSiblObj(p, ObjId);
6334+
if ( pSibl ) {
6335+
int SiblId = Gia_ObjId(p, pSibl);
6336+
if ( Gia_ManDupChoicesCheckOverlap( p, SiblId, Gia_ObjFaninId0(pObj, ObjId), Gia_ObjFaninId1(pObj, ObjId) ) ) {
6337+
assert( p->pSibls[ObjId] == SiblId );
6338+
p->pSibls[ObjId] = p->pSibls[SiblId];
6339+
Gia_ManReorderChoices_rec( pNew, p, pObj );
6340+
return;
6341+
}
6342+
}
62996343
Gia_ManReorderChoices_rec( pNew, p, Gia_ObjFanin0(pObj) );
63006344
Gia_ManReorderChoices_rec( pNew, p, Gia_ObjFanin1(pObj) );
63016345
if ( pSibl ) Gia_ManReorderChoices_rec( pNew, p, pSibl );

src/base/abci/abc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47482,8 +47482,8 @@ int Abc_CommandAbc9Dch( Abc_Frame_t * pAbc, int argc, char ** argv )
4748247482
Abc_Print( -2, "\t-f : toggle using lighter logic synthesis [default = %s]\n", pPars->fLightSynth? "yes": "no" );
4748347483
Abc_Print( -2, "\t-r : toggle skipping choices with redundant support [default = %s]\n", pPars->fSkipRedSupp? "yes": "no" );
4748447484
Abc_Print( -2, "\t-e : toggle computing and merging equivalences [default = %s]\n", fEquiv? "yes": "no" );
47485-
Abc_Print( -2, "\t-m : toggle minimizing logic level after merging equivalences [default = %s]\n", fRandom? "yes": "no" );
47486-
Abc_Print( -2, "\t-n : toggle selecting random choices while merging equivalences [default = %s]\n", fMinLevel? "yes": "no" );
47485+
Abc_Print( -2, "\t-m : toggle minimizing logic level after merging equivalences [default = %s]\n", fMinLevel? "yes": "no" );
47486+
Abc_Print( -2, "\t-n : toggle selecting random choices while merging equivalences [default = %s]\n", fRandom? "yes": "no" );
4748747487
Abc_Print( -2, "\t-g : toggle using GIA to prove equivalences [default = %s]\n", pPars->fUseGia? "yes": "no" );
4748847488
Abc_Print( -2, "\t-c : toggle using circuit-based SAT vs. MiniSat [default = %s]\n", pPars->fUseCSat? "yes": "no" );
4748947489
Abc_Print( -2, "\t-x : toggle using new choice computation [default = %s]\n", pPars->fUseNew? "yes": "no" );

0 commit comments

Comments
 (0)