diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2014-10-04 19:36:41 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2014-10-04 19:36:41 -0700 |
commit | 734435f441791dbc74211b6c0cc5cf261d1da669 (patch) | |
tree | 74f1dfdf3b643a5e8fd1a2b083f22c0b1addb61e /src/map | |
parent | 24083998ab2e6abdb0cacd90a8f45a01201aa7ce (diff) | |
download | abc-734435f441791dbc74211b6c0cc5cf261d1da669.tar.gz abc-734435f441791dbc74211b6c0cc5cf261d1da669.tar.bz2 abc-734435f441791dbc74211b6c0cc5cf261d1da669.zip |
Deriving cell mapping with &if -kz.
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/if/ifDsd.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/map/if/ifDsd.c b/src/map/if/ifDsd.c index c71df9e7..90e30287 100644 --- a/src/map/if/ifDsd.c +++ b/src/map/if/ifDsd.c @@ -1160,13 +1160,13 @@ If_DsdMan_t * If_DsdManLoad( char * pFileName ) } ABC_FREE( pTruth ); RetValue = fread( &Num, 4, 1, pFile ); - if ( Num ) + if ( RetValue && Num ) { p->vPerms = Vec_WrdStart( Num ); RetValue = fread( Vec_WrdArray(p->vPerms), sizeof(word)*Num, 1, pFile ); } RetValue = fread( &Num, 4, 1, pFile ); - if ( Num ) + if ( RetValue && Num ) { p->pCellStr = ABC_CALLOC( char, Num + 1 ); RetValue = fread( p->pCellStr, sizeof(char)*Num, 1, pFile ); @@ -1196,6 +1196,8 @@ void If_DsdManMerge( If_DsdMan_t * p, If_DsdMan_t * pNew ) vMap = Vec_IntAlloc( Vec_PtrSize(&pNew->vObjs) ); Vec_IntPush( vMap, 0 ); Vec_IntPush( vMap, 1 ); + if ( p->vPerms && pNew->vPerms ) + Vec_WrdFillExtra( p->vPerms, Vec_PtrSize(&p->vObjs) + Vec_PtrSize(&pNew->vObjs), 0 ); If_DsdVecForEachNode( &pNew->vObjs, pObj, i ) { If_DsdObjForEachFaninLit( &pNew->vObjs, pObj, iFanin, k ) @@ -1203,10 +1205,14 @@ void If_DsdManMerge( If_DsdMan_t * p, If_DsdMan_t * pNew ) Id = If_DsdObjFindOrAdd( p, pObj->Type, pFanins, pObj->nFans, pObj->Type == IF_DSD_PRIME ? If_DsdObjTruth(pNew, pObj) : NULL ); if ( pObj->fMark ) If_DsdVecObjSetMark( &p->vObjs, Id ); + if ( p->vPerms && pNew->vPerms && i < Vec_WrdSize(pNew->vPerms) ) + Vec_WrdFillExtra( p->vPerms, Id, Vec_WrdEntry(pNew->vPerms, i) ); Vec_IntPush( vMap, Id ); } assert( Vec_IntSize(vMap) == Vec_PtrSize(&pNew->vObjs) ); Vec_IntFree( vMap ); + if ( p->vPerms && pNew->vPerms ) + Vec_WrdShrink( p->vPerms, Vec_PtrSize(&p->vObjs) ); } void If_DsdManCleanOccur( If_DsdMan_t * p, int fVerbose ) { @@ -1220,6 +1226,7 @@ void If_DsdManCleanMarks( If_DsdMan_t * p, int fVerbose ) If_DsdObj_t * pObj; int i; ABC_FREE( p->pCellStr ); + Vec_WrdFreeP( &p->vPerms ); If_DsdVecForEachObj( &p->vObjs, pObj, i ) pObj->fMark = 0; } |