From a4f977638849d8ba679cbdfd66e3a74c9bf91fe3 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Thu, 7 Jan 2016 16:50:01 -0800 Subject: Consolidating timing manager Scl_Con_t and propagating changes. --- src/aig/gia/giaNf.c | 18 ++++++++---------- src/base/abci/abcMap.c | 42 ++++++++++++++++++++++++++++++++++++++++-- src/map/mio/mio.h | 3 --- src/map/mio/mioUtils.c | 8 +++++--- src/map/scl/sclCon.h | 5 ++--- src/map/scl/sclLibScl.c | 16 +++++++++------- src/opt/sfm/sfmDec.c | 37 +++++++++++++++++++------------------ src/opt/sfm/sfmInt.h | 1 + src/opt/sfm/sfmLib.c | 4 ++-- src/opt/sfm/sfmMit.c | 1 + src/opt/sfm/sfmTim.c | 12 ++++++------ 11 files changed, 93 insertions(+), 54 deletions(-) (limited to 'src') diff --git a/src/aig/gia/giaNf.c b/src/aig/gia/giaNf.c index 2bb542cf..c811a339 100644 --- a/src/aig/gia/giaNf.c +++ b/src/aig/gia/giaNf.c @@ -1253,8 +1253,6 @@ void Nf_ManCutMatch( Nf_Man_t * p, int iObj ) Nf_Mat_t * pDn = &pBest->M[1][0]; Nf_Mat_t * pAp = &pBest->M[0][1]; Nf_Mat_t * pAn = &pBest->M[1][1]; -// word FlowRefP = (word)(MIO_NUM * Nf_ObjFlowRefs(p, iObj, 0)); -// word FlowRefN = (word)(MIO_NUM * Nf_ObjFlowRefs(p, iObj, 1)); float FlowRefPf = Nf_ObjFlowRefs(p, iObj, 0); float FlowRefNf = Nf_ObjFlowRefs(p, iObj, 1); int i, * pCut, * pCutSet = Nf_ObjCutSet( p, iObj ); @@ -1354,10 +1352,10 @@ void Nf_ManCutMatch( Nf_Man_t * p, int iObj ) if ( pAn->D == SCL_INFINITY ) printf( "Object %d has pAn unassigned.\n", iObj ); /* - pDp->F = Abc_MinFloat( pDp->F, FLT_MAX/MIO_NUM ); - pDn->F = Abc_MinFloat( pDn->F, FLT_MAX/MIO_NUM ); - pAp->F = Abc_MinFloat( pAp->F, FLT_MAX/MIO_NUM ); - pAn->F = Abc_MinFloat( pAn->F, FLT_MAX/MIO_NUM ); + pDp->F = Abc_MinFloat( pDp->F, FLT_MAX/SCL_NUM ); + pDn->F = Abc_MinFloat( pDn->F, FLT_MAX/SCL_NUM ); + pAp->F = Abc_MinFloat( pAp->F, FLT_MAX/SCL_NUM ); + pAn->F = Abc_MinFloat( pAn->F, FLT_MAX/SCL_NUM ); */ assert( pDp->D < SCL_INFINITY ); assert( pDn->D < SCL_INFINITY ); @@ -1823,7 +1821,7 @@ void Nf_ManElaBestMatchOne( Nf_Man_t * p, int iObj, int c, int * pCut, int * pCu pMb->Cfg = Cfg; pMb->Cfg.fCompl = 0; // compute area - pMb->F = MIO_NUMINV * (ABC_INT64_T)Nf_MatchRefArea( p, iObj, c, pMb, Required ); + pMb->F = Scl_Int2Flt((int)Nf_MatchRefArea(p, iObj, c, pMb, Required)); // compare if ( pRes->F > pMb->F || (pRes->F == pMb->F && pRes->D > pMb->D) ) *pRes = *pMb; @@ -1987,14 +1985,14 @@ void Nf_ManComputeMappingEla( Nf_Man_t * p ) printf( "%d -> %d ", Nf_ManCell(p, pM->Gate)->nFanins, Nf_ManCell(p, pMb->Gate)->nFanins ); printf( "D: %7.2f -> %7.2f ", Scl_Int2Flt(pM->D), Scl_Int2Flt(pMb->D) ); printf( "R: %7.2f ", Required == SCL_INFINITY ? 9999.99 : Scl_Int2Flt(Required) ); - printf( "A: %7.2f -> %7.2f ", MIO_NUMINV * (ABC_INT64_T)AreaBef, MIO_NUMINV * (ABC_INT64_T)AreaAft ); - printf( "G: %7.2f (%7.2f) ", AreaBef >= AreaAft ? MIO_NUMINV * (ABC_INT64_T)(AreaBef - AreaAft) : -MIO_NUMINV * (ABC_INT64_T)(AreaAft - AreaBef), MIO_NUMINV * (ABC_INT64_T)(Gain) ); + printf( "A: %7.2f -> %7.2f ", Scl_Int2Flt((int)AreaBef), Scl_Int2Flt((int)AreaAft) ); + printf( "G: %7.2f (%7.2f) ", Scl_Int2Flt((int)AreaBef - (int)AreaAft), Scl_Int2Flt((int)Gain) ); printf( "\n" ); } // set best match assert( pMb->fBest ); assert( pMb->D <= Required ); - //assert( pMb->F == MIO_NUMINV * (ABC_INT64_T)AreaAft ); + //assert( Scl_Flt2Int(pMb->F) == (int)AreaAft ); assert( AreaBef >= AreaAft ); *pM = *pMb; // update timing diff --git a/src/base/abci/abcMap.c b/src/base/abci/abcMap.c index 9098c71f..4e588e2d 100644 --- a/src/base/abci/abcMap.c +++ b/src/base/abci/abcMap.c @@ -22,6 +22,8 @@ #include "base/main/main.h" #include "map/mio/mio.h" #include "map/mapper/mapper.h" +#include "misc/util/utilNam.h" +#include "map/scl/sclCon.h" ABC_NAMESPACE_IMPL_START @@ -217,6 +219,34 @@ Map_Time_t * Abc_NtkMapCopyCoRequired( Abc_Ntk_t * pNtk, Abc_Time_t * ppTimes ) return p; } +/**Function************************************************************* + + Synopsis [Load the network into manager.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +Map_Time_t * Abc_NtkMapCopyCiArrivalCon( Abc_Ntk_t * pNtk ) +{ + Map_Time_t * p; int i; + p = ABC_CALLOC( Map_Time_t, Abc_NtkCiNum(pNtk) ); + for ( i = 0; i < Abc_NtkCiNum(pNtk); i++ ) + p[i].Fall = p[i].Rise = p[i].Worst = Scl_Int2Flt( Scl_ConGetInArr(i) ); + return p; +} +Map_Time_t * Abc_NtkMapCopyCoRequiredCon( Abc_Ntk_t * pNtk ) +{ + Map_Time_t * p; int i; + p = ABC_CALLOC( Map_Time_t, Abc_NtkCoNum(pNtk) ); + for ( i = 0; i < Abc_NtkCoNum(pNtk); i++ ) + p[i].Fall = p[i].Rise = p[i].Worst = Scl_Int2Flt( Scl_ConGetOutReq(i) ); + return p; +} + /**Function************************************************************* Synopsis [Load the network into manager.] @@ -245,8 +275,16 @@ Map_Man_t * Abc_NtkToMap( Abc_Ntk_t * pNtk, double DelayTarget, int fRecovery, f Map_ManSetAreaRecovery( pMan, fRecovery ); Map_ManSetOutputNames( pMan, Abc_NtkCollectCioNames(pNtk, 1) ); Map_ManSetDelayTarget( pMan, (float)DelayTarget ); - Map_ManSetInputArrivals( pMan, Abc_NtkMapCopyCiArrival(pNtk, Abc_NtkGetCiArrivalTimes(pNtk)) ); - Map_ManSetOutputRequireds( pMan, Abc_NtkMapCopyCoRequired(pNtk, Abc_NtkGetCoRequiredTimes(pNtk)) ); + + // set arrival and requireds + if ( Scl_ConIsRunning() && Scl_ConHasInArrs() ) + Map_ManSetInputArrivals( pMan, Abc_NtkMapCopyCiArrivalCon(pNtk) ); + else + Map_ManSetInputArrivals( pMan, Abc_NtkMapCopyCiArrival(pNtk, Abc_NtkGetCiArrivalTimes(pNtk)) ); + if ( Scl_ConIsRunning() && Scl_ConHasOutReqs() ) + Map_ManSetOutputRequireds( pMan, Abc_NtkMapCopyCoRequiredCon(pNtk) ); + else + Map_ManSetOutputRequireds( pMan, Abc_NtkMapCopyCoRequired(pNtk, Abc_NtkGetCoRequiredTimes(pNtk)) ); // create PIs and remember them in the old nodes Abc_NtkCleanCopy( pNtk ); 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++ ) diff --git a/src/opt/sfm/sfmDec.c b/src/opt/sfm/sfmDec.c index f228222e..ff0dc574 100644 --- a/src/opt/sfm/sfmDec.c +++ b/src/opt/sfm/sfmDec.c @@ -149,6 +149,7 @@ static inline word * Sfm_DecDivPats( Sfm_Dec_t * p, int d, int c ) { r static inline int Sfm_ManReadObjDelay( Sfm_Dec_t * p, int Id ) { return p->pMit ? Sfm_MitReadObjDelay(p->pMit, Id) : Sfm_TimReadObjDelay(p->pTim, Id); } static inline int Sfm_ManReadNtkDelay( Sfm_Dec_t * p ) { return p->pMit ? Sfm_MitReadNtkDelay(p->pMit) : Sfm_TimReadNtkDelay(p->pTim); } +static inline int Sfm_ManReadNtkMinSlack( Sfm_Dec_t * p ) { return p->pMit ? Sfm_MitReadNtkMinSlack(p->pMit) : 0; } @@ -211,9 +212,9 @@ Sfm_Dec_t * Sfm_DecStart( Sfm_Par_t * pPars, Mio_Library_t * pLib, Abc_Ntk_t * p p->pNtk = pNtk; p->pSat = sat_solver_new(); p->pGateInv = Mio_LibraryReadInv( pLib ); - p->AreaInv = MIO_NUM*Mio_GateReadArea( p->pGateInv ); - p->DelayInv = MIO_NUM*Mio_GateReadDelayMax( p->pGateInv ); - p->DeltaCrit = pPars->DeltaCrit ? MIO_NUM*pPars->DeltaCrit : 5 * (int)(MIO_NUM*Mio_LibraryReadDelayInvMax(pLib)) / 2; + p->AreaInv = Scl_Flt2Int(Mio_GateReadArea(p->pGateInv)); + p->DelayInv = Scl_Flt2Int(Mio_GateReadDelayMax(p->pGateInv)); + p->DeltaCrit = pPars->DeltaCrit ? Scl_Flt2Int((float)pPars->DeltaCrit) : 5 * Scl_Flt2Int(Mio_LibraryReadDelayInvMax(pLib)) / 2; p->timeLib = Abc_Clock(); p->pLib = Sfm_LibPrepare( pPars->nVarMax, 1, !pPars->fArea, pPars->fVerbose, pPars->fLibVerbose ); p->timeLib = Abc_Clock() - p->timeLib; @@ -676,13 +677,13 @@ int Sfm_DecMffcArea( Abc_Ntk_t * pNtk, Vec_Int_t * vMffc ) Abc_Obj_t * pObj; int i, nAreaMffc = 0; Abc_NtkForEachObjVec( vMffc, pNtk, pObj, i ) - nAreaMffc += (int)(MIO_NUM * Mio_GateReadArea((Mio_Gate_t *)pObj->pData)); + nAreaMffc += Scl_Flt2Int(Mio_GateReadArea((Mio_Gate_t *)pObj->pData)); return nAreaMffc; } int Sfm_MffcDeref_rec( Abc_Obj_t * pObj ) { Abc_Obj_t * pFanin; - int i, Area = (int)(MIO_NUM*Mio_GateReadArea((Mio_Gate_t *)pObj->pData)); + int i, Area = Scl_Flt2Int(Mio_GateReadArea((Mio_Gate_t *)pObj->pData)); Abc_ObjForEachFanin( pObj, pFanin, i ) { assert( pFanin->vFanouts.nSize > 0 ); @@ -694,7 +695,7 @@ int Sfm_MffcDeref_rec( Abc_Obj_t * pObj ) int Sfm_MffcRef_rec( Abc_Obj_t * pObj, Vec_Int_t * vMffc ) { Abc_Obj_t * pFanin; - int i, Area = (int)(MIO_NUM*Mio_GateReadArea((Mio_Gate_t *)pObj->pData)); + int i, Area = Scl_Flt2Int(Mio_GateReadArea((Mio_Gate_t *)pObj->pData)); Abc_ObjForEachFanin( pObj, pFanin, i ) { if ( pFanin->vFanouts.nSize++ == 0 && !Abc_ObjIsCi(pFanin) ) @@ -753,7 +754,7 @@ int Sfm_DecComputeFlipInvGain( Sfm_Dec_t * p, Abc_Obj_t * pPivot, int * pfNeedIn continue; } pGateNew = (Mio_Gate_t *)Vec_PtrEntry( &p->vGateHands, Handle ); - Gain += MIO_NUM*Mio_GateReadArea(pGate) - MIO_NUM*Mio_GateReadArea(pGateNew); + Gain += Scl_Flt2Int(Mio_GateReadArea(pGate)) - Scl_Flt2Int(Mio_GateReadArea(pGateNew)); } if ( fNeedInv ) Gain -= p->AreaInv; @@ -816,7 +817,7 @@ int Sfm_DecPeformDec_rec( Sfm_Dec_t * p, word * pTruth, int * pSupp, int * pAssu if ( p->pPars->fVeryVerbose ) { printf( "\nObject %d\n", p->iTarget ); - printf( "Divs = %d. Nodes = %d. Mffc = %d. Mffc area = %.2f. ", p->nDivs, Vec_IntSize(&p->vObjGates), p->nMffc, MIO_NUMINV*p->AreaMffc ); + printf( "Divs = %d. Nodes = %d. Mffc = %d. Mffc area = %.2f. ", p->nDivs, Vec_IntSize(&p->vObjGates), p->nMffc, Scl_Int2Flt(p->AreaMffc) ); printf( "Pat0 = %d. Pat1 = %d. ", p->nPats[0], p->nPats[1] ); printf( "\n" ); if ( nAssump ) @@ -1099,7 +1100,7 @@ int Sfm_DecPeformDec2( Sfm_Dec_t * p, Abc_Obj_t * pObj ) int i, RetValue, Prev = 0, iBest = -1, AreaThis, AreaNew;//, AreaNewInv; int GainThis, GainBest = -1, iLibObj, iLibObjBest = -1; assert( p->pPars->fArea == 1 ); -//printf( "AreaGainInv = %8.2f ", MIO_NUMINV*AreaGainInv ); +//printf( "AreaGainInv = %8.2f ", Scl_Int2Flt(AreaGainInv) ); //Sfm_DecPrint( p, NULL ); if ( fVeryVerbose ) printf( "\nNode %4d : MFFC %2d\n", p->iTarget, p->nMffc ); @@ -1149,7 +1150,7 @@ int Sfm_DecPeformDec2( Sfm_Dec_t * p, Abc_Obj_t * pObj ) if ( AreaNew > 0 && AreaNewInv > 0 && AreaNew - AreaNewInv + AreaGainInv > 0 ) printf( "AreaNew = %8.2f AreaNewInv = %8.2f Gain = %8.2f Total = %8.2f\n", - MIO_NUMINV*AreaNew, MIO_NUMINV*AreaNewInv, MIO_NUMINV*(AreaNew - AreaNewInv), MIO_NUMINV*(AreaNew - AreaNewInv + AreaGainInv) ); + Scl_Int2Flt(AreaNew), Scl_Int2Flt(AreaNewInv), Scl_Int2Flt(AreaNew - AreaNewInv), Scl_Int2Flt(AreaNew - AreaNewInv + AreaGainInv) ); else printf( "\n" ); */ @@ -1488,14 +1489,14 @@ void Sfm_DecMarkMffc( Abc_Obj_t * pPivot, int nLevelMin, int nMffcMax, int fVery Vec_IntPushUnique( vInMffc, Abc_ObjId(pFanin3) ); /* - printf( "Node %d: (%.2f) ", pPivot->Id, MIO_NUMINV*Sfm_ManReadObjDelay(p, Abc_ObjId(pPivot)) ); + printf( "Node %d: (%.2f) ", pPivot->Id, Scl_Int2Flt(Sfm_ManReadObjDelay(p, Abc_ObjId(pPivot))) ); Abc_ObjForEachFanin( pPivot, pFanin, i ) - printf( "%d: %.2f ", Abc_ObjLevel(pFanin), MIO_NUMINV*Sfm_ManReadObjDelay(p, Abc_ObjId(pFanin)) ); + printf( "%d: %.2f ", Abc_ObjLevel(pFanin), Scl_Int2Flt(Sfm_ManReadObjDelay(p, Abc_ObjId(pFanin))) ); printf( "\n" ); printf( "Node %d: ", pPivot->Id ); Abc_NtkForEachObjVec( vInMffc, pPivot->pNtk, pObj, i ) - printf( "%d: %.2f ", Abc_ObjLevel(pObj), MIO_NUMINV*Sfm_ManReadObjDelay(p, Abc_ObjId(pObj)) ); + printf( "%d: %.2f ", Abc_ObjLevel(pObj), Scl_Int2Flt(Sfm_ManReadObjDelay(p, Abc_ObjId(pObj))) ); printf( "\n" ); */ } @@ -1588,7 +1589,7 @@ printf( "\n\nTarget %d\n", Abc_ObjId(pPivot) ); Sfm_DecMarkMffc( pPivot, nLevelMin, pPars->nMffcMax, fVeryVerbose, vMffc, vInMffc, pTim, pMit ); assert( Vec_IntSize(vMffc) <= pPars->nMffcMax ); if ( fVeryVerbose ) -printf( "Mffc size = %d. Mffc area = %.2f. InMffc size = %d.\n", Vec_IntSize(vMffc), Sfm_DecMffcArea(pNtk, vMffc)*MIO_NUMINV, Vec_IntSize(vInMffc) ); +printf( "Mffc size = %d. Mffc area = %.2f. InMffc size = %d.\n", Vec_IntSize(vMffc), Scl_Int2Flt(Sfm_DecMffcArea(pNtk, vMffc)), Vec_IntSize(vInMffc) ); // collect TFI(TFO) Abc_NtkForEachObjVec( vRoots, pNtk, pObj, i ) Abc_NtkDfsOne_rec( pObj, vTfi, nLevelMin, SFM_MASK_INPUT ); @@ -2072,10 +2073,10 @@ p->timeTime += Abc_Clock() - clk; assert( p->pMit || p->DelayMin == 0 || p->DelayMin == Sfm_ManReadObjDelay(p, Abc_ObjId(pObjNew)) ); // report if ( pPars->fDelayVerbose ) - printf( "Node %5d %5d : I =%3d. Cand = %5d (%6.2f %%) Old =%8.2f. New =%8.2f. Final =%8.2f\n", + printf( "Node %5d %5d : I =%3d. Cand = %5d (%6.2f %%) Old =%8.2f. New =%8.2f. Final =%8.2f. WNS =%8.2f.\n", OldId, Abc_NtkObjNumMax(p->pNtk), i, Vec_IntSize(&p->vCands), 100.0 * Vec_IntSize(&p->vCands) / Abc_NtkNodeNum(p->pNtk), - MIO_NUMINV*DelayOld, MIO_NUMINV*Sfm_ManReadObjDelay(p, Abc_ObjId(pObjNew)), - MIO_NUMINV*Sfm_ManReadNtkDelay(p) ); + Scl_Int2Flt(DelayOld), Scl_Int2Flt(Sfm_ManReadObjDelay(p, Abc_ObjId(pObjNew))), + Scl_Int2Flt(Sfm_ManReadNtkDelay(p)), Scl_Int2Flt(Sfm_ManReadNtkMinSlack(p)) ); break; } if ( pPars->iNodeOne ) @@ -2110,7 +2111,7 @@ void Abc_NtkPerformMfs3( Abc_Ntk_t * pNtk, Sfm_Par_t * pPars ) if ( !pPars->fArea ) printf( "Win = %d. ", pPars->nTimeWin ); if ( !pPars->fArea ) - printf( "Delta = %.2f ps. ", MIO_NUMINV*p->DeltaCrit ); + printf( "Delta = %.2f ps. ", Scl_Int2Flt(p->DeltaCrit) ); if ( pPars->fArea ) printf( "0-cost = %s. ", pPars->fZeroCost ? "yes" : "no" ); printf( "Effort = %s. ", pPars->fMoreEffort ? "yes" : "no" ); diff --git a/src/opt/sfm/sfmInt.h b/src/opt/sfm/sfmInt.h index a08979ab..2b96d4bd 100644 --- a/src/opt/sfm/sfmInt.h +++ b/src/opt/sfm/sfmInt.h @@ -230,6 +230,7 @@ extern int Sfm_TimEvalRemapping( Sfm_Tim_t * p, Vec_Int_t * vFanins, Ve extern Sfm_Mit_t * Sfm_MitStart( Mio_Library_t * pLib, SC_Lib * pScl, Scl_Con_t * pExt, Abc_Ntk_t * pNtk, int DeltaCrit ); extern void Sfm_MitStop( Sfm_Mit_t * p ); extern int Sfm_MitReadNtkDelay( Sfm_Mit_t * p ); +extern int Sfm_MitReadNtkMinSlack( Sfm_Mit_t * p ); extern int Sfm_MitReadObjDelay( Sfm_Mit_t * p, int iObj ); extern void Sfm_MitTransferLoad( Sfm_Mit_t * p, Abc_Obj_t * pNew, Abc_Obj_t * pOld ); extern void Sfm_MitTimingGrow( Sfm_Mit_t * p ); diff --git a/src/opt/sfm/sfmLib.c b/src/opt/sfm/sfmLib.c index 0bf7c4a0..34906b56 100644 --- a/src/opt/sfm/sfmLib.c +++ b/src/opt/sfm/sfmLib.c @@ -537,7 +537,7 @@ void Sfm_LibPrintObj( Sfm_Lib_t * p, Sfm_Fun_t * pObj ) Mio_Cell2_t * pCellB = p->pCells + (int)pObj->pFansB[0]; Mio_Cell2_t * pCellT = p->pCells + (int)pObj->pFansT[0]; int i, nFanins = pCellB->nFanins + (pCellT == p->pCells ? 0 : pCellT->nFanins - 1); - printf( "F = %d A =%6.2f ", nFanins, MIO_NUMINV*pObj->Area ); + printf( "F = %d A =%6.2f ", nFanins, Scl_Int2Flt(pObj->Area) ); if ( pCellT == p->pCells ) Sfm_LibPrintGate( pCellB, pObj->pFansB + 1, NULL, NULL ); else @@ -548,7 +548,7 @@ void Sfm_LibPrintObj( Sfm_Lib_t * p, Sfm_Fun_t * pObj ) int Offset = Vec_IntEntry( &p->vProfs, Sfm_LibFunId(p, pObj) ); int * pProf = Vec_IntEntryP( &p->vStore, Offset ); for ( i = 0; i < nFanins; i++ ) - printf( "%6.2f ", MIO_NUMINV*pProf[i] ); + printf( "%6.2f ", Scl_Int2Flt(pProf[i]) ); } } void Sfm_LibPrint( Sfm_Lib_t * p ) diff --git a/src/opt/sfm/sfmMit.c b/src/opt/sfm/sfmMit.c index 09fcf34c..bd9dfb52 100644 --- a/src/opt/sfm/sfmMit.c +++ b/src/opt/sfm/sfmMit.c @@ -52,6 +52,7 @@ struct Sfm_Mit_t_ Sfm_Mit_t * Sfm_MitStart( Mio_Library_t * pLib, SC_Lib * pScl, Scl_Con_t * pExt, Abc_Ntk_t * pNtk, int DeltaCrit ) { return NULL; } void Sfm_MitStop( Sfm_Mit_t * p ) {} int Sfm_MitReadNtkDelay( Sfm_Mit_t * p ) { return 0;} +int Sfm_MitReadNtkMinSlack( Sfm_Mit_t * p ) { return 0;} int Sfm_MitReadObjDelay( Sfm_Mit_t * p, int iObj ) { return 0;} void Sfm_MitTransferLoad( Sfm_Mit_t * p, Abc_Obj_t * pNew, Abc_Obj_t * pOld ) {}; void Sfm_MitTimingGrow( Sfm_Mit_t * p ) {}; diff --git a/src/opt/sfm/sfmTim.c b/src/opt/sfm/sfmTim.c index d5ccc3e2..d2880639 100644 --- a/src/opt/sfm/sfmTim.c +++ b/src/opt/sfm/sfmTim.c @@ -75,8 +75,8 @@ static inline int Sfm_TimSlack( Sfm_Tim_t * p, Abc_Obj_t * pNode ) { i static inline void Sfm_TimEdgeArrival( Sfm_Tim_t * p, Mio_Pin_t * pPin, int * pTimeIn, int * pTimeOut ) { Mio_PinPhase_t PinPhase = Mio_PinReadPhase(pPin); - int tDelayBlockRise = (int)(MIO_NUM*Mio_PinReadDelayBlockRise(pPin)); - int tDelayBlockFall = (int)(MIO_NUM*Mio_PinReadDelayBlockFall(pPin)); + int tDelayBlockRise = Scl_Flt2Int(Mio_PinReadDelayBlockRise(pPin)); + int tDelayBlockFall = Scl_Flt2Int(Mio_PinReadDelayBlockFall(pPin)); if ( PinPhase != MIO_PHASE_INV ) // NONINV phase is present { pTimeOut[0] = Abc_MaxInt( pTimeOut[0], pTimeIn[0] + tDelayBlockRise ); @@ -109,8 +109,8 @@ static inline void Sfm_TimNodeArrival( Sfm_Tim_t * p, Abc_Obj_t * pNode ) static inline void Sfm_TimEdgeRequired( Sfm_Tim_t * p, Mio_Pin_t * pPin, int * pTimeIn, int * pTimeOut ) { Mio_PinPhase_t PinPhase = Mio_PinReadPhase(pPin); - int tDelayBlockRise = (int)(MIO_NUM*Mio_PinReadDelayBlockRise(pPin)); - int tDelayBlockFall = (int)(MIO_NUM*Mio_PinReadDelayBlockFall(pPin)); + int tDelayBlockRise = Scl_Flt2Int(Mio_PinReadDelayBlockRise(pPin)); + int tDelayBlockFall = Scl_Flt2Int(Mio_PinReadDelayBlockFall(pPin)); if ( PinPhase != MIO_PHASE_INV ) // NONINV phase is present { pTimeIn[0] = Abc_MinInt( pTimeIn[0], pTimeOut[0] - tDelayBlockRise ); @@ -235,7 +235,7 @@ Sfm_Tim_t * Sfm_TimStart( Mio_Library_t * pLib, Scl_Con_t * pExt, Abc_Ntk_t * pN Vec_IntFill( &p->vTimArrs, 3*Abc_NtkObjNumMax(pNtk), 0 ); Vec_IntFill( &p->vTimReqs, 3*Abc_NtkObjNumMax(pNtk), 0 ); p->Delay = Sfm_TimTrace( p ); - assert( DeltaCrit > 0 && DeltaCrit < MIO_NUM*1000 ); + assert( DeltaCrit > 0 && DeltaCrit < Scl_Flt2Int(1000.0) ); p->DeltaCrit = DeltaCrit; return p; } @@ -272,7 +272,7 @@ void Sfm_TimTest( Abc_Ntk_t * pNtk ) { Mio_Library_t * pLib = (Mio_Library_t *)pNtk->pManFunc; Sfm_Tim_t * p = Sfm_TimStart( pLib, NULL, pNtk, 100 ); - printf( "Max delay = %.2f. Path = %d (%d).\n", MIO_NUMINV*p->Delay, Sfm_TimCriticalPath(p, 1), Abc_NtkNodeNum(p->pNtk) ); + printf( "Max delay = %.2f. Path = %d (%d).\n", Scl_Int2Flt(p->Delay), Sfm_TimCriticalPath(p, 1), Abc_NtkNodeNum(p->pNtk) ); Sfm_TimStop( p ); } -- cgit v1.2.3