Commit a4f80c1d by Alan Mishchenko

Cleaning up buffering code.

parent 89cab3ad
...@@ -122,8 +122,6 @@ clk = Abc_Clock(); ...@@ -122,8 +122,6 @@ clk = Abc_Clock();
continue; continue;
if ( i > Notches ) if ( i > Notches )
break; break;
// if ( p->vInDrive && !Abc_SclInputDriveOk( p, pObj, pCellNew ) )
// continue;
// set new cell // set new cell
Abc_SclObjSetCell( pObj, pCellNew ); Abc_SclObjSetCell( pObj, pCellNew );
Abc_SclUpdateLoad( p, pObj, pCellOld, pCellNew ); Abc_SclUpdateLoad( p, pObj, pCellOld, pCellNew );
......
...@@ -813,126 +813,6 @@ void Abc_SclPrintBuffers( SC_Lib * pLib, Abc_Ntk_t * pNtk, int fVerbose ) ...@@ -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 /// /// END OF FILE ///
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
......
...@@ -571,7 +571,6 @@ extern void Abc_SclTimeIncInsert( SC_Man * p, Abc_Obj_t * pObj ); ...@@ -571,7 +571,6 @@ extern void Abc_SclTimeIncInsert( SC_Man * p, Abc_Obj_t * pObj );
extern void Abc_SclTimeIncUpdateLevel( Abc_Obj_t * pObj ); extern void Abc_SclTimeIncUpdateLevel( Abc_Obj_t * pObj );
extern void Abc_SclTimePerform( SC_Lib * pLib, Abc_Ntk_t * pNtk, int nTreeCRatio, int fUseWireLoads, int fShowAll, int fPrintPath, int fDumpStats ); extern void Abc_SclTimePerform( SC_Lib * pLib, Abc_Ntk_t * pNtk, int nTreeCRatio, int fUseWireLoads, int fShowAll, int fPrintPath, int fDumpStats );
extern void Abc_SclPrintBuffers( SC_Lib * pLib, Abc_Ntk_t * pNtk, int fVerbose ); extern void Abc_SclPrintBuffers( SC_Lib * pLib, Abc_Ntk_t * pNtk, int fVerbose );
extern int Abc_SclInputDriveOk( SC_Man * p, Abc_Obj_t * pObj, SC_Cell * pCell );
/*=== sclUpsize.c ===============================================================*/ /*=== sclUpsize.c ===============================================================*/
extern int Abc_SclCountNearCriticalNodes( SC_Man * p ); extern int Abc_SclCountNearCriticalNodes( SC_Man * p );
extern void Abc_SclUpsizePerform( SC_Lib * pLib, Abc_Ntk_t * pNtk, SC_SizePars * pPars ); extern void Abc_SclUpsizePerform( SC_Lib * pLib, Abc_Ntk_t * pNtk, SC_SizePars * pPars );
......
...@@ -291,8 +291,6 @@ int Abc_SclFindBestCell( SC_Man * p, Abc_Obj_t * pObj, Vec_Int_t * vRecalcs, Vec ...@@ -291,8 +291,6 @@ int Abc_SclFindBestCell( SC_Man * p, Abc_Obj_t * pObj, Vec_Int_t * vRecalcs, Vec
continue; continue;
if ( k > Notches ) if ( k > Notches )
break; break;
// if ( p->vInDrive && !Abc_SclInputDriveOk( p, pObj, pCellNew ) )
// continue;
// set new cell // set new cell
Abc_SclObjSetCell( pObj, pCellNew ); Abc_SclObjSetCell( pObj, pCellNew );
Abc_SclUpdateLoad( p, pObj, pCellOld, pCellNew ); Abc_SclUpdateLoad( p, pObj, pCellOld, pCellNew );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment