From a4f80c1d36ee2ea986ac3fd637aa91f97537cdb6 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Sun, 13 Oct 2013 21:05:35 -0700 Subject: Cleaning up buffering code. --- src/map/scl/sclSize.c | 120 -------------------------------------------------- 1 file changed, 120 deletions(-) (limited to 'src/map/scl/sclSize.c') diff --git a/src/map/scl/sclSize.c b/src/map/scl/sclSize.c index 37dca670..70f8e1a6 100644 --- a/src/map/scl/sclSize.c +++ b/src/map/scl/sclSize.c @@ -813,126 +813,6 @@ void Abc_SclPrintBuffers( SC_Lib * pLib, Abc_Ntk_t * pNtk, int fVerbose ) } -/**Function************************************************************* - - Synopsis [Checks if the input drive capability is ok.] - - Description [] - - SideEffects [] - - SeeAlso [] - -***********************************************************************/ -int Abc_SclInputDriveOk( SC_Man * p, Abc_Obj_t * pObj, SC_Cell * pCell ) -{ - Abc_Obj_t * pFanin; - int i; - assert( Abc_ObjFaninNum(pObj) == pCell->n_inputs ); - Abc_ObjForEachFanin( pObj, pFanin, i ) - if ( Abc_ObjIsPi(pFanin) && Abc_SclObjInDrive(p, pFanin) > 0 && - (Abc_SclObjInDrive(p, pFanin) / Abc_ObjFanoutNum(pFanin)) < SC_CellPinCap( pCell, i ) ) - return 0; - return 1; -} - -/**Function************************************************************* - - Synopsis [Select nodes that need to be buffered.] - - Description [] - - SideEffects [] - - SeeAlso [] - -***********************************************************************/ -Vec_Wec_t * Abc_SclSelectSplitNodes( SC_Man * p, Abc_Ntk_t * pNtk ) -{ - Vec_Wec_t * vSplits; - Vec_Int_t * vCrits, * vNonCrits, * vLevel; - Abc_Obj_t * pObj, * pFanout; - int i, k; - assert( p->EstLoadMax > 0 ); - vCrits = Vec_IntAlloc( 1000 ); - vNonCrits = Vec_IntAlloc( 1000 ); - vSplits = Vec_WecAlloc( 1000 ); - Abc_NtkForEachNodeCi( pNtk, pObj, i ) - { - if ( Abc_SclObjLoadValue(p, pObj) < 1 ) - { -// printf( "%d ", Abc_ObjFanoutNum(pObj) ); - continue; - } -/* - printf( "%d : %.0f ", i, 0.5 * (Abc_SclObjLoad(p, pObj)->fall + Abc_SclObjLoad(p, pObj)->rise) ); - Abc_ObjForEachFanout( pObj, pFanout, k ) - printf( "%.1f ", SC_CellPinCapAve(Abc_SclObjCell(pFanout)) ); - printf( "\n" ); -*/ - // skip non-critical nodes -// if ( Abc_SclObjSlack(p, pObj) > 100 ) -// continue; - // collect non-critical fanouts of the node - Vec_IntClear( vCrits ); - Vec_IntClear( vNonCrits ); - Abc_ObjForEachFanout( pObj, pFanout, k ) - if ( Abc_SclObjGetSlack(p, pFanout, p->MaxDelay0) < 100 ) - Vec_IntPush( vCrits, Abc_ObjId(pFanout) ); - else - Vec_IntPush( vNonCrits, Abc_ObjId(pFanout) ); -// assert( Vec_IntSize(vNonCrits) < Abc_ObjFanoutNum(pObj) ); - // skip if there is nothing to split -// if ( Vec_IntSize(vNonCrits) < 2 ) -// continue; - // remember them - vLevel = Vec_WecPushLevel( vSplits ); - Vec_IntPush( vLevel, i ); - Vec_IntAppend( vLevel, vCrits ); - // remember them - vLevel = Vec_WecPushLevel( vSplits ); - Vec_IntPush( vLevel, i ); - Vec_IntAppend( vLevel, vNonCrits ); - } - Vec_IntFree( vCrits ); - Vec_IntFree( vNonCrits ); - // print out - printf( "Collected %d nodes to split.\n", Vec_WecSize(vSplits) ); - return vSplits; -} -void Abc_SclPerformSplit( SC_Man * p, Abc_Ntk_t * pNtk, Vec_Wec_t * vSplits ) -{ - Abc_Obj_t * pObj, * pObjInv, * pFanout; - Vec_Int_t * vLevel; - int i, k; - assert( pNtk->vPhases != NULL ); - Vec_WecForEachLevel( vSplits, vLevel, i ) - { - pObj = Abc_NtkObj( pNtk, Vec_IntEntry(vLevel, 0) ); - pObjInv = Abc_NtkCreateNodeInv( pNtk, pObj ); - Abc_NtkForEachObjVecStart( vLevel, pNtk, pFanout, k, 1 ) - { - Abc_ObjFaninFlipPhase( pFanout, Abc_NodeFindFanin(pFanout, pObj) ); - Abc_ObjPatchFanin( pFanout, pObj, pObjInv ); - } - } - Vec_IntFillExtra( pNtk->vPhases, Abc_NtkObjNumMax(pNtk), 0 ); -} -Abc_Ntk_t * Abc_SclBuffSizeStep( SC_Lib * pLib, Abc_Ntk_t * pNtk, int nTreeCRatio, int fUseWireLoads ) -{ - SC_Man * p; - Vec_Wec_t * vSplits; - p = Abc_SclManStart( pLib, pNtk, fUseWireLoads, 1, 0, nTreeCRatio ); - Abc_SclTimeNtkPrint( p, 0, 0 ); - if ( p->nEstNodes ) - printf( "Estimated nodes = %d.\n", p->nEstNodes ); - vSplits = Abc_SclSelectSplitNodes( p, pNtk ); - Abc_SclPerformSplit( p, pNtk, vSplits ); - Vec_WecFree( vSplits ); - Abc_SclManFree( p ); - return Abc_NtkDupDfs( pNtk ); -} - //////////////////////////////////////////////////////////////////////// /// END OF FILE /// //////////////////////////////////////////////////////////////////////// -- cgit v1.2.3