ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
dchInt.h File Reference
#include "aig/aig/aig.h"
#include "sat/bsat/satSolver.h"
#include "dch.h"
Include dependency graph for dchInt.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Dch_Man_t_
 

Typedefs

typedef typedefABC_NAMESPACE_HEADER_START struct Dch_Cla_t_ Dch_Cla_t
 INCLUDES ///.
 
typedef struct Dch_Man_t_ Dch_Man_t
 

Functions

int Dch_DeriveChoiceCountReprs (Aig_Man_t *pAig)
 FUNCTION DECLARATIONS ///.
 
int Dch_DeriveChoiceCountEquivs (Aig_Man_t *pAig)
 
Aig_Man_tDch_DeriveChoiceAig (Aig_Man_t *pAig, int fSkipRedSupps)
 
Dch_Cla_tDch_ClassesStart (Aig_Man_t *pAig)
 
void Dch_ClassesSetData (Dch_Cla_t *p, void *pManData, unsigned(*pFuncNodeHash)(void *, Aig_Obj_t *), int(*pFuncNodeIsConst)(void *, Aig_Obj_t *), int(*pFuncNodesAreEqual)(void *, Aig_Obj_t *, Aig_Obj_t *))
 
void Dch_ClassesStop (Dch_Cla_t *p)
 
int Dch_ClassesLitNum (Dch_Cla_t *p)
 
Aig_Obj_t ** Dch_ClassesReadClass (Dch_Cla_t *p, Aig_Obj_t *pRepr, int *pnSize)
 
void Dch_ClassesPrint (Dch_Cla_t *p, int fVeryVerbose)
 
void Dch_ClassesPrepare (Dch_Cla_t *p, int fLatchCorr, int nMaxLevs)
 
int Dch_ClassesRefine (Dch_Cla_t *p)
 
int Dch_ClassesRefineOneClass (Dch_Cla_t *p, Aig_Obj_t *pRepr, int fRecursive)
 
void Dch_ClassesCollectOneClass (Dch_Cla_t *p, Aig_Obj_t *pRepr, Vec_Ptr_t *vRoots)
 
void Dch_ClassesCollectConst1Group (Dch_Cla_t *p, Aig_Obj_t *pObj, int nNodes, Vec_Ptr_t *vRoots)
 
int Dch_ClassesRefineConst1Group (Dch_Cla_t *p, Vec_Ptr_t *vRoots, int fRecursive)
 
void Dch_CnfNodeAddToSolver (Dch_Man_t *p, Aig_Obj_t *pObj)
 
Dch_Man_tDch_ManCreate (Aig_Man_t *pAig, Dch_Pars_t *pPars)
 DECLARATIONS ///.
 
void Dch_ManStop (Dch_Man_t *p)
 
void Dch_ManSatSolverRecycle (Dch_Man_t *p)
 
int Dch_NodesAreEquiv (Dch_Man_t *p, Aig_Obj_t *pObj1, Aig_Obj_t *pObj2)
 DECLARATIONS ///.
 
Dch_Cla_tDch_CreateCandEquivClasses (Aig_Man_t *pAig, int nWords, int fVerbose)
 
void Dch_ManResimulateCex (Dch_Man_t *p, Aig_Obj_t *pObj, Aig_Obj_t *pRepr)
 
void Dch_ManResimulateCex2 (Dch_Man_t *p, Aig_Obj_t *pObj, Aig_Obj_t *pRepr)
 
void Dch_ManSweep (Dch_Man_t *p)
 

Typedef Documentation

◆ Dch_Cla_t

typedef typedefABC_NAMESPACE_HEADER_START struct Dch_Cla_t_ Dch_Cla_t

INCLUDES ///.

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

FileName [dchInt.h]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Choice computation for tech-mapping.]

Synopsis [External declarations.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 29, 2008.]

Revision [

Id
dchInt.h,v 1.00 2008/07/29 00:00:00 alanmi Exp

] PARAMETERS /// BASIC TYPES ///

Definition at line 47 of file dchInt.h.

◆ Dch_Man_t

typedef struct Dch_Man_t_ Dch_Man_t

Definition at line 50 of file dchInt.h.

Function Documentation

◆ Dch_ClassesCollectConst1Group()

void Dch_ClassesCollectConst1Group ( Dch_Cla_t * p,
Aig_Obj_t * pObj,
int nNodes,
Vec_Ptr_t * vRoots )
extern

Function*************************************************************

Synopsis [Returns equivalence class of the given node.]

Description []

SideEffects []

SeeAlso []

Definition at line 546 of file dchClass.c.

547{
548 int i, Limit;
549 Vec_PtrClear( vRoots );
550 Limit = Abc_MinInt( pObj->Id + nNodes, Aig_ManObjNumMax(p->pAig) );
551 for ( i = pObj->Id; i < Limit; i++ )
552 {
553 pObj = Aig_ManObj( p->pAig, i );
554 if ( pObj && Dch_ObjIsConst1Cand( p->pAig, pObj ) )
555 Vec_PtrPush( vRoots, pObj );
556 }
557}
Cube * p
Definition exorList.c:222
int Id
Definition aig.h:85
Here is the caller graph for this function:

◆ Dch_ClassesCollectOneClass()

void Dch_ClassesCollectOneClass ( Dch_Cla_t * p,
Aig_Obj_t * pRepr,
Vec_Ptr_t * vRoots )
extern

Function*************************************************************

Synopsis [Returns equivalence class of the given node.]

Description []

SideEffects []

SeeAlso []

Definition at line 525 of file dchClass.c.

526{
527 Aig_Obj_t * pObj;
528 int i;
529 Vec_PtrClear( vRoots );
530 Dch_ClassForEachNode( p, pRepr, pObj, i )
531 Vec_PtrPush( vRoots, pObj );
532 assert( Vec_PtrSize(vRoots) > 1 );
533}
struct Aig_Obj_t_ Aig_Obj_t
Definition aig.h:51
#define Dch_ClassForEachNode(p, pRepr, pNode, i)
Definition dchClass.c:71
#define assert(ex)
Definition util_old.h:213
Here is the caller graph for this function:

◆ Dch_ClassesLitNum()

int Dch_ClassesLitNum ( Dch_Cla_t * p)
extern

