diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2013-11-01 13:25:19 -0400 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2013-11-01 13:25:19 -0400 |
commit | a509fa8ea89cc6374c7a13e7632cb51bc455ce43 (patch) | |
tree | aaa4fff72e352cf892f22c66d717a35471bd142f /src/aig | |
parent | ea1a2cfdaba5729eb9624bbc54b869784860f9f0 (diff) | |
download | abc-a509fa8ea89cc6374c7a13e7632cb51bc455ce43.tar.gz abc-a509fa8ea89cc6374c7a13e7632cb51bc455ce43.tar.bz2 abc-a509fa8ea89cc6374c7a13e7632cb51bc455ce43.zip |
Sweeper internal verification.
Diffstat (limited to 'src/aig')
-rw-r--r-- | src/aig/gia/gia.h | 2 | ||||
-rw-r--r-- | src/aig/gia/giaDup.c | 35 | ||||
-rw-r--r-- | src/aig/gia/giaSweeper.c | 21 |
3 files changed, 34 insertions, 24 deletions
diff --git a/src/aig/gia/gia.h b/src/aig/gia/gia.h index c3e0d033..a6e36e6c 100644 --- a/src/aig/gia/gia.h +++ b/src/aig/gia/gia.h @@ -1008,7 +1008,7 @@ extern Gia_Man_t * Gia_ManDupDfsCiMap( Gia_Man_t * p, int * pCi2Lit, Vec extern Gia_Man_t * Gia_ManDupDfsClasses( Gia_Man_t * p ); extern Gia_Man_t * Gia_ManDupTopAnd( Gia_Man_t * p, int fVerbose ); extern Gia_Man_t * Gia_ManMiter( Gia_Man_t * pAig0, Gia_Man_t * pAig1, int nInsDup, int fDualOut, int fSeq, int fImplic, int fVerbose ); -extern Gia_Man_t * Gia_ManDupAnd( Gia_Man_t * p, int fCompl ); +extern Gia_Man_t * Gia_ManDupAndOr( Gia_Man_t * p, int fUseOr, int fCompl ); extern Gia_Man_t * Gia_ManDupZeroUndc( Gia_Man_t * p, char * pInit, int fVerbose ); extern Gia_Man_t * Gia_ManMiter2( Gia_Man_t * p, char * pInit, int fVerbose ); extern Gia_Man_t * Gia_ManTransformMiter( Gia_Man_t * p ); diff --git a/src/aig/gia/giaDup.c b/src/aig/gia/giaDup.c index 92076573..657aa2bb 100644 --- a/src/aig/gia/giaDup.c +++ b/src/aig/gia/giaDup.c @@ -2027,9 +2027,40 @@ Gia_Man_t * Gia_ManMiter( Gia_Man_t * p0, Gia_Man_t * p1, int nInsDup, int fDual SeeAlso [] ***********************************************************************/ -Gia_Man_t * Gia_ManDupAnd( Gia_Man_t * p, int fCompl ) +Gia_Man_t * Gia_ManDupAndOr( Gia_Man_t * p, int fUseOr, int fCompl ) { - return NULL; + Gia_Man_t * pNew, * pTemp; + Gia_Obj_t * pObj; + int i, iResult; + assert( Gia_ManRegNum(p) == 0 ); + pNew = Gia_ManStart( Gia_ManObjNum(p) ); + pNew->pName = Abc_UtilStrsav( p->pName ); + Gia_ManConst0(p)->Value = 0; + Gia_ManHashAlloc( pNew ); + Gia_ManForEachPi( p, pObj, i ) + pObj->Value = Gia_ManAppendCi( pNew ); + Gia_ManForEachAnd( p, pObj, i ) + pObj->Value = Gia_ManHashAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) ); + if ( fUseOr ) // construct OR of all POs + { + iResult = 0; + Gia_ManForEachPo( p, pObj, i ) + iResult = Gia_ManHashOr( pNew, iResult, Gia_ObjFanin0Copy(pObj) ); + } + else // construct AND of all POs + { + iResult = 1; + Gia_ManForEachPo( p, pObj, i ) + iResult = Gia_ManHashAnd( pNew, iResult, Gia_ObjFanin0Copy(pObj) ); + } + iResult = Abc_LitNotCond( iResult, (int)(fCompl > 0) ); + Gia_ManForEachPo( p, pObj, i ) + pObj->Value = Gia_ManAppendCo( pNew, iResult ); + Gia_ManHashStop( pNew ); + Gia_ManSetRegNum( pNew, Gia_ManRegNum(p) ); + pNew = Gia_ManCleanup( pTemp = pNew ); + Gia_ManStop( pTemp ); + return pNew; } /**Function************************************************************* diff --git a/src/aig/gia/giaSweeper.c b/src/aig/gia/giaSweeper.c index 2da162d1..3c91c467 100644 --- a/src/aig/gia/giaSweeper.c +++ b/src/aig/gia/giaSweeper.c @@ -969,27 +969,6 @@ Vec_Int_t * Gia_SweeperGraft( Gia_Man_t * pDst, Vec_Int_t * vProbes, Gia_Man_t * /**Function************************************************************* - Synopsis [Verification of the sweeper.] - - Description [] - - SideEffects [] - - SeeAlso [] - -***********************************************************************/ -int Gia_SweeperVerify( Gia_Man_t * p0, Gia_Man_t * p1, Gia_Man_t * pC ) -{ - Gia_Man_t * pMiter = Gia_ManMiter( p0, p1, 0, 0, 0, 0, 0 ); - Gia_Man_t * pConstr = Gia_ManDupAnd( pC, 0 ); - - Gia_ManStop( pConstr ); - Gia_ManStop( pMiter ); - return 1; -} - -/**Function************************************************************* - Synopsis [Performs conditional sweeping of the cone.] Description [Returns the result as a new GIA manager with as many inputs |