2012-08-25 06:31:46 +02:00
|
|
|
/**CFile****************************************************************
|
|
|
|
|
|
2012-08-29 04:24:13 +02:00
|
|
|
FileName [sclSize.c]
|
2012-08-25 06:31:46 +02:00
|
|
|
|
|
|
|
|
SystemName [ABC: Logic synthesis and verification system.]
|
|
|
|
|
|
2012-08-30 01:20:39 +02:00
|
|
|
PackageName [Standard-cell library representation.]
|
|
|
|
|
|
|
|
|
|
Synopsis [Gate sizing algorithms.]
|
2012-08-25 06:31:46 +02:00
|
|
|
|
|
|
|
|
Author [Alan Mishchenko, Niklas Een]
|
|
|
|
|
|
|
|
|
|
Affiliation [UC Berkeley]
|
|
|
|
|
|
|
|
|
|
Date [Ver. 1.0. Started - August 24, 2012.]
|
|
|
|
|
|
2012-08-29 04:24:13 +02:00
|
|
|
Revision [$Id: sclSize.c,v 1.0 2012/08/24 00:00:00 alanmi Exp $]
|
2012-08-25 06:31:46 +02:00
|
|
|
|
|
|
|
|
***********************************************************************/
|
|
|
|
|
|
|
|
|
|
#include "sclInt.h"
|
2012-08-29 09:48:36 +02:00
|
|
|
#include "sclMan.h"
|
2012-08-25 06:31:46 +02:00
|
|
|
|
|
|
|
|
ABC_NAMESPACE_IMPL_START
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
/// DECLARATIONS ///
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
/// FUNCTION DEFINITIONS ///
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2012-08-30 20:10:02 +02:00
|
|
|
/**Function*************************************************************
|
|
|
|
|
|
|
|
|
|
Synopsis [Collect nodes in network.]
|
|
|
|
|
|
|
|
|
|
Description []
|
|
|
|
|
|
|
|
|
|
SideEffects []
|
|
|
|
|
|
|
|
|
|
SeeAlso []
|
|
|
|
|
|
|
|
|
|
***********************************************************************/
|
|
|
|
|
Vec_Int_t * Abc_SclCollectNodes( Abc_Ntk_t * p )
|
|
|
|
|
{
|
|
|
|
|
Vec_Int_t * vRes;
|
|
|
|
|
Abc_Obj_t * pObj;
|
|
|
|
|
int i;
|
|
|
|
|
vRes = Vec_IntAlloc( Abc_NtkNodeNum(p) );
|
|
|
|
|
Abc_NtkForEachNode( p, pObj, i )
|
|
|
|
|
Vec_IntPush( vRes, i );
|
|
|
|
|
return vRes;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**Function*************************************************************
|
|
|
|
|
|
|
|
|
|
Synopsis [Collect near-critical CO nodes.]
|
|
|
|
|
|
|
|
|
|
Description []
|
|
|
|
|
|
|
|
|
|
SideEffects []
|
|
|
|
|
|
|
|
|
|
SeeAlso []
|
|
|
|
|
|
|
|
|
|
***********************************************************************/
|
|
|
|
|
Vec_Int_t * Abc_SclFindCriticalCoRange( SC_Man * p, int Range )
|
|
|
|
|
{
|
|
|
|
|
float fMaxArr = Abc_SclGetMaxDelay( p );
|
|
|
|
|
Vec_Int_t * vPivots;
|
|
|
|
|
Abc_Obj_t * pObj;
|
|
|
|
|
int i;
|
|
|
|
|
vPivots = Vec_IntAlloc( 100 );
|
|
|
|
|
Abc_NtkForEachCo( p->pNtk, pObj, i )
|
|
|
|
|
if ( Abc_SclObjTimeMax(p, pObj) >= fMaxArr * (100 - Range) / 100 )
|
|
|
|
|
Vec_IntPush( vPivots, Abc_ObjId(pObj) );
|
|
|
|
|
assert( Vec_IntSize(vPivots) > 0 );
|
|
|
|
|
return vPivots;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**Function*************************************************************
|
|
|
|
|
|
|
|
|
|
Synopsis [Collect nodes in cone.]
|
|
|
|
|
|
|
|
|
|
Description []
|
|
|
|
|
|
|
|
|
|
SideEffects []
|
|
|
|
|
|
|
|
|
|
SeeAlso []
|
|
|
|
|
|
|
|
|
|
***********************************************************************/
|
|
|
|
|
void Abc_SclFindCriticalCone_rec( Abc_Obj_t * pObj, Vec_Int_t * vVisited )
|
|
|
|
|
{
|
|
|
|
|
Abc_Obj_t * pNext;
|
|
|
|
|
int i;
|
|
|
|
|
if ( Abc_ObjIsCi(pObj) )
|
|
|
|
|
return;
|
|
|
|
|
if ( Abc_NodeIsTravIdCurrent( pObj ) )
|
|
|
|
|
return;
|
|
|
|
|
Abc_NodeSetTravIdCurrent( pObj );
|
|
|
|
|
assert( Abc_ObjIsNode(pObj) );
|
|
|
|
|
Abc_ObjForEachFanin( pObj, pNext, i )
|
|
|
|
|
Abc_SclFindCriticalCone_rec( pNext, vVisited );
|
|
|
|
|
Vec_IntPush( vVisited, Abc_ObjId(pObj) );
|
|
|
|
|
}
|
|
|
|
|
Vec_Int_t * Abc_SclFindCriticalCone( SC_Man * p, int Range, Vec_Int_t ** pvPivots )
|
|
|
|
|
{
|
|
|
|
|
Vec_Int_t * vPivots = Abc_SclFindCriticalCoRange( p, Range );
|
|
|
|
|
Vec_Int_t * vPath = Vec_IntAlloc( 100 );
|
|
|
|
|
Abc_Obj_t * pObj;
|
|
|
|
|
int i;
|
|
|
|
|
Abc_NtkIncrementTravId( p->pNtk );
|
|
|
|
|
Abc_NtkForEachObjVec( vPivots, p->pNtk, pObj, i )
|
|
|
|
|
Abc_SclFindCriticalCone_rec( Abc_ObjFanin0(pObj), vPath );
|
|
|
|
|
if ( pvPivots )
|
|
|
|
|
*pvPivots = vPivots;
|
|
|
|
|
else
|
|
|
|
|
Vec_IntFree( vPivots );
|
|
|
|
|
return vPath;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**Function*************************************************************
|
|
|
|
|
|
|
|
|
|
Synopsis [Collect nodes in critical path.]
|
|
|
|
|
|
|
|
|
|
Description []
|
|
|
|
|
|
|
|
|
|
SideEffects []
|
|
|
|
|
|
|
|
|
|
SeeAlso []
|
|
|
|
|
|
|
|
|
|
***********************************************************************/
|
|
|
|
|
Vec_Int_t * Abc_SclFindCriticalPath( SC_Man * p, int Range, Vec_Int_t ** pvPivots )
|
|
|
|
|
{
|
|
|
|
|
Vec_Int_t * vPivots = Abc_SclFindCriticalCoRange( p, Range );
|
|
|
|
|
Vec_Int_t * vPath = Vec_IntAlloc( 100 );
|
|
|
|
|
Abc_Obj_t * pObj;
|
|
|
|
|
int i, fRise = 0;
|
|
|
|
|
Abc_NtkForEachObjVec( vPivots, p->pNtk, pObj, i )
|
|
|
|
|
{
|
|
|
|
|
pObj = Abc_ObjFanin0(pObj);
|
|
|
|
|
while ( pObj && Abc_ObjIsNode(pObj) )
|
|
|
|
|
{
|
|
|
|
|
Vec_IntPush( vPath, Abc_ObjId(pObj) );
|
|
|
|
|
pObj = Abc_SclFindMostCriticalFanin( p, &fRise, pObj );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ( pvPivots )
|
|
|
|
|
*pvPivots = vPivots;
|
|
|
|
|
else
|
|
|
|
|
Vec_IntFree( vPivots );
|
|
|
|
|
return vPath;
|
|
|
|
|
}
|
|
|
|
|
|
2012-08-29 09:48:36 +02:00
|
|
|
/**Function*************************************************************
|
|
|
|
|
|
|
|
|
|
Synopsis [Collect TFO of the fanins of the object.]
|
|
|
|
|
|
|
|
|
|
Description []
|
|
|
|
|
|
|
|
|
|
SideEffects []
|
|
|
|
|
|
|
|
|
|
SeeAlso []
|
|
|
|
|
|
|
|
|
|
***********************************************************************/
|
|
|
|
|
void Abc_SclCollectTfo_rec( Abc_Obj_t * pObj, Vec_Int_t * vVisited )
|
|
|
|
|
{
|
|
|
|
|
Abc_Obj_t * pNext;
|
|
|
|
|
int i;
|
2012-08-30 20:10:02 +02:00
|
|
|
// if ( Abc_ObjIsCo(pObj) )
|
|
|
|
|
// return;
|
2012-08-29 09:48:36 +02:00
|
|
|
if ( Abc_NodeIsTravIdCurrent( pObj ) )
|
|
|
|
|
return;
|
|
|
|
|
Abc_NodeSetTravIdCurrent( pObj );
|
|
|
|
|
Abc_ObjForEachFanout( pObj, pNext, i )
|
|
|
|
|
Abc_SclCollectTfo_rec( pNext, vVisited );
|
|
|
|
|
Vec_IntPush( vVisited, Abc_ObjId(pObj) );
|
|
|
|
|
}
|
2012-08-30 20:10:02 +02:00
|
|
|
void Abc_SclMarkTfi_rec( Abc_Obj_t * pObj )
|
|
|
|
|
{
|
|
|
|
|
Abc_Obj_t * pNext;
|
|
|
|
|
int i;
|
|
|
|
|
if ( Abc_ObjIsCi(pObj) )
|
|
|
|
|
return;
|
|
|
|
|
if ( !Abc_NodeIsTravIdPrevious( pObj ) )
|
|
|
|
|
return;
|
|
|
|
|
if ( Abc_NodeIsTravIdCurrent( pObj ) )
|
|
|
|
|
return;
|
|
|
|
|
Abc_NodeSetTravIdCurrent( pObj );
|
|
|
|
|
assert( Abc_ObjIsNode(pObj) || Abc_ObjIsCo(pObj) );
|
|
|
|
|
Abc_ObjForEachFanin( pObj, pNext, i )
|
|
|
|
|
Abc_SclMarkTfi_rec( pNext );
|
|
|
|
|
}
|
|
|
|
|
Vec_Int_t * Abc_SclCollectTfo( Abc_Ntk_t * p, Abc_Obj_t * pObj, Vec_Int_t * vPivots )
|
2012-08-29 09:48:36 +02:00
|
|
|
{
|
|
|
|
|
Vec_Int_t * vVisited;
|
|
|
|
|
Abc_Obj_t * pFanin;
|
2012-08-30 20:10:02 +02:00
|
|
|
int i, k;
|
2012-08-29 09:48:36 +02:00
|
|
|
assert( Abc_ObjIsNode(pObj) );
|
|
|
|
|
vVisited = Vec_IntAlloc( 100 );
|
2012-08-30 20:10:02 +02:00
|
|
|
// collect nodes in the TFO
|
2012-08-29 09:48:36 +02:00
|
|
|
Abc_NtkIncrementTravId( p );
|
|
|
|
|
Abc_SclCollectTfo_rec( pObj, vVisited );
|
|
|
|
|
Abc_ObjForEachFanin( pObj, pFanin, i )
|
|
|
|
|
if ( Abc_ObjIsNode(pFanin) )
|
|
|
|
|
Abc_SclCollectTfo_rec( pFanin, vVisited );
|
2012-08-30 20:10:02 +02:00
|
|
|
if ( vPivots )
|
|
|
|
|
{
|
|
|
|
|
// mark nodes in the TFI
|
|
|
|
|
Abc_NtkIncrementTravId( p );
|
|
|
|
|
Abc_NtkForEachObjVec( vPivots, p, pObj, i )
|
|
|
|
|
Abc_SclMarkTfi_rec( pObj );
|
|
|
|
|
// remove unmarked nodes
|
|
|
|
|
k = 0;
|
|
|
|
|
Abc_NtkForEachObjVec( vVisited, p, pObj, i )
|
|
|
|
|
if ( Abc_NodeIsTravIdCurrent( pObj ) )
|
|
|
|
|
Vec_IntWriteEntry( vVisited, k++, Abc_ObjId(pObj) );
|
|
|
|
|
Vec_IntShrink( vVisited, k );
|
|
|
|
|
}
|
|
|
|
|
// reverse order
|
2012-08-29 09:48:36 +02:00
|
|
|
Vec_IntReverseOrder( vVisited );
|
|
|
|
|
return vVisited;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**Function*************************************************************
|
|
|
|
|
|
|
|
|
|
Synopsis []
|
|
|
|
|
|
|
|
|
|
Description []
|
|
|
|
|
|
|
|
|
|
SideEffects []
|
|
|
|
|
|
|
|
|
|
SeeAlso []
|
|
|
|
|
|
|
|
|
|
***********************************************************************/
|
|
|
|
|
SC_Cell * Abc_SclObjResiable( SC_Man * p, Abc_Obj_t * pObj )
|
|
|
|
|
{
|
|
|
|
|
SC_Cell * pOld = Abc_SclObjCell( p, pObj );
|
|
|
|
|
return pOld->pNext != pOld ? pOld->pNext : NULL;
|
|
|
|
|
}
|
2012-08-30 20:10:02 +02:00
|
|
|
float Abc_SclSizingGain( SC_Man * p, Abc_Obj_t * pPivot, Vec_Int_t * vPivots )
|
2012-08-29 09:48:36 +02:00
|
|
|
{
|
|
|
|
|
double dGain = 0;
|
|
|
|
|
Vec_Int_t * vCone;
|
|
|
|
|
Abc_Obj_t * pObj;
|
|
|
|
|
int i;
|
|
|
|
|
assert( Abc_ObjIsNode(pPivot) );
|
2012-08-30 20:10:02 +02:00
|
|
|
vCone = Abc_SclCollectTfo( p->pNtk, pPivot, vPivots );
|
2012-08-29 09:48:36 +02:00
|
|
|
Abc_SclConeStore( p, vCone );
|
|
|
|
|
Abc_SclTimeCone( p, vCone );
|
2012-08-30 20:10:02 +02:00
|
|
|
// Abc_NtkForEachObjVec( vCone, p->pNtk, pObj, i )
|
|
|
|
|
Abc_NtkForEachObjVec( vPivots, p->pNtk, pObj, i )
|
2012-08-29 09:48:36 +02:00
|
|
|
if ( Abc_ObjIsCo(pObj) )
|
2012-08-30 20:10:02 +02:00
|
|
|
{
|
|
|
|
|
Abc_SclObjDupFanin( p, pObj );
|
2012-08-29 09:48:36 +02:00
|
|
|
dGain += Abc_SclObjGain( p, pObj );
|
2012-08-30 20:10:02 +02:00
|
|
|
}
|
2012-08-29 09:48:36 +02:00
|
|
|
Abc_SclConeRestore( p, vCone );
|
|
|
|
|
Vec_IntFree( vCone );
|
|
|
|
|
return dGain;
|
|
|
|
|
}
|
2012-08-30 20:10:02 +02:00
|
|
|
Abc_Obj_t * Abc_SclChooseBiggestGain( SC_Man * p, Vec_Int_t * vPath, Vec_Int_t * vPivots )
|
2012-08-29 09:48:36 +02:00
|
|
|
{
|
|
|
|
|
SC_Cell * pOld, * pNew;
|
|
|
|
|
Abc_Obj_t * pPivot = NULL, * pObj;
|
2012-08-30 20:10:02 +02:00
|
|
|
double dGainBest = 0.00001, dGain;
|
2012-08-29 09:48:36 +02:00
|
|
|
int i, gateId;
|
|
|
|
|
Abc_NtkForEachObjVec( vPath, p->pNtk, pObj, i )
|
|
|
|
|
{
|
|
|
|
|
if ( Abc_ObjIsCo(pObj) )
|
|
|
|
|
continue;
|
|
|
|
|
pOld = Abc_SclObjCell( p, pObj );
|
|
|
|
|
pNew = Abc_SclObjResiable( p, pObj );
|
|
|
|
|
if ( pNew == NULL )
|
|
|
|
|
continue;
|
2012-08-30 01:20:39 +02:00
|
|
|
//printf( "changing %s for %s at node %d ", pOld->pName, pNew->pName, Abc_ObjId(pObj) );
|
2012-08-29 09:48:36 +02:00
|
|
|
gateId = Vec_IntEntry(p->vGates, Abc_ObjId(pObj));
|
2012-08-30 01:20:39 +02:00
|
|
|
Vec_IntWriteEntry( p->vGates, Abc_ObjId(pObj), Abc_SclCellFind(p->pLib, pNew->pName) );
|
2012-08-29 09:48:36 +02:00
|
|
|
|
|
|
|
|
Abc_SclUpdateLoad( p, pObj, pOld, pNew );
|
2012-08-30 20:10:02 +02:00
|
|
|
dGain = Abc_SclSizingGain( p, pObj, vPivots );
|
2012-08-29 09:48:36 +02:00
|
|
|
Abc_SclUpdateLoad( p, pObj, pNew, pOld );
|
2012-08-30 01:20:39 +02:00
|
|
|
//printf( "gain is %f\n", dGain );
|
|
|
|
|
Vec_IntWriteEntry( p->vGates, Abc_ObjId(pObj), Abc_SclCellFind(p->pLib, pOld->pName) );
|
2012-08-29 09:48:36 +02:00
|
|
|
assert( gateId == Vec_IntEntry(p->vGates, Abc_ObjId(pObj)) );
|
|
|
|
|
if ( dGainBest < dGain )
|
|
|
|
|
{
|
|
|
|
|
dGainBest = dGain;
|
|
|
|
|
pPivot = pObj;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return pPivot;
|
|
|
|
|
}
|
2012-08-30 01:20:39 +02:00
|
|
|
void Abc_SclUpdateNetwork( SC_Man * p, Abc_Obj_t * pObj, int iStep, int fVerbose )
|
2012-08-29 09:48:36 +02:00
|
|
|
{
|
|
|
|
|
Vec_Int_t * vCone;
|
|
|
|
|
SC_Cell * pOld, * pNew;
|
|
|
|
|
// find new gate
|
|
|
|
|
pOld = Abc_SclObjCell( p, pObj );
|
|
|
|
|
pNew = Abc_SclObjResiable( p, pObj );
|
|
|
|
|
assert( pNew != NULL );
|
|
|
|
|
// update gate
|
|
|
|
|
Abc_SclUpdateLoad( p, pObj, pOld, pNew );
|
|
|
|
|
p->SumArea += pNew->area - pOld->area;
|
2012-08-30 01:20:39 +02:00
|
|
|
Vec_IntWriteEntry( p->vGates, Abc_ObjId(pObj), Abc_SclCellFind(p->pLib, pNew->pName) );
|
2012-08-29 09:48:36 +02:00
|
|
|
// update info
|
2012-08-30 20:10:02 +02:00
|
|
|
vCone = Abc_SclCollectTfo( p->pNtk, pObj, NULL );
|
2012-08-30 01:20:39 +02:00
|
|
|
Abc_SclConeStore( p, vCone );
|
2012-08-29 09:48:36 +02:00
|
|
|
Abc_SclTimeCone( p, vCone );
|
|
|
|
|
Vec_IntFree( vCone );
|
2012-08-30 01:20:39 +02:00
|
|
|
// print output
|
|
|
|
|
if ( fVerbose )
|
2012-08-29 09:48:36 +02:00
|
|
|
{
|
2012-08-30 01:20:39 +02:00
|
|
|
printf( "%5d : ", iStep );
|
|
|
|
|
printf( "%5d ", Abc_ObjId(pObj) );
|
|
|
|
|
printf( "%-12s-> %-12s ", pOld->pName, pNew->pName );
|
|
|
|
|
printf( "delay =%8.2f ps ", SC_LibTimePs(p->pLib, Abc_SclGetMaxDelay(p)) );
|
|
|
|
|
printf( "area =%10.2f ", p->SumArea );
|
2012-08-30 20:10:02 +02:00
|
|
|
// Abc_PrintTime( 1, "Time", clock() - p->clkStart );
|
|
|
|
|
ABC_PRTr( "Time", clock() - p->clkStart );
|
2012-08-29 09:48:36 +02:00
|
|
|
}
|
|
|
|
|
}
|
2012-08-30 20:10:02 +02:00
|
|
|
|
2012-08-25 06:31:46 +02:00
|
|
|
/**Function*************************************************************
|
|
|
|
|
|
|
|
|
|
Synopsis []
|
|
|
|
|
|
|
|
|
|
Description []
|
|
|
|
|
|
|
|
|
|
SideEffects []
|
|
|
|
|
|
|
|
|
|
SeeAlso []
|
|
|
|
|
|
|
|
|
|
***********************************************************************/
|
2012-08-30 20:10:02 +02:00
|
|
|
void Abc_SclSizingPerform( SC_Lib * pLib, Abc_Ntk_t * pNtk, int nSteps, int nRange, int fTryAll, int fPrintCP, int fVerbose )
|
2012-08-27 02:32:22 +02:00
|
|
|
{
|
2012-08-29 09:48:36 +02:00
|
|
|
SC_Man * p;
|
2012-08-30 20:10:02 +02:00
|
|
|
Vec_Int_t * vPath, * vPivots;
|
2012-08-29 09:48:36 +02:00
|
|
|
Abc_Obj_t * pBest;
|
2012-08-30 20:10:02 +02:00
|
|
|
int i, nCones = 0;
|
2012-08-30 01:20:39 +02:00
|
|
|
p = Abc_SclManStart( pLib, pNtk );
|
2012-08-30 20:10:02 +02:00
|
|
|
if ( fPrintCP )
|
2012-08-30 01:20:39 +02:00
|
|
|
Abc_SclTimeNtkPrint( p, 0 );
|
|
|
|
|
if ( fVerbose )
|
2012-08-30 20:10:02 +02:00
|
|
|
printf( "Iterative gate-sizing of network \"%s\" with library \"%s\":\n", Abc_NtkName(pNtk), pLib->pName );
|
2012-08-30 01:20:39 +02:00
|
|
|
if ( fVerbose )
|
|
|
|
|
{
|
2012-08-30 20:10:02 +02:00
|
|
|
// printf( "%5d : ", 0 );
|
|
|
|
|
printf( "Starting parameters of current mapping: " );
|
2012-08-30 01:20:39 +02:00
|
|
|
printf( "delay =%8.2f ps ", SC_LibTimePs(p->pLib, Abc_SclGetMaxDelay(p)) );
|
|
|
|
|
printf( "area =%10.2f ", p->SumArea );
|
|
|
|
|
Abc_PrintTime( 1, "Time", clock() - p->clkStart );
|
|
|
|
|
}
|
2012-08-29 09:48:36 +02:00
|
|
|
for ( i = 0; i < nSteps; i++ )
|
|
|
|
|
{
|
2012-08-30 20:10:02 +02:00
|
|
|
vPath = Abc_SclFindCriticalPath( p, nRange, &vPivots );
|
|
|
|
|
pBest = Abc_SclChooseBiggestGain( p, vPath, vPivots );
|
2012-08-29 09:48:36 +02:00
|
|
|
Vec_IntFree( vPath );
|
2012-08-30 20:10:02 +02:00
|
|
|
Vec_IntFree( vPivots );
|
2012-08-29 09:48:36 +02:00
|
|
|
if ( pBest == NULL )
|
2012-08-30 20:10:02 +02:00
|
|
|
{
|
|
|
|
|
if ( fTryAll )
|
|
|
|
|
{
|
|
|
|
|
vPath = Abc_SclFindCriticalCone( p, nRange, &vPivots );
|
|
|
|
|
// vPath = Abc_SclFindCriticalPath( p, nRange+5, &vPivots );
|
|
|
|
|
pBest = Abc_SclChooseBiggestGain( p, vPath, vPivots );
|
|
|
|
|
Vec_IntFree( vPath );
|
|
|
|
|
Vec_IntFree( vPivots );
|
|
|
|
|
nCones++;
|
|
|
|
|
}
|
|
|
|
|
if ( pBest == NULL )
|
|
|
|
|
break;
|
|
|
|
|
}
|
2012-08-30 01:20:39 +02:00
|
|
|
Abc_SclUpdateNetwork( p, pBest, i+1, fVerbose );
|
|
|
|
|
// recompute loads every 100 steps
|
|
|
|
|
if ( i && i % 100 == 0 )
|
|
|
|
|
Abc_SclComputeLoad( p );
|
2012-08-29 09:48:36 +02:00
|
|
|
}
|
2012-08-30 01:20:39 +02:00
|
|
|
p->MaxDelay = Abc_SclGetMaxDelay(p);
|
2012-08-30 20:10:02 +02:00
|
|
|
if ( fPrintCP )
|
2012-08-30 01:20:39 +02:00
|
|
|
Abc_SclTimeNtkPrint( p, 0 );
|
|
|
|
|
// print cumulative statistics
|
2012-08-30 20:10:02 +02:00
|
|
|
printf( "Cones: %d. ", nCones );
|
|
|
|
|
printf( "Resized: %d. ", i );
|
2012-08-30 01:20:39 +02:00
|
|
|
printf( "Delay: " );
|
|
|
|
|
printf( "%.2f -> %.2f ps ", SC_LibTimePs(p->pLib, p->MaxDelay0), SC_LibTimePs(p->pLib, p->MaxDelay) );
|
|
|
|
|
printf( "(%+.1f %%). ", 100.0 * (p->MaxDelay - p->MaxDelay0)/ p->MaxDelay0 );
|
|
|
|
|
printf( "Area: " );
|
|
|
|
|
printf( "%.2f -> %.2f ", p->SumArea0, p->SumArea );
|
|
|
|
|
printf( "(%+.1f %%). ", 100.0 * (p->SumArea - p->SumArea0)/ p->SumArea0 );
|
|
|
|
|
Abc_PrintTime( 1, "Time", clock() - p->clkStart );
|
|
|
|
|
// save the result and quit
|
|
|
|
|
Abc_SclManSetGates( pLib, pNtk, p->vGates ); // updates gate pointers
|
2012-08-29 09:48:36 +02:00
|
|
|
Abc_SclManFree( p );
|
2012-08-27 02:32:22 +02:00
|
|
|
}
|
2012-08-25 06:31:46 +02:00
|
|
|
|
2012-08-26 04:00:26 +02:00
|
|
|
|
2012-08-25 06:31:46 +02:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
/// END OF FILE ///
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ABC_NAMESPACE_IMPL_END
|
|
|
|
|
|