26 #ifdef ABC_USE_PTHREADS
29 #include "../lib/pthread.h"
43 #ifndef ABC_USE_PTHREADS
49 #else // pthreads are used
52 typedef struct Abs_ThData_t_
60 pthread_mutex_t g_mutex = PTHREAD_MUTEX_INITIALIZER;
61 static volatile int g_nRunIds = 0;
62 static volatile int g_fAbstractionProved = 0;
65 int Abs_CallBackToStop(
int RunId ) {
assert( RunId <= g_nRunIds );
return RunId < g_nRunIds; }
73 if ( pPars->pFuncStop && pPars->pFuncStop(pPars->RunId) )
95 void * Abs_ProverThread(
void * pArg )
97 Abs_ThData_t * pThData = (Abs_ThData_t *)pArg;
103 pPars->RunId = pThData->RunId;
104 pPars->pFuncStop = Abs_CallBackToStop;
109 status = pthread_mutex_lock(&g_mutex);
assert( status == 0 );
110 g_fAbstractionProved = 1;
111 status = pthread_mutex_unlock(&g_mutex);
assert( status == 0 );
114 if ( pThData->fVerbose )
117 Abc_Print( 1,
"Proved abstraction %d.\n", pThData->RunId );
118 else if ( RetValue == 0 )
119 Abc_Print( 1,
"Disproved abstraction %d.\n", pThData->RunId );
120 else if ( RetValue == -1 )
121 Abc_Print( 1,
"Cancelled abstraction %d.\n", pThData->RunId );
128 pthread_exit( NULL );
135 Abs_ThData_t * pThData;
139 pthread_t ProverThread;
164 status = pthread_mutex_lock(&g_mutex);
assert( status == 0 );
165 g_fAbstractionProved = 0;
166 status = pthread_mutex_unlock(&g_mutex);
assert( status == 0 );
169 pThData->pAig = pAig;
170 pThData->fVerbose = fVerbose;
171 status = pthread_mutex_lock(&g_mutex);
assert( status == 0 );
172 pThData->RunId = ++g_nRunIds;
173 status = pthread_mutex_unlock(&g_mutex);
assert( status == 0 );
175 if ( fVerbose )
Abc_Print( 1,
"\nTrying to prove abstraction %d.\n", pThData->RunId );
176 status = pthread_create( &ProverThread, NULL, Abs_ProverThread, pThData );
182 status = pthread_mutex_lock(&g_mutex);
assert( status == 0 );
184 status = pthread_mutex_unlock(&g_mutex);
assert( status == 0 );
189 if ( g_fAbstractionProved == 0 )
191 status = pthread_mutex_lock(&g_mutex);
assert( status == 0 );
192 g_fAbstractionProved = 0;
193 status = pthread_mutex_unlock(&g_mutex);
assert( status == 0 );
197 #endif // pthreads are used
void Gia_ManStop(Gia_Man_t *p)
Aig_Man_t * Gia_ManToAigSimple(Gia_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
void Aig_ManStop(Aig_Man_t *p)
void Pdr_ManSetDefaultParams(Pdr_Par_t *pPars)
MACRO DEFINITIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Pdr_Par_t_ Pdr_Par_t
INCLUDES ///.
typedefABC_NAMESPACE_HEADER_START struct Ssw_Pars_t_ Ssw_Pars_t
INCLUDES ///.
void Gia_ManCleanValue(Gia_Man_t *p)
Gia_Man_t * Gia_ManDupAbsGates(Gia_Man_t *p, Vec_Int_t *vGateClasses)
Aig_Man_t * Ssw_SignalCorrespondence(Aig_Man_t *pAig, Ssw_Pars_t *pPars)
#define ABC_ALLOC(type, num)
ABC_NAMESPACE_IMPL_START Aig_Man_t * Dar_ManRwsat(Aig_Man_t *pAig, int fBalance, int fVerbose)
DECLARATIONS ///.
int Gia_GlaProveCheck(int fVerbose)
void Ssw_ManSetDefaultParams(Ssw_Pars_t *p)
DECLARATIONS ///.
#define ABC_NAMESPACE_IMPL_END
static void Abc_Print(int level, const char *format,...)
#define ABC_NAMESPACE_IMPL_START
void Gia_GlaProveCancel(int fVerbose)
int Pdr_ManSolve(Aig_Man_t *p, Pdr_Par_t *pPars)
#define ABC_CALLOC(type, num)
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
ABC_NAMESPACE_IMPL_START void Gia_GlaProveAbsracted(Gia_Man_t *p, int fSimpProver, int fVerbose)
DECLARATIONS ///.