diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2012-09-23 12:01:59 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2012-09-23 12:01:59 -0700 |
commit | 6e774ef541114d1cff4926192dc5221c4f43c52e (patch) | |
tree | 04e98076be710d59ab018299ac535775cc0e43b7 /src/base/abci | |
parent | a50a38155cd4e99e76775c36987e8bc41c61f0c6 (diff) | |
download | abc-6e774ef541114d1cff4926192dc5221c4f43c52e.tar.gz abc-6e774ef541114d1cff4926192dc5221c4f43c52e.tar.bz2 abc-6e774ef541114d1cff4926192dc5221c4f43c52e.zip |
Cleaing AIG manager by removing pointers to HAIG.
Diffstat (limited to 'src/base/abci')
-rw-r--r-- | src/base/abci/abcBalance.c | 3 | ||||
-rw-r--r-- | src/base/abci/abcHaig.c | 181 | ||||
-rw-r--r-- | src/base/abci/abcPart.c | 1 | ||||
-rw-r--r-- | src/base/abci/module.make | 2 |
4 files changed, 1 insertions, 186 deletions
diff --git a/src/base/abci/abcBalance.c b/src/base/abci/abcBalance.c index 2c391e89..9807997c 100644 --- a/src/base/abci/abcBalance.c +++ b/src/base/abci/abcBalance.c @@ -277,9 +277,6 @@ Abc_Obj_t * Abc_NodeBalance_rec( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNodeOld, Vec_ // if ( Abc_ObjRegular(pNodeOld->pCopy) == Abc_AigConst1(pNtkNew) ) // printf( "Constant node\n" ); // assert( pNodeOld->Level >= Abc_ObjRegular(pNodeOld->pCopy)->Level ); - // update HAIG -// if ( Abc_ObjRegular(pNodeOld->pCopy)->pNtk->pHaig ) -// Hop_ObjCreateChoice( pNodeOld->pEquiv, Abc_ObjRegular(pNodeOld->pCopy)->pEquiv ); return pNodeOld->pCopy; } diff --git a/src/base/abci/abcHaig.c b/src/base/abci/abcHaig.c index d6c0ddad..02547de1 100644 --- a/src/base/abci/abcHaig.c +++ b/src/base/abci/abcHaig.c @@ -31,129 +31,6 @@ ABC_NAMESPACE_IMPL_START /// FUNCTION DEFINITIONS /// //////////////////////////////////////////////////////////////////////// -#if 0 - -/**Function************************************************************* - - Synopsis [Start history AIG.] - - Description [] - - SideEffects [] - - SeeAlso [] - -***********************************************************************/ -int Abc_NtkHaigStart( Abc_Ntk_t * pNtk ) -{ - Hop_Man_t * p; - Abc_Obj_t * pObj, * pTemp; - int i; - assert( Abc_NtkIsStrash(pNtk) ); - // check if the package is already started - if ( pNtk->pHaig ) - { - Abc_NtkHaigStop( pNtk ); - assert( pNtk->pHaig == NULL ); - printf( "Warning: Previous history AIG was removed.\n" ); - } - // make sure the data is clean - Abc_NtkForEachObj( pNtk, pObj, i ) - assert( pObj->pEquiv == NULL ); - // start the HOP package - p = Hop_ManStart(); - p->vObjs = Vec_PtrAlloc( 4096 ); - Vec_PtrPush( p->vObjs, Hop_ManConst1(p) ); - // map the constant node - Abc_AigConst1(pNtk)->pEquiv = Hop_ManConst1(p); - // map the CIs - Abc_NtkForEachCi( pNtk, pObj, i ) - pObj->pEquiv = Hop_ObjCreatePi(p); - // map the internal nodes - Abc_NtkForEachNode( pNtk, pObj, i ) - pObj->pEquiv = Hop_And( p, Abc_ObjChild0Equiv(pObj), Abc_ObjChild1Equiv(pObj) ); - // map the choice nodes - if ( Abc_NtkGetChoiceNum( pNtk ) ) - { - // print warning about choice nodes - printf( "Warning: The choice nodes in the original AIG are converted into HAIG.\n" ); - Abc_NtkForEachNode( pNtk, pObj, i ) - { - if ( !Abc_AigNodeIsChoice( pObj ) ) - continue; - for ( pTemp = pObj->pData; pTemp; pTemp = pTemp->pData ) - Hop_ObjCreateChoice( pObj->pEquiv, pTemp->pEquiv ); - } - } - // make sure everything is okay - if ( !Hop_ManCheck(p) ) - { - printf( "Abc_NtkHaigStart: Check for History AIG has failed.\n" ); - Hop_ManStop(p); - return 0; - } - pNtk->pHaig = p; - return 1; -} - -/**Function************************************************************* - - Synopsis [Stops history AIG.] - - Description [] - - SideEffects [] - - SeeAlso [] - -***********************************************************************/ -int Abc_NtkHaigStop( Abc_Ntk_t * pNtk ) -{ - Abc_Obj_t * pObj; - int i; - assert( Abc_NtkIsStrash(pNtk) ); - if ( pNtk->pHaig == NULL ) - { - printf( "Warning: History AIG is not allocated.\n" ); - return 1; - } - Abc_NtkForEachObj( pNtk, pObj, i ) - pObj->pEquiv = NULL; - Hop_ManStop( pNtk->pHaig ); - pNtk->pHaig = NULL; - return 1; -} - -/**Function************************************************************* - - Synopsis [Transfers the HAIG to the new network.] - - Description [] - - SideEffects [] - - SeeAlso [] - -***********************************************************************/ -void Abc_NtkHaigTranfer( Abc_Ntk_t * pNtkOld, Abc_Ntk_t * pNtkNew ) -{ - Abc_Obj_t * pObj; - int i; - if ( pNtkOld->pHaig == NULL ) - return; - // transfer the package - assert( pNtkNew->pHaig == NULL ); - pNtkNew->pHaig = pNtkOld->pHaig; - pNtkOld->pHaig = NULL; - // transfer constant pointer - Abc_AigConst1(pNtkOld)->pCopy->pEquiv = Abc_AigConst1(pNtkOld)->pEquiv; - // transfer the CI pointers - Abc_NtkForEachCi( pNtkOld, pObj, i ) - pObj->pCopy->pEquiv = pObj->pEquiv; -} - - -#endif /**Function************************************************************* @@ -642,64 +519,6 @@ int Abc_NtkHaigResetReprs( Hop_Man_t * p ) return nFanouts; } -#if 0 - -/**Function************************************************************* - - Synopsis [Stops history AIG.] - - Description [] - - SideEffects [] - - SeeAlso [] - -***********************************************************************/ -Abc_Ntk_t * Abc_NtkHaigUse( Abc_Ntk_t * pNtk ) -{ - Hop_Man_t * pMan, * pManTemp; - Abc_Ntk_t * pNtkAig; - Abc_Obj_t * pObj; - int i; - - // check if HAIG is available - assert( Abc_NtkIsStrash(pNtk) ); - if ( pNtk->pHaig == NULL ) - { - printf( "Warning: History AIG is not available.\n" ); - return NULL; - } - // convert HOP package into AIG with choices - // print HAIG stats -// Hop_ManPrintStats( pMan ); // USES DATA!!! - - // add the POs - Abc_NtkForEachCo( pNtk, pObj, i ) - Hop_ObjCreatePo( pNtk->pHaig, Abc_ObjChild0Equiv(pObj) ); - - // clean the old network - Abc_NtkForEachObj( pNtk, pObj, i ) - pObj->pEquiv = NULL; - pMan = pNtk->pHaig; - pNtk->pHaig = 0; - - // iteratively reconstruct the HOP manager to create choice nodes - while ( Abc_NtkHaigResetReprs( pMan ) ) - { - pMan = Abc_NtkHaigReconstruct( pManTemp = pMan ); - Hop_ManStop( pManTemp ); - } - - // traverse in the topological order and create new AIG - pNtkAig = Abc_NtkHaigRecreateAig( pNtk, pMan ); - Hop_ManStop( pMan ); - - // free HAIG - return pNtkAig; -} - -#endif - /**Function************************************************************* Synopsis [Transform HOP manager into the one without loops.] diff --git a/src/base/abci/abcPart.c b/src/base/abci/abcPart.c index 779c5c7e..c68e0729 100644 --- a/src/base/abci/abcPart.c +++ b/src/base/abci/abcPart.c @@ -1000,7 +1000,6 @@ Hop_Man_t * Abc_NtkPartStartHop( Abc_Ntk_t * pNtk ) Abc_Ntk_t * Abc_NtkPartStitchChoices( Abc_Ntk_t * pNtk, Vec_Ptr_t * vParts ) { extern Abc_Ntk_t * Abc_NtkHopRemoveLoops( Abc_Ntk_t * pNtk, Hop_Man_t * pMan ); - Hop_Man_t * pMan; Vec_Ptr_t * vNodes; Abc_Ntk_t * pNtkNew, * pNtkTemp; diff --git a/src/base/abci/module.make b/src/base/abci/module.make index e25e497d..cb57acaa 100644 --- a/src/base/abci/module.make +++ b/src/base/abci/module.make @@ -21,7 +21,7 @@ SRC += src/base/abci/abc.c \ src/base/abci/abcFraig.c \ src/base/abci/abcFxu.c \ src/base/abci/abcGen.c \ - src/base/abci/abcHaig.c \ + src/base/abci/abcHaig.c \ src/base/abci/abcIf.c \ src/base/abci/abcIfif.c \ src/base/abci/abcIfMux.c \ |