diff options
Diffstat (limited to 'src/aig/llb/llb1Man.c')
-rw-r--r-- | src/aig/llb/llb1Man.c | 45 |
1 files changed, 37 insertions, 8 deletions
diff --git a/src/aig/llb/llb1Man.c b/src/aig/llb/llb1Man.c index d9c13a76..f5de25e0 100644 --- a/src/aig/llb/llb1Man.c +++ b/src/aig/llb/llb1Man.c @@ -47,9 +47,13 @@ void Llb_ManPrepareVarMap( Llb_Man_t * p ) Aig_Obj_t * pObjLi, * pObjLo; int i, iVarLi, iVarLo; assert( p->vNs2Glo == NULL ); + assert( p->vCs2Glo == NULL ); assert( p->vGlo2Cs == NULL ); + assert( p->vGlo2Ns == NULL ); p->vNs2Glo = Vec_IntStartFull( Vec_IntSize(p->vVar2Obj) ); + p->vCs2Glo = Vec_IntStartFull( Vec_IntSize(p->vVar2Obj) ); p->vGlo2Cs = Vec_IntStartFull( Aig_ManRegNum(p->pAig) ); + p->vGlo2Ns = Vec_IntStartFull( Aig_ManRegNum(p->pAig) ); Saig_ManForEachLiLo( p->pAig, pObjLi, pObjLo, i ) { iVarLi = Vec_IntEntry(p->vObj2Var, Aig_ObjId(pObjLi)); @@ -57,7 +61,16 @@ void Llb_ManPrepareVarMap( Llb_Man_t * p ) assert( iVarLi >= 0 && iVarLi < Vec_IntSize(p->vVar2Obj) ); assert( iVarLo >= 0 && iVarLo < Vec_IntSize(p->vVar2Obj) ); Vec_IntWriteEntry( p->vNs2Glo, iVarLi, i ); + Vec_IntWriteEntry( p->vCs2Glo, iVarLo, i ); Vec_IntWriteEntry( p->vGlo2Cs, i, iVarLo ); + Vec_IntWriteEntry( p->vGlo2Ns, i, iVarLi ); + } + // add mapping of the PIs + Saig_ManForEachPi( p->pAig, pObjLo, i ) + { + iVarLo = Vec_IntEntry(p->vObj2Var, Aig_ObjId(pObjLo)); + Vec_IntWriteEntry( p->vCs2Glo, iVarLo, Aig_ManRegNum(p->pAig)+i ); + Vec_IntWriteEntry( p->vNs2Glo, iVarLo, Aig_ManRegNum(p->pAig)+i ); } } @@ -117,6 +130,7 @@ void Llb_ManPrepareVarLimits( Llb_Man_t * p ) void Llb_ManStop( Llb_Man_t * p ) { Llb_Grp_t * pGrp; + DdNode * bTemp; int i; // Vec_IntFreeP( &p->vMem ); @@ -128,25 +142,39 @@ void Llb_ManStop( Llb_Man_t * p ) Llb_MtrFree( p->pMatrix ); Vec_PtrForEachEntry( Llb_Grp_t *, p->vGroups, pGrp, i ) Llb_ManGroupStop( pGrp ); - Vec_PtrFreeP( &p->vGroups ); - Vec_IntFreeP( &p->vVar2Obj ); - Vec_IntFreeP( &p->vObj2Var ); - Vec_IntFreeP( &p->vVarBegs ); - Vec_IntFreeP( &p->vVarEnds ); - Vec_IntFreeP( &p->vNs2Glo ); - Vec_IntFreeP( &p->vGlo2Cs ); -// Vec_IntFreeP( &p->vHints ); if ( p->dd ) { +// printf( "Manager dd\n" ); Extra_StopManager( p->dd ); } if ( p->ddG ) { +// printf( "Manager ddG\n" ); if ( p->ddG->bFunc ) Cudd_RecursiveDeref( p->ddG, p->ddG->bFunc ); Extra_StopManager( p->ddG ); } + if ( p->ddR ) + { +// printf( "Manager ddR\n" ); + if ( p->ddR->bFunc ) + Cudd_RecursiveDeref( p->ddR, p->ddR->bFunc ); + Vec_PtrForEachEntry( DdNode *, p->vRings, bTemp, i ) + Cudd_RecursiveDeref( p->ddR, bTemp ); + Extra_StopManager( p->ddR ); + } Aig_ManStop( p->pAig ); + Vec_PtrFreeP( &p->vGroups ); + Vec_IntFreeP( &p->vVar2Obj ); + Vec_IntFreeP( &p->vObj2Var ); + Vec_IntFreeP( &p->vVarBegs ); + Vec_IntFreeP( &p->vVarEnds ); + Vec_PtrFreeP( &p->vRings ); + Vec_IntFreeP( &p->vNs2Glo ); + Vec_IntFreeP( &p->vCs2Glo ); + Vec_IntFreeP( &p->vGlo2Cs ); + Vec_IntFreeP( &p->vGlo2Ns ); +// Vec_IntFreeP( &p->vHints ); ABC_FREE( p ); } @@ -172,6 +200,7 @@ Llb_Man_t * Llb_ManStart( Aig_Man_t * pAigGlo, Aig_Man_t * pAig, Gia_ParLlb_t * p->pAig = pAig; p->vVar2Obj = Llb_ManMarkPivotNodes( p->pAig, pPars->fUsePivots ); p->vObj2Var = Vec_IntInvert( p->vVar2Obj, -1 ); + p->vRings = Vec_PtrAlloc( 100 ); Llb_ManPrepareVarMap( p ); Llb_ManPrepareGroups( p ); Aig_ManCleanMarkA( pAig ); |