From a42e6ecd23f4c9fe24ffaef084dcf15e3af71316 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Fri, 9 May 2025 17:13:40 -0700 Subject: [PATCH] Fixing a bug in "read_lib". --- src/map/scl/scl.c | 2 +- src/map/scl/sclLibUtil.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/map/scl/scl.c b/src/map/scl/scl.c index 9112bceca..dab44d873 100644 --- a/src/map/scl/scl.c +++ b/src/map/scl/scl.c @@ -340,7 +340,7 @@ usage: fprintf( pAbc->Err, "\t-v : toggle writing verbose information [default = %s]\n", fVerbose? "yes": "no" ); fprintf( pAbc->Err, "\t-w : toggle writing information about skipped gates [default = %s]\n", fVeryVerbose? "yes": "no" ); fprintf( pAbc->Err, "\t-m : toggle merging library with exisiting library [default = %s]\n", fMerge? "yes": "no" ); - fprintf( pAbc->Err, "\t-a : toggle using prefix for the cell names [default = %s]\n", fUseAll? "yes": "no" ); + fprintf( pAbc->Err, "\t-a : toggle reading all cells when using gain-based modeling [default = %s]\n", fUseAll? "yes": "no" ); fprintf( pAbc->Err, "\t-p : toggle using prefix for the cell names [default = %s]\n", fUsePrefix? "yes": "no" ); fprintf( pAbc->Err, "\t-h : prints the command summary\n" ); fprintf( pAbc->Err, "\t : the name of a file to read\n" ); diff --git a/src/map/scl/sclLibUtil.c b/src/map/scl/sclLibUtil.c index 88e8e514e..4115143c3 100644 --- a/src/map/scl/sclLibUtil.c +++ b/src/map/scl/sclLibUtil.c @@ -897,6 +897,21 @@ Vec_Str_t * Abc_SclProduceGenlibStr( SC_Lib * p, float Slew, float Gain, int nGa if ( nGatesMin && pRepr->n_inputs > 2 && Abc_SclClassCellNum(pRepr) < nGatesMin ) continue; SC_CellForEachPinOut( pRepr, pPinOut, j ) + { + SC_CellForEachPinIn( pRepr, pPin, k ) + { + float Delay = Abc_SclComputeDelayClassPin( p, pRepr, k, Slew, Gain ); + if ( Delay <= 0 ) { + printf( "Cell %s cannot be used because delay of a pin is <= 0.\n", pRepr->pName ); + break; + } + } + if ( k < pRepr->n_inputs ) + break; + } + if ( j < pRepr->n_outputs ) + continue; + SC_CellForEachPinOut( pRepr, pPinOut, j ) { assert( strlen(pRepr->pName) < 200 ); Vec_StrPrintStr( vStr, "GATE " );