diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2014-07-20 22:11:00 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2014-07-20 22:11:00 -0700 |
commit | ea73401db5258da2311e6ad4d31a9a7e10437f33 (patch) | |
tree | 9bd82d0068598191c7a68b3c8c13532e428f0933 /src/aig | |
parent | ba3f2ac6c02f06f197447326be150dfbd93d1879 (diff) | |
download | abc-ea73401db5258da2311e6ad4d31a9a7e10437f33.tar.gz abc-ea73401db5258da2311e6ad4d31a9a7e10437f33.tar.bz2 abc-ea73401db5258da2311e6ad4d31a9a7e10437f33.zip |
Updates and changes to several packages.
Diffstat (limited to 'src/aig')
-rw-r--r-- | src/aig/gia/gia.h | 9 | ||||
-rw-r--r-- | src/aig/gia/giaBalance.c | 1 | ||||
-rw-r--r-- | src/aig/gia/giaIf.c | 21 | ||||
-rw-r--r-- | src/aig/gia/giaLf.c | 4 | ||||
-rw-r--r-- | src/aig/gia/giaMf.c | 3 | ||||
-rw-r--r-- | src/aig/gia/giaStr.c | 2 | ||||
-rw-r--r-- | src/aig/gia/giaUtil.c | 9 |
7 files changed, 31 insertions, 18 deletions
diff --git a/src/aig/gia/gia.h b/src/aig/gia/gia.h index f3a40ca1..6fc30367 100644 --- a/src/aig/gia/gia.h +++ b/src/aig/gia/gia.h @@ -255,6 +255,7 @@ struct Jf_Par_t_ int nRoundsEla; int nRelaxRatio; int nCoarseLimit; + int nAreaTuner; int nVerbLimit; int DelayTarget; int fAreaOnly; @@ -911,11 +912,12 @@ static inline void Gia_ObjSetFanout( Gia_Man_t * p, Gia_Obj_t * pObj, int #define Gia_ObjForEachFanoutStaticId( p, Id, FanId, i ) \ for ( i = 0; (i < Gia_ObjFanoutNumId(p, Id)) && (((FanId) = Gia_ObjFanoutId(p, Id, i)), 1); i++ ) -static inline int Gia_ManHasMapping( Gia_Man_t * p ) { return p->vMapping != NULL; } -static inline int Gia_ObjIsLut( Gia_Man_t * p, int Id ) { return Vec_IntEntry(p->vMapping, Id) != 0; } +static inline int Gia_ManHasMapping( Gia_Man_t * p ) { return p->vMapping != NULL; } +static inline int Gia_ObjIsLut( Gia_Man_t * p, int Id ) { return Vec_IntEntry(p->vMapping, Id) != 0; } static inline int Gia_ObjLutSize( Gia_Man_t * p, int Id ) { return Vec_IntEntry(p->vMapping, Vec_IntEntry(p->vMapping, Id)); } static inline int * Gia_ObjLutFanins( Gia_Man_t * p, int Id ) { return Vec_IntEntryP(p->vMapping, Vec_IntEntry(p->vMapping, Id)) + 1; } -static inline int Gia_ObjLutFanin( Gia_Man_t * p, int Id, int i ) { return Gia_ObjLutFanins(p, Id)[i]; } +static inline int Gia_ObjLutFanin( Gia_Man_t * p, int Id, int i ) { return Gia_ObjLutFanins(p, Id)[i]; } +static inline int Gia_ObjLutIsMux( Gia_Man_t * p, int Id ) { return (int)(Gia_ObjLutFanins(p, Id)[Gia_ObjLutSize(p, Id)] == -Id); } #define Gia_ManForEachLut( p, i ) \ for ( i = 1; i < Gia_ManObjNum(p); i++ ) if ( !Gia_ObjIsLut(p, i) ) {} else @@ -1334,6 +1336,7 @@ extern Vec_Int_t * Gia_ManCollectPoIds( Gia_Man_t * p ); extern int Gia_ObjIsMuxType( Gia_Obj_t * pNode ); extern int Gia_ObjRecognizeExor( Gia_Obj_t * pObj, Gia_Obj_t ** ppFan0, Gia_Obj_t ** ppFan1 ); extern Gia_Obj_t * Gia_ObjRecognizeMux( Gia_Obj_t * pNode, Gia_Obj_t ** ppNodeT, Gia_Obj_t ** ppNodeE ); +extern int Gia_ObjRecognizeMuxLits( Gia_Man_t * p, Gia_Obj_t * pNode, int * iLitT, int * iLitE ); extern int Gia_NodeMffcSize( Gia_Man_t * p, Gia_Obj_t * pNode ); extern int Gia_ManHasDangling( Gia_Man_t * p ); extern int Gia_ManMarkDangling( Gia_Man_t * p ); diff --git a/src/aig/gia/giaBalance.c b/src/aig/gia/giaBalance.c index abb6dd19..611bbf87 100644 --- a/src/aig/gia/giaBalance.c +++ b/src/aig/gia/giaBalance.c @@ -1032,6 +1032,7 @@ Gia_Man_t * Gia_ManAigSyn2( Gia_Man_t * p, int fOldAlgo, int fCoarsen, int fCutM pPars->fCoarsen = fCoarsen; pPars->fCutMin = fCutMin; pPars->nRelaxRatio = nRelaxRatio; + pPars->nAreaTuner = 1; } if ( fVerbose ) Gia_ManPrintStats( p, NULL ); if ( Gia_ManAndNum(p) == 0 ) diff --git a/src/aig/gia/giaIf.c b/src/aig/gia/giaIf.c index 537ffd0a..20204798 100644 --- a/src/aig/gia/giaIf.c +++ b/src/aig/gia/giaIf.c @@ -318,29 +318,32 @@ void Gia_ManPrintGetMuxFanins( Gia_Man_t * p, Gia_Obj_t * pObj, int * pFanins ) } int Gia_ManCountDupLut6( Gia_Man_t * p ) { - int i, nCountDup = 0, nCountPis = 0; - Gia_ManCleanMark0( p ); + int i, nCountDup = 0, nCountPis = 0, nCountMux = 0; + Gia_ManCleanMark01( p ); Gia_ManForEachLut( p, i ) - if ( Gia_ObjLutSize(p, i) == 3 && Gia_ObjLutFanins(p, i)[3] == -i ) + if ( Gia_ObjLutSize(p, i) == 3 && Gia_ObjLutIsMux(p, i) ) { Gia_Obj_t * pFanin; int pFanins[3]; Gia_ManPrintGetMuxFanins( p, Gia_ManObj(p, i), pFanins ); + Gia_ManObj(p, i)->fMark1 = 1; pFanin = Gia_ManObj(p, pFanins[1]); nCountPis += Gia_ObjIsCi(pFanin); nCountDup += pFanin->fMark0; + nCountMux += pFanin->fMark1; pFanin->fMark0 = 1; pFanin = Gia_ManObj(p, pFanins[2]); nCountPis += Gia_ObjIsCi(pFanin); nCountDup += pFanin->fMark0; + nCountMux += pFanin->fMark1; pFanin->fMark0 = 1; } - Gia_ManCleanMark0( p ); - if ( nCountDup + nCountPis ) - printf( "Dup fanins = %d. CI fanins = %d. Total = %d. (%.2f %%)\n", - nCountDup, nCountPis, nCountDup + nCountPis, 100.0 * (nCountDup + nCountPis) / Gia_ManLutNum(p) ); + Gia_ManCleanMark01( p ); + if ( nCountDup + nCountPis + nCountMux ) + printf( "Dup fanins = %d. CI fanins = %d. MUX fanins = %d. Total = %d. (%.2f %%)\n", + nCountDup, nCountPis, nCountMux, nCountDup + nCountPis, 100.0 * (nCountDup + nCountPis + nCountMux) / Gia_ManLutNum(p) ); return nCountDup + nCountPis; } @@ -354,7 +357,7 @@ void Gia_ManPrintMappingStats( Gia_Man_t * p, char * pDumpFile ) pLevels = ABC_CALLOC( int, Gia_ManObjNum(p) ); Gia_ManForEachLut( p, i ) { - if ( Gia_ObjLutSize(p, i) == 3 && Gia_ObjLutFanins(p, i)[3] == -i ) + if ( Gia_ObjLutSize(p, i) == 3 && Gia_ObjLutIsMux(p, i) ) { int pFanins[3]; Gia_ManPrintGetMuxFanins( p, Gia_ManObj(p, i), pFanins ); @@ -1576,7 +1579,7 @@ void Gia_ManTransferMapping( Gia_Man_t * pGia, Gia_Man_t * p ) Vec_IntPush( p->vMapping, Gia_ObjLutSize(pGia, i) ); Gia_LutForEachFanin( pGia, i, iFan, k ) Vec_IntPush( p->vMapping, Abc_Lit2Var(Gia_ObjValue(Gia_ManObj(pGia, iFan))) ); - Vec_IntPush( p->vMapping, Gia_ObjId(p, pObj) ); + Vec_IntPush( p->vMapping, Gia_ObjLutIsMux(pGia, i) ? -Gia_ObjId(p, pObj) : Gia_ObjId(p, pObj) ); } Gia_ManMappingVerify( p ); } diff --git a/src/aig/gia/giaLf.c b/src/aig/gia/giaLf.c index ebd0dc18..96a633f4 100644 --- a/src/aig/gia/giaLf.c +++ b/src/aig/gia/giaLf.c @@ -52,10 +52,6 @@ Gia_Man_t * Lf_ManPerformMapping( Gia_Man_t * pGia, Jf_Par_t * pPars ) { return Jf_ManPerformMapping( pGia, pPars ); } -Gia_Man_t * Gia_ManPerformLfMapping( Gia_Man_t * p, Jf_Par_t * pPars, int fNormalized ) -{ - return Jf_ManPerformMapping( p, pPars ); -} //////////////////////////////////////////////////////////////////////// /// END OF FILE /// diff --git a/src/aig/gia/giaMf.c b/src/aig/gia/giaMf.c index 0ff54c8d..da571904 100644 --- a/src/aig/gia/giaMf.c +++ b/src/aig/gia/giaMf.c @@ -943,7 +943,7 @@ static inline int Mf_CutArea( Mf_Man_t * p, int nLeaves, int iFunc ) if ( p->pPars->fGenCnf ) return Vec_IntEntry(&p->vCnfSizes, Abc_Lit2Var(iFunc)); if ( p->pPars->fOptEdge ) - return nLeaves + 1; + return nLeaves + p->pPars->nAreaTuner; return 1; } static inline void Mf_CutParams( Mf_Man_t * p, Mf_Cut_t * pCut, float FlowRefs ) @@ -1386,6 +1386,7 @@ void Mf_ManSetDefaultPars( Jf_Par_t * pPars ) pPars->nRoundsEla = 1; pPars->nRelaxRatio = 0; pPars->nCoarseLimit = 3; + pPars->nAreaTuner = 1; pPars->nVerbLimit = 5; pPars->DelayTarget = -1; pPars->fAreaOnly = 0; diff --git a/src/aig/gia/giaStr.c b/src/aig/gia/giaStr.c index 823d7f27..13ddb233 100644 --- a/src/aig/gia/giaStr.c +++ b/src/aig/gia/giaStr.c @@ -43,7 +43,7 @@ ABC_NAMESPACE_IMPL_START SeeAlso [] ***********************************************************************/ -Gia_Man_t * Str_NormalizeTest( Gia_Man_t * p, int nLutSize, int fUseMuxes, int fVerbose ) +Gia_Man_t * Gia_ManLutBalance( Gia_Man_t * p, int nLutSize, int fUseMuxes, int fRecursive, int fOptArea, int fVerbose ) { return Gia_ManDup(p); } diff --git a/src/aig/gia/giaUtil.c b/src/aig/gia/giaUtil.c index e37022c3..7bf29b18 100644 --- a/src/aig/gia/giaUtil.c +++ b/src/aig/gia/giaUtil.c @@ -1052,6 +1052,15 @@ Gia_Obj_t * Gia_ObjRecognizeMux( Gia_Obj_t * pNode, Gia_Obj_t ** ppNodeT, Gia_Ob assert( 0 ); // this is not MUX return NULL; } +int Gia_ObjRecognizeMuxLits( Gia_Man_t * p, Gia_Obj_t * pNode, int * iLitT, int * iLitE ) +{ + Gia_Obj_t * pNodeT, * pNodeE; + Gia_Obj_t * pCtrl = Gia_ObjRecognizeMux( pNode, &pNodeT, &pNodeE ); + assert( pCtrl != NULL ); + *iLitT = Gia_Obj2Lit( p, pNodeT ); + *iLitE = Gia_Obj2Lit( p, pNodeE ); + return Gia_Obj2Lit( p, pCtrl ); +} /**Function************************************************************* |