abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
cecMan.c File Reference
#include "cecInt.h"

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START
Cec_ManSat_t
Cec_ManSatCreate (Gia_Man_t *pAig, Cec_ParSat_t *pPars)
 DECLARATIONS ///. More...
 
void Cec_ManSatPrintStats (Cec_ManSat_t *p)
 
void Cec_ManSatStop (Cec_ManSat_t *p)
 
Cec_ManPat_tCec_ManPatStart ()
 
void Cec_ManPatPrintStats (Cec_ManPat_t *p)
 
void Cec_ManPatStop (Cec_ManPat_t *p)
 
Cec_ManSim_tCec_ManSimStart (Gia_Man_t *pAig, Cec_ParSim_t *pPars)
 
void Cec_ManSimStop (Cec_ManSim_t *p)
 
Cec_ManFra_tCec_ManFraStart (Gia_Man_t *pAig, Cec_ParFra_t *pPars)
 
void Cec_ManFraStop (Cec_ManFra_t *p)
 

Function Documentation

Cec_ManFra_t* Cec_ManFraStart ( Gia_Man_t pAig,
Cec_ParFra_t pPars 
)

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

Synopsis [Creates AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 262 of file cecMan.c.

263 {
264  Cec_ManFra_t * p;
265  p = ABC_ALLOC( Cec_ManFra_t, 1 );
266  memset( p, 0, sizeof(Cec_ManFra_t) );
267  p->pAig = pAig;
268  p->pPars = pPars;
269  p->vXorNodes = Vec_IntAlloc( 1000 );
270  return p;
271 }
char * memset()
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
Vec_Int_t * vXorNodes
Definition: cecInt.h:152
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
Gia_Man_t * pAig
Definition: cecInt.h:149
Cec_ParFra_t * pPars
Definition: cecInt.h:150
void Cec_ManFraStop ( Cec_ManFra_t p)

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

Synopsis [Deletes AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 284 of file cecMan.c.

285 {
286  Vec_IntFree( p->vXorNodes );
287  ABC_FREE( p );
288 }
Vec_Int_t * vXorNodes
Definition: cecInt.h:152
#define ABC_FREE(obj)
Definition: abc_global.h:232
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
void Cec_ManPatPrintStats ( Cec_ManPat_t p)

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

Synopsis [Creates AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 150 of file cecMan.c.

151 {
152  Abc_Print( 1, "Latest: P = %8d. L = %10d. Lm = %10d. Ave = %6.1f. MEM =%6.2f MB\n",
153  p->nPats, p->nPatLits, p->nPatLitsMin, 1.0 * p->nPatLitsMin/p->nPats,
154  1.0*(Vec_StrSize(p->vStorage)-p->iStart)/(1<<20) );
155  Abc_Print( 1, "Total: P = %8d. L = %10d. Lm = %10d. Ave = %6.1f. MEM =%6.2f MB\n",
156  p->nPatsAll, p->nPatLitsAll, p->nPatLitsMinAll, 1.0 * p->nPatLitsMinAll/p->nPatsAll,
157  1.0*Vec_StrSize(p->vStorage)/(1<<20) );
158  Abc_PrintTimeP( 1, "Finding ", p->timeFind, p->timeTotal );
159  Abc_PrintTimeP( 1, "Shrinking", p->timeShrink, p->timeTotal );
160  Abc_PrintTimeP( 1, "Verifying", p->timeVerify, p->timeTotal );
161  Abc_PrintTimeP( 1, "Sorting ", p->timeSort, p->timeTotal );
162  Abc_PrintTimeP( 1, "Packing ", p->timePack, p->timeTotal );
163  Abc_PrintTime( 1, "TOTAL ", p->timeTotal );
164 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static void Abc_PrintTimeP(int level, const char *pStr, abctime time, abctime Time)
Definition: abc_global.h:372
static void Abc_PrintTime(int level, const char *pStr, abctime time)
Definition: abc_global.h:367
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
static int Vec_StrSize(Vec_Str_t *p)
Definition: bblif.c:600
Cec_ManPat_t* Cec_ManPatStart ( )

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

Synopsis [Creates AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 129 of file cecMan.c.

130 {
131  Cec_ManPat_t * p;
132  p = ABC_CALLOC( Cec_ManPat_t, 1 );
133  p->vStorage = Vec_StrAlloc( 1<<20 );
134  p->vPattern1 = Vec_IntAlloc( 1000 );
135  p->vPattern2 = Vec_IntAlloc( 1000 );
136  return p;
137 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static Vec_Str_t * Vec_StrAlloc(int nCap)
Definition: bblif.c:495
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
typedefABC_NAMESPACE_HEADER_START struct Cec_ManPat_t_ Cec_ManPat_t
INCLUDES ///.
Definition: cecInt.h:48
#define ABC_CALLOC(type, num)
Definition: abc_global.h:230
void Cec_ManPatStop ( Cec_ManPat_t p)

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

Synopsis [Deletes AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 177 of file cecMan.c.

178 {
179  Vec_StrFree( p->vStorage );
180  Vec_IntFree( p->vPattern1 );
181  Vec_IntFree( p->vPattern2 );
182  ABC_FREE( p );
183 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static void Vec_StrFree(Vec_Str_t *p)
Definition: bblif.c:616
#define ABC_FREE(obj)
Definition: abc_global.h:232
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
ABC_NAMESPACE_IMPL_START Cec_ManSat_t* Cec_ManSatCreate ( Gia_Man_t pAig,
Cec_ParSat_t pPars 
)

DECLARATIONS ///.

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

FileName [cecMan.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Combinational equivalence checking.]

Synopsis [Manager procedures.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

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

Synopsis [Creates the manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file cecMan.c.

46 {
47  Cec_ManSat_t * p;
48  // create interpolation manager
49  p = ABC_ALLOC( Cec_ManSat_t, 1 );
50  memset( p, 0, sizeof(Cec_ManSat_t) );
51  p->pPars = pPars;
52  p->pAig = pAig;
53  // SAT solving
54  p->nSatVars = 1;
55  p->pSatVars = ABC_CALLOC( int, Gia_ManObjNum(pAig) );
56  p->vUsedNodes = Vec_PtrAlloc( 1000 );
57  p->vFanins = Vec_PtrAlloc( 100 );
58  p->vCex = Vec_IntAlloc( 100 );
59  p->vVisits = Vec_IntAlloc( 100 );
60  return p;
61 }
char * memset()
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Cec_ParSat_t * pPars
Definition: cecInt.h:78
Vec_Int_t * vVisits
Definition: cecInt.h:92
Gia_Man_t * pAig
Definition: cecInt.h:80
int * pSatVars
Definition: cecInt.h:85
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
int nSatVars
Definition: cecInt.h:84
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
Vec_Ptr_t * vFanins
Definition: cecInt.h:89
Vec_Int_t * vCex
Definition: cecInt.h:91
Vec_Ptr_t * vUsedNodes
Definition: cecInt.h:86
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
#define ABC_CALLOC(type, num)
Definition: abc_global.h:230
static int Gia_ManObjNum(Gia_Man_t *p)
Definition: gia.h:388
void Cec_ManSatPrintStats ( Cec_ManSat_t p)

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

Synopsis [Prints statistics of the manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 74 of file cecMan.c.

75 {
76  Abc_Print( 1, "CO = %8d ", Gia_ManCoNum(p->pAig) );
77  Abc_Print( 1, "AND = %8d ", Gia_ManAndNum(p->pAig) );
78  Abc_Print( 1, "Conf = %5d ", p->pPars->nBTLimit );
79  Abc_Print( 1, "MinVar = %5d ", p->pPars->nSatVarMax );
80  Abc_Print( 1, "MinCalls = %5d\n", p->pPars->nCallsRecycle );
81  Abc_Print( 1, "Unsat calls %6d (%6.2f %%) Ave conf = %8.1f ",
82  p->nSatUnsat, p->nSatTotal? 100.0*p->nSatUnsat/p->nSatTotal : 0.0, p->nSatUnsat? 1.0*p->nConfUnsat/p->nSatUnsat :0.0 );
83  Abc_PrintTimeP( 1, "Time", p->timeSatUnsat, p->timeTotal );
84  Abc_Print( 1, "Sat calls %6d (%6.2f %%) Ave conf = %8.1f ",
85  p->nSatSat, p->nSatTotal? 100.0*p->nSatSat/p->nSatTotal : 0.0, p->nSatSat? 1.0*p->nConfSat/p->nSatSat : 0.0 );
86  Abc_PrintTimeP( 1, "Time", p->timeSatSat, p->timeTotal );
87  Abc_Print( 1, "Undef calls %6d (%6.2f %%) Ave conf = %8.1f ",
88  p->nSatUndec, p->nSatTotal? 100.0*p->nSatUndec/p->nSatTotal : 0.0, p->nSatUndec? 1.0*p->nConfUndec/p->nSatUndec : 0.0 );
89  Abc_PrintTimeP( 1, "Time", p->timeSatUndec, p->timeTotal );
90  Abc_PrintTime( 1, "Total time", p->timeTotal );
91 }
int timeSatSat
Definition: cecInt.h:105
int timeTotal
Definition: cecInt.h:107
int nConfUndec
Definition: cecInt.h:102
int nConfUnsat
Definition: cecInt.h:100
Cec_ParSat_t * pPars
Definition: cecInt.h:78
int nSatUnsat
Definition: cecInt.h:94
Gia_Man_t * pAig
Definition: cecInt.h:80
static void Abc_PrintTimeP(int level, const char *pStr, abctime time, abctime Time)
Definition: abc_global.h:372
static void Abc_PrintTime(int level, const char *pStr, abctime time)
Definition: abc_global.h:367
static int Gia_ManAndNum(Gia_Man_t *p)
Definition: gia.h:389
int nSatUndec
Definition: cecInt.h:96
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int timeSatUnsat
Definition: cecInt.h:104
int nSatTotal
Definition: cecInt.h:97
int nConfSat
Definition: cecInt.h:101
int timeSatUndec
Definition: cecInt.h:106
int nSatSat
Definition: cecInt.h:95
static int Gia_ManCoNum(Gia_Man_t *p)
Definition: gia.h:384
void Cec_ManSatStop ( Cec_ManSat_t p)

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

Synopsis [Frees the manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 104 of file cecMan.c.

105 {
106  if ( p->pSat )
107  sat_solver_delete( p->pSat );
108  Vec_IntFree( p->vCex );
109  Vec_IntFree( p->vVisits );
110  Vec_PtrFree( p->vUsedNodes );
111  Vec_PtrFree( p->vFanins );
112  ABC_FREE( p->pSatVars );
113  ABC_FREE( p );
114 }
sat_solver * pSat
Definition: cecInt.h:83
void sat_solver_delete(sat_solver *s)
Definition: satSolver.c:1141
Vec_Int_t * vVisits
Definition: cecInt.h:92
int * pSatVars
Definition: cecInt.h:85
Vec_Ptr_t * vFanins
Definition: cecInt.h:89
Vec_Int_t * vCex
Definition: cecInt.h:91
Vec_Ptr_t * vUsedNodes
Definition: cecInt.h:86
#define ABC_FREE(obj)
Definition: abc_global.h:232
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
Cec_ManSim_t* Cec_ManSimStart ( Gia_Man_t pAig,
Cec_ParSim_t pPars 
)

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

Synopsis [Creates AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 198 of file cecMan.c.

199 {
200  Cec_ManSim_t * p;
201  p = ABC_ALLOC( Cec_ManSim_t, 1 );
202  memset( p, 0, sizeof(Cec_ManSim_t) );
203  p->pAig = pAig;
204  p->pPars = pPars;
205  p->nWords = pPars->nWords;
206  p->pSimInfo = ABC_CALLOC( int, Gia_ManObjNum(pAig) );
207  p->vClassOld = Vec_IntAlloc( 1000 );
208  p->vClassNew = Vec_IntAlloc( 1000 );
209  p->vClassTemp = Vec_IntAlloc( 1000 );
210  p->vRefinedC = Vec_IntAlloc( 10000 );
212  if ( pPars->fCheckMiter || Gia_ManRegNum(p->pAig) )
213  {
215  Vec_PtrCleanSimInfo( p->vCoSimInfo, 0, pPars->nWords );
216  }
217  p->iOut = -1;
218  return p;
219 }
char * memset()
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static void Vec_PtrCleanSimInfo(Vec_Ptr_t *vInfo, int iWord, int nWords)
Definition: vecPtr.h:968
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
Gia_Man_t * pAig
Definition: cecInt.h:115
int fCheckMiter
Definition: cec.h:67
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
int nWords
Definition: cecInt.h:117
Vec_Ptr_t * vCiSimInfo
Definition: cecInt.h:127
Vec_Int_t * vClassNew
Definition: cecInt.h:139
static int Gia_ManCiNum(Gia_Man_t *p)
Definition: gia.h:383
int * pSimInfo
Definition: cecInt.h:119
Cec_ParSim_t * pPars
Definition: cecInt.h:116
#define ABC_CALLOC(type, num)
Definition: abc_global.h:230
Vec_Ptr_t * vCoSimInfo
Definition: cecInt.h:128
Vec_Int_t * vRefinedC
Definition: cecInt.h:141
int nWords
Definition: cec.h:61
Vec_Int_t * vClassTemp
Definition: cecInt.h:140
static int Gia_ManObjNum(Gia_Man_t *p)
Definition: gia.h:388
static Vec_Ptr_t * Vec_PtrAllocSimInfo(int nEntries, int nWords)
Definition: vecPtr.h:929
static int Gia_ManCoNum(Gia_Man_t *p)
Definition: gia.h:384
Vec_Int_t * vClassOld
Definition: cecInt.h:138
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
void Cec_ManSimStop ( Cec_ManSim_t p)

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

Synopsis [Deletes AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 232 of file cecMan.c.

233 {
234  Vec_IntFree( p->vClassOld );
235  Vec_IntFree( p->vClassNew );
236  Vec_IntFree( p->vClassTemp );
237  Vec_IntFree( p->vRefinedC );
238  if ( p->vCiSimInfo )
239  Vec_PtrFree( p->vCiSimInfo );
240  if ( p->vCoSimInfo )
241  Vec_PtrFree( p->vCoSimInfo );
242  ABC_FREE( p->pScores );
243  ABC_FREE( p->pCexComb );
244  ABC_FREE( p->pCexes );
245  ABC_FREE( p->pMems );
246  ABC_FREE( p->pSimInfo );
247  ABC_FREE( p );
248 }
Abc_Cex_t * pCexComb
Definition: cecInt.h:133
int * pScores
Definition: cecInt.h:136
Vec_Ptr_t * vCiSimInfo
Definition: cecInt.h:127
void ** pCexes
Definition: cecInt.h:130
Vec_Int_t * vClassNew
Definition: cecInt.h:139
int * pSimInfo
Definition: cecInt.h:119
#define ABC_FREE(obj)
Definition: abc_global.h:232
Vec_Ptr_t * vCoSimInfo
Definition: cecInt.h:128
Vec_Int_t * vRefinedC
Definition: cecInt.h:141
Vec_Int_t * vClassTemp
Definition: cecInt.h:140
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
unsigned * pMems
Definition: cecInt.h:120
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
Vec_Int_t * vClassOld
Definition: cecInt.h:138