Commit 9d195981 by Alan Mishchenko

Change from input slew to input drive strength in the BLIF file.

parent 56a233be
......@@ -120,6 +120,8 @@ clk = Abc_Clock();
continue;
if ( i > Notches )
break;
if ( p->pInDrive && !Abc_SclInputDriveOk( p, pObj, pCellNew ) )
continue;
// set new cell
Abc_SclObjSetCell( p, pObj, pCellNew );
Abc_SclUpdateLoad( p, pObj, pCellOld, pCellNew );
......
......@@ -111,18 +111,36 @@ void Abc_SclComputeLoad( SC_Man * p )
pLoad->rise += pLoadPo->rise;
pLoad->fall += pLoadPo->fall;
}
if ( p->pWLoadUsed == NULL )
return;
// add wire load
vWireCaps = Abc_SclFindWireCaps( p, p->pWLoadUsed );
Abc_NtkForEachNode1( p->pNtk, pObj, i )
if ( p->pWLoadUsed != NULL )
{
SC_Pair * pLoad = Abc_SclObjLoad( p, pObj );
k = Abc_MinInt( Vec_FltSize(vWireCaps)-1, Abc_ObjFanoutNum(pObj) );
pLoad->rise += Vec_FltEntry(vWireCaps, k);
pLoad->fall += Vec_FltEntry(vWireCaps, k);
vWireCaps = Abc_SclFindWireCaps( p, p->pWLoadUsed );
Abc_NtkForEachNode1( p->pNtk, pObj, i )
{
SC_Pair * pLoad = Abc_SclObjLoad( p, pObj );
k = Abc_MinInt( Vec_FltSize(vWireCaps)-1, Abc_ObjFanoutNum(pObj) );
pLoad->rise += Vec_FltEntry(vWireCaps, k);
pLoad->fall += Vec_FltEntry(vWireCaps, k);
}
Abc_NtkForEachPi( p->pNtk, pObj, i )
{
SC_Pair * pLoad = Abc_SclObjLoad( p, pObj );
k = Abc_MinInt( Vec_FltSize(vWireCaps)-1, Abc_ObjFanoutNum(pObj) );
pLoad->rise += Vec_FltEntry(vWireCaps, k);
pLoad->fall += Vec_FltEntry(vWireCaps, k);
}
Vec_FltFree( vWireCaps );
}
// check input loads
if ( p->pInDrive != NULL )
{
Abc_NtkForEachPi( p->pNtk, pObj, i )
{
SC_Pair * pLoad = Abc_SclObjLoad( p, pObj );
if ( p->pInDrive[Abc_ObjId(pObj)] != 0 && (pLoad->rise > p->pInDrive[Abc_ObjId(pObj)] || pLoad->fall > p->pInDrive[Abc_ObjId(pObj)]) )
printf( "Maximum input drive strength is exceeded at primary input %d.\n", i );
}
}
Vec_FltFree( vWireCaps );
}
/**Function*************************************************************
......
......@@ -298,6 +298,7 @@ void Abc_SclManReadSlewAndLoad( SC_Man * p, Abc_Ntk_t * pNtk )
int i;
if ( pNtk->pManTime == NULL )
return;
/*
// read input slew
pTime = Abc_NtkReadDefaultInputDrive( pNtk );
if ( Abc_MaxFloat(pTime->Rise, pTime->Fall) != 0 )
......@@ -321,6 +322,27 @@ void Abc_SclManReadSlewAndLoad( SC_Man * p, Abc_Ntk_t * pNtk )
pSlew->fall = SC_LibTimeFromPs( p->pLib, pTime->Fall );
}
}
*/
pTime = Abc_NtkReadDefaultInputDrive( pNtk );
if ( Abc_MaxFloat(pTime->Rise, pTime->Fall) != 0 )
{
printf( "Default input drive strength is specified (%.2f ff; %.2f ff).\n", pTime->Rise, pTime->Fall );
if ( p->pInDrive == NULL )
p->pInDrive = ABC_CALLOC( float, Abc_NtkObjNumMax(pNtk) );
Abc_NtkForEachPi( pNtk, pObj, i )
p->pInDrive[Abc_ObjId(pObj)] = 0.5 * SC_LibCapFromFf( p->pLib, pTime->Rise ) + 0.5 * SC_LibCapFromFf( p->pLib, pTime->Fall );
}
if ( Abc_NodeReadInputDrive(pNtk, 0) != NULL )
{
printf( "Input drive strengths for some primary inputs are specified.\n" );
if ( p->pInDrive == NULL )
p->pInDrive = ABC_CALLOC( float, Abc_NtkObjNumMax(pNtk) );
Abc_NtkForEachPi( pNtk, pObj, i )
{
pTime = Abc_NodeReadInputDrive(pNtk, i);
p->pInDrive[Abc_ObjId(pObj)] = 0.5 * SC_LibCapFromFf( p->pLib, pTime->Rise ) + 0.5 * SC_LibCapFromFf( p->pLib, pTime->Fall );
}
}
// read output load
pTime = Abc_NtkReadDefaultOutputLoad( pNtk );
if ( Abc_MaxFloat(pTime->Rise, pTime->Fall) != 0 )
......@@ -511,6 +533,30 @@ 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) && p->pInDrive[Abc_ObjId(pFanin)] > 0 &&
(p->pInDrive[Abc_ObjId(pFanin)] / Abc_ObjFanoutNum(pFanin)) <
Abc_MaxFloat(SC_CellPin(pCell, i)->rise_cap, SC_CellPin(pCell, i)->fall_cap) )
return 0;
return 1;
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
......
......@@ -58,7 +58,8 @@ struct SC_Man_
SC_Pair * pSlews; // slews for each gate
SC_Pair * pTimes2; // arrivals for each gate
SC_Pair * pSlews2; // slews for each gate
float * pSlack; // slacks for each gate
float * pSlack; // slacks for each gatt
float * pInDrive; // maximum input drive strength
Vec_Flt_t * vTimesOut; // output arrival times
Vec_Que_t * vQue; // outputs by their time
SC_WireLoad * pWLoadUsed; // name of the used WireLoad model
......@@ -185,6 +186,7 @@ static inline void Abc_SclManFree( SC_Man * p )
ABC_FREE( p->pTimes2 );
ABC_FREE( p->pSlews2 );
ABC_FREE( p->pSlack );
ABC_FREE( p->pInDrive );
ABC_FREE( p );
}
static inline void Abc_SclManCleanTime( SC_Man * p )
......@@ -404,6 +406,7 @@ extern void Abc_SclTimeCone( SC_Man * p, Vec_Int_t * vCone );
extern void Abc_SclTimeNtkRecompute( SC_Man * p, float * pArea, float * pDelay, int fReverse, float DUser );
extern void Abc_SclTimePerform( SC_Lib * pLib, Abc_Ntk_t * pNtk, int fUseWireLoads, int fShowAll, int fPrintPath, int fDumpStats );
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 ===============================================================*/
extern void Abc_SclUpsizePerform( SC_Lib * pLib, Abc_Ntk_t * pNtk, SC_SizePars * pPars );
/*=== sclUtil.c ===============================================================*/
......
......@@ -286,6 +286,8 @@ int Abc_SclFindUpsizes( SC_Man * p, Vec_Int_t * vPathNodes, int Ratio, int Notch
continue;
if ( k > Notches )
break;
if ( p->pInDrive && !Abc_SclInputDriveOk( p, pObj, pCellNew ) )
continue;
// set new cell
Abc_SclObjSetCell( p, pObj, 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