diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/mio/mio.h | 3 | ||||
-rw-r--r-- | src/map/mio/mioUtils.c | 8 | ||||
-rw-r--r-- | src/map/scl/sclCon.h | 5 | ||||
-rw-r--r-- | src/map/scl/sclLibScl.c | 16 |
4 files changed, 16 insertions, 16 deletions
diff --git a/src/map/mio/mio.h b/src/map/mio/mio.h index 06a461ab..63246d91 100644 --- a/src/map/mio/mio.h +++ b/src/map/mio/mio.h @@ -70,9 +70,6 @@ struct Mio_Cell2_t_ void * pMioGate; // gate pointer }; -#define MIO_NUM 1000 -#define MIO_NUMINV 0.001 - //////////////////////////////////////////////////////////////////////// /// GLOBAL VARIABLES /// //////////////////////////////////////////////////////////////////////// diff --git a/src/map/mio/mioUtils.c b/src/map/mio/mioUtils.c index e03159f3..101d5d0f 100644 --- a/src/map/mio/mioUtils.c +++ b/src/map/mio/mioUtils.c @@ -22,7 +22,9 @@ #include "exp.h" #include "misc/util/utilTruth.h" #include "opt/dau/dau.h" +#include "misc/util/utilNam.h" #include "map/scl/sclLib.h" +#include "map/scl/sclCon.h" ABC_NAMESPACE_IMPL_START @@ -655,13 +657,13 @@ static inline void Mio_CollectCopy2( Mio_Cell2_t * pCell, Mio_Gate_t * pGate ) pCell->vExpr = pGate->vExpr; pCell->uTruth = pGate->uTruth; pCell->AreaF = pGate->dArea; - pCell->AreaW = (word)(MIO_NUM * pGate->dArea); + pCell->AreaW = (word)(SCL_NUM * pGate->dArea); pCell->nFanins = pGate->nInputs; pCell->pMioGate = pGate; pCell->iDelayAve = 0; for ( k = 0, pPin = pGate->pPins; pPin; pPin = pPin->pNext, k++ ) { - pCell->iDelays[k] = (int)(MIO_NUM/2 * pPin->dDelayBlockRise + MIO_NUM/2 * pPin->dDelayBlockFall); + pCell->iDelays[k] = (int)(SCL_NUM/2 * pPin->dDelayBlockRise + SCL_NUM/2 * pPin->dDelayBlockFall); pCell->iDelayAve += pCell->iDelays[k]; } if ( pCell->nFanins ) @@ -758,7 +760,7 @@ Mio_Cell2_t * Mio_CollectRootsNew2( Mio_Library_t * pLib, int nInputs, int * pnG printf( "None\n" ); else printf( "%-20s In = %d N = %3d A = %12.6f D = %12.6f\n", - pCell->pName, pCell->nFanins, pCounts[i], pCell->AreaF, MIO_NUMINV*pCell->iDelayAve ); + pCell->pName, pCell->nFanins, pCounts[i], pCell->AreaF, Scl_Int2Flt(pCell->iDelayAve) ); } ABC_FREE( pCounts ); } 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++ ) |