diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2014-12-21 22:22:31 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2014-12-21 22:22:31 -0800 |
commit | 58d28539a7bfaa4edfa6a549c0802cb4a2aabe41 (patch) | |
tree | 3dbf8ad3467a7e468993f6cf42a1648c21f91b72 /src/base | |
parent | fa32acde61bed1ce9bfaaeb98b95e4ad6144da2c (diff) | |
download | abc-58d28539a7bfaa4edfa6a549c0802cb4a2aabe41.tar.gz abc-58d28539a7bfaa4edfa6a549c0802cb4a2aabe41.tar.bz2 abc-58d28539a7bfaa4edfa6a549c0802cb4a2aabe41.zip |
Gate sizing with barrier buffers.
Diffstat (limited to 'src/base')
-rw-r--r-- | src/base/abc/abc.h | 2 | ||||
-rw-r--r-- | src/base/abc/abcDfs.c | 25 | ||||
-rw-r--r-- | src/base/abc/abcNtk.c | 44 |
3 files changed, 71 insertions, 0 deletions
diff --git a/src/base/abc/abc.h b/src/base/abc/abc.h index 6e5f3301..d684d3df 100644 --- a/src/base/abc/abc.h +++ b/src/base/abc/abc.h @@ -610,6 +610,7 @@ extern ABC_DLL Abc_Ntk_t * Abc_NtkDarLatchSweep( Abc_Ntk_t * pNtk, int fL extern ABC_DLL float Abc_NtkDelayTraceLut( Abc_Ntk_t * pNtk, int fUseLutLib ); /*=== abcDfs.c ==========================================================*/ extern ABC_DLL Vec_Ptr_t * Abc_NtkDfs( Abc_Ntk_t * pNtk, int fCollectAll ); +extern ABC_DLL Vec_Ptr_t * Abc_NtkDfs2( Abc_Ntk_t * pNtk ); extern ABC_DLL Vec_Ptr_t * Abc_NtkDfsNodes( Abc_Ntk_t * pNtk, Abc_Obj_t ** ppNodes, int nNodes ); extern ABC_DLL Vec_Ptr_t * Abc_NtkDfsReverse( Abc_Ntk_t * pNtk ); extern ABC_DLL Vec_Ptr_t * Abc_NtkDfsReverseNodes( Abc_Ntk_t * pNtk, Abc_Obj_t ** ppNodes, int nNodes ); @@ -755,6 +756,7 @@ extern ABC_DLL Abc_Ntk_t * Abc_NtkStartRead( char * pName ); extern ABC_DLL void Abc_NtkFinalizeRead( Abc_Ntk_t * pNtk ); extern ABC_DLL Abc_Ntk_t * Abc_NtkDup( Abc_Ntk_t * pNtk ); extern ABC_DLL Abc_Ntk_t * Abc_NtkDupDfs( Abc_Ntk_t * pNtk ); +extern ABC_DLL Abc_Ntk_t * Abc_NtkDupDfsNoBarBufs( Abc_Ntk_t * pNtk ); extern ABC_DLL Abc_Ntk_t * Abc_NtkDupTransformMiter( Abc_Ntk_t * pNtk ); extern ABC_DLL Abc_Ntk_t * Abc_NtkCreateCone( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode, char * pNodeName, int fUseAllCis ); extern ABC_DLL Abc_Ntk_t * Abc_NtkCreateConeArray( Abc_Ntk_t * pNtk, Vec_Ptr_t * vRoots, int fUseAllCis ); diff --git a/src/base/abc/abcDfs.c b/src/base/abc/abcDfs.c index 1825087e..9dd2b4bf 100644 --- a/src/base/abc/abcDfs.c +++ b/src/base/abc/abcDfs.c @@ -110,6 +110,31 @@ Vec_Ptr_t * Abc_NtkDfs( Abc_Ntk_t * pNtk, int fCollectAll ) Synopsis [Returns the DFS ordered array of logic nodes.] + Description [Collects only the internal nodes, leaving out CIs and CO. + However it marks with the current TravId both CIs and COs.] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +Vec_Ptr_t * Abc_NtkDfs2( Abc_Ntk_t * pNtk ) +{ + Vec_Ptr_t * vNodes = Vec_PtrAlloc( 100 ); + Abc_Obj_t * pObj; int i; + Abc_NtkIncrementTravId( pNtk ); + Abc_NtkForEachCo( pNtk, pObj, i ) + { + Abc_NodeSetTravIdCurrent( pObj ); + Abc_NtkDfs_rec( Abc_ObjFanin0Ntk(Abc_ObjFanin0(pObj)), vNodes ); + } + return vNodes; +} + +/**Function************************************************************* + + Synopsis [Returns the DFS ordered array of logic nodes.] + Description [Collects only the internal nodes, leaving out PIs, POs and latches.] SideEffects [] diff --git a/src/base/abc/abcNtk.c b/src/base/abc/abcNtk.c index cb52924f..ed00968b 100644 --- a/src/base/abc/abcNtk.c +++ b/src/base/abc/abcNtk.c @@ -513,6 +513,50 @@ Abc_Ntk_t * Abc_NtkDupDfs( Abc_Ntk_t * pNtk ) pNtk->pCopy = pNtkNew; return pNtkNew; } +Abc_Ntk_t * Abc_NtkDupDfsNoBarBufs( Abc_Ntk_t * pNtk ) +{ + Vec_Ptr_t * vNodes; + Abc_Ntk_t * pNtkNew; + Abc_Obj_t * pObj, * pFanin; + int i, k; + if ( pNtk == NULL ) + return NULL; + assert( Abc_NtkIsLogic(pNtk) ); + assert( pNtk->nBarBufs2 > 0 ); + // start the network + pNtkNew = Abc_NtkStartFrom( pNtk, pNtk->ntkType, pNtk->ntkFunc ); + // copy the internal nodes + vNodes = Abc_NtkDfs2( pNtk ); + Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i ) + if ( Abc_ObjIsBarBuf(pObj) ) + pObj->pCopy = Abc_ObjFanin0(pObj)->pCopy; + else + Abc_NtkDupObj( pNtkNew, pObj, 0 ); + Vec_PtrFree( vNodes ); + // reconnect all objects (no need to transfer attributes on edges) + Abc_NtkForEachObj( pNtk, pObj, i ) + if ( !Abc_ObjIsBox(pObj) && !Abc_ObjIsBo(pObj) && !Abc_ObjIsBarBuf(pObj) ) + Abc_ObjForEachFanin( pObj, pFanin, k ) + if ( pObj->pCopy && pFanin->pCopy ) + Abc_ObjAddFanin( pObj->pCopy, pFanin->pCopy ); + // duplicate the EXDC Ntk + if ( pNtk->pExdc ) + pNtkNew->pExdc = Abc_NtkDup( pNtk->pExdc ); + if ( pNtk->pExcare ) + pNtkNew->pExcare = Abc_NtkDup( (Abc_Ntk_t *)pNtk->pExcare ); + // duplicate timing manager + if ( pNtk->pManTime ) + Abc_NtkTimeInitialize( pNtkNew, pNtk ); + if ( pNtk->vPhases ) + Abc_NtkTransferPhases( pNtkNew, pNtk ); + if ( pNtk->pWLoadUsed ) + pNtkNew->pWLoadUsed = Abc_UtilStrsav( pNtk->pWLoadUsed ); + // check correctness + if ( !Abc_NtkCheck( pNtkNew ) ) + fprintf( stdout, "Abc_NtkDup(): Network check has failed.\n" ); + pNtk->pCopy = pNtkNew; + return pNtkNew; +} /**Function************************************************************* |