abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
fraigInt.h
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [fraigInt.h]
4 
5  PackageName [FRAIG: Functionally reduced AND-INV graphs.]
6 
7  Synopsis [Internal declarations of the FRAIG package.]
8 
9  Author [Alan Mishchenko <alanmi@eecs.berkeley.edu>]
10 
11  Affiliation [UC Berkeley]
12 
13  Date [Ver. 2.0. Started - October 1, 2004]
14 
15  Revision [$Id: fraigInt.h,v 1.15 2005/07/08 01:01:31 alanmi Exp $]
16 
17 ***********************************************************************/
18 
19 #ifndef ABC__sat__fraig__fraigInt_h
20 #define ABC__sat__fraig__fraigInt_h
21 
22 
23 ////////////////////////////////////////////////////////////////////////
24 /// INCLUDES ///
25 ////////////////////////////////////////////////////////////////////////
26 
27 #include <stdio.h>
28 #include <stdlib.h>
29 #include <string.h>
30 #include <assert.h>
31 
32 #include "misc/util/abc_global.h"
33 #include "fraig.h"
34 #include "sat/msat/msat.h"
35 
37 
38 
39 ////////////////////////////////////////////////////////////////////////
40 /// PARAMETERS ///
41 ////////////////////////////////////////////////////////////////////////
42 
43 /*
44  The AIG node policy:
45  - Each node has its main number (pNode->Num)
46  This is the number of this node in the array of all nodes and its SAT variable number
47  - The PI nodes are stored along with other nodes
48  Additionally, PI nodes have a PI number, by which they are stored in the PI node array
49  - The constant node is has number 0 and is also stored in the array
50 */
51 
52 ////////////////////////////////////////////////////////////////////////
53 /// MACRO DEFINITIONS ///
54 ////////////////////////////////////////////////////////////////////////
55 
56 // enable this macro to support the fanouts
57 #define FRAIG_ENABLE_FANOUTS
58 #define FRAIG_PATTERNS_RANDOM 2048 // should not be less than 128 and more than 32768 (2^15)
59 #define FRAIG_PATTERNS_DYNAMIC 2048 // should not be less than 256 and more than 32768 (2^15)
60 #define FRAIG_MAX_PRIMES 1024 // the maximum number of primes used for hashing
61 
62 // this parameter determines when simulation info is extended
63 // it will be extended when the free storage in the dynamic simulation
64 // info is less or equal to this number of words (FRAIG_WORDS_STORE)
65 // this is done because if the free storage for dynamic simulation info
66 // is not sufficient, computation becomes inefficient
67 #define FRAIG_WORDS_STORE 5
68 
69 // the bit masks
70 #define FRAIG_MASK(n) ((~((unsigned)0)) >> (32-(n)))
71 #define FRAIG_FULL (~((unsigned)0))
72 #define FRAIG_NUM_WORDS(n) (((n)>>5) + (((n)&31) > 0))
73 
74 // generating random unsigned (#define RAND_MAX 0x7fff)
75 //#define FRAIG_RANDOM_UNSIGNED ((((unsigned)rand()) << 24) ^ (((unsigned)rand()) << 12) ^ ((unsigned)rand()))
76 #define FRAIG_RANDOM_UNSIGNED Aig_ManRandom(0)
77 
78 // macros to get hold of the bits in a bit string
79 #define Fraig_BitStringSetBit(p,i) ((p)[(i)>>5] |= (1<<((i) & 31)))
80 #define Fraig_BitStringXorBit(p,i) ((p)[(i)>>5] ^= (1<<((i) & 31)))
81 #define Fraig_BitStringHasBit(p,i) (((p)[(i)>>5] & (1<<((i) & 31))) > 0)
82 
83 // macros to get hold of the bits in the support info
84 //#define Fraig_NodeSetVarStr(p,i) (Fraig_Regular(p)->pSuppStr[((i)%FRAIG_SUPP_SIGN)>>5] |= (1<<(((i)%FRAIG_SUPP_SIGN) & 31)))
85 //#define Fraig_NodeHasVarStr(p,i) ((Fraig_Regular(p)->pSuppStr[((i)%FRAIG_SUPP_SIGN)>>5] & (1<<(((i)%FRAIG_SUPP_SIGN) & 31))) > 0)
86 #define Fraig_NodeSetVarStr(p,i) Fraig_BitStringSetBit(Fraig_Regular(p)->pSuppStr,i)
87 #define Fraig_NodeHasVarStr(p,i) Fraig_BitStringHasBit(Fraig_Regular(p)->pSuppStr,i)
88 
89 // copied from "extra.h" for stand-aloneness
90 #define Fraig_PrintTime(a,t) printf( "%s = ", (a) ); printf( "%6.2f sec\n", (float)(t)/(float)(CLOCKS_PER_SEC) )
91 
92 #define Fraig_HashKey2(a,b,TSIZE) (((ABC_PTRUINT_T)(a) + (ABC_PTRUINT_T)(b) * 12582917) % TSIZE)
93 //#define Fraig_HashKey2(a,b,TSIZE) (( ((unsigned)(a)->Num * 19) ^ ((unsigned)(b)->Num * 1999) ) % TSIZE)
94 //#define Fraig_HashKey2(a,b,TSIZE) ( ((unsigned)((a)->Num + (b)->Num) * ((a)->Num + (b)->Num + 1) / 2) % TSIZE)
95 // the other two hash functions give bad distribution of hash chain lengths (not clear why)
96 
97 ////////////////////////////////////////////////////////////////////////
98 /// STRUCTURE DEFINITIONS ///
99 ////////////////////////////////////////////////////////////////////////
100 
102 
103 // the mapping manager
105 {
106  // the AIG nodes
107  Fraig_NodeVec_t * vInputs; // the array of primary inputs
108  Fraig_NodeVec_t * vNodes; // the array of all nodes, including primary inputs
109  Fraig_NodeVec_t * vOutputs; // the array of primary outputs (some internal nodes)
110  Fraig_Node_t * pConst1; // the pointer to the constant node (vNodes->pArray[0])
111 
112  // info about the original circuit
113  char ** ppInputNames; // the primary input names
114  char ** ppOutputNames; // the primary output names
115 
116  // various hash-tables
117  Fraig_HashTable_t * pTableS; // hashing by structure
118  Fraig_HashTable_t * pTableF; // hashing by simulation info
119  Fraig_HashTable_t * pTableF0; // hashing by simulation info (sparse functions)
120 
121  // parameters
122  int nWordsRand; // the number of words of random simulation info
123  int nWordsDyna; // the number of words of dynamic simulation info
124  int nBTLimit; // the max number of backtracks to perform
125  int nSeconds; // the runtime limit for the miter proof
126  int fFuncRed; // performs only one level hashing
127  int fFeedBack; // enables solver feedback
128  int fDist1Pats; // enables solver feedback
129  int fDoSparse; // performs equiv tests for sparse functions
130  int fChoicing; // enables recording structural choices
131  int fTryProve; // tries to solve the final miter
132  int fVerbose; // the verbosiness flag
133  int fVerboseP; // the verbosiness flag
134  ABC_INT64_T nInspLimit; // the inspection limit
135 
136  int nTravIds; // the traversal counter
137  int nTravIds2; // the traversal counter
138 
139  // info related to the solver feedback
140  int iWordStart; // the first word to use for simulation
141  int iWordPerm; // the number of words stored permanently
142  int iPatsPerm; // the number of patterns stored permanently
143  Fraig_NodeVec_t * vCones; // the temporary array of internal variables
144  Msat_IntVec_t * vPatsReal; // the array of real pattern numbers
145  unsigned * pSimsReal; // used for simulation patterns
146  unsigned * pSimsDiff; // used for simulation patterns
147  unsigned * pSimsTemp; // used for simulation patterns
148 
149  // the support information
151  unsigned ** pSuppS;
152  unsigned ** pSuppF;
153 
154  // the memory managers
155  Fraig_MemFixed_t * mmNodes; // the memory manager for nodes
156  Fraig_MemFixed_t * mmSims; // the memory manager for simulation info
157 
158  // solving the SAT problem
159  Msat_Solver_t * pSat; // the SAT solver
160  Msat_IntVec_t * vProj; // the temporary array of projection vars
161  int nSatNums; // the counter of SAT variables
162  int * pModel; // the assignment, which satisfies the miter
163  // these arrays belong to the solver
164  Msat_IntVec_t * vVarsInt; // the temporary array of variables
165  Msat_ClauseVec_t * vAdjacents; // the temporary storage for connectivity
166  Msat_IntVec_t * vVarsUsed; // the array marking vars appearing in the cone
167 
168  // various statistic variables
169  int nSatCalls; // the number of times equivalence checking was called
170  int nSatProof; // the number of times a proof was found
171  int nSatCounter; // the number of times a counter example was found
172  int nSatFails; // the number of times the SAT solver failed to complete due to resource limit or prediction
173  int nSatFailsReal; // the number of times the SAT solver failed to complete due to resource limit
174 
175  int nSatCallsImp; // the number of times equivalence checking was called
176  int nSatProofImp; // the number of times a proof was found
177  int nSatCounterImp;// the number of times a counter example was found
178  int nSatFailsImp; // the number of times the SAT solver failed to complete
179 
180  int nSatZeros; // the number of times the simulation vector is zero
181  int nSatSupps; // the number of times the support info was useful
182  int nRefErrors; // the number of ref counting errors
183  int nImplies; // the number of implication cases
184  int nSatImpls; // the number of implication SAT calls
185  int nVarsClauses; // the number of variables with clauses
190 
191  // runtime statistics
192  abctime timeToAig; // time to transfer to the mapping structure
193  abctime timeSims; // time to compute k-feasible cuts
194  abctime timeTrav; // time to traverse the network
195  abctime timeFeed; // time for solver feedback (recording and resimulating)
196  abctime timeImply; // time to analyze implications
197  abctime timeSat; // time to compute the truth table for each cut
198  abctime timeToNet; // time to transfer back to the network
199  abctime timeTotal; // the total mapping time
200  abctime time1; // time to perform one task
201  abctime time2; // time to perform another task
202  abctime time3; // time to perform another task
203  abctime time4; // time to perform another task
204 };
205 
206 // the mapping node
208 {
209  // various numbers associated with the node
210  int Num; // the unique number (SAT var number) of this node
211  int NumPi; // if the node is a PI, this is its variable number
212  int Level; // the level of the node
213  int nRefs; // the number of references of the node
214  int TravId; // the traversal ID (use to avoid cleaning marks)
215  int TravId2; // the traversal ID (use to avoid cleaning marks)
216 
217  // general information about the node
218  unsigned fInv : 1; // the mark to show that simulation info is complemented
219  unsigned fNodePo : 1; // the mark used for primary outputs
220  unsigned fClauses : 1; // the clauses for this node are loaded
221  unsigned fMark0 : 1; // the mark used for traversals
222  unsigned fMark1 : 1; // the mark used for traversals
223  unsigned fMark2 : 1; // the mark used for traversals
224  unsigned fMark3 : 1; // the mark used for traversals
225  unsigned fFeedUse : 1; // the presence of the variable in the feedback
226  unsigned fFeedVal : 1; // the value of the variable in the feedback
227  unsigned fFailTfo : 1; // the node is in the TFO of the failed SAT run
228  unsigned nFanouts : 2; // the indicator of fanouts (none, one, or many)
229  unsigned nOnes : 20; // the number of 1's in the random sim info
230 
231  // the children of the node
232  Fraig_Node_t * p1; // the first child
233  Fraig_Node_t * p2; // the second child
234  Fraig_NodeVec_t * vFanins; // the fanins of the supergate rooted at this node
235 // Fraig_NodeVec_t * vFanouts; // the fanouts of the supergate rooted at this node
236 
237  // various linked lists
238  Fraig_Node_t * pNextS; // the next node in the structural hash table
239  Fraig_Node_t * pNextF; // the next node in the functional (simulation) hash table
240  Fraig_Node_t * pNextD; // the next node in the list of nodes based on dynamic simulation
241  Fraig_Node_t * pNextE; // the next structural choice (functionally-equivalent node)
242  Fraig_Node_t * pRepr; // the canonical functional representative of the node
243 
244  // simulation data
245  unsigned uHashR; // the hash value for random information
246  unsigned uHashD; // the hash value for dynamic information
247  unsigned * puSimR; // the simulation information (random)
248  unsigned * puSimD; // the simulation information (dynamic)
249 
250  // misc information
251  Fraig_Node_t * pData0; // temporary storage for the corresponding network node
252  Fraig_Node_t * pData1; // temporary storage for the corresponding network node
253 
254 #ifdef FRAIG_ENABLE_FANOUTS
255  // representation of node's fanouts
256  Fraig_Node_t * pFanPivot; // the first fanout of this node
257  Fraig_Node_t * pFanFanin1; // the next fanout of p1
258  Fraig_Node_t * pFanFanin2; // the next fanout of p2
259 #endif
260 };
261 
262 // the vector of nodes
264 {
265  int nCap; // the number of allocated entries
266  int nSize; // the number of entries in the array
267  Fraig_Node_t ** pArray; // the array of nodes
268 };
269 
270 // the hash table
272 {
273  Fraig_Node_t ** pBins; // the table bins
274  int nBins; // the size of the table
275  int nEntries; // the total number of entries in the table
276 };
277 
278 // getting hold of the next fanout of the node
279 #define Fraig_NodeReadNextFanout( pNode, pFanout ) \
280  ( ( pFanout == NULL )? NULL : \
281  ((Fraig_Regular((pFanout)->p1) == (pNode))? \
282  (pFanout)->pFanFanin1 : (pFanout)->pFanFanin2) )
283 // getting hold of the place where the next fanout will be attached
284 #define Fraig_NodeReadNextFanoutPlace( pNode, pFanout ) \
285  ( (Fraig_Regular((pFanout)->p1) == (pNode))? \
286  &(pFanout)->pFanFanin1 : &(pFanout)->pFanFanin2 )
287 // iterator through the fanouts of the node
288 #define Fraig_NodeForEachFanout( pNode, pFanout ) \
289  for ( pFanout = (pNode)->pFanPivot; pFanout; \
290  pFanout = Fraig_NodeReadNextFanout(pNode, pFanout) )
291 // safe iterator through the fanouts of the node
292 #define Fraig_NodeForEachFanoutSafe( pNode, pFanout, pFanout2 ) \
293  for ( pFanout = (pNode)->pFanPivot, \
294  pFanout2 = Fraig_NodeReadNextFanout(pNode, pFanout); \
295  pFanout; \
296  pFanout = pFanout2, \
297  pFanout2 = Fraig_NodeReadNextFanout(pNode, pFanout) )
298 
299 // iterators through the entries in the linked lists of nodes
300 // the list of nodes in the structural hash table
301 #define Fraig_TableBinForEachEntryS( pBin, pEnt ) \
302  for ( pEnt = pBin; \
303  pEnt; \
304  pEnt = pEnt->pNextS )
305 #define Fraig_TableBinForEachEntrySafeS( pBin, pEnt, pEnt2 ) \
306  for ( pEnt = pBin, \
307  pEnt2 = pEnt? pEnt->pNextS: NULL; \
308  pEnt; \
309  pEnt = pEnt2, \
310  pEnt2 = pEnt? pEnt->pNextS: NULL )
311 // the list of nodes in the functional (simulation) hash table
312 #define Fraig_TableBinForEachEntryF( pBin, pEnt ) \
313  for ( pEnt = pBin; \
314  pEnt; \
315  pEnt = pEnt->pNextF )
316 #define Fraig_TableBinForEachEntrySafeF( pBin, pEnt, pEnt2 ) \
317  for ( pEnt = pBin, \
318  pEnt2 = pEnt? pEnt->pNextF: NULL; \
319  pEnt; \
320  pEnt = pEnt2, \
321  pEnt2 = pEnt? pEnt->pNextF: NULL )
322 // the list of nodes with the same simulation and different functionality
323 #define Fraig_TableBinForEachEntryD( pBin, pEnt ) \
324  for ( pEnt = pBin; \
325  pEnt; \
326  pEnt = pEnt->pNextD )
327 #define Fraig_TableBinForEachEntrySafeD( pBin, pEnt, pEnt2 ) \
328  for ( pEnt = pBin, \
329  pEnt2 = pEnt? pEnt->pNextD: NULL; \
330  pEnt; \
331  pEnt = pEnt2, \
332  pEnt2 = pEnt? pEnt->pNextD: NULL )
333 // the list of nodes with the same functionality
334 #define Fraig_TableBinForEachEntryE( pBin, pEnt ) \
335  for ( pEnt = pBin; \
336  pEnt; \
337  pEnt = pEnt->pNextE )
338 #define Fraig_TableBinForEachEntrySafeE( pBin, pEnt, pEnt2 ) \
339  for ( pEnt = pBin, \
340  pEnt2 = pEnt? pEnt->pNextE: NULL; \
341  pEnt; \
342  pEnt = pEnt2, \
343  pEnt2 = pEnt? pEnt->pNextE: NULL )
344 
345 ////////////////////////////////////////////////////////////////////////
346 /// GLOBAL VARIABLES ///
347 ////////////////////////////////////////////////////////////////////////
348 
349 // random number generator imported from another package
350 extern unsigned Aig_ManRandom( int fReset );
351 
352 ////////////////////////////////////////////////////////////////////////
353 /// FUNCTION DEFINITIONS ///
354 ////////////////////////////////////////////////////////////////////////
355 
356 /*=== fraigCanon.c =============================================================*/
358 /*=== fraigFanout.c =============================================================*/
359 extern void Fraig_NodeAddFaninFanout( Fraig_Node_t * pFanin, Fraig_Node_t * pFanout );
360 extern void Fraig_NodeRemoveFaninFanout( Fraig_Node_t * pFanin, Fraig_Node_t * pFanoutToRemove );
361 extern int Fraig_NodeGetFanoutNum( Fraig_Node_t * pNode );
362 /*=== fraigFeed.c =============================================================*/
363 extern void Fraig_FeedBackInit( Fraig_Man_t * p );
364 extern void Fraig_FeedBack( Fraig_Man_t * p, int * pModel, Msat_IntVec_t * vVars, Fraig_Node_t * pOld, Fraig_Node_t * pNew );
365 extern void Fraig_FeedBackTest( Fraig_Man_t * p );
366 extern int Fraig_FeedBackCompress( Fraig_Man_t * p );
367 extern int * Fraig_ManAllocCounterExample( Fraig_Man_t * p );
368 extern int * Fraig_ManSaveCounterExample( Fraig_Man_t * p, Fraig_Node_t * pNode );
369 /*=== fraigMan.c =============================================================*/
370 extern void Fraig_ManCreateSolver( Fraig_Man_t * p );
371 /*=== fraigMem.c =============================================================*/
372 extern Fraig_MemFixed_t * Fraig_MemFixedStart( int nEntrySize );
373 extern void Fraig_MemFixedStop( Fraig_MemFixed_t * p, int fVerbose );
374 extern char * Fraig_MemFixedEntryFetch( Fraig_MemFixed_t * p );
375 extern void Fraig_MemFixedEntryRecycle( Fraig_MemFixed_t * p, char * pEntry );
376 extern void Fraig_MemFixedRestart( Fraig_MemFixed_t * p );
378 /*=== fraigNode.c =============================================================*/
382 extern void Fraig_NodeSimulate( Fraig_Node_t * pNode, int iWordStart, int iWordStop, int fUseRand );
383 /*=== fraigPrime.c =============================================================*/
384 extern int s_FraigPrimes[FRAIG_MAX_PRIMES];
385 /*=== fraigSat.c ===============================================================*/
386 extern int Fraig_NodeIsImplication( Fraig_Man_t * p, Fraig_Node_t * pOld, Fraig_Node_t * pNew, int nBTLimit );
387 /*=== fraigTable.c =============================================================*/
388 extern Fraig_HashTable_t * Fraig_HashTableCreate( int nSize );
389 extern void Fraig_HashTableFree( Fraig_HashTable_t * p );
390 extern int Fraig_HashTableLookupS( Fraig_Man_t * pMan, Fraig_Node_t * p1, Fraig_Node_t * p2, Fraig_Node_t ** ppNodeRes );
391 extern Fraig_Node_t * Fraig_HashTableLookupF( Fraig_Man_t * pMan, Fraig_Node_t * pNode );
393 extern void Fraig_HashTableInsertF0( Fraig_Man_t * pMan, Fraig_Node_t * pNode );
394 extern int Fraig_CompareSimInfo( Fraig_Node_t * pNode1, Fraig_Node_t * pNode2, int iWordLast, int fUseRand );
395 extern int Fraig_CompareSimInfoUnderMask( Fraig_Node_t * pNode1, Fraig_Node_t * pNode2, int iWordLast, int fUseRand, unsigned * puMask );
396 extern int Fraig_FindFirstDiff( Fraig_Node_t * pNode1, Fraig_Node_t * pNode2, int fCompl, int iWordLast, int fUseRand );
397 extern void Fraig_CollectXors( Fraig_Node_t * pNode1, Fraig_Node_t * pNode2, int iWordLast, int fUseRand, unsigned * puMask );
398 extern void Fraig_TablePrintStatsS( Fraig_Man_t * pMan );
399 extern void Fraig_TablePrintStatsF( Fraig_Man_t * pMan );
400 extern void Fraig_TablePrintStatsF0( Fraig_Man_t * pMan );
401 extern int Fraig_TableRehashF0( Fraig_Man_t * pMan, int fLinkEquiv );
402 /*=== fraigUtil.c ===============================================================*/
403 extern int Fraig_NodeCountPis( Msat_IntVec_t * vVars, int nVarsPi );
404 extern int Fraig_NodeCountSuppVars( Fraig_Man_t * p, Fraig_Node_t * pNode, int fSuppStr );
405 extern int Fraig_NodesCompareSupps( Fraig_Man_t * p, Fraig_Node_t * pOld, Fraig_Node_t * pNew );
406 extern int Fraig_NodeAndSimpleCase_rec( Fraig_Node_t * pOld, Fraig_Node_t * pNew );
407 extern int Fraig_NodeIsExorType( Fraig_Node_t * pNode );
408 extern void Fraig_ManSelectBestChoice( Fraig_Man_t * p );
409 extern int Fraig_BitStringCountOnes( unsigned * pString, int nWords );
410 extern void Fraig_PrintBinary( FILE * pFile, unsigned * pSign, int nBits );
411 extern int Fraig_NodeIsExorType( Fraig_Node_t * pNode );
412 extern int Fraig_NodeIsExor( Fraig_Node_t * pNode );
413 extern int Fraig_NodeIsMuxType( Fraig_Node_t * pNode );
414 extern Fraig_Node_t * Fraig_NodeRecognizeMux( Fraig_Node_t * pNode, Fraig_Node_t ** ppNodeT, Fraig_Node_t ** ppNodeE );
415 extern int Fraig_ManCountExors( Fraig_Man_t * pMan );
416 extern int Fraig_ManCountMuxes( Fraig_Man_t * pMan );
417 extern int Fraig_NodeSimsContained( Fraig_Man_t * pMan, Fraig_Node_t * pNode1, Fraig_Node_t * pNode2 );
418 extern int Fraig_NodeIsInSupergate( Fraig_Node_t * pOld, Fraig_Node_t * pNew );
419 extern Fraig_NodeVec_t * Fraig_CollectSupergate( Fraig_Node_t * pNode, int fStopAtMux );
420 extern int Fraig_CountPis( Fraig_Man_t * p, Msat_IntVec_t * vVarNums );
421 extern void Fraig_ManIncrementTravId( Fraig_Man_t * pMan );
422 extern void Fraig_NodeSetTravIdCurrent( Fraig_Man_t * pMan, Fraig_Node_t * pNode );
423 extern int Fraig_NodeIsTravIdCurrent( Fraig_Man_t * pMan, Fraig_Node_t * pNode );
424 extern int Fraig_NodeIsTravIdPrevious( Fraig_Man_t * pMan, Fraig_Node_t * pNode );
425 /*=== fraigVec.c ===============================================================*/
427 
428 
429 
431 
432 #endif
433 
434 ////////////////////////////////////////////////////////////////////////
435 /// END OF FILE ///
436 ////////////////////////////////////////////////////////////////////////
Fraig_Node_t * pFanFanin1
Definition: fraigInt.h:257
ABC_INT64_T nInspLimit
Definition: fraigInt.h:134
int Fraig_FeedBackCompress(Fraig_Man_t *p)
Definition: fraigFeed.c:278
abctime timeTrav
Definition: fraigInt.h:194
void Fraig_NodeSetTravIdCurrent(Fraig_Man_t *pMan, Fraig_Node_t *pNode)
Definition: fraigUtil.c:996
int Fraig_NodeIsTravIdPrevious(Fraig_Man_t *pMan, Fraig_Node_t *pNode)
Definition: fraigUtil.c:1028
unsigned * pSimsReal
Definition: fraigInt.h:145
Fraig_Node_t * Fraig_NodeCreateConst(Fraig_Man_t *p)
FUNCTION DEFINITIONS ///.
Definition: fraigNode.c:46
Fraig_HashTable_t * pTableF
Definition: fraigInt.h:118
void Fraig_NodeSimulate(Fraig_Node_t *pNode, int iWordStart, int iWordStop, int fUseRand)
Definition: fraigNode.c:226
int Fraig_NodesCompareSupps(Fraig_Man_t *p, Fraig_Node_t *pOld, Fraig_Node_t *pNew)
abctime timeFeed
Definition: fraigInt.h:195
typedefABC_NAMESPACE_HEADER_START struct Fraig_ManStruct_t_ Fraig_Man_t
INCLUDES ///.
Definition: fraig.h:40
int * Fraig_ManSaveCounterExample(Fraig_Man_t *p, Fraig_Node_t *pNode)
Definition: fraigFeed.c:860
#define FRAIG_MAX_PRIMES
Definition: fraigInt.h:60
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Fraig_NodeVec_t * vOutputs
Definition: fraigInt.h:109
void Fraig_MemFixedEntryRecycle(Fraig_MemFixed_t *p, char *pEntry)
Definition: fraigMem.c:182
int Fraig_MemFixedReadMemUsage(Fraig_MemFixed_t *p)
Definition: fraigMem.c:240
void Fraig_NodeAddFaninFanout(Fraig_Node_t *pFanin, Fraig_Node_t *pFanout)
DECLARATIONS ///.
Definition: fraigFanout.c:45
unsigned ** pSuppF
Definition: fraigInt.h:152
DECLARATIONS ///.
Definition: fraigMem.c:28
void Fraig_FeedBackTest(Fraig_Man_t *p)
void Fraig_TablePrintStatsF(Fraig_Man_t *pMan)
Definition: fraigTable.c:537
void Fraig_ManIncrementTravId(Fraig_Man_t *pMan)
Definition: fraigUtil.c:980
Fraig_MemFixed_t * mmSims
Definition: fraigInt.h:156
void Fraig_TablePrintStatsF0(Fraig_Man_t *pMan)
Definition: fraigTable.c:566
Fraig_Node_t * Fraig_NodeCreate(Fraig_Man_t *p, Fraig_Node_t *p1, Fraig_Node_t *p2)
Definition: fraigNode.c:160
void Fraig_FeedBackInit(Fraig_Man_t *p)
FUNCTION DEFINITIONS ///.
Definition: fraigFeed.c:57
Msat_IntVec_t * vPatsReal
Definition: fraigInt.h:144
int Fraig_CompareSimInfo(Fraig_Node_t *pNode1, Fraig_Node_t *pNode2, int iWordLast, int fUseRand)
Definition: fraigTable.c:351
Fraig_Node_t ** pBins
Definition: fraigInt.h:273
Fraig_Node_t * Fraig_NodeAndCanon(Fraig_Man_t *pMan, Fraig_Node_t *p1, Fraig_Node_t *p2)
FUNCTION DEFINITIONS ///.
Definition: fraigCanon.c:52
abctime timeSims
Definition: fraigInt.h:193
void Fraig_TablePrintStatsS(Fraig_Man_t *pMan)
Definition: fraigTable.c:504
unsigned fClauses
Definition: fraigInt.h:220
Fraig_Node_t * pNextD
Definition: fraigInt.h:240
void Fraig_HashTableFree(Fraig_HashTable_t *p)
Definition: fraigTable.c:70
int Fraig_HashTableLookupS(Fraig_Man_t *pMan, Fraig_Node_t *p1, Fraig_Node_t *p2, Fraig_Node_t **ppNodeRes)
Definition: fraigTable.c:90
unsigned * puSimD
Definition: fraigInt.h:248
unsigned ** pSuppS
Definition: fraigInt.h:151
Fraig_Node_t * p2
Definition: fraigInt.h:233
unsigned fFeedUse
Definition: fraigInt.h:225
int nWords
Definition: abcNpn.c:127
Msat_Solver_t * pSat
Definition: fraigInt.h:159
int Fraig_CountPis(Fraig_Man_t *p, Msat_IntVec_t *vVarNums)
Definition: fraigUtil.c:817
int Fraig_NodeIsInSupergate(Fraig_Node_t *pOld, Fraig_Node_t *pNew)
Definition: fraigUtil.c:905
Fraig_Node_t * Fraig_NodeCreatePi(Fraig_Man_t *p)
Definition: fraigNode.c:87
Fraig_NodeVec_t * vNodes
Definition: fraigInt.h:108
Fraig_Node_t * Fraig_NodeRecognizeMux(Fraig_Node_t *pNode, Fraig_Node_t **ppNodeT, Fraig_Node_t **ppNodeE)
Definition: fraigUtil.c:658
void Fraig_FeedBack(Fraig_Man_t *p, int *pModel, Msat_IntVec_t *vVars, Fraig_Node_t *pOld, Fraig_Node_t *pNew)
Definition: fraigFeed.c:80
int Fraig_FindFirstDiff(Fraig_Node_t *pNode1, Fraig_Node_t *pNode2, int fCompl, int iWordLast, int fUseRand)
Definition: fraigTable.c:390
Fraig_Node_t * pNextF
Definition: fraigInt.h:239
abctime timeImply
Definition: fraigInt.h:196
unsigned * puSimR
Definition: fraigInt.h:247
Fraig_Node_t * pNextE
Definition: fraigInt.h:241
void Fraig_ManSelectBestChoice(Fraig_Man_t *p)
int Fraig_NodeSimsContained(Fraig_Man_t *pMan, Fraig_Node_t *pNode1, Fraig_Node_t *pNode2)
Definition: fraigUtil.c:784
Fraig_Node_t * Fraig_HashTableLookupF0(Fraig_Man_t *pMan, Fraig_Node_t *pNode)
Definition: fraigTable.c:193
int * Fraig_ManAllocCounterExample(Fraig_Man_t *p)
Definition: fraigFeed.c:787
unsigned * pSimsDiff
Definition: fraigInt.h:146
int Fraig_ManCountMuxes(Fraig_Man_t *pMan)
Definition: fraigUtil.c:763
Fraig_HashTable_t * pTableS
Definition: fraigInt.h:117
int Fraig_CompareSimInfoUnderMask(Fraig_Node_t *pNode1, Fraig_Node_t *pNode2, int iWordLast, int fUseRand, unsigned *puMask)
Definition: fraigTable.c:451
abctime timeToAig
Definition: fraigInt.h:192
int Fraig_NodeIsExor(Fraig_Node_t *pNode)
Definition: fraigUtil.c:633
Fraig_Node_t * pData1
Definition: fraigInt.h:252
abctime timeTotal
Definition: fraigInt.h:199
void Fraig_HashTableInsertF0(Fraig_Man_t *pMan, Fraig_Node_t *pNode)
Definition: fraigTable.c:237
Fraig_Node_t * p1
Definition: fraigInt.h:232
Msat_IntVec_t * vVarsUsed
Definition: fraigInt.h:166
int Fraig_NodeIsTravIdCurrent(Fraig_Man_t *pMan, Fraig_Node_t *pNode)
Definition: fraigUtil.c:1012
int Fraig_NodeIsImplication(Fraig_Man_t *p, Fraig_Node_t *pOld, Fraig_Node_t *pNew, int nBTLimit)
Definition: fraigSat.c:551
Fraig_HashTable_t * pTableF0
Definition: fraigInt.h:119
Fraig_Node_t * pFanFanin2
Definition: fraigInt.h:258
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
Definition: abc_global.h:105
void Fraig_ManCreateSolver(Fraig_Man_t *p)
Definition: fraigMan.c:325
int Fraig_NodeCountPis(Msat_IntVec_t *vVars, int nVarsPi)
Msat_IntVec_t * vVarsInt
Definition: fraigInt.h:164
void Fraig_CollectXors(Fraig_Node_t *pNode1, Fraig_Node_t *pNode2, int iWordLast, int fUseRand, unsigned *puMask)
Definition: fraigTable.c:478
#define ABC_NAMESPACE_HEADER_END
Definition: abc_global.h:106
Fraig_HashTable_t * Fraig_HashTableCreate(int nSize)
FUNCTION DEFINITIONS ///.
Definition: fraigTable.c:46
unsigned Aig_ManRandom(int fReset)
GLOBAL VARIABLES ///.
Definition: aigUtil.c:1157
Fraig_NodeVec_t * Fraig_CollectSupergate(Fraig_Node_t *pNode, int fStopAtMux)
Definition: fraigUtil.c:960
int Fraig_NodeAndSimpleCase_rec(Fraig_Node_t *pOld, Fraig_Node_t *pNew)
int Fraig_BitStringCountOnes(unsigned *pString, int nWords)
Definition: fraigUtil.c:288
int Fraig_NodeGetFanoutNum(Fraig_Node_t *pNode)
Definition: fraigFanout.c:164
Msat_ClauseVec_t * vAdjacents
Definition: fraigInt.h:165
Fraig_Node_t * pRepr
Definition: fraigInt.h:242
int Fraig_NodeIsMuxType(Fraig_Node_t *pNode)
Definition: fraigUtil.c:591
unsigned fFailTfo
Definition: fraigInt.h:227
char ** ppInputNames
Definition: fraigInt.h:113
unsigned fFeedVal
Definition: fraigInt.h:226
Fraig_MemFixed_t * mmNodes
Definition: fraigInt.h:155
Fraig_Node_t * pNextS
Definition: fraigInt.h:238
int Fraig_NodeCountSuppVars(Fraig_Man_t *p, Fraig_Node_t *pNode, int fSuppStr)
Fraig_Node_t ** pArray
Definition: fraigInt.h:267
Fraig_Node_t * Fraig_HashTableLookupF(Fraig_Man_t *pMan, Fraig_Node_t *pNode)
Definition: fraigTable.c:136
unsigned * pSimsTemp
Definition: fraigInt.h:147
unsigned fNodePo
Definition: fraigInt.h:219
void Fraig_MemFixedRestart(Fraig_MemFixed_t *p)
Definition: fraigMem.c:202
char * Fraig_MemFixedEntryFetch(Fraig_MemFixed_t *p)
Definition: fraigMem.c:131
void Fraig_NodeVecSortByRefCount(Fraig_NodeVec_t *p)
Definition: fraigVec.c:539
void Fraig_MemFixedStop(Fraig_MemFixed_t *p, int fVerbose)
Definition: fraigMem.c:102
void Fraig_NodeRemoveFaninFanout(Fraig_Node_t *pFanin, Fraig_Node_t *pFanoutToRemove)
Definition: fraigFanout.c:101
int Fraig_ManCountExors(Fraig_Man_t *pMan)
Definition: fraigUtil.c:742
Fraig_Node_t * pFanPivot
Definition: fraigInt.h:256
int Fraig_TableRehashF0(Fraig_Man_t *pMan, int fLinkEquiv)
Definition: fraigTable.c:604
char ** ppOutputNames
Definition: fraigInt.h:114
Fraig_NodeVec_t * vCones
Definition: fraigInt.h:143
void Fraig_PrintBinary(FILE *pFile, unsigned *pSign, int nBits)
Definition: fraigUtil.c:402
Msat_IntVec_t * vProj
Definition: fraigInt.h:160
ABC_INT64_T abctime
Definition: abc_global.h:278
unsigned nFanouts
Definition: fraigInt.h:228
Fraig_MemFixed_t * Fraig_MemFixedStart(int nEntrySize)
FUNCTION DEFINITIONS ///.
Definition: fraigMem.c:63
Fraig_NodeVec_t * vFanins
Definition: fraigInt.h:234
abctime timeToNet
Definition: fraigInt.h:198
Fraig_NodeVec_t * vInputs
Definition: fraigInt.h:107
int Fraig_NodeIsExorType(Fraig_Node_t *pNode)
Definition: fraigUtil.c:558
typedefABC_NAMESPACE_HEADER_START struct Msat_Solver_t_ Msat_Solver_t
INCLUDES ///.
Definition: msat.h:42
int s_FraigPrimes[FRAIG_MAX_PRIMES]
DECLARATIONS ///.
Definition: fraigPrime.c:30
Fraig_Node_t * pConst1
Definition: fraigInt.h:110
Fraig_Node_t * pData0
Definition: fraigInt.h:251