From 7d3976a76353b4a89588925285e80ea33efa0797 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Tue, 17 Sep 2013 13:16:20 -0700 Subject: Unifying standard cell library representations. --- src/map/mio/mio.c | 2 +- src/map/mio/mio.h | 8 +++++--- src/map/mio/mioUtils.c | 34 +++++++++++++++++++++++++++++++++- 3 files changed, 39 insertions(+), 5 deletions(-) (limited to 'src/map/mio') diff --git a/src/map/mio/mio.c b/src/map/mio/mio.c index d05a9129..d99d267a 100644 --- a/src/map/mio/mio.c +++ b/src/map/mio/mio.c @@ -82,7 +82,7 @@ static char * pMcncGenlib[25] = { ***********************************************************************/ void Mio_Init( Abc_Frame_t * pAbc ) { - Cmd_CommandAdd( pAbc, "SC mapping", "read_liberty", Mio_CommandReadLiberty, 0 ); +// Cmd_CommandAdd( pAbc, "SC mapping", "read_liberty", Mio_CommandReadLiberty, 0 ); Cmd_CommandAdd( pAbc, "SC mapping", "read_genlib", Mio_CommandReadGenlib, 0 ); Cmd_CommandAdd( pAbc, "SC mapping", "write_genlib", Mio_CommandWriteGenlib, 0 ); diff --git a/src/map/mio/mio.h b/src/map/mio/mio.h index 2b4876ad..c779992e 100644 --- a/src/map/mio/mio.h +++ b/src/map/mio/mio.h @@ -82,7 +82,6 @@ static inline char * Mio_UtilStrsav( char * s ) { return s ? strcpy(ABC_A /*=== mio.c =============================================================*/ extern void Mio_UpdateGenlib( Mio_Library_t * pLib ); extern int Mio_UpdateGenlib2( Vec_Str_t * vStr, Vec_Str_t * vStr2, char * pFileName, int fVerbose ); -extern void Abc_SclDeriveGenlib( void * pScl, float Slew, float Gain, int nGatesMin ); /*=== mioApi.c =============================================================*/ extern char * Mio_LibraryReadName ( Mio_Library_t * pLib ); extern int Mio_LibraryReadGateNum ( Mio_Library_t * pLib ); @@ -161,10 +160,13 @@ extern Mio_Gate_t * Mio_GateCreatePseudo( int nInputs ); extern void Mio_LibraryShiftDelay( Mio_Library_t * pLib, double Shift ); extern void Mio_LibraryMultiArea( Mio_Library_t * pLib, double Multi ); extern void Mio_LibraryMultiDelay( Mio_Library_t * pLib, double Multi ); +extern void Mio_LibraryTransferDelays( Mio_Library_t * pLibD, Mio_Library_t * pLibS ); -ABC_NAMESPACE_HEADER_END - +/*=== sclUtil.c =========================================================*/ +extern Mio_Library_t * Abc_SclDeriveGenlibSimple( void * pScl ); +extern Mio_Library_t * Abc_SclDeriveGenlib( void * pScl, float Slew, float Gain, int nGatesMin ); +ABC_NAMESPACE_HEADER_END #endif diff --git a/src/map/mio/mioUtils.c b/src/map/mio/mioUtils.c index 9ddda24e..be2f0ec6 100644 --- a/src/map/mio/mioUtils.c +++ b/src/map/mio/mioUtils.c @@ -260,7 +260,7 @@ void Mio_WriteLibrary( FILE * pFile, Mio_Library_t * pLib, int fPrintSops ) Mio_GateForEachPin( pGate, pPin ) NameLen = Abc_MaxInt( NameLen, strlen(pPin->pName) ); } - fprintf( pFile, "# The genlib library \"%s\".\n", pLib->pName ); + fprintf( pFile, "# The genlib library \"%s\" written by ABC on %s\n\n", pLib->pName, Extra_TimeStamp() ); for ( i = 0; i < pLib->nGates; i++ ) Mio_WriteGate( pFile, pLib->ppGates0[i], GateLen, NameLen, FormLen, fPrintSops, fAllPins ); } @@ -705,6 +705,38 @@ void Mio_LibraryMultiDelay( Mio_Library_t * pLib, double Multi ) } } +/**Function************************************************************* + + Synopsis [Transfers delays from the second to the first.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +void Mio_LibraryTransferDelays( Mio_Library_t * pLibD, Mio_Library_t * pLibS ) +{ + Mio_Gate_t * pGateD, * pGateS; + Mio_Pin_t * pPinD, * pPinS; + Mio_LibraryForEachGate( pLibS, pGateS ) + { + Mio_LibraryForEachGate( pLibD, pGateD ) + { + if ( pGateD->uTruth != pGateS->uTruth ) + continue; + pPinS = Mio_GateReadPins( pGateS ); + Mio_GateForEachPin( pGateD, pPinD ) + { + pPinD->dDelayBlockRise = pPinS->dDelayBlockRise; + pPinD->dDelayBlockFall = pPinS->dDelayBlockFall; + pPinD->dDelayBlockMax = pPinS->dDelayBlockMax; + pPinS = Mio_PinReadNext(pPinS); + } + } + } +} //////////////////////////////////////////////////////////////////////// /// END OF FILE /// -- cgit v1.2.3