diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2013-08-20 08:46:31 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2013-08-20 08:46:31 -0700 |
commit | 1ad363c1566bd878bd71f9032f446506efcbcc9a (patch) | |
tree | a719c0799293f87c6e28b503cdf42816310f369c /src/proof/ssw/sswRarity.c | |
parent | b7c8f9188d99b4ab509c57f75b95f26de4fb656c (diff) | |
download | abc-1ad363c1566bd878bd71f9032f446506efcbcc9a.tar.gz abc-1ad363c1566bd878bd71f9032f446506efcbcc9a.tar.bz2 abc-1ad363c1566bd878bd71f9032f446506efcbcc9a.zip |
Added switch &sim -g to enable flop grouping.
Diffstat (limited to 'src/proof/ssw/sswRarity.c')
-rw-r--r-- | src/proof/ssw/sswRarity.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/src/proof/ssw/sswRarity.c b/src/proof/ssw/sswRarity.c index 10e19b5a..214a3e3c 100644 --- a/src/proof/ssw/sswRarity.c +++ b/src/proof/ssw/sswRarity.c @@ -1124,6 +1124,33 @@ finish: /**Function************************************************************* + Synopsis [Derive random flop permutation.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +Vec_Int_t * Ssw_RarRandomPermFlop( int nFlops ) +{ + Vec_Int_t * vPerm; + int i, k, * pArray; + srand( 1 ); + printf( "Generating random permutation of %d flops.\n", nFlops ); + vPerm = Vec_IntStartNatural( nFlops ); + pArray = Vec_IntArray( vPerm ); + for ( i = 0; i < nFlops; i++ ) + { + k = rand() % nFlops; + ABC_SWAP( int, pArray[i], pArray[k] ); + } + return vPerm; +} + +/**Function************************************************************* + Synopsis [Perform sequential simulation.] Description [] @@ -1137,7 +1164,16 @@ int Ssw_RarSimulateGia( Gia_Man_t * p, Ssw_RarPars_t * pPars ) { Aig_Man_t * pAig; int RetValue; - pAig = Gia_ManToAigSimple( p ); + if ( pPars->fUseFfGrouping ) + { + Vec_Int_t * vPerm = Ssw_RarRandomPermFlop( Gia_ManRegNum(p) ); + Gia_Man_t * pTemp = Gia_ManDupPermFlop( p, vPerm ); + Vec_IntFree( vPerm ); + pAig = Gia_ManToAigSimple( pTemp ); + Gia_ManStop( pTemp ); + } + else + pAig = Gia_ManToAigSimple( p ); RetValue = Ssw_RarSimulate( pAig, pPars ); // save counter-example Abc_CexFree( p->pCexSeq ); |