Commit 7e293ebe by Alan Mishchenko

User-controlable SAT sweeper.

parent fe3b2e25
...@@ -108,6 +108,7 @@ struct Gia_Man_t_ ...@@ -108,6 +108,7 @@ struct Gia_Man_t_
int * pHTable; // hash table int * pHTable; // hash table
int nHTable; // hash table size int nHTable; // hash table size
int fAddStrash; // performs additional structural hashing int fAddStrash; // performs additional structural hashing
int fSweeper; // sweeper is running
int * pRefs; // the reference count int * pRefs; // the reference count
Vec_Int_t * vLevels; // levels of the nodes Vec_Int_t * vLevels; // levels of the nodes
int nLevels; // the mamixum level int nLevels; // the mamixum level
...@@ -473,6 +474,12 @@ static inline int Gia_ManAppendAnd( Gia_Man_t * p, int iLit0, int iLit1 ) ...@@ -473,6 +474,12 @@ static inline int Gia_ManAppendAnd( Gia_Man_t * p, int iLit0, int iLit1 )
Gia_ObjAddFanout( p, Gia_ObjFanin0(pObj), pObj ); Gia_ObjAddFanout( p, Gia_ObjFanin0(pObj), pObj );
Gia_ObjAddFanout( p, Gia_ObjFanin1(pObj), pObj ); Gia_ObjAddFanout( p, Gia_ObjFanin1(pObj), pObj );
} }
if ( p->fSweeper )
{
Gia_ObjFanin0(pObj)->fMark0 = Gia_ObjFanin1(pObj)->fMark0 = 1;
pObj->fPhase = (Gia_ObjPhase(Gia_ObjFanin0(pObj)) ^ Gia_ObjFaninC0(pObj)) &
(Gia_ObjPhase(Gia_ObjFanin1(pObj)) ^ Gia_ObjFaninC1(pObj));
}
return Gia_ObjId( p, pObj ) << 1; return Gia_ObjId( p, pObj ) << 1;
} }
static inline int Gia_ManAppendPinType( Gia_Man_t * p, int iLit ) static inline int Gia_ManAppendPinType( Gia_Man_t * p, int iLit )
...@@ -983,6 +990,9 @@ extern void Gia_ManStgPrint( FILE * pFile, Vec_Int_t * vLines, in ...@@ -983,6 +990,9 @@ extern void Gia_ManStgPrint( FILE * pFile, Vec_Int_t * vLines, in
extern Gia_Man_t * Gia_ManStgRead( char * pFileName, int kHot, int fVerbose ); extern Gia_Man_t * Gia_ManStgRead( char * pFileName, int kHot, int fVerbose );
/*=== giaSweep.c ============================================================*/ /*=== giaSweep.c ============================================================*/
extern Gia_Man_t * Gia_ManFraigSweep( Gia_Man_t * p, void * pPars ); extern Gia_Man_t * Gia_ManFraigSweep( Gia_Man_t * p, void * pPars );
/*=== giaSweeper.c ============================================================*/
extern Gia_Man_t * Gia_ManStartSweeper();
extern void Gia_ManStopSweeper( Gia_Man_t * p );
/*=== giaSwitch.c ============================================================*/ /*=== giaSwitch.c ============================================================*/
extern float Gia_ManEvaluateSwitching( Gia_Man_t * p ); extern float Gia_ManEvaluateSwitching( Gia_Man_t * p );
extern float Gia_ManComputeSwitching( Gia_Man_t * p, int nFrames, int nPref, int fProbOne ); extern float Gia_ManComputeSwitching( Gia_Man_t * p, int nFrames, int nPref, int fProbOne );
......
...@@ -286,9 +286,9 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep ...@@ -286,9 +286,9 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
int Fans[2][DAU_MAX_VAR], * pFans[2] = { Fans[0], Fans[1] }; int Fans[2][DAU_MAX_VAR], * pFans[2] = { Fans[0], Fans[1] };
// create fanins // create fanins
for ( j = 0; j < (int)pCut0->nLeaves; j++ ) for ( j = 0; j < (int)pCut0->nLeaves; j++ )
pFans[0][j] = Abc_Lit2Lit( p->pPerm[0], (int)pCut0->pPerm[j] ); pFans[0][j] = Abc_Lit2LitV( p->pPerm[0], (int)pCut0->pPerm[j] );
for ( j = 0; j < (int)pCut1->nLeaves; j++ ) for ( j = 0; j < (int)pCut1->nLeaves; j++ )
pFans[1][j] = Abc_Lit2Lit( p->pPerm[1], (int)pCut1->pPerm[j] ); pFans[1][j] = Abc_Lit2LitV( p->pPerm[1], (int)pCut1->pPerm[j] );
// canonicize // canonicize
if ( iDsd[0] > iDsd[1] ) if ( iDsd[0] > iDsd[1] )
{ {
......
...@@ -263,7 +263,8 @@ static inline int Abc_LitIsCompl( int Lit ) { return Lit & 1; ...@@ -263,7 +263,8 @@ static inline int Abc_LitIsCompl( int Lit ) { return Lit & 1;
static inline int Abc_LitNot( int Lit ) { return Lit ^ 1; } static inline int Abc_LitNot( int Lit ) { return Lit ^ 1; }
static inline int Abc_LitNotCond( int Lit, int c ) { return Lit ^ (int)(c > 0); } static inline int Abc_LitNotCond( int Lit, int c ) { return Lit ^ (int)(c > 0); }
static inline int Abc_LitRegular( int Lit ) { return Lit & ~01; } static inline int Abc_LitRegular( int Lit ) { return Lit & ~01; }
static inline int Abc_Lit2Lit( int * pMap, int Lit ) { return Abc_Var2Lit( pMap[Abc_Lit2Var(Lit)], Abc_LitIsCompl(Lit) ); } static inline int Abc_Lit2LitV( int * pMap, int Lit ) { return Abc_Var2Lit( pMap[Abc_Lit2Var(Lit)], Abc_LitIsCompl(Lit) ); }
static inline int Abc_Lit2LitL( int * pMap, int Lit ) { return Abc_LitNotCond( pMap[Abc_Lit2Var(Lit)], Abc_LitIsCompl(Lit) ); }
enum Abc_VerbLevel enum Abc_VerbLevel
{ {
......
...@@ -1489,7 +1489,7 @@ if ( Counter ) ...@@ -1489,7 +1489,7 @@ if ( Counter )
// translate this map into the one that maps vars of iDsdRes into literals of cut // translate this map into the one that maps vars of iDsdRes into literals of cut
pFun->nFans = Dss_VecLitSuppSize( p->vObjs, pFun->iDsd ); pFun->nFans = Dss_VecLitSuppSize( p->vObjs, pFun->iDsd );
for ( i = 0; i < (int)pFun->nFans; i++ ) for ( i = 0; i < (int)pFun->nFans; i++ )
pFun->pFans[i] = (unsigned char)Abc_Lit2Lit( pMapDsd2Truth, pPermDsd[i] ); pFun->pFans[i] = (unsigned char)Abc_Lit2LitV( pMapDsd2Truth, pPermDsd[i] );
// Dss_EntPrint( pEnt, pFun ); // Dss_EntPrint( pEnt, pFun );
return pFun; return pFun;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment