summaryrefslogtreecommitdiffstats
path: root/src/map/scl
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2016-01-07 16:50:01 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2016-01-07 16:50:01 -0800
commita4f977638849d8ba679cbdfd66e3a74c9bf91fe3 (patch)
treec215da8bb3fba0244cd65ce0c61f7a7b5aa5788b /src/map/scl
parent15a891f97a954a67b4a65079b8371b41fb499dc9 (diff)
downloadabc-a4f977638849d8ba679cbdfd66e3a74c9bf91fe3.tar.gz
abc-a4f977638849d8ba679cbdfd66e3a74c9bf91fe3.tar.bz2
abc-a4f977638849d8ba679cbdfd66e3a74c9bf91fe3.zip
Consolidating timing manager Scl_Con_t and propagating changes.
Diffstat (limited to 'src/map/scl')
-rw-r--r--src/map/scl/sclCon.h5
-rw-r--r--src/map/scl/sclLibScl.c16
2 files changed, 11 insertions, 10 deletions
diff --git a/src/map/scl/sclCon.h b/src/map/scl/sclCon.h
index ca241018..aeeffbf2 100644
--- a/src/map/scl/sclCon.h
+++ b/src/map/scl/sclCon.h
@@ -60,11 +60,10 @@ struct Scl_Con_t_
#define SCL_DEF_DIRECTIVE(ITEM) ".default_"ITEM
#define SCL_NUM 1000
-#define SCL_NUMINV 0.001
#define SCL_INFINITY (0x3FFFFFFF)
-static inline int Scl_Flt2Int( float w ) { return SCL_NUM*w; }
-static inline float Scl_Int2Flt( int i ) { return SCL_NUMINV*i; }
+static inline int Scl_Flt2Int( float w ) { return SCL_NUM*w; }
+static inline float Scl_Int2Flt( int i ) { return (float)i/SCL_NUM; }
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
diff --git a/src/map/scl/sclLibScl.c b/src/map/scl/sclLibScl.c
index f3a1b0ed..933bd573 100644
--- a/src/map/scl/sclLibScl.c
+++ b/src/map/scl/sclLibScl.c
@@ -23,6 +23,8 @@
#include "map/mio/mio.h"
#include "bool/kit/kit.h"
#include "misc/extra/extra.h"
+#include "misc/util/utilNam.h"
+#include "map/scl/sclCon.h"
ABC_NAMESPACE_IMPL_START
@@ -56,14 +58,14 @@ static void Abc_SclReadSurface( Vec_Str_t * vOut, int * pPos, SC_Surface * p )
{
float Num = Vec_StrGetF(vOut, pPos);
Vec_FltPush( &p->vIndex0, Num );
- Vec_IntPush( &p->vIndex0I, (int)(MIO_NUM*Num) );
+ Vec_IntPush( &p->vIndex0I, Scl_Flt2Int(Num) );
}
for ( i = Vec_StrGetI(vOut, pPos); i != 0; i-- )
{
float Num = Vec_StrGetF(vOut, pPos);
Vec_FltPush( &p->vIndex1, Num );
- Vec_IntPush( &p->vIndex1I, (int)(MIO_NUM*Num) );
+ Vec_IntPush( &p->vIndex1I, Scl_Flt2Int(Num) );
}
for ( i = 0; i < Vec_FltSize(&p->vIndex0); i++ )
@@ -76,7 +78,7 @@ static void Abc_SclReadSurface( Vec_Str_t * vOut, int * pPos, SC_Surface * p )
{
float Num = Vec_StrGetF(vOut, pPos);
Vec_FltPush( vVec, Num );
- Vec_IntPush( vVecI, (int)(MIO_NUM*Num) );
+ Vec_IntPush( vVecI, Scl_Flt2Int(Num) );
}
}
@@ -154,8 +156,8 @@ static int Abc_SclReadLibrary( Vec_Str_t * vOut, int * pPos, SC_Lib * p )
pCell->n_inputs = Vec_StrGetI(vOut, pPos);
pCell->n_outputs = Vec_StrGetI(vOut, pPos);
- pCell->areaI = (int)(MIO_NUM*pCell->area);
- pCell->leakageI = (int)(MIO_NUM*pCell->leakage);
+ pCell->areaI = Scl_Flt2Int(pCell->area);
+ pCell->leakageI = Scl_Flt2Int(pCell->leakage);
/*
printf( "%s\n", pCell->pName );
if ( !strcmp( "XOR3_X4M_A9TL", pCell->pName ) )
@@ -173,8 +175,8 @@ static int Abc_SclReadLibrary( Vec_Str_t * vOut, int * pPos, SC_Lib * p )
pPin->rise_cap = Vec_StrGetF(vOut, pPos);
pPin->fall_cap = Vec_StrGetF(vOut, pPos);
- pPin->rise_capI = (int)(MIO_NUM*pPin->rise_cap);
- pPin->fall_capI = (int)(MIO_NUM*pPin->fall_cap);
+ pPin->rise_capI = Scl_Flt2Int(pPin->rise_cap);
+ pPin->fall_capI = Scl_Flt2Int(pPin->fall_cap);
}
for ( j = 0; j < pCell->n_outputs; j++ )