Function*************************************************************

Synopsis [Stop representation of equivalence classes.]

Description []

SideEffects []

SeeAlso []

Definition at line 206 of file dchClass.c.

207{
208 return p->nLits;
209}
Here is the caller graph for this function:

◆ Dch_ClassesPrepare()

void Dch_ClassesPrepare ( Dch_Cla_t * p,
int fLatchCorr,
int nMaxLevs )
extern

Function*************************************************************

Synopsis [Creates initial simulation classes.]

Description [Assumes that simulation info is assigned.]

SideEffects []

SeeAlso []

Definition at line 336 of file dchClass.c.

337{
338 Aig_Obj_t ** ppTable, ** ppNexts, ** ppClassNew;
339 Aig_Obj_t * pObj, * pTemp, * pRepr;
340 int i, k, nTableSize, nNodes, iEntry, nEntries, nEntries2;
341
342 // allocate the hash table hashing simulation info into nodes
343 nTableSize = Abc_PrimeCudd( Aig_ManObjNumMax(p->pAig)/4 );
344 ppTable = ABC_CALLOC( Aig_Obj_t *, nTableSize );
345 ppNexts = ABC_CALLOC( Aig_Obj_t *, Aig_ManObjNumMax(p->pAig) );
346
347 // add all the nodes to the hash table
348 nEntries = 0;
349 Aig_ManForEachObj( p->pAig, pObj, i )
350 {
351 if ( fLatchCorr )
352 {
353 if ( !Aig_ObjIsCi(pObj) )
354 continue;
355 }
356 else
357 {
358 if ( !Aig_ObjIsNode(pObj) && !Aig_ObjIsCi(pObj) )
359 continue;
360 // skip the node with more that the given number of levels
361 if ( nMaxLevs && (int)pObj->Level >= nMaxLevs )
362 continue;
363 }
364 // check if the node belongs to the class of constant 1
365 if ( p->pFuncNodeIsConst( p->pManData, pObj ) )
366 {
367 Dch_ObjSetConst1Cand( p->pAig, pObj );
368 p->nCands1++;
369 continue;
370 }
371 // hash the node by its simulation info
372 iEntry = p->pFuncNodeHash( p->pManData, pObj ) % nTableSize;
373 // add the node to the class
374 if ( ppTable[iEntry] == NULL )
375 ppTable[iEntry] = pObj;
376 else
377 {
378 // set the representative of this node
379 pRepr = ppTable[iEntry];
380 Aig_ObjSetRepr( p->pAig, pObj, pRepr );
381 // add node to the table
382 if ( Dch_ObjNext( ppNexts, pRepr ) == NULL )
383 { // this will be the second entry
384 p->pClassSizes[pRepr->Id]++;
385 nEntries++;
386 }
387 // add the entry to the list
388 Dch_ObjSetNext( ppNexts, pObj, Dch_ObjNext( ppNexts, pRepr ) );
389 Dch_ObjSetNext( ppNexts, pRepr, pObj );
390 p->pClassSizes[pRepr->Id]++;
391 nEntries++;
392 }
393 }
394
395 // allocate room for classes
396 p->pMemClasses = ABC_ALLOC( Aig_Obj_t *, nEntries + p->nCands1 );
397 p->pMemClassesFree = p->pMemClasses + nEntries;
398
399 // copy the entries into storage in the topological order
400 nEntries2 = 0;
401 Aig_ManForEachObj( p->pAig, pObj, i )
402 {
403 if ( !Aig_ObjIsNode(pObj) && !Aig_ObjIsCi(pObj) )
404 continue;
405 nNodes = p->pClassSizes[pObj->Id];
406 // skip the nodes that are not representatives of non-trivial classes
407 if ( nNodes == 0 )
408 continue;
409 assert( nNodes > 1 );
410 // add the nodes to the class in the topological order
411 ppClassNew = p->pMemClasses + nEntries2;
412 ppClassNew[0] = pObj;
413 for ( pTemp = Dch_ObjNext(ppNexts, pObj), k = 1; pTemp;
414 pTemp = Dch_ObjNext(ppNexts, pTemp), k++ )
415 {
416 ppClassNew[nNodes-k] = pTemp;
417 }
418 // add the class of nodes
419 p->pClassSizes[pObj->Id] = 0;
420 Dch_ObjAddClass( p, pObj, ppClassNew, nNodes );
421 // increment the number of entries
422 nEntries2 += nNodes;
423 }
424 assert( nEntries == nEntries2 );
425 ABC_FREE( ppTable );
426 ABC_FREE( ppNexts );
427 // now it is time to refine the classes
430}
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
#define ABC_CALLOC(type, num)
Definition abc_global.h:265
#define ABC_FREE(obj)
Definition abc_global.h:267
#define Aig_ManForEachObj(p, pObj, i)
Definition aig.h:403
void Dch_ClassesCheck(Dch_Cla_t *p)
Definition dchClass.c:241
int Dch_ClassesRefine(Dch_Cla_t *p)
Definition dchClass.c:504
unsigned Level
Definition aig.h:82
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dch_ClassesPrint()

void Dch_ClassesPrint ( Dch_Cla_t * p,
int fVeryVerbose )
extern

Function*************************************************************

Synopsis [Prints simulation classes.]

Description []

SideEffects []

SeeAlso []

Definition at line 303 of file dchClass.c.

304{
305 Aig_Obj_t ** ppClass;
306 Aig_Obj_t * pObj;
307 int i;
308 Abc_Print( 1, "Equivalence classes: Const1 = %5d. Class = %5d. Lit = %5d.\n",
309 p->nCands1, p->nClasses, p->nLits );
310 if ( !fVeryVerbose )
311 return;
312 Abc_Print( 1, "Constants { " );
313 Aig_ManForEachObj( p->pAig, pObj, i )
314 if ( Dch_ObjIsConst1Cand( p->pAig, pObj ) )
315 Abc_Print( 1, "%d(%d,%d) ", pObj->Id, pObj->Level, Aig_SupportSize(p->pAig,pObj) );
316 Abc_Print( 1, "}\n" );
317 Dch_ManForEachClass( p, ppClass, i )
318 {
319 Abc_Print( 1, "%3d (%3d) : ", i, p->pClassSizes[i] );
320 Dch_ClassesPrintOne( p, ppClass[0] );
321 }
322 Abc_Print( 1, "\n" );
323}
int Aig_SupportSize(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition aigDfs.c:772
#define Dch_ManForEachClass(p, ppClass, i)
Definition dchClass.c:67
void Dch_ClassesPrintOne(Dch_Cla_t *p, Aig_Obj_t *pRepr)
Definition dchClass.c:282
Here is the call graph for this function:

◆ Dch_ClassesReadClass()

Aig_Obj_t ** Dch_ClassesReadClass ( Dch_Cla_t * p,
Aig_Obj_t * pRepr,
int * pnSize )
extern

Function*************************************************************

Synopsis [Stop representation of equivalence classes.]

Description []

SideEffects []

SeeAlso []

Definition at line 222 of file dchClass.c.

223{
224 assert( p->pId2Class[pRepr->Id] != NULL );
225 assert( p->pClassSizes[pRepr->Id] > 1 );
226 *pnSize = p->pClassSizes[pRepr->Id];
227 return p->pId2Class[pRepr->Id];
228}
Here is the caller graph for this function:

◆ Dch_ClassesRefine()

int Dch_ClassesRefine ( Dch_Cla_t * p)
extern

Function*************************************************************

Synopsis [Refines the classes after simulation.]

Description []

SideEffects []

SeeAlso []

Definition at line 504 of file dchClass.c.

505{
506 Aig_Obj_t ** ppClass;
507 int i, nRefis = 0;
508 Dch_ManForEachClass( p, ppClass, i )
509 nRefis += Dch_ClassesRefineOneClass( p, ppClass[0], 0 );
510 return nRefis;
511}
int Dch_ClassesRefineOneClass(Dch_Cla_t *p, Aig_Obj_t *pReprOld, int fRecursive)
Definition dchClass.c:443
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dch_ClassesRefineConst1Group()

int Dch_ClassesRefineConst1Group ( Dch_Cla_t * p,
Vec_Ptr_t * vRoots,
int fRecursive )
extern

Function*************************************************************

Synopsis [Refine the group of constant 1 nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 570 of file dchClass.c.

571{
572 Aig_Obj_t * pObj, * pReprNew, ** ppClassNew;
573 int i;
574 if ( Vec_PtrSize(vRoots) == 0 )
575 return 0;
576 // collect the nodes to be refined
577 Vec_PtrClear( p->vClassNew );
578 Vec_PtrForEachEntry( Aig_Obj_t *, vRoots, pObj, i )
579 if ( !p->pFuncNodeIsConst( p->pManData, pObj ) )
580 Vec_PtrPush( p->vClassNew, pObj );
581 // check if there is a new class
582 if ( Vec_PtrSize(p->vClassNew) == 0 )
583 return 0;
584 p->nCands1 -= Vec_PtrSize(p->vClassNew);
585 pReprNew = (Aig_Obj_t *)Vec_PtrEntry( p->vClassNew, 0 );
586 Aig_ObjSetRepr( p->pAig, pReprNew, NULL );
587 if ( Vec_PtrSize(p->vClassNew) == 1 )
588 return 1;
589 // create a new class composed of these nodes
590 ppClassNew = p->pMemClassesFree;
591 p->pMemClassesFree += Vec_PtrSize(p->vClassNew);
592 Vec_PtrForEachEntry( Aig_Obj_t *, p->vClassNew, pObj, i )
593 {
594 ppClassNew[i] = pObj;
595 Aig_ObjSetRepr( p->pAig, pObj, i? pReprNew : NULL );
596 }
597 Dch_ObjAddClass( p, pReprNew, ppClassNew, Vec_PtrSize(p->vClassNew) );
598 // refine them recursively
599 if ( fRecursive )
600 return 1 + Dch_ClassesRefineOneClass( p, pReprNew, 1 );
601 return 1;
602}
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dch_ClassesRefineOneClass()

int Dch_ClassesRefineOneClass ( Dch_Cla_t * p,
Aig_Obj_t * pReprOld,
int fRecursive )
extern

Function*************************************************************

Synopsis [Iteratively refines the classes after simulation.]

Description [Returns the number of refinements performed.]

SideEffects []

SeeAlso []

Definition at line 443 of file dchClass.c.

444{
445 Aig_Obj_t ** pClassOld, ** pClassNew;
446 Aig_Obj_t * pObj, * pReprNew;
447 int i;
448
449 // split the class
450 Vec_PtrClear( p->vClassOld );
451 Vec_PtrClear( p->vClassNew );
452 Dch_ClassForEachNode( p, pReprOld, pObj, i )
453 if ( p->pFuncNodesAreEqual(p->pManData, pReprOld, pObj) )
454 Vec_PtrPush( p->vClassOld, pObj );
455 else
456 Vec_PtrPush( p->vClassNew, pObj );
457 // check if splitting happened
458 if ( Vec_PtrSize(p->vClassNew) == 0 )
459 return 0;
460
461 // get the new representative
462 pReprNew = (Aig_Obj_t *)Vec_PtrEntry( p->vClassNew, 0 );
463 assert( Vec_PtrSize(p->vClassOld) > 0 );
464 assert( Vec_PtrSize(p->vClassNew) > 0 );
465
466 // create old class
467 pClassOld = Dch_ObjRemoveClass( p, pReprOld );
468 Vec_PtrForEachEntry( Aig_Obj_t *, p->vClassOld, pObj, i )
469 {
470 pClassOld[i] = pObj;
471 Aig_ObjSetRepr( p->pAig, pObj, i? pReprOld : NULL );
472 }
473 // create new class
474 pClassNew = pClassOld + i;
475 Vec_PtrForEachEntry( Aig_Obj_t *, p->vClassNew, pObj, i )
476 {
477 pClassNew[i] = pObj;
478 Aig_ObjSetRepr( p->pAig, pObj, i? pReprNew : NULL );
479 }
480
481 // put classes back
482 if ( Vec_PtrSize(p->vClassOld) > 1 )
483 Dch_ObjAddClass( p, pReprOld, pClassOld, Vec_PtrSize(p->vClassOld) );
484 if ( Vec_PtrSize(p->vClassNew) > 1 )
485 Dch_ObjAddClass( p, pReprNew, pClassNew, Vec_PtrSize(p->vClassNew) );
486
487 // check if the class should be recursively refined
488 if ( fRecursive && Vec_PtrSize(p->vClassNew) > 1 )
489 return 1 + Dch_ClassesRefineOneClass( p, pReprNew, 1 );
490 return 1;
491}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dch_ClassesSetData()

void Dch_ClassesSetData ( Dch_Cla_t * p,
void * pManData,
unsigned(* pFuncNodeHash )(void *, Aig_Obj_t *),
int(* pFuncNodeIsConst )(void *, Aig_Obj_t *),
int(* pFuncNodesAreEqual )(void *, Aig_Obj_t *, Aig_Obj_t *) )
extern

Function*************************************************************

Synopsis [Starts representation of equivalence classes.]

Description []

SideEffects []

SeeAlso []

Definition at line 163 of file dchClass.c.

167{
168 p->pManData = pManData;
169 p->pFuncNodeHash = pFuncNodeHash;
170 p->pFuncNodeIsConst = pFuncNodeIsConst;
171 p->pFuncNodesAreEqual = pFuncNodesAreEqual;
172}
Here is the caller graph for this function:

◆ Dch_ClassesStart()

Dch_Cla_t * Dch_ClassesStart ( Aig_Man_t * pAig)
extern

Function*************************************************************

Synopsis [Starts representation of equivalence classes.]

Description []

SideEffects []

SeeAlso []

Definition at line 137 of file dchClass.c.

138{
139 Dch_Cla_t * p;
140 p = ABC_ALLOC( Dch_Cla_t, 1 );
141 memset( p, 0, sizeof(Dch_Cla_t) );
142 p->pAig = pAig;
143 p->pId2Class = ABC_CALLOC( Aig_Obj_t **, Aig_ManObjNumMax(pAig) );
144 p->pClassSizes = ABC_CALLOC( int, Aig_ManObjNumMax(pAig) );
145 p->vClassOld = Vec_PtrAlloc( 100 );
146 p->vClassNew = Vec_PtrAlloc( 100 );
147 assert( pAig->pReprs == NULL );
148 Aig_ManReprStart( pAig, Aig_ManObjNumMax(pAig) );
149 return p;
150}
void Aig_ManReprStart(Aig_Man_t *p, int nIdMax)
DECLARATIONS ///.
Definition aigRepr.c:45
typedefABC_NAMESPACE_HEADER_START struct Dch_Cla_t_ Dch_Cla_t
INCLUDES ///.
Definition dchInt.h:47
char * memset()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dch_ClassesStop()

void Dch_ClassesStop ( Dch_Cla_t * p)
extern

Function*************************************************************

Synopsis [Stop representation of equivalence classes.]

Description []

SideEffects []

SeeAlso []

Definition at line 185 of file dchClass.c.

186{
187 if ( p->vClassNew ) Vec_PtrFree( p->vClassNew );
188 if ( p->vClassOld ) Vec_PtrFree( p->vClassOld );
189 ABC_FREE( p->pId2Class );
190 ABC_FREE( p->pClassSizes );
191 ABC_FREE( p->pMemClasses );
192 ABC_FREE( p );
193}
Here is the caller graph for this function:

◆ Dch_CnfNodeAddToSolver()

void Dch_CnfNodeAddToSolver ( Dch_Man_t * p,
Aig_Obj_t * pObj )
extern

Function*************************************************************

Synopsis [Updates the solver clause database.]

Description []

SideEffects []

SeeAlso []

Definition at line 287 of file dchCnf.c.

288{
289 Vec_Ptr_t * vFrontier;
290 Aig_Obj_t * pNode, * pFanin;
291 int i, k, fUseMuxes = 1;
292 // quit if CNF is ready
293 if ( Dch_ObjSatNum(p,pObj) )
294 return;
295 // start the frontier
296 vFrontier = Vec_PtrAlloc( 100 );
297 Dch_ObjAddToFrontier( p, pObj, vFrontier );
298 // explore nodes in the frontier
299 Vec_PtrForEachEntry( Aig_Obj_t *, vFrontier, pNode, i )
300 {
301 // create the supergate
302 assert( Dch_ObjSatNum(p,pNode) );
303 if ( fUseMuxes && Aig_ObjIsMuxType(pNode) )
304 {
305 Vec_PtrClear( p->vFanins );
306 Vec_PtrPushUnique( p->vFanins, Aig_ObjFanin0( Aig_ObjFanin0(pNode) ) );
307 Vec_PtrPushUnique( p->vFanins, Aig_ObjFanin0( Aig_ObjFanin1(pNode) ) );
308 Vec_PtrPushUnique( p->vFanins, Aig_ObjFanin1( Aig_ObjFanin0(pNode) ) );
309 Vec_PtrPushUnique( p->vFanins, Aig_ObjFanin1( Aig_ObjFanin1(pNode) ) );
310 Vec_PtrForEachEntry( Aig_Obj_t *, p->vFanins, pFanin, k )
311 Dch_ObjAddToFrontier( p, Aig_Regular(pFanin), vFrontier );
312 Dch_AddClausesMux( p, pNode );
313 }
314 else
315 {
316 Dch_CollectSuper( pNode, fUseMuxes, p->vFanins );
317 Vec_PtrForEachEntry( Aig_Obj_t *, p->vFanins, pFanin, k )
318 Dch_ObjAddToFrontier( p, Aig_Regular(pFanin), vFrontier );
319 Dch_AddClausesSuper( p, pNode, p->vFanins );
320 }
321 assert( Vec_PtrSize(p->vFanins) > 1 );
322 }
323 Vec_PtrFree( vFrontier );
324}
int Aig_ObjIsMuxType(Aig_Obj_t *pObj)
Definition aigUtil.c:307
void Dch_AddClausesSuper(Dch_Man_t *p, Aig_Obj_t *pNode, Vec_Ptr_t *vSuper)
Definition dchCnf.c:164
void Dch_ObjAddToFrontier(Dch_Man_t *p, Aig_Obj_t *pObj, Vec_Ptr_t *vFrontier)
Definition dchCnf.c:262
ABC_NAMESPACE_IMPL_START void Dch_AddClausesMux(Dch_Man_t *p, Aig_Obj_t *pNode)
DECLARATIONS ///.
Definition dchCnf.c:45
void Dch_CollectSuper(Aig_Obj_t *pObj, int fUseMuxes, Vec_Ptr_t *vSuper)
Definition dchCnf.c:243
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dch_CreateCandEquivClasses()

Dch_Cla_t * Dch_CreateCandEquivClasses ( Aig_Man_t * pAig,
int nWords,
int fVerbose )
extern

Function*************************************************************

Synopsis [Derives candidate equivalence classes of AIG nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 264 of file dchSim.c.

265{
266 Dch_Cla_t * pClasses;
267 Vec_Ptr_t * vSims;
268 int i;
269 // allocate simulation information
270 vSims = Vec_PtrAllocSimInfo( Aig_ManObjNumMax(pAig), nWords );
271 // run random simulation from the primary inputs
272 Dch_PerformRandomSimulation( pAig, vSims );
273 // start storage for equivalence classes
274 pClasses = Dch_ClassesStart( pAig );
276 // hash nodes by sim info
277 Dch_ClassesPrepare( pClasses, 0, 0 );
278 // iterate random simulation
279 for ( i = 0; i < 7; i++ )
280 {
281 Dch_PerformRandomSimulation( pAig, vSims );
282 Dch_ClassesRefine( pClasses );
283 }
284 // clean up and return
285 Vec_PtrFree( vSims );
286 // prepare class refinement procedures
288 return pClasses;
289}
int nWords
Definition abcNpn.c:127
void Dch_ClassesPrepare(Dch_Cla_t *p, int fLatchCorr, int nMaxLevs)
Definition dchClass.c:336
void Dch_ClassesSetData(Dch_Cla_t *p, void *pManData, unsigned(*pFuncNodeHash)(void *, Aig_Obj_t *), int(*pFuncNodeIsConst)(void *, Aig_Obj_t *), int(*pFuncNodesAreEqual)(void *, Aig_Obj_t *, Aig_Obj_t *))
Definition dchClass.c:163
Dch_Cla_t * Dch_ClassesStart(Aig_Man_t *pAig)
Definition dchClass.c:137
int Dch_NodesAreEqualCex(void *p, Aig_Obj_t *pObj0, Aig_Obj_t *pObj1)
Definition dchSim.c:70
int Dch_NodeIsConstCex(void *p, Aig_Obj_t *pObj)
FUNCTION DEFINITIONS ///.
Definition dchSim.c:54
int Dch_NodesAreEqual(void *p, Aig_Obj_t *pObj0, Aig_Obj_t *pObj1)
Definition dchSim.c:167
unsigned Dch_NodeHash(void *p, Aig_Obj_t *pObj)
Definition dchSim.c:86
int Dch_NodeIsConst(void *p, Aig_Obj_t *pObj)
Definition dchSim.c:134
void Dch_PerformRandomSimulation(Aig_Man_t *pAig, Vec_Ptr_t *vSims)
Definition dchSim.c:201
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dch_DeriveChoiceAig()

Aig_Man_t * Dch_DeriveChoiceAig ( Aig_Man_t * pAig,
int fSkipRedSupps )
extern

Definition at line 524 of file dchChoice.c.

525{
526 int fCheck = 0;
527 Aig_Man_t * pChoices, * pTemp;
528 // verify
529 if ( fCheck )
530 Aig_ManCheckReprs( pAig );
531 // compute choices
532 pChoices = Dch_DeriveChoiceAigInt( pAig, fSkipRedSupps );
533 ABC_FREE( pChoices->pReprs );
534 // verify
535 if ( fCheck )
536 Dch_CheckChoices( pChoices, fSkipRedSupps );
537 // find correct topo order with choices
538 pChoices = Aig_ManDupDfs( pTemp = pChoices );
539 Aig_ManStop( pTemp );
540 // verify
541 if ( fCheck )
542 Dch_CheckChoices( pChoices, fSkipRedSupps );
543 return pChoices;
544}
Aig_Man_t * Aig_ManDupDfs(Aig_Man_t *p)
Definition aigDup.c:563
void Aig_ManStop(Aig_Man_t *p)
Definition aigMan.c:187
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition aig.h:50
Aig_Man_t * Dch_DeriveChoiceAigInt(Aig_Man_t *pAig, int fSkipRedSupps)
Definition dchChoice.c:501
void Dch_CheckChoices(Aig_Man_t *p, int fSkipRedSupps)
Definition dchChoice.c:206
void Aig_ManCheckReprs(Aig_Man_t *p)
Definition dchChoice.c:163
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dch_DeriveChoiceCountEquivs()

int Dch_DeriveChoiceCountEquivs ( Aig_Man_t * pAig)
extern

Definition at line 89 of file dchChoice.c.

90{
91 Aig_Obj_t * pObj, * pEquiv;
92 int i, nEquivs = 0;
93 Aig_ManForEachObj( pAig, pObj, i )
94 {
95 pEquiv = Aig_ObjEquiv( pAig, pObj );
96 if ( pEquiv == NULL )
97 continue;
98 assert( pEquiv->Id < pObj->Id );
99 nEquivs++;
100 }
101 return nEquivs;
102}
Here is the caller graph for this function:

◆ Dch_DeriveChoiceCountReprs()

int Dch_DeriveChoiceCountReprs ( Aig_Man_t * pAig)
extern

FUNCTION DECLARATIONS ///.

Function*************************************************************

Synopsis [Counts the number of representatives.]

Description []

SideEffects []

SeeAlso []

Definition at line 75 of file dchChoice.c.

76{
77 Aig_Obj_t * pObj, * pRepr;
78 int i, nReprs = 0;
79 Aig_ManForEachObj( pAig, pObj, i )
80 {
81 pRepr = Aig_ObjRepr( pAig, pObj );
82 if ( pRepr == NULL )
83 continue;
84 assert( pRepr->Id < pObj->Id );
85 nReprs++;
86 }
87 return nReprs;
88}
Here is the caller graph for this function:

◆ Dch_ManCreate()

Dch_Man_t * Dch_ManCreate ( Aig_Man_t * pAig,
Dch_Pars_t * pPars )
extern

DECLARATIONS ///.

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

FileName [dchMan.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Choice computation for tech-mapping.]

Synopsis [Calls to the SAT solver.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 29, 2008.]

Revision [

Id
dchMan.c,v 1.00 2008/07/29 00:00:00 alanmi Exp

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

Synopsis [Creates the manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file dchMan.c.

46{
47 Dch_Man_t * p;
48 // create interpolation manager
49 p = ABC_ALLOC( Dch_Man_t, 1 );
50 memset( p, 0, sizeof(Dch_Man_t) );
51 p->pPars = pPars;
52 p->pAigTotal = pAig; //Dch_DeriveTotalAig( vAigs );
53 Aig_ManFanoutStart( p->pAigTotal );
54 // SAT solving
55 p->nSatVars = 1;
56 p->pSatVars = ABC_CALLOC( int, Aig_ManObjNumMax(p->pAigTotal) );
57 p->vUsedNodes = Vec_PtrAlloc( 1000 );
58 p->vFanins = Vec_PtrAlloc( 100 );
59 p->vSimRoots = Vec_PtrAlloc( 1000 );
60 p->vSimClasses = Vec_PtrAlloc( 1000 );
61 // equivalences proved
62 p->pReprsProved = ABC_CALLOC( Aig_Obj_t *, Aig_ManObjNumMax(p->pAigTotal) );
63 return p;
64}
void Aig_ManFanoutStart(Aig_Man_t *p)
FUNCTION DEFINITIONS ///.
Definition aigFanout.c:56
struct Dch_Man_t_ Dch_Man_t
Definition dchInt.h:50
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dch_ManResimulateCex()

void Dch_ManResimulateCex ( Dch_Man_t * p,
Aig_Obj_t * pObj,
Aig_Obj_t * pRepr )
extern

Function*************************************************************

Synopsis [Handle the counter-example.]

Description []

SideEffects []

SeeAlso []

Definition at line 177 of file dchSimSat.c.

178{
179 Aig_Obj_t * pRoot, ** ppClass;
180 int i, k, nSize, RetValue1, RetValue2;
181 abctime clk = Abc_Clock();
182 // get the equivalence classes
183 Dch_ManCollectTfoCands( p, pObj, pRepr );
184 // resimulate the cone of influence of the solved nodes
185 p->nConeThis = 0;
186 Aig_ManIncrementTravId( p->pAigTotal );
187 Aig_ObjSetTravIdCurrent( p->pAigTotal, Aig_ManConst1(p->pAigTotal) );
190 p->nConeMax = Abc_MaxInt( p->nConeMax, p->nConeThis );
191 // resimulate the cone of influence of the other nodes
192 Vec_PtrForEachEntry( Aig_Obj_t *, p->vSimRoots, pRoot, i )
194 // refine these nodes
195 RetValue1 = Dch_ClassesRefineConst1Group( p->ppClasses, p->vSimRoots, 0 );
196 // resimulate the cone of influence of the cand classes
197 RetValue2 = 0;
198 Vec_PtrForEachEntry( Aig_Obj_t *, p->vSimClasses, pRoot, i )
199 {
200 ppClass = Dch_ClassesReadClass( p->ppClasses, pRoot, &nSize );
201 for ( k = 0; k < nSize; k++ )
202 Dch_ManResimulateOther_rec( p, ppClass[k] );
203 // refine this class
204 RetValue2 += Dch_ClassesRefineOneClass( p->ppClasses, pRoot, 0 );
205 }
206 // make sure refinement happened
207 if ( Aig_ObjIsConst1(pRepr) )
208 assert( RetValue1 );
209 else
210 assert( RetValue2 );
211p->timeSimSat += Abc_Clock() - clk;
212}
ABC_INT64_T abctime
Definition abc_global.h:332
void Aig_ManIncrementTravId(Aig_Man_t *p)
DECLARATIONS ///.
Definition aigUtil.c:44
Aig_Obj_t ** Dch_ClassesReadClass(Dch_Cla_t *p, Aig_Obj_t *pRepr, int *pnSize)
Definition dchClass.c:222
int Dch_ClassesRefineConst1Group(Dch_Cla_t *p, Vec_Ptr_t *vRoots, int fRecursive)
Definition dchClass.c:570
void Dch_ManResimulateSolved_rec(Dch_Man_t *p, Aig_Obj_t *pObj)
Definition dchSimSat.c:111
void Dch_ManCollectTfoCands(Dch_Man_t *p, Aig_Obj_t *pObj1, Aig_Obj_t *pObj2)
Definition dchSimSat.c:84
void Dch_ManResimulateOther_rec(Dch_Man_t *p, Aig_Obj_t *pObj)
Definition dchSimSat.c:149
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dch_ManResimulateCex2()

void Dch_ManResimulateCex2 ( Dch_Man_t * p,
Aig_Obj_t * pObj,
Aig_Obj_t * pRepr )
extern

Function*************************************************************

Synopsis [Handle the counter-example.]

Description []

SideEffects []

SeeAlso []

Definition at line 225 of file dchSimSat.c.

226{
227 Aig_Obj_t * pRoot;
228 int i, RetValue;
229 abctime clk = Abc_Clock();
230 // get the equivalence class
231 if ( Dch_ObjIsConst1Cand(p->pAigTotal, pObj) )
232 Dch_ClassesCollectConst1Group( p->ppClasses, pObj, 500, p->vSimRoots );
233 else
234 Dch_ClassesCollectOneClass( p->ppClasses, pRepr, p->vSimRoots );
235 // resimulate the cone of influence of the solved nodes
236 p->nConeThis = 0;
237 Aig_ManIncrementTravId( p->pAigTotal );
238 Aig_ObjSetTravIdCurrent( p->pAigTotal, Aig_ManConst1(p->pAigTotal) );
241 p->nConeMax = Abc_MaxInt( p->nConeMax, p->nConeThis );
242 // resimulate the cone of influence of the other nodes
243 Vec_PtrForEachEntry( Aig_Obj_t *, p->vSimRoots, pRoot, i )
245 // refine this class
246 if ( Dch_ObjIsConst1Cand(p->pAigTotal, pObj) )
247 RetValue = Dch_ClassesRefineConst1Group( p->ppClasses, p->vSimRoots, 0 );
248 else
249 RetValue = Dch_ClassesRefineOneClass( p->ppClasses, pRepr, 0 );
250 assert( RetValue );
251p->timeSimSat += Abc_Clock() - clk;
252}
void Dch_ClassesCollectConst1Group(Dch_Cla_t *p, Aig_Obj_t *pObj, int nNodes, Vec_Ptr_t *vRoots)
Definition dchClass.c:546
void Dch_ClassesCollectOneClass(Dch_Cla_t *p, Aig_Obj_t *pRepr, Vec_Ptr_t *vRoots)
Definition dchClass.c:525
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dch_ManSatSolverRecycle()

void Dch_ManSatSolverRecycle ( Dch_Man_t * p)
extern

Function*************************************************************

Synopsis [Recycles the SAT solver.]

Description []

SideEffects []

SeeAlso []

Definition at line 153 of file dchMan.c.

154{
155 int Lit;
156 if ( p->pSat )
157 {
158 Aig_Obj_t * pObj;
159 int i;
160 Vec_PtrForEachEntry( Aig_Obj_t *, p->vUsedNodes, pObj, i )
161 Dch_ObjSetSatNum( p, pObj, 0 );
162 Vec_PtrClear( p->vUsedNodes );
163// memset( p->pSatVars, 0, sizeof(int) * Aig_ManObjNumMax(p->pAigTotal) );
164 sat_solver_delete( p->pSat );
165 }
166 p->pSat = sat_solver_new();
167 sat_solver_setnvars( p->pSat, 1000 );
168 // var 0 is not used
169 // var 1 is reserved for const1 node - add the clause
170 p->nSatVars = 1;
171// p->nSatVars = 0;
172 Lit = toLit( p->nSatVars );
173 if ( p->pPars->fPolarFlip )
174 Lit = lit_neg( Lit );
175 sat_solver_addclause( p->pSat, &Lit, &Lit + 1 );
176 Dch_ObjSetSatNum( p, Aig_ManConst1(p->pAigFraig), p->nSatVars++ );
177
178 p->nRecycles++;
179 p->nCallsSince = 0;
180}
#define sat_solver_addclause
Definition cecSatG2.c:37
sat_solver * sat_solver_new(void)
Definition satSolver.c:1137
void sat_solver_setnvars(sat_solver *s, int n)
Definition satSolver.c:1272
void sat_solver_delete(sat_solver *s)
Definition satSolver.c:1341
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dch_ManStop()

void Dch_ManStop ( Dch_Man_t * p)
extern

Function*************************************************************

Synopsis [Frees the manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 122 of file dchMan.c.

123{
124 Aig_ManFanoutStop( p->pAigTotal );
125 if ( p->pPars->fVerbose )
127 if ( p->pAigFraig )
128 Aig_ManStop( p->pAigFraig );
129 if ( p->ppClasses )
130 Dch_ClassesStop( p->ppClasses );
131 if ( p->pSat )
132 sat_solver_delete( p->pSat );
133 Vec_PtrFree( p->vUsedNodes );
134 Vec_PtrFree( p->vFanins );
135 Vec_PtrFree( p->vSimRoots );
136 Vec_PtrFree( p->vSimClasses );
137 ABC_FREE( p->pReprsProved );
138 ABC_FREE( p->pSatVars );
139 ABC_FREE( p );
140}
void Aig_ManFanoutStop(Aig_Man_t *p)
Definition aigFanout.c:89
void Dch_ClassesStop(Dch_Cla_t *p)
Definition dchClass.c:185
void Dch_ManPrintStats(Dch_Man_t *p)
Definition dchMan.c:77
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dch_ManSweep()

void Dch_ManSweep ( Dch_Man_t * p)
extern

Function*************************************************************

Synopsis [Performs fraiging for the internal nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 106 of file dchSweep.c.

107{
108 Bar_Progress_t * pProgress = NULL;
109 Aig_Obj_t * pObj, * pObjNew;
110 int i;
111 // map constants and PIs
112 p->pAigFraig = Aig_ManStart( Aig_ManObjNumMax(p->pAigTotal) );
113 Aig_ManCleanData( p->pAigTotal );
114 Aig_ManConst1(p->pAigTotal)->pData = Aig_ManConst1(p->pAigFraig);
115 Aig_ManForEachCi( p->pAigTotal, pObj, i )
116 pObj->pData = Aig_ObjCreateCi( p->pAigFraig );
117 // sweep internal nodes
118 pProgress = Bar_ProgressStart( stdout, Aig_ManObjNumMax(p->pAigTotal) );
119 Aig_ManForEachNode( p->pAigTotal, pObj, i )
120 {
121 Bar_ProgressUpdate( pProgress, i, NULL );
122 if ( Dch_ObjFraig(Aig_ObjFanin0(pObj)) == NULL ||
123 Dch_ObjFraig(Aig_ObjFanin1(pObj)) == NULL )
124 continue;
125 pObjNew = Aig_And( p->pAigFraig, Dch_ObjChild0Fra(pObj), Dch_ObjChild1Fra(pObj) );
126 if ( pObjNew == NULL )
127 continue;
128 Dch_ObjSetFraig( pObj, pObjNew );
129 Dch_ManSweepNode( p, pObj );
130 }
131 Bar_ProgressStop( pProgress );
132 // update the representatives of the nodes (makes classes invalid)
133 ABC_FREE( p->pAigTotal->pReprs );
134 p->pAigTotal->pReprs = p->pReprsProved;
135 p->pReprsProved = NULL;
136 // clean the mark
137 Aig_ManCleanMarkB( p->pAigTotal );
138}
void Aig_ManCleanMarkB(Aig_Man_t *p)
Definition aigUtil.c:167
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
Definition aig.h:393
Aig_Obj_t * Aig_And(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
Definition aigOper.c:104
Aig_Man_t * Aig_ManStart(int nNodesMax)
DECLARATIONS ///.
Definition aigMan.c:47
#define Aig_ManForEachNode(p, pObj, i)
Definition aig.h:413
Aig_Obj_t * Aig_ObjCreateCi(Aig_Man_t *p)
DECLARATIONS ///.
Definition aigObj.c:45
void Aig_ManCleanData(Aig_Man_t *p)
Definition aigUtil.c:205
void Bar_ProgressStop(Bar_Progress_t *p)
Definition bar.c:126
Bar_Progress_t * Bar_ProgressStart(FILE *pFile, int nItemsTotal)
FUNCTION DEFINITIONS ///.
Definition bar.c:66
struct Bar_Progress_t_ Bar_Progress_t
BASIC TYPES ///.
Definition bar.h:48
void Dch_ManSweepNode(Dch_Man_t *p, Aig_Obj_t *pObj)
FUNCTION DEFINITIONS ///.
Definition dchSweep.c:49
void * pData
Definition aig.h:87
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dch_NodesAreEquiv()

int Dch_NodesAreEquiv ( Dch_Man_t * p,
Aig_Obj_t * pOld,
Aig_Obj_t * pNew )
extern

DECLARATIONS ///.

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

FileName [dchSat.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Choice computation for tech-mapping.]

Synopsis [Calls to the SAT solver.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 29, 2008.]

Revision [

Id
dchSat.c,v 1.00 2008/07/29 00:00:00 alanmi Exp

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

Synopsis [Runs equivalence test for the two nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file dchSat.c.

46{
47 int nBTLimit = p->pPars->nBTLimit;
48 int pLits[2], RetValue, RetValue1, status;
49 abctime clk;
50 p->nSatCalls++;
51
52 // sanity checks
53 assert( !Aig_IsComplement(pNew) );
54 assert( !Aig_IsComplement(pOld) );
55 assert( pNew != pOld );
56
57 p->nCallsSince++; // experiment with this!!!
58
59 // check if SAT solver needs recycling
60 if ( p->pSat == NULL ||
61 (p->pPars->nSatVarMax &&
62 p->nSatVars > p->pPars->nSatVarMax &&
63 p->nCallsSince > p->pPars->nCallsRecycle) )
65
66 // if the nodes do not have SAT variables, allocate them
69
70 // propage unit clauses
71 if ( p->pSat->qtail != p->pSat->qhead )
72 {
73 status = sat_solver_simplify(p->pSat);
74 assert( status != 0 );
75 assert( p->pSat->qtail == p->pSat->qhead );
76 }
77
78 // solve under assumptions
79 // A = 1; B = 0 OR A = 1; B = 1
80 pLits[0] = toLitCond( Dch_ObjSatNum(p,pOld), 0 );
81 pLits[1] = toLitCond( Dch_ObjSatNum(p,pNew), pOld->fPhase == pNew->fPhase );
82 if ( p->pPars->fPolarFlip )
83 {
84 if ( pOld->fPhase ) pLits[0] = lit_neg( pLits[0] );
85 if ( pNew->fPhase ) pLits[1] = lit_neg( pLits[1] );
86 }
87//Sat_SolverWriteDimacs( p->pSat, "temp.cnf", pLits, pLits + 2, 1 );
88clk = Abc_Clock();
89 RetValue1 = sat_solver_solve( p->pSat, pLits, pLits + 2,
90 (ABC_INT64_T)nBTLimit, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
91p->timeSat += Abc_Clock() - clk;
92 if ( RetValue1 == l_False )
93 {
94p->timeSatUnsat += Abc_Clock() - clk;
95 pLits[0] = lit_neg( pLits[0] );
96 pLits[1] = lit_neg( pLits[1] );
97 RetValue = sat_solver_addclause( p->pSat, pLits, pLits + 2 );
98 assert( RetValue );
99 p->nSatCallsUnsat++;
100 }
101 else if ( RetValue1 == l_True )
102 {
103p->timeSatSat += Abc_Clock() - clk;
104 p->nSatCallsSat++;
105 return 0;
106 }
107 else // if ( RetValue1 == l_Undef )
108 {
109p->timeSatUndec += Abc_Clock() - clk;
110 p->nSatFailsReal++;
111 return -1;
112 }
113
114 // if the old node was constant 0, we already know the answer
115 if ( pOld == Aig_ManConst1(p->pAigFraig) )
116 {
117 p->nSatProof++;
118 return 1;
119 }
120
121 // solve under assumptions
122 // A = 0; B = 1 OR A = 0; B = 0
123 pLits[0] = toLitCond( Dch_ObjSatNum(p,pOld), 1 );
124 pLits[1] = toLitCond( Dch_ObjSatNum(p,pNew), pOld->fPhase ^ pNew->fPhase );
125 if ( p->pPars->fPolarFlip )
126 {
127 if ( pOld->fPhase ) pLits[0] = lit_neg( pLits[0] );
128 if ( pNew->fPhase ) pLits[1] = lit_neg( pLits[1] );
129 }
130clk = Abc_Clock();
131 RetValue1 = sat_solver_solve( p->pSat, pLits, pLits + 2,
132 (ABC_INT64_T)nBTLimit, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
133p->timeSat += Abc_Clock() - clk;
134 if ( RetValue1 == l_False )
135 {
136p->timeSatUnsat += Abc_Clock() - clk;
137 pLits[0] = lit_neg( pLits[0] );
138 pLits[1] = lit_neg( pLits[1] );
139 RetValue = sat_solver_addclause( p->pSat, pLits, pLits + 2 );
140 assert( RetValue );
141 p->nSatCallsUnsat++;
142 }
143 else if ( RetValue1 == l_True )
144 {
145p->timeSatSat += Abc_Clock() - clk;
146 p->nSatCallsSat++;
147 return 0;
148 }
149 else // if ( RetValue1 == l_Undef )
150 {
151p->timeSatUndec += Abc_Clock() - clk;
152 p->nSatFailsReal++;
153 return -1;
154 }
155 // return SAT proof
156 p->nSatProof++;
157 return 1;
158}
#define l_True
Definition bmcBmcS.c:35
#define l_False
Definition bmcBmcS.c:36
#define sat_solver_solve
Definition cecSatG2.c:45
void Dch_CnfNodeAddToSolver(Dch_Man_t *p, Aig_Obj_t *pObj)
Definition dchCnf.c:287
void Dch_ManSatSolverRecycle(Dch_Man_t *p)
Definition dchMan.c:153
int sat_solver_simplify(sat_solver *s)
Definition satSolver.c:1515
unsigned int fPhase
Definition aig.h:78
Here is the call graph for this function:
Here is the caller graph for this function: