summaryrefslogtreecommitdiffstats
path: root/src/aig
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2013-09-30 22:41:55 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2013-09-30 22:41:55 -0700
commit1fb7ef8153eb42bc8b614f109571c9e47138b956 (patch)
tree4dbed89f936a808c2b73343289f9716a33e5ab6a /src/aig
parent4f72aff1d164b1ebb190ac5e1e7a5c01d8d1e720 (diff)
downloadabc-1fb7ef8153eb42bc8b614f109571c9e47138b956.tar.gz
abc-1fb7ef8153eb42bc8b614f109571c9e47138b956.tar.bz2
abc-1fb7ef8153eb42bc8b614f109571c9e47138b956.zip
Converting mapped AIG into strashed AIG.
Diffstat (limited to 'src/aig')
-rw-r--r--src/aig/gia/giaBalance.c15
-rw-r--r--src/aig/gia/giaJf.c2
2 files changed, 12 insertions, 5 deletions
diff --git a/src/aig/gia/giaBalance.c b/src/aig/gia/giaBalance.c
index 6f1b615c..3aa17845 100644
--- a/src/aig/gia/giaBalance.c
+++ b/src/aig/gia/giaBalance.c
@@ -21,6 +21,7 @@
#include "gia.h"
#include "misc/vec/vecHash.h"
#include "misc/vec/vecQue.h"
+#include "opt/dau/dau.h"
ABC_NAMESPACE_IMPL_START
@@ -906,7 +907,7 @@ Gia_Man_t * Dam_ManMultiExtractInt( Gia_Man_t * pGia, int nNewNodesMax, int fVer
int i, iDiv;
p = Dam_ManAlloc( pGia );
Dam_ManCreatePairs( p, fVerbose );
- for ( i = 0; i < nNewNodesMax && Vec_QueTopCost(p->vQue) > 0; i++ )
+ for ( i = 0; i < nNewNodesMax && Vec_QueTopCost(p->vQue) > 2; i++ )
{
iDiv = Vec_QuePop(p->vQue);
if ( fVeryVerbose )
@@ -932,13 +933,19 @@ Gia_Man_t * Dam_ManMultiExtractInt( Gia_Man_t * pGia, int nNewNodesMax, int fVer
}
Gia_Man_t * Gia_ManAreaBalance( Gia_Man_t * p, int fSimpleAnd, int nNewNodesMax, int fVerbose, int fVeryVerbose )
{
- Gia_Man_t * pNew, * pNew1, * pNew2;
- if ( fVerbose ) Gia_ManPrintStats( p, NULL );
- pNew = fSimpleAnd ? Gia_ManDup( p ) : Gia_ManDupMuxes( p );
+ Gia_Man_t * pNew0, * pNew, * pNew1, * pNew2;
+ // get the starting manager
+ pNew0 = Gia_ManHasMapping(p) ? (Gia_Man_t *)Dsm_ManDeriveGia(p) : p;
+ if ( fVerbose ) Gia_ManPrintStats( pNew0, NULL );
+ // derive internal manager
+ pNew = fSimpleAnd ? Gia_ManDup( pNew0 ) : Gia_ManDupMuxes( pNew0 );
if ( fVerbose ) Gia_ManPrintStats( pNew, NULL );
+ if ( pNew0 != p ) Gia_ManStop( pNew0 );
+ // perform the operation
pNew1 = Dam_ManMultiExtractInt( pNew, nNewNodesMax, fVerbose, fVeryVerbose );
if ( fVerbose ) Gia_ManPrintStats( pNew1, NULL );
Gia_ManStop( pNew );
+ // derive the final result
pNew2 = Gia_ManDupNoMuxes( pNew1 );
if ( fVerbose ) Gia_ManPrintStats( pNew2, NULL );
Gia_ManStop( pNew1 );
diff --git a/src/aig/gia/giaJf.c b/src/aig/gia/giaJf.c
index e330fb80..6af8a4b3 100644
--- a/src/aig/gia/giaJf.c
+++ b/src/aig/gia/giaJf.c
@@ -1499,7 +1499,7 @@ Gia_Man_t * Jf_ManDeriveGia( Jf_Man_t * p )
Jf_CutForEachLit( pCut, iLit, k )
Vec_IntPush( vLeaves, Abc_Lit2LitL(Vec_IntArray(vCopies), iLit) );
// create GIA
- iLit = Dsm_ManDeriveGia( pNew, pTruth, vLeaves, vCover );
+ iLit = Dsm_ManTruthToGia( pNew, pTruth, vLeaves, vCover );
iLit = Abc_LitNotCond( iLit, (p->pPars->fCutMin && Jf_CutFuncCompl(pCut)) );
Vec_IntWriteEntry( vCopies, i, iLit );
}