diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2011-07-02 13:58:12 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2011-07-02 13:58:12 -0700 |
commit | f866920eb5603f60fb087c96607d58c94fb31f28 (patch) | |
tree | b2b92fd38a1c7e79b10ed45baaf13bfa2f8e67bd /src/aig/saig/saigMiter.c | |
parent | 6c2ac7661dc1ea3ddd83617dd247a467e00486de (diff) | |
download | abc-f866920eb5603f60fb087c96607d58c94fb31f28.tar.gz abc-f866920eb5603f60fb087c96607d58c94fb31f28.tar.bz2 abc-f866920eb5603f60fb087c96607d58c94fb31f28.zip |
Added a new demitering feature for dual-output miters.
Diffstat (limited to 'src/aig/saig/saigMiter.c')
-rw-r--r-- | src/aig/saig/saigMiter.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/aig/saig/saigMiter.c b/src/aig/saig/saigMiter.c index 0fdac6cc..be80f545 100644 --- a/src/aig/saig/saigMiter.c +++ b/src/aig/saig/saigMiter.c @@ -696,6 +696,63 @@ int Saig_ManDemiterSimpleDiff( Aig_Man_t * p, Aig_Man_t ** ppAig0, Aig_Man_t ** /**Function************************************************************* + Synopsis [Returns 1 if AIG can be demitered.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +int Saig_ManDemiterDual( Aig_Man_t * p, Aig_Man_t ** ppAig0, Aig_Man_t ** ppAig1 ) +{ + Aig_Man_t * pTemp; + Aig_Obj_t * pObj; + int i, k; + + if ( p->pFanData ) + Aig_ManFanoutStop( p ); + + k = 0; + pTemp = Aig_ManDupSimple( p ); + Saig_ManForEachPo( pTemp, pObj, i ) + { + if ( i & 1 ) + Aig_ObjDeletePo( pTemp, pObj ); + else + Vec_PtrWriteEntry( pTemp->vPos, k++, pObj ); + } + Saig_ManForEachLi( pTemp, pObj, i ) + Vec_PtrWriteEntry( pTemp->vPos, k++, pObj ); + Vec_PtrShrink( pTemp->vPos, k ); + pTemp->nTruePos = k - Saig_ManRegNum(pTemp); + Aig_ManSeqCleanup( pTemp ); + *ppAig0 = Aig_ManDupSimple( pTemp ); + Aig_ManStop( pTemp ); + + k = 0; + pTemp = Aig_ManDupSimple( p ); + Saig_ManForEachPo( pTemp, pObj, i ) + { + if ( i & 1 ) + Vec_PtrWriteEntry( pTemp->vPos, k++, pObj ); + else + Aig_ObjDeletePo( pTemp, pObj ); + } + Saig_ManForEachLi( pTemp, pObj, i ) + Vec_PtrWriteEntry( pTemp->vPos, k++, pObj ); + Vec_PtrShrink( pTemp->vPos, k ); + pTemp->nTruePos = k - Saig_ManRegNum(pTemp); + Aig_ManSeqCleanup( pTemp ); + *ppAig1 = Aig_ManDupSimple( pTemp ); + Aig_ManStop( pTemp ); + + return 1; +} + +/**Function************************************************************* + Synopsis [Duplicates the AIG to have constant-0 initial state.] Description [] |