diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2015-03-14 16:32:21 +0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2015-03-14 16:32:21 +0700 |
commit | 1451e4551c84c0b57db264c129856eb3e52a7a76 (patch) | |
tree | 954436fef0be05d1ef1adb9281f5e2313335cf01 /src/sat/bmc | |
parent | e89fe16b91e708b897cb58f90fefe2714b520ec8 (diff) | |
download | abc-1451e4551c84c0b57db264c129856eb3e52a7a76.tar.gz abc-1451e4551c84c0b57db264c129856eb3e52a7a76.tar.bz2 abc-1451e4551c84c0b57db264c129856eb3e52a7a76.zip |
Adding flop-input-only switch -f in &fftest.
Diffstat (limited to 'src/sat/bmc')
-rw-r--r-- | src/sat/bmc/bmc.h | 1 | ||||
-rw-r--r-- | src/sat/bmc/bmcFault.c | 47 |
2 files changed, 35 insertions, 13 deletions
diff --git a/src/sat/bmc/bmc.h b/src/sat/bmc/bmc.h index d39f570f..e489c255 100644 --- a/src/sat/bmc/bmc.h +++ b/src/sat/bmc/bmc.h @@ -131,6 +131,7 @@ struct Bmc_ParFf_t_ int nTimeOut; int nIterCheck; int fBasic; + int fFfOnly; int fDump; int fDumpUntest; int fVerbose; diff --git a/src/sat/bmc/bmcFault.c b/src/sat/bmc/bmcFault.c index 4912d82c..d0186d31 100644 --- a/src/sat/bmc/bmcFault.c +++ b/src/sat/bmc/bmcFault.c @@ -57,6 +57,7 @@ void Gia_ParFfSetDefault( Bmc_ParFf_t * p ) p->nTimeOut = 0; p->nIterCheck = 0; p->fBasic = 0; + p->fFfOnly = 0; p->fDump = 0; p->fDumpUntest = 0; p->fVerbose = 0; @@ -178,7 +179,7 @@ static inline void Cnf_DataLiftGia( Cnf_Dat_t * p, Gia_Man_t * pGia, int nVarsPl SeeAlso [] ***********************************************************************/ -Gia_Man_t * Gia_ManFaultUnfold( Gia_Man_t * p, int fUseMuxes ) +Gia_Man_t * Gia_ManFaultUnfold( Gia_Man_t * p, int fUseMuxes, int fFfOnly ) { Gia_Man_t * pNew, * pTemp; Gia_Obj_t * pObj; @@ -201,20 +202,40 @@ Gia_Man_t * Gia_ManFaultUnfold( Gia_Man_t * p, int fUseMuxes ) pObj->Value = Gia_ObjRoToRi(p, pObj)->Value; Gia_ManForEachPi( p, pObj, i ) pObj->Value = Gia_ManAppendCi( pNew ); - Gia_ManForEachAnd( p, pObj, i ) + if ( fFfOnly ) { - iCtrl = Gia_ManAppendCi(pNew); - iThis = Gia_ManHashAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) ); - if ( fUseMuxes ) - pObj->Value = Gia_ManHashMux( pNew, iCtrl, pObj->Value, iThis ); - else - pObj->Value = iThis; + Gia_ManForEachAnd( p, pObj, i ) + pObj->Value = Gia_ManHashAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) ); + Gia_ManForEachPo( p, pObj, i ) + pObj->Value = Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) ); + Gia_ManForEachRi( p, pObj, i ) + { + iCtrl = Gia_ManAppendCi(pNew); + iThis = Gia_ObjFanin0Copy(pObj); + if ( fUseMuxes ) + pObj->Value = Gia_ManHashMux( pNew, iCtrl, pObj->Value, iThis ); + else + pObj->Value = iThis; + pObj->Value = Gia_ManAppendCo( pNew, pObj->Value ); + } + } + else + { + Gia_ManForEachAnd( p, pObj, i ) + { + iCtrl = Gia_ManAppendCi(pNew); + iThis = Gia_ManHashAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) ); + if ( fUseMuxes ) + pObj->Value = Gia_ManHashMux( pNew, iCtrl, pObj->Value, iThis ); + else + pObj->Value = iThis; + } + Gia_ManForEachCo( p, pObj, i ) + pObj->Value = Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) ); } - Gia_ManForEachCo( p, pObj, i ) - pObj->Value = Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) ); pNew = Gia_ManCleanup( pTemp = pNew ); Gia_ManStop( pTemp ); - assert( Gia_ManPiNum(pNew) == Gia_ManRegNum(p) + 2 * Gia_ManPiNum(p) + Gia_ManAndNum(p) ); + assert( Gia_ManPiNum(pNew) == Gia_ManRegNum(p) + 2 * Gia_ManPiNum(p) + (fFfOnly ? Gia_ManRegNum(p) : Gia_ManAndNum(p)) ); return pNew; } @@ -922,8 +943,8 @@ int Gia_ManFaultPrepare( Gia_Man_t * p, Gia_Man_t * pG, Bmc_ParFf_t * pPars, int else if ( pPars->Algo == 1 ) { assert( Gia_ManRegNum(p) > 0 ); - p0 = Gia_ManFaultUnfold( pG, 0 ); - p1 = Gia_ManFaultUnfold( p, 1 ); + p0 = Gia_ManFaultUnfold( pG, 0, pPars->fFfOnly ); + p1 = Gia_ManFaultUnfold( p, 1, pPars->fFfOnly ); } else if ( pPars->Algo == 2 ) p1 = Gia_ManStuckAtUnfold( p, vMap ); |