From da65e88e3b346bcd70198b980e918ea9f1e11b4e Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Mon, 22 Jun 2015 23:04:59 -0700 Subject: Version abc90804 committer: Baruch Sterin --- src/aig/dch/dch.h | 2 +- src/aig/dch/dchCore.c | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) (limited to 'src/aig/dch') diff --git a/src/aig/dch/dch.h b/src/aig/dch/dch.h index 38978164..7271d256 100644 --- a/src/aig/dch/dch.h +++ b/src/aig/dch/dch.h @@ -68,7 +68,7 @@ struct Dch_Pars_t_ /*=== dchCore.c ==========================================================*/ extern void Dch_ManSetDefaultParams( Dch_Pars_t * p ); extern Aig_Man_t * Dch_ComputeChoices( Aig_Man_t * pAig, Dch_Pars_t * pPars ); - +extern void Dch_ComputeEquivalences( Aig_Man_t * pAig, Dch_Pars_t * pPars ); #ifdef __cplusplus } diff --git a/src/aig/dch/dchCore.c b/src/aig/dch/dchCore.c index 4a8d8b53..d38d5668 100644 --- a/src/aig/dch/dchCore.c +++ b/src/aig/dch/dchCore.c @@ -90,7 +90,7 @@ p->timeTotal = clock() - clkTotal; ABC_FREE( pAig->pTable ); pResult = Dch_DeriveChoiceAig( pAig ); // count the number of representatives - if ( pPars->fVerbose ) + if ( pPars->fVerbose ) printf( "STATS: Reprs = %6d. Equivs = %6d. Choices = %6d.\n", Dch_DeriveChoiceCountReprs( pAig ), Dch_DeriveChoiceCountEquivs( pResult ), @@ -98,6 +98,38 @@ p->timeTotal = clock() - clkTotal; return pResult; } +/**Function************************************************************* + + Synopsis [Performs computation of AIGs with choices.] + + Description [Takes several AIGs and performs choicing.] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +void Dch_ComputeEquivalences( Aig_Man_t * pAig, Dch_Pars_t * pPars ) +{ + Dch_Man_t * p; + int clk, clkTotal = clock(); + // reset random numbers + Aig_ManRandom(1); + // start the choicing manager + p = Dch_ManCreate( pAig, pPars ); + // compute candidate equivalence classes +clk = clock(); + p->ppClasses = Dch_CreateCandEquivClasses( pAig, pPars->nWords, pPars->fVerbose ); +p->timeSimInit = clock() - clk; +// Dch_ClassesPrint( p->ppClasses, 0 ); + p->nLits = Dch_ClassesLitNum( p->ppClasses ); + // perform SAT sweeping + Dch_ManSweep( p ); + // free memory ahead of time +p->timeTotal = clock() - clkTotal; + Dch_ManStop( p ); +} + //////////////////////////////////////////////////////////////////////// /// END OF FILE /// //////////////////////////////////////////////////////////////////////// -- cgit v1.2.3