diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2014-08-04 10:53:08 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2014-08-04 10:53:08 -0700 |
commit | 1d9d6814ee20412a37fcda79a333d9d7e3fee1d4 (patch) | |
tree | d8981253d6d3e9a11b50b85e95efef2dbe66439d | |
parent | 82aec90c6cfd503fb6efaf5251bb5286785f7038 (diff) | |
download | abc-1d9d6814ee20412a37fcda79a333d9d7e3fee1d4.tar.gz abc-1d9d6814ee20412a37fcda79a333d9d7e3fee1d4.tar.bz2 abc-1d9d6814ee20412a37fcda79a333d9d7e3fee1d4.zip |
Enabling ISOP-based minimization in 'collapse' if EXDC is available.
-rw-r--r-- | src/base/abci/abcCollapse.c | 35 | ||||
-rw-r--r-- | src/base/abci/abcStrash.c | 2 |
2 files changed, 35 insertions, 2 deletions
diff --git a/src/base/abci/abcCollapse.c b/src/base/abci/abcCollapse.c index 20fe04b5..76a6f009 100644 --- a/src/base/abci/abcCollapse.c +++ b/src/base/abci/abcCollapse.c @@ -117,6 +117,40 @@ Abc_Ntk_t * Abc_NtkFromGlobalBdds( Abc_Ntk_t * pNtk ) DdManager * dd = (DdManager *)Abc_NtkGlobalBddMan( pNtk ); int i; + // extract don't-care and compute ISOP + if ( pNtk->pExdc ) + { + DdManager * ddExdc = NULL; + DdNode * bBddMin, * bBddDc, * bBddL, * bBddU; + assert( Abc_NtkIsStrash(pNtk->pExdc) ); + assert( Abc_NtkCoNum(pNtk->pExdc) == 1 ); + // compute the global BDDs + if ( Abc_NtkBuildGlobalBdds(pNtk->pExdc, 10000000, 1, 1, 0) == NULL ) + return NULL; + // transfer tot the same manager + ddExdc = (DdManager *)Abc_NtkGlobalBddMan( pNtk->pExdc ); + bBddDc = (DdNode *)Abc_ObjGlobalBdd(Abc_NtkCo(pNtk->pExdc, 0)); + bBddDc = Cudd_bddTransfer( ddExdc, dd, bBddDc ); Cudd_Ref( bBddDc ); + Abc_NtkFreeGlobalBdds( pNtk->pExdc, 1 ); + // minimize the output + Abc_NtkForEachCo( pNtk, pNode, i ) + { + bBddMin = (DdNode *)Abc_ObjGlobalBdd(pNode); + // derive lower and uppwer bound + bBddL = Cudd_bddAnd( dd, bBddMin, Cudd_Not(bBddDc) ); Cudd_Ref( bBddL ); + bBddU = Cudd_bddAnd( dd, Cudd_Not(bBddMin), Cudd_Not(bBddDc) ); Cudd_Ref( bBddU ); + Cudd_RecursiveDeref( dd, bBddMin ); + // compute new one + bBddMin = Cudd_bddIsop( dd, bBddL, Cudd_Not(bBddU) ); Cudd_Ref( bBddMin ); + Cudd_RecursiveDeref( dd, bBddL ); + Cudd_RecursiveDeref( dd, bBddU ); + // update global BDD + Abc_ObjSetGlobalBdd( pNode, bBddMin ); + //Extra_bddPrint( dd, bBddMin ); printf( "\n" ); + } + Cudd_RecursiveDeref( dd, bBddDc ); + } + // pReo = Extra_ReorderInit( Abc_NtkCiNum(pNtk), 1000 ); // runtime1 = runtime2 = 0; @@ -176,7 +210,6 @@ Abc_Obj_t * Abc_NodeFromGlobalBdds( Abc_Ntk_t * pNtkNew, DdManager * dd, DdNode return pNodeNew; } - //////////////////////////////////////////////////////////////////////// /// END OF FILE /// //////////////////////////////////////////////////////////////////////// diff --git a/src/base/abci/abcStrash.c b/src/base/abci/abcStrash.c index a3d87323..4dd6bf50 100644 --- a/src/base/abci/abcStrash.c +++ b/src/base/abci/abcStrash.c @@ -293,7 +293,7 @@ Abc_Ntk_t * Abc_NtkStrash( Abc_Ntk_t * pNtk, int fAllNodes, int fCleanup, int fR // printf( "Warning: AIG cleanup removed %d nodes (this is not a bug).\n", nNodes ); // duplicate EXDC if ( pNtk->pExdc ) - pNtkAig->pExdc = Abc_NtkDup( pNtk->pExdc ); + pNtkAig->pExdc = Abc_NtkStrash( pNtk->pExdc, fAllNodes, fCleanup, fRecord ); // make sure everything is okay if ( !Abc_NtkCheck( pNtkAig ) ) { |