diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2020-06-24 10:20:28 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2020-06-24 10:20:28 -0700 |
commit | 322cea8234aaa6a46c3f2f19c3c3246476231875 (patch) | |
tree | b37df578dd397e8c327c6bc3ce31115077edaccd /src | |
parent | 58e3a5caff7033200fce5136dd7e02eee87c4e8a (diff) | |
download | abc-322cea8234aaa6a46c3f2f19c3c3246476231875.tar.gz abc-322cea8234aaa6a46c3f2f19c3c3246476231875.tar.bz2 abc-322cea8234aaa6a46c3f2f19c3c3246476231875.zip |
Bug fix in &cec (handling the case when the miter is disproved by the all-0 pattern).
Diffstat (limited to 'src')
-rw-r--r-- | src/base/abci/abc.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index 52475b50..69d72757 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -36950,13 +36950,31 @@ int Abc_CommandAbc9Cec( Abc_Frame_t * pAbc, int argc, char ** argv ) } else { - Gia_Man_t * pTemp; + abctime clk = Abc_Clock(); + Gia_Obj_t * pObj; int i; if ( !pPars->fSilent ) Abc_Print( 1, "Assuming the current network is a single-output miter.\n" ); - pTemp = Gia_ManDemiterToDual( pAbc->pGia ); - pAbc->Status = Cec_ManVerify( pTemp, pPars ); - ABC_SWAP( Abc_Cex_t *, pAbc->pGia->pCexComb, pTemp->pCexComb ); - Gia_ManStop( pTemp ); + // handle the case when the output is disproved by an all-0 primary input pattern + ABC_FREE( pAbc->pGia->pCexComb ); + Gia_ManSetPhase( pAbc->pGia ); + Gia_ManForEachCo( pAbc->pGia, pObj, i ) + if ( pObj->fPhase ) + { + pAbc->pGia->pCexComb = Abc_CexAlloc( 0, Gia_ManCiNum(pAbc->pGia), 1 ); + if ( !pPars->fSilent ) + { + Abc_Print( 1, "Networks are NOT EQUIVALENT. Output %d trivially differs (different phase). ", i ); + Abc_PrintTime( 1, "Time", Abc_Clock() - clk ); + } + break; + } + if ( pAbc->pGia->pCexComb == NULL ) + { + Gia_Man_t * pTemp = Gia_ManDemiterToDual( pAbc->pGia ); + pAbc->Status = Cec_ManVerify( pTemp, pPars ); + ABC_SWAP( Abc_Cex_t *, pAbc->pGia->pCexComb, pTemp->pCexComb ); + Gia_ManStop( pTemp ); + } } Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexComb ); return 0; |