diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2019-12-11 20:25:55 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2019-12-11 20:25:55 -0800 |
commit | 4f4b207f2f648808e8feffcc4bfea6e8f7c40734 (patch) | |
tree | 3bfcb61438f30c92c7a7f55f9b033ae9421301bc /src/base/acb | |
parent | 24d9ce6baff9f8155faa5a64873ede0ef58ef924 (diff) | |
download | abc-4f4b207f2f648808e8feffcc4bfea6e8f7c40734.tar.gz abc-4f4b207f2f648808e8feffcc4bfea6e8f7c40734.tar.bz2 abc-4f4b207f2f648808e8feffcc4bfea6e8f7c40734.zip |
Bug fix in recently modified code.
Diffstat (limited to 'src/base/acb')
-rw-r--r-- | src/base/acb/acbUtil.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/base/acb/acbUtil.c b/src/base/acb/acbUtil.c index 11ff6163..17c32485 100644 --- a/src/base/acb/acbUtil.c +++ b/src/base/acb/acbUtil.c @@ -587,21 +587,23 @@ Vec_Int_t * Acb_NtkCollectCopies( Acb_Ntk_t * p, Gia_Man_t * pGia, Vec_Ptr_t ** Vec_Int_t * vObjs = Acb_NtkFindNodes2( p ); Vec_Int_t * vNodes = Vec_IntAlloc( Acb_NtkObjNum(p) ); Vec_Ptr_t * vNodesR = Vec_PtrStart( Gia_ManObjNum(pGia) ); + Vec_Bit_t * vDriver = Vec_BitStart( Acb_NtkObjNum(p) ); + Gia_ManForEachCoId( pGia, iObj, i ) + { + Vec_BitWriteEntry( vDriver, Gia_ObjFaninId0(Gia_ManObj(pGia, iObj), iObj), 1 ); + Vec_PtrWriteEntry( vNodesR, iObj, Abc_UtilStrsav(Acb_ObjNameStr(p, Acb_NtkCo(p, i))) ); + Vec_IntPush( vNodes, iObj ); + } Vec_IntForEachEntry( vObjs, iObj, i ) if ( (iLit = Acb_ObjCopy(p, iObj)) >= 0 && Gia_ObjIsAnd(Gia_ManObj(pGia, Abc_Lit2Var(iLit))) ) { - if ( Vec_PtrEntry(vNodesR, Abc_Lit2Var(iLit)) == NULL ) + if ( !Vec_BitEntry(vDriver, Abc_Lit2Var(iLit)) && Vec_PtrEntry(vNodesR, Abc_Lit2Var(iLit)) == NULL ) { Vec_PtrWriteEntry( vNodesR, Abc_Lit2Var(iLit), Abc_UtilStrsav(Acb_ObjNameStr(p, iObj)) ); Vec_IntPush( vNodes, Abc_Lit2Var(iLit) ); } } - // create POs - Gia_ManForEachCoId( pGia, iObj, i ) - { - Vec_PtrWriteEntry( vNodesR, iObj, Abc_UtilStrsav(Acb_ObjNameStr(p, Acb_NtkCo(p, i))) ); - Vec_IntPush( vNodes, iObj ); - } + Vec_BitFree( vDriver ); Vec_IntFree( vObjs ); Vec_IntSort( vNodes, 0 ); *pvNodesR = vNodesR; |