Skip to content

Commit

Permalink
Trasferring equivalence in the special-case usage of &scorr.
Browse files Browse the repository at this point in the history
  • Loading branch information
alanminko committed Sep 13, 2024
1 parent 0d10253 commit 9c152b7
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
48 changes: 48 additions & 0 deletions src/aig/gia/giaEquiv.c
Original file line number Diff line number Diff line change
Expand Up @@ -2732,6 +2732,54 @@ void Gia_ManTransferTest( Gia_Man_t * p )
Gia_ManStop( pNew );
}

/**Function*************************************************************
Synopsis [Transfer from new to old.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Gia_ManTransferEquivs2( Gia_Man_t * p, Gia_Man_t * pOld )
{
Gia_Obj_t * pObj;
Vec_Int_t * vClass;
int i, k, iNode, iRepr;
assert( p->pReprs != NULL );
assert( p->pNexts != NULL );
assert( pOld->pReprs == NULL );
assert( pOld->pNexts == NULL );
// create map
Gia_ManFillValue( p );
Gia_ManForEachObj( pOld, pObj, i )
if ( ~pObj->Value )
Gia_ManObj(p, Abc_Lit2Var(pObj->Value))->Value = Abc_Var2Lit(i, 0);
// start representatives
pOld->pReprs = ABC_CALLOC( Gia_Rpr_t, Gia_ManObjNum(pOld) );
for ( i = 0; i < Gia_ManObjNum(pOld); i++ )
Gia_ObjSetRepr( pOld, i, GIA_VOID );
// iterate over constant candidates
Gia_ManForEachConst( p, i )
Gia_ObjSetRepr( pOld, Abc_Lit2Var(Gia_ManObj(p, i)->Value), 0 );
// iterate over class candidates
vClass = Vec_IntAlloc( 100 );
Gia_ManForEachClass( p, i )
{
Vec_IntClear( vClass );
Gia_ClassForEachObj( p, i, k )
Vec_IntPushUnique( vClass, Abc_Lit2Var(Gia_ManObj(p, k)->Value) );
assert( Vec_IntSize( vClass ) > 1 );
Vec_IntSort( vClass, 0 );
iRepr = Vec_IntEntry( vClass, 0 );
Vec_IntForEachEntryStart( vClass, iNode, k, 1 )
Gia_ObjSetRepr( pOld, iNode, iRepr );
}
Vec_IntFree( vClass );
pOld->pNexts = Gia_ManDeriveNexts( pOld );
}

/**Function*************************************************************
Expand Down
2 changes: 2 additions & 0 deletions src/base/abci/abc.c
Original file line number Diff line number Diff line change
Expand Up @@ -38616,6 +38616,7 @@ int Abc_CommandAbc9Scorr( Abc_Frame_t * pAbc, int argc, char ** argv )
Vec_Int_t * vStops = Gia_ManFindStopFlops( pAbc->pGia, nFlopIncFreq, pPars->fVerbose );
if ( vStops )
{
extern void Gia_ManTransferEquivs2( Gia_Man_t * p, Gia_Man_t * pNew );
Gia_Man_t * pUsed = Gia_ManDupStopsAdd( pAbc->pGia, vStops );
if ( pPars->nPartSize > 0 )
pTemp = Gia_SignalCorrespondencePart( pUsed, pPars );
Expand All @@ -38625,6 +38626,7 @@ int Abc_CommandAbc9Scorr( Abc_Frame_t * pAbc, int argc, char ** argv )
pTemp = Gia_ManScorrDivideTest( pUsed, pPars );
else
pTemp = Cec_ManLSCorrespondence( pUsed, pPars );
Gia_ManTransferEquivs2( pUsed, pAbc->pGia );
Gia_ManStop( pUsed );
pTemp = Gia_ManDupStopsRem( pUsed = pTemp, vStops );
Gia_ManStop( pUsed );
Expand Down

0 comments on commit 9c152b7

Please sign in to comment.