summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2014-02-06 12:22:30 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2014-02-06 12:22:30 -0800
commit48912a22474688302c4ed62133111740061f58bb (patch)
tree3900a5030532a3d7630459ea1272a1ce3a784a79 /src
parentb910cba3e2e065d444d4a7b1bcbf81227417fc11 (diff)
downloadabc-48912a22474688302c4ed62133111740061f58bb.tar.gz
abc-48912a22474688302c4ed62133111740061f58bb.tar.bz2
abc-48912a22474688302c4ed62133111740061f58bb.zip
Fixing Liberty parser to handle 'scalar' delay/slew tables.
Diffstat (limited to 'src')
-rw-r--r--src/map/scl/sclLib.h9
-rw-r--r--src/map/scl/sclLibUtil.c7
-rw-r--r--src/map/scl/sclLiberty.c17
3 files changed, 33 insertions, 0 deletions
diff --git a/src/map/scl/sclLib.h b/src/map/scl/sclLib.h
index 18335085..e7c70e51 100644
--- a/src/map/scl/sclLib.h
+++ b/src/map/scl/sclLib.h
@@ -484,6 +484,15 @@ static inline float Scl_LibLookup( SC_Surface * p, float slew, float load )
float sfrac, lfrac, p0, p1;
int s, l;
+ // handle constant table
+ if ( Vec_FltSize(p->vIndex0) == 1 && Vec_FltSize(p->vIndex1) == 1 )
+ {
+ Vec_Flt_t * vTemp = (Vec_Flt_t *)Vec_PtrEntry(p->vData, 0);
+ assert( Vec_PtrSize(p->vData) == 1 );
+ assert( Vec_FltSize(vTemp) == 1 );
+ return Vec_FltEntry(vTemp, 0);
+ }
+
// Find closest sample points in surface:
pIndex0 = Vec_FltArray(p->vIndex0);
for ( s = 1; s < Vec_FltSize(p->vIndex0)-1; s++ )
diff --git a/src/map/scl/sclLibUtil.c b/src/map/scl/sclLibUtil.c
index 8f4bcd61..54635404 100644
--- a/src/map/scl/sclLibUtil.c
+++ b/src/map/scl/sclLibUtil.c
@@ -353,6 +353,13 @@ int Abc_SclComputeParametersPin( SC_Lib * p, SC_Cell * pCell, int iPin, float Sl
Vec_Flt_t * vIndex = pTime ? pTime->pCellRise->vIndex1 : NULL; // capacitance
if ( vIndex == NULL )
return 0;
+ // handle constant table
+ if ( Vec_FltSize(vIndex) == 1 )
+ {
+ *pLD = 0;
+ *pPD = Vec_FltEntry( (Vec_Flt_t *)Vec_PtrEntry(pTime->pCellRise->vData, 0), 0 );
+ return 1;
+ }
// get load points
Load0.rise = Load0.fall = 0.0;
Load1.rise = Load1.fall = Vec_FltEntry( vIndex, 0 );
diff --git a/src/map/scl/sclLiberty.c b/src/map/scl/sclLiberty.c
index e128b515..36d01c1b 100644
--- a/src/map/scl/sclLiberty.c
+++ b/src/map/scl/sclLiberty.c
@@ -1030,6 +1030,23 @@ int Scl_LibertyScanTable( Scl_Tree_t * p, Vec_Ptr_t * vOut, Scl_Item_t * pTiming
Vec_PtrPush( vOut, vInd2 );
Vec_PtrPush( vOut, vValues );
}
+ else if ( !strcmp(pTempl, "scalar") )
+ {
+ Scl_ItemForEachChild( p, pTable, pItem )
+ if ( !Scl_LibertyCompare(p, pItem->Key, "values") )
+ {
+ assert(vValues == NULL);
+ vValues = Scl_LibertyReadFloatVec( Scl_LibertyReadString(p, pItem->Head) );
+ assert( Vec_FltSize(vValues) == 1 );
+ // write entries
+ Vec_PtrPush( vOut, Vec_IntStart(1) );
+ Vec_PtrPush( vOut, Vec_IntStart(1) );
+ Vec_PtrPush( vOut, vValues );
+ break;
+ }
+ else
+ { printf( "Cannot read \"scalar\" template\n" ); return 0; }
+ }
else
{
// fetch the template