ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
cgtSat.c File Reference
#include "cgtInt.h"
Include dependency graph for cgtSat.c:

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START int Cgt_CheckImplication (Cgt_Man_t *p, Aig_Obj_t *pGate, Aig_Obj_t *pMiter)
 DECLARATIONS ///.
 

Function Documentation

◆ Cgt_CheckImplication()

ABC_NAMESPACE_IMPL_START int Cgt_CheckImplication ( Cgt_Man_t * p,
Aig_Obj_t * pGate,
Aig_Obj_t * pMiter )

DECLARATIONS ///.

CFile****************************************************************

FileName [cgtSat.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Clock gating package.]

Synopsis [Checking implications using SAT.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

Id
cgtSat.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

] FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis [Runs equivalence test for the two nodes.]

Description [Both nodes should be regular and different from each other.]

SideEffects []

SeeAlso []

Definition at line 46 of file cgtSat.c.

47{
48 int nBTLimit = p->pPars->nConfMax;
49 int pLits[2], RetValue;
50 abctime clk;
51 p->nCalls++;
52
53 // sanity checks
54 assert( p->pSat && p->pCnf );
55 assert( !Aig_IsComplement(pMiter) );
56 assert( Aig_Regular(pGate) != pMiter );
57
58 // solve under assumptions
59 // G => !M -- true G & M -- false
60 pLits[0] = toLitCond( p->pCnf->pVarNums[Aig_Regular(pGate)->Id], Aig_IsComplement(pGate) );
61 pLits[1] = toLitCond( p->pCnf->pVarNums[pMiter->Id], 0 );
62
63clk = Abc_Clock();
64 RetValue = sat_solver_solve( p->pSat, pLits, pLits + 2, (ABC_INT64_T)nBTLimit, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
65p->timeSat += Abc_Clock() - clk;
66 if ( RetValue == l_False )
67 {
68p->timeSatUnsat += Abc_Clock() - clk;
69 pLits[0] = lit_neg( pLits[0] );
70 pLits[1] = lit_neg( pLits[1] );
71 RetValue = sat_solver_addclause( p->pSat, pLits, pLits + 2 );
72 assert( RetValue );
73 sat_solver_compress( p->pSat );
74 p->nCallsUnsat++;
75 return 1;
76 }
77 else if ( RetValue == l_True )
78 {
79p->timeSatSat += Abc_Clock() - clk;
80 p->nCallsSat++;
81 return 0;
82 }
83 else // if ( RetValue1 == l_Undef )
84 {
85p->timeSatUndec += Abc_Clock() - clk;
86 p->nCallsUndec++;
87 return -1;
88 }
89 return -2;
90}
ABC_INT64_T abctime
Definition abc_global.h:332
#define l_True
Definition bmcBmcS.c:35
#define l_False
Definition bmcBmcS.c:36
#define sat_solver_addclause
Definition cecSatG2.c:37
#define sat_solver_solve
Definition cecSatG2.c:45
Cube * p
Definition exorList.c:222
int Id
Definition aig.h:85
#define assert(ex)
Definition util_old.h:213
Here is the caller graph for this function: