diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2013-05-25 22:13:46 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2013-05-25 22:13:46 -0700 |
commit | 8e639c3d79224a471d14ac4a34a6a21902157eda (patch) | |
tree | 7f1d710ad80c8f551377ac96e13156fd69c4aa9f /src/base/abci/abcMfs.c | |
parent | 94a75fe6d8f8709603dbf9e5bf959174dc3342ac (diff) | |
download | abc-8e639c3d79224a471d14ac4a34a6a21902157eda.tar.gz abc-8e639c3d79224a471d14ac4a34a6a21902157eda.tar.bz2 abc-8e639c3d79224a471d14ac4a34a6a21902157eda.zip |
New command 'putontop' to concatenate networks for don't-care-based optimization.
Diffstat (limited to 'src/base/abci/abcMfs.c')
-rw-r--r-- | src/base/abci/abcMfs.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/src/base/abci/abcMfs.c b/src/base/abci/abcMfs.c index 7953be15..3368fe5d 100644 --- a/src/base/abci/abcMfs.c +++ b/src/base/abci/abcMfs.c @@ -63,6 +63,24 @@ Vec_Ptr_t * Abc_NtkAssignIDs( Abc_Ntk_t * pNtk ) pObj->iTemp = Abc_NtkPiNum(pNtk) + Vec_PtrSize(vNodes) + i; return vNodes; } +Vec_Ptr_t * Abc_NtkAssignIDs2( Abc_Ntk_t * pNtk ) +{ + Vec_Ptr_t * vNodes; + Abc_Obj_t * pObj; + int i; + Abc_NtkCleanCopy( pNtk ); + Abc_NtkForEachPi( pNtk, pObj, i ) + pObj->iTemp = i; + vNodes = Vec_PtrAlloc( Abc_NtkNodeNum(pNtk) ); + Abc_NtkForEachNode( pNtk, pObj, i ) + { + Vec_PtrPush( vNodes, pObj ); + pObj->iTemp = Abc_NtkPiNum(pNtk) + i; + } + Abc_NtkForEachPo( pNtk, pObj, i ) + pObj->iTemp = Abc_NtkPiNum(pNtk) + Vec_PtrSize(vNodes) + i; + return vNodes; +} /**Function************************************************************* @@ -75,7 +93,7 @@ Vec_Ptr_t * Abc_NtkAssignIDs( Abc_Ntk_t * pNtk ) SeeAlso [] ***********************************************************************/ -Sfm_Ntk_t * Abc_NtkExtractMfs( Abc_Ntk_t * pNtk ) +Sfm_Ntk_t * Abc_NtkExtractMfs( Abc_Ntk_t * pNtk, int nFirstFixed ) { Vec_Ptr_t * vNodes; Vec_Wec_t * vFanins; @@ -84,7 +102,7 @@ Sfm_Ntk_t * Abc_NtkExtractMfs( Abc_Ntk_t * pNtk ) Vec_Int_t * vArray; Abc_Obj_t * pObj, * pFanin; int i, k, nObjs; - vNodes = Abc_NtkAssignIDs( pNtk ); + vNodes = nFirstFixed ? Abc_NtkAssignIDs2(pNtk) : Abc_NtkAssignIDs(pNtk); nObjs = Abc_NtkPiNum(pNtk) + Vec_PtrSize(vNodes) + Abc_NtkPoNum(pNtk); vFanins = Vec_WecStart( nObjs ); vFixed = Vec_StrStart( nObjs ); @@ -105,6 +123,10 @@ Sfm_Ntk_t * Abc_NtkExtractMfs( Abc_Ntk_t * pNtk ) Vec_IntPush( vArray, pFanin->iTemp ); } Vec_PtrFree( vNodes ); + // update fixed + assert( nFirstFixed >= 0 && nFirstFixed < Abc_NtkNodeNum(pNtk) ); + for ( i = Abc_NtkPiNum(pNtk); i < Abc_NtkPiNum(pNtk) + nFirstFixed; i++ ) + Vec_StrWriteEntry( vFixed, i, (char)1 ); return Sfm_NtkConstruct( vFanins, Abc_NtkPiNum(pNtk), Abc_NtkPoNum(pNtk), vFixed, vTruths ); } @@ -193,7 +215,7 @@ int Abc_NtkPerformMfs( Abc_Ntk_t * pNtk, Sfm_Par_t * pPars ) return 0; } // collect information - p = Abc_NtkExtractMfs( pNtk ); + p = Abc_NtkExtractMfs( pNtk, pPars->nFirstFixed ); // perform optimization nNodes = Sfm_NtkPerform( p, pPars ); // call the fast extract procedure |