mirror of https://github.com/YosysHQ/abc.git
Debugging and finetuning the flow.
This commit is contained in:
parent
73a997a8bd
commit
a2d97cf2b6
|
|
@ -328,8 +328,8 @@ Amap_Lib_t * Amap_ParseTokens( Vec_Ptr_t * vTokens, int fVerbose )
|
|||
Amap_Lib_t * p;
|
||||
Amap_Gat_t * pGate, * pPrev;
|
||||
Amap_Pin_t * pPin;
|
||||
char * pToken;
|
||||
int i, nPins, iPos = 0;
|
||||
char * pToken, * pMoGate = NULL;
|
||||
int i, nPins, iPos = 0, Count = 0;
|
||||
p = Amap_LibAlloc();
|
||||
pToken = (char *)Vec_PtrEntry(vTokens, iPos++);
|
||||
do
|
||||
|
|
@ -420,10 +420,15 @@ Amap_Lib_t * Amap_ParseTokens( Vec_Ptr_t * vTokens, int fVerbose )
|
|||
if ( pPrev && !strcmp(pPrev->pName, pGate->pName) )
|
||||
{
|
||||
pPrev->pTwin = pGate, pGate->pTwin = pPrev;
|
||||
printf( "Warning: Detected multi-output gate \"%s\".\n", pGate->pName );
|
||||
// printf( "Warning: Detected multi-output gate \"%s\".\n", pGate->pName );
|
||||
if ( pMoGate == NULL )
|
||||
pMoGate = pGate->pName;
|
||||
Count++;
|
||||
}
|
||||
pPrev = pGate;
|
||||
}
|
||||
if ( Count )
|
||||
printf( "Warning: Detected %d multi-output gates (for example, \"%s\").\n", Count, pMoGate );
|
||||
return p;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -422,6 +422,9 @@ int Scl_CommandReadScl( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
Abc_SclLoad( pLib, (SC_Lib **)&pAbc->pLibScl );
|
||||
if ( fDump )
|
||||
Abc_SclWriteLiberty( Extra_FileNameGenericAppend(pFileName, "_temp.lib"), (SC_Lib *)pAbc->pLibScl );
|
||||
// extract genlib library
|
||||
if ( pAbc->pLibScl )
|
||||
Abc_SclInstallGenlib( pAbc->pLibScl, 0, 0, 0 );
|
||||
return 0;
|
||||
|
||||
usage:
|
||||
|
|
|
|||
|
|
@ -580,6 +580,21 @@ static inline float Scl_LibPinArrivalEstimate( SC_Cell * pCell, int iPin, float
|
|||
Scl_LibPinArrival( Scl_CellPinTime(pCell, iPin), &ArrIn, &SlewIn, &LoadIn, &ArrOut, &SlewOut );
|
||||
return 0.5 * ArrOut.fall + 0.5 * ArrOut.rise;
|
||||
}
|
||||
static inline void Scl_LibHandleInputDriver( SC_Cell * pCell, SC_Pair * pLoadIn, SC_Pair * pArrOut, SC_Pair * pSlewOut )
|
||||
{
|
||||
SC_Pair LoadIn = { 0.0, 0.0 }; // zero input load
|
||||
SC_Pair ArrIn = { 0.0, 0.0 }; // zero input time
|
||||
SC_Pair SlewIn = { 0.0, 0.0 }; // zero input slew
|
||||
SC_Pair ArrOut0 = { 0.0, 0.0 }; // output time under zero load
|
||||
SC_Pair ArrOut1 = { 0.0, 0.0 }; // output time under given load
|
||||
SC_Pair SlewOut = { 0.0, 0.0 }; // output slew under zero load
|
||||
pSlewOut->fall = pSlewOut->rise = 0;
|
||||
assert( pCell->n_inputs == 1 );
|
||||
Scl_LibPinArrival( Scl_CellPinTime(pCell, 0), &ArrIn, &SlewIn, &LoadIn, &ArrOut0, &SlewOut );
|
||||
Scl_LibPinArrival( Scl_CellPinTime(pCell, 0), &ArrIn, &SlewIn, pLoadIn, &ArrOut1, pSlewOut );
|
||||
pArrOut->fall = ArrOut1.fall - ArrOut0.fall;
|
||||
pArrOut->rise = ArrOut1.rise - ArrOut0.rise;
|
||||
}
|
||||
|
||||
/*=== sclLiberty.c ===============================================================*/
|
||||
extern SC_Lib * Abc_SclReadLiberty( char * pFileName, int fVerbose, int fVeryVerbose );
|
||||
|
|
|
|||
|
|
@ -404,20 +404,15 @@ static void Abc_SclWriteLibrary( Vec_Str_t * vOut, SC_Lib * p )
|
|||
Vec_StrPutS( vOut, pPin->pName );
|
||||
Vec_StrPutF( vOut, pPin->max_out_cap );
|
||||
Vec_StrPutF( vOut, pPin->max_out_slew );
|
||||
Vec_StrPutI( vOut, pCell->n_inputs );
|
||||
|
||||
// write function
|
||||
if ( pPin->func_text == NULL )
|
||||
{
|
||||
// formula is not given - write empty string
|
||||
Vec_StrPutS( vOut, "" );
|
||||
// write truth table
|
||||
assert( Vec_WrdSize(pPin->vFunc) == Abc_Truth6WordNum(pCell->n_inputs) );
|
||||
Vec_StrPutI( vOut, pCell->n_inputs );
|
||||
Vec_WrdForEachEntry( pPin->vFunc, uWord, k ) // -- 'size = 1u << (n_vars - 6)'
|
||||
Vec_StrPutW( vOut, uWord ); // -- 64-bit number, written uncompressed (low-byte first)
|
||||
}
|
||||
else // formula is given
|
||||
Vec_StrPutS( vOut, pPin->func_text );
|
||||
Vec_StrPutS( vOut, pPin->func_text ? pPin->func_text : "" );
|
||||
|
||||
// write truth table
|
||||
assert( Vec_WrdSize(pPin->vFunc) == Abc_Truth6WordNum(pCell->n_inputs) );
|
||||
Vec_WrdForEachEntry( pPin->vFunc, uWord, k ) // -- 'size = 1u << (n_vars - 6)'
|
||||
Vec_StrPutW( vOut, uWord ); // -- 64-bit number, written uncompressed (low-byte first)
|
||||
|
||||
// Write 'rtiming': (pin-to-pin timing tables for this particular output)
|
||||
assert( Vec_PtrSize(pPin->vRTimings) == pCell->n_inputs );
|
||||
|
|
|
|||
|
|
@ -116,14 +116,14 @@ static inline void Abc_SclTimeNodePrint( SC_Man * p, Abc_Obj_t * pObj, int fRise
|
|||
printf( "%-*s ", Length, pCell ? pCell->pName : "pi" );
|
||||
printf( "A =%7.2f ", pCell ? pCell->area : 0.0 );
|
||||
printf( "D%s =", fRise ? "r" : "f" );
|
||||
printf( "%5.0f", Abc_MaxFloat(Abc_SclObjTimePs(p, pObj, 0), Abc_SclObjTimePs(p, pObj, 1)) );
|
||||
printf( "%6.0f ps ", -Abc_AbsFloat(Abc_SclObjTimePs(p, pObj, 0) - Abc_SclObjTimePs(p, pObj, 1)) );
|
||||
printf( "S =%5.0f ps ", Abc_SclObjSlewPs(p, pObj, fRise >= 0 ? fRise : 0 ) );
|
||||
printf( "Cin =%4.0f ff ", pCell ? SC_CellPinCapAve(pCell) : 0.0 );
|
||||
printf( "Cout =%5.0f ff ", Abc_SclObjLoadFf(p, pObj, fRise >= 0 ? fRise : 0 ) );
|
||||
printf( "Cmax =%5.0f ff ", pCell ? SC_CellPin(pCell, pCell->n_inputs)->max_out_cap : 0.0 );
|
||||
printf( "%6.1f", Abc_MaxFloat(Abc_SclObjTimePs(p, pObj, 0), Abc_SclObjTimePs(p, pObj, 1)) );
|
||||
printf( "%7.1f ps ", -Abc_AbsFloat(Abc_SclObjTimePs(p, pObj, 0) - Abc_SclObjTimePs(p, pObj, 1)) );
|
||||
printf( "S =%6.1f ps ", Abc_SclObjSlewPs(p, pObj, fRise >= 0 ? fRise : 0) );
|
||||
printf( "Cin =%5.1f ff ", pCell ? SC_LibCapFf(p->pLib, SC_CellPinCapAve(pCell)) : 0.0 );
|
||||
printf( "Cout =%6.1f ff ", Abc_SclObjLoadFf(p, pObj, fRise >= 0 ? fRise : 0) );
|
||||
printf( "Cmax =%6.1f ff ", pCell ? SC_LibCapFf(p->pLib, SC_CellPin(pCell, pCell->n_inputs)->max_out_cap) : 0.0 );
|
||||
printf( "G =%5d ", pCell ? (int)(100.0 * Abc_SclObjLoadAve(p, pObj) / SC_CellPinCapAve(pCell)) : 0 );
|
||||
printf( "SL =%5.1f ps", Abc_SclObjSlackPs(p, pObj, p->MaxDelay0) );
|
||||
printf( "SL =%6.1f ps", Abc_SclObjSlackPs(p, pObj, p->MaxDelay0) );
|
||||
printf( "\n" );
|
||||
}
|
||||
void Abc_SclTimeNtkPrint( SC_Man * p, int fShowAll, int fPrintPath )
|
||||
|
|
@ -527,6 +527,7 @@ void Abc_SclManReadSlewAndLoad( SC_Man * p, Abc_Ntk_t * pNtk )
|
|||
// printf( "Default PI driving cell is specified (%s).\n", Abc_FrameReadDrivingCell() );
|
||||
p->pPiDrive = SC_LibCell( p->pLib, iCell );
|
||||
assert( p->pPiDrive != NULL );
|
||||
assert( p->pPiDrive->n_inputs == 1 );
|
||||
}
|
||||
}
|
||||
if ( pNtk->pManTime == NULL )
|
||||
|
|
|
|||
|
|
@ -226,6 +226,7 @@ static inline void Abc_SclManFree( SC_Man * p )
|
|||
ABC_FREE( p->pSlews );
|
||||
ABC_FREE( p );
|
||||
}
|
||||
/*
|
||||
static inline void Abc_SclManCleanTime( SC_Man * p )
|
||||
{
|
||||
Vec_Flt_t * vSlews;
|
||||
|
|
@ -249,6 +250,26 @@ static inline void Abc_SclManCleanTime( SC_Man * p )
|
|||
}
|
||||
Vec_FltFree( vSlews );
|
||||
}
|
||||
*/
|
||||
static inline void Abc_SclManCleanTime( SC_Man * p )
|
||||
{
|
||||
memset( p->pTimes, 0, sizeof(SC_Pair) * p->nObjs );
|
||||
memset( p->pSlews, 0, sizeof(SC_Pair) * p->nObjs );
|
||||
memset( p->pDepts, 0, sizeof(SC_Pair) * p->nObjs );
|
||||
if ( p->pPiDrive != NULL )
|
||||
{
|
||||
SC_Pair * pSlew, * pTime, * pLoad;
|
||||
Abc_Obj_t * pObj;
|
||||
int i;
|
||||
Abc_NtkForEachPi( p->pNtk, pObj, i )
|
||||
{
|
||||
pLoad = Abc_SclObjLoad( p, pObj );
|
||||
pTime = Abc_SclObjTime( p, pObj );
|
||||
pSlew = Abc_SclObjSlew( p, pObj );
|
||||
Scl_LibHandleInputDriver( p->pPiDrive, pLoad, pTime, pSlew );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**Function*************************************************************
|
||||
|
|
|
|||
Loading…
Reference in New Issue