ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
acecCore.c
Go to the documentation of this file.
1
20
21#include "acecInt.h"
22#include "proof/cec/cec.h"
23#include "misc/util/utilTruth.h"
24#include "misc/extra/extra.h"
25
27
28
32
33#define TRUTH_UNUSED 0x1234567812345678
34
38
51{
52 memset( p, 0, sizeof(Acec_ParCec_t) );
53 p->nBTLimit = 1000; // conflict limit at a node
54 p->TimeLimit = 0; // the runtime limit in seconds
55 p->fMiter = 0; // input circuit is a miter
56 p->fDualOutput = 0; // dual-output miter
57 p->fTwoOutput = 0; // two-output miter
58 p->fSilent = 0; // print no messages
59 p->fVeryVerbose = 0; // verbose stats
60 p->fVerbose = 0; // verbose stats
61 p->iOutFail = -1; // the number of failed output
62}
63
75void Acec_VerifyClasses( Gia_Man_t * p, Vec_Wec_t * vLits, Vec_Wec_t * vReprs )
76{
77 Vec_Ptr_t * vFunc = Vec_PtrAlloc( Vec_WecSize(vLits) );
78 Vec_Int_t * vSupp = Vec_IntAlloc( 100 );
79 Vec_Wrd_t * vTemp = Vec_WrdStart( Gia_ManObjNum(p) );
80 Vec_Int_t * vLevel;
81 int i, j, k, Entry, Entry2, nOvers = 0, nErrors = 0;
82 Vec_WecForEachLevel( vLits, vLevel, i )
83 {
84 Vec_Wrd_t * vTruths = Vec_WrdAlloc( Vec_IntSize(vLevel) );
85 Vec_IntForEachEntry( vLevel, Entry, k )
86 {
87 word Truth = Gia_ObjComputeTruth6Cis( p, Entry, vSupp, vTemp );
88 if ( Vec_IntSize(vSupp) > 6 )
89 {
90 nOvers++;
91 Vec_WrdPush( vTruths, TRUTH_UNUSED );
92 continue;
93 }
94 vSupp->nSize = Abc_Tt6MinBase( &Truth, vSupp->pArray, vSupp->nSize );
95 if ( Vec_IntSize(vSupp) > 5 )
96 {
97 nOvers++;
98 Vec_WrdPush( vTruths, TRUTH_UNUSED );
99 continue;
100 }
101 Vec_WrdPush( vTruths, Truth );
102 }
103 Vec_PtrPush( vFunc, vTruths );
104 }
105 if ( nOvers )
106 printf( "Detected %d oversize support nodes.\n", nOvers );
107 Vec_IntFree( vSupp );
108 Vec_WrdFree( vTemp );
109 // verify the classes
110 Vec_WecForEachLevel( vReprs, vLevel, i )
111 {
112 Vec_Wrd_t * vTruths = (Vec_Wrd_t *)Vec_PtrEntry( vFunc, i );
113 Vec_IntForEachEntry( vLevel, Entry, k )
114 Vec_IntForEachEntryStart( vLevel, Entry2, j, k+1 )
115 {
116 word Truth = Vec_WrdEntry( vTruths, k );
117 word Truth2 = Vec_WrdEntry( vTruths, j );
118 if ( Entry == Entry2 )
119 {
120 nErrors++;
121 if ( Truth != Truth2 && Truth != TRUTH_UNUSED && Truth2 != TRUTH_UNUSED )
122 printf( "Rank %d: Lit %d and %d do not pass verification.\n", i, k, j );
123 }
124 if ( Entry == Abc_LitNot(Entry2) )
125 {
126 nErrors++;
127 if ( Truth != ~Truth2 && Truth != TRUTH_UNUSED && Truth2 != TRUTH_UNUSED )
128 printf( "Rank %d: Lit %d and %d do not pass verification.\n", i, k, j );
129 }
130 }
131 }
132 if ( nErrors )
133 printf( "Total errors in equivalence classes = %d.\n", nErrors );
134 Vec_VecFree( (Vec_Vec_t *)vFunc );
135}
136
149{
150 Gia_Obj_t * pObj;
151 int i;
152 Gia_ManFillValue( pAdd );
153 Gia_ManConst0(pAdd)->Value = 0;
154 if ( pBase == NULL )
155 {
156 pBase = Gia_ManStart( Gia_ManObjNum(pAdd) );
157 pBase->pName = Abc_UtilStrsav( pAdd->pName );
158 pBase->pSpec = Abc_UtilStrsav( pAdd->pSpec );
159 Gia_ManForEachCi( pAdd, pObj, i )
160 pObj->Value = Gia_ManAppendCi(pBase);
161 Gia_ManHashAlloc( pBase );
162 }
163 else
164 {
165 assert( Gia_ManCiNum(pBase) == Gia_ManCiNum(pAdd) );
166 Gia_ManForEachCi( pAdd, pObj, i )
167 pObj->Value = Gia_Obj2Lit( pBase, Gia_ManCi(pBase, i) );
168 }
169 Gia_ManForEachAnd( pAdd, pObj, i )
170 pObj->Value = Gia_ManHashAnd( pBase, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
171 return pBase;
172}
174{
175 int Id;
176 Gia_ManCreateRefs( pBase );
177 Gia_ManForEachAndId( pBase, Id )
178 if ( Gia_ObjRefNumId(pBase, Id) == 0 )
179 Gia_ManAppendCo( pBase, Abc_Var2Lit(Id,0) );
180}
182{
183 Gia_Obj_t * pObj; int i;
184 Vec_Int_t * vMapNew = Vec_IntStartFull( Gia_ManObjNum(pAdd) );
185 Gia_ManSetPhase( pAdd );
186 Vec_IntWriteEntry( vMapNew, 0, 0 );
187 Gia_ManForEachCand( pAdd, pObj, i )
188 {
189 int iObjBase = Abc_Lit2Var(pObj->Value);
190 Gia_Obj_t * pObjBase = Gia_ManObj( pBase, iObjBase );
191 int iObjRepr = Abc_Lit2Var(pObjBase->Value);
192 Vec_IntWriteEntry( vMapNew, i, Abc_Var2Lit(iObjRepr, Gia_ObjPhase(pObj)) );
193 }
194 return vMapNew;
195}
196void Acec_ComputeEquivClasses( Gia_Man_t * pOne, Gia_Man_t * pTwo, Vec_Int_t ** pvMap1, Vec_Int_t ** pvMap2 )
197{
198 abctime clk = Abc_Clock();
199 Gia_Man_t * pBase, * pRepr;
200 pBase = Acec_CommonStart( NULL, pOne );
201 pBase = Acec_CommonStart( pBase, pTwo );
202 Acec_CommonFinish( pBase );
203 //Gia_ManShow( pBase, NULL, 0, 0, 0 );
204 pRepr = Gia_ManComputeGiaEquivs( pBase, 100, 0 );
205 *pvMap1 = Acec_CountRemap( pOne, pBase );
206 *pvMap2 = Acec_CountRemap( pTwo, pBase );
207 Gia_ManStop( pBase );
208 Gia_ManStop( pRepr );
209 printf( "Finished computing equivalent nodes. " );
210 Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
211}
212void Acec_MatchBoxesSort( int * pArray, int nSize, int * pCostLits )
213{
214 int i, j, best_i;
215 for ( i = 0; i < nSize-1; i++ )
216 {
217 best_i = i;
218 for ( j = i+1; j < nSize; j++ )
219 if ( Abc_Lit2LitL(pCostLits, pArray[j]) > Abc_Lit2LitL(pCostLits, pArray[best_i]) )
220 best_i = j;
221 ABC_SWAP( int, pArray[i], pArray[best_i] );
222 }
223}
224void Acec_MatchPrintEquivLits( Gia_Man_t * p, Vec_Wec_t * vLits, int * pCostLits, int fVerbose )
225{
226 Vec_Int_t * vSupp;
227 Vec_Wrd_t * vTemp;
228 Vec_Int_t * vLevel;
229 int i, k, Entry;
230 printf( "Leaf literals and their classes:\n" );
231 Vec_WecForEachLevel( vLits, vLevel, i )
232 {
233 if ( Vec_IntSize(vLevel) == 0 )
234 continue;
235 printf( "Rank %2d : %2d ", i, Vec_IntSize(vLevel) );
236 Vec_IntForEachEntry( vLevel, Entry, k )
237 printf( "%s%d(%d) ", Abc_LitIsCompl(Entry) ? "-":"+", Abc_Lit2Var(Entry), Abc_Lit2LitL(pCostLits, Entry) );
238 printf( "\n" );
239 }
240 if ( !fVerbose )
241 return;
242 vSupp = Vec_IntAlloc( 100 );
243 vTemp = Vec_WrdStart( Gia_ManObjNum(p) );
244 Vec_WecForEachLevel( vLits, vLevel, i )
245 {
246 //if ( i != 20 )
247 // continue;
248 if ( Vec_IntSize(vLevel) == 0 )
249 continue;
250 Vec_IntForEachEntry( vLevel, Entry, k )
251 {
252 word Truth = Gia_ObjComputeTruth6Cis( p, Entry, vSupp, vTemp );
253/*
254 {
255 int iObj = Abc_Lit2Var(Entry);
256 Gia_Man_t * pGia0 = Gia_ManDupAndCones( p, &iObj, 1, 1 );
257 Gia_ManShow( pGia0, NULL, 0, 0, 0 );
258 Gia_ManStop( pGia0 );
259 }
260*/
261 printf( "Rank = %4d : ", i );
262 printf( "Obj = %4d ", Abc_Lit2Var(Entry) );
263 if ( Vec_IntSize(vSupp) > 6 )
264 {
265 printf( "Supp = %d.\n", Vec_IntSize(vSupp) );
266 continue;
267 }
268 vSupp->nSize = Abc_Tt6MinBase( &Truth, vSupp->pArray, vSupp->nSize );
269 if ( Vec_IntSize(vSupp) > 5 )
270 {
271 printf( "Supp = %d.\n", Vec_IntSize(vSupp) );
272 continue;
273 }
274 Extra_PrintHex( stdout, (unsigned*)&Truth, Vec_IntSize(vSupp) );
275 if ( Vec_IntSize(vSupp) == 4 ) printf( " " );
276 if ( Vec_IntSize(vSupp) == 3 ) printf( " " );
277 if ( Vec_IntSize(vSupp) <= 2 ) printf( " " );
278 printf( " " );
279 Vec_IntPrint( vSupp );
280 }
281 printf( "\n" );
282 }
283 Vec_IntFree( vSupp );
284 Vec_WrdFree( vTemp );
285}
287{
288 Vec_Wec_t * vRes = Vec_WecStart( Vec_WecSize(vLits) );
289 Vec_Int_t * vLevel; int i, k, iLit;
290 Vec_WecForEachLevel( vLits, vLevel, i )
291 Vec_IntForEachEntry( vLevel, iLit, k )
292 Vec_WecPush( vRes, i, Abc_Lit2LitL(Vec_IntArray(vMap), iLit) );
293 return vRes;
294}
295int Acec_MatchCountCommon( Vec_Wec_t * vLits1, Vec_Wec_t * vLits2, int Shift )
296{
297 Vec_Int_t * vRes = Vec_IntAlloc( 100 );
298 Vec_Int_t * vLevel1, * vLevel2;
299 int i, nCommon = 0;
300 Vec_WecForEachLevel( vLits1, vLevel1, i )
301 {
302 if ( i+Shift < 0 || i+Shift >= Vec_WecSize(vLits2) )
303 continue;
304 vLevel2 = Vec_WecEntry( vLits2, i+Shift );
305 nCommon += Vec_IntTwoFindCommonReverse( vLevel1, vLevel2, vRes );
306 }
307 Vec_IntFree( vRes );
308 return nCommon;
309}
310void Vec_IntInsertOrder( Vec_Int_t * vLits, Vec_Int_t * vClasses, int Lit, int Class )
311{
312 int i;
313 for ( i = Vec_IntSize(vClasses)-1; i >= 0; i-- )
314 if ( Vec_IntEntry(vClasses,i) >= Class )
315 break;
316 Vec_IntInsert( vLits, i+1, Lit );
317 Vec_IntInsert( vClasses, i+1, Class );
318}
319void Acec_MoveDuplicates( Vec_Wec_t * vLits, Vec_Wec_t * vClasses )
320{
321 Vec_Int_t * vLevel1, * vLevel2;
322 int i, k, Prev, This, Entry, Counter = 0;
323 Vec_WecForEachLevel( vLits, vLevel1, i )
324 {
325 if ( i == Vec_WecSize(vLits) - 1 )
326 break;
327 vLevel2 = Vec_WecEntry(vClasses, i);
328 assert( Vec_IntSize(vLevel1) == Vec_IntSize(vLevel2) );
329 Prev = -1;
330 Vec_IntForEachEntry( vLevel2, This, k )
331 {
332 if ( Prev != This )
333 {
334 Prev = This;
335 continue;
336 }
337 Prev = -1;
338 Entry = Vec_IntEntry( vLevel1, k );
339
340 Vec_IntDrop( vLevel1, k );
341 Vec_IntDrop( vLevel2, k-- );
342
343 Vec_IntDrop( vLevel1, k );
344 Vec_IntDrop( vLevel2, k-- );
345
346 Vec_IntInsertOrder( Vec_WecEntry(vLits, i+1), Vec_WecEntry(vClasses, i+1), Entry, This );
347
348 assert( Vec_IntSize(vLevel1) == Vec_IntSize(vLevel2) );
349 assert( Vec_IntSize(Vec_WecEntry(vLits, i+1)) == Vec_IntSize(Vec_WecEntry(vClasses, i+1)) );
350 Counter++;
351 }
352 }
353 printf( "Moved %d pairs of PPs to normalize the matrix.\n", Counter );
354}
355
356void Acec_MatchCheckShift( Gia_Man_t * pGia0, Gia_Man_t * pGia1, Vec_Wec_t * vLits0, Vec_Wec_t * vLits1, Vec_Int_t * vMap0, Vec_Int_t * vMap1, Vec_Wec_t * vRoots0, Vec_Wec_t * vRoots1 )
357{
358 Vec_Wec_t * vRes0 = Acec_MatchCopy( vLits0, vMap0 );
359 Vec_Wec_t * vRes1 = Acec_MatchCopy( vLits1, vMap1 );
360 int nCommon = Acec_MatchCountCommon( vRes0, vRes1, 0 );
361 int nCommonPlus = Acec_MatchCountCommon( vRes0, vRes1, 1 );
362 int nCommonMinus = Acec_MatchCountCommon( vRes0, vRes1, -1 );
363 if ( nCommonPlus >= nCommonMinus && nCommonPlus > nCommon )
364 {
365 Vec_WecInsertLevel( vLits0, 0 );
366 Vec_WecInsertLevel( vRoots0, 0 );
367 Vec_WecInsertLevel( vRes0, 0 );
368 printf( "Shifted one level up.\n" );
369 }
370 else if ( nCommonMinus > nCommonPlus && nCommonMinus > nCommon )
371 {
372 Vec_WecInsertLevel( vLits1, 0 );
373 Vec_WecInsertLevel( vRoots1, 0 );
374 Vec_WecInsertLevel( vRes1, 0 );
375 printf( "Shifted one level down.\n" );
376 }
377 Acec_MoveDuplicates( vLits0, vRes0 );
378 Acec_MoveDuplicates( vLits1, vRes1 );
379
380 //Vec_WecPrintLits( vLits1 );
381 //printf( "Input literals:\n" );
382 //Vec_WecPrintLits( vLits0 );
383 //printf( "Equiv classes:\n" );
384 //Vec_WecPrintLits( vRes0 );
385 //printf( "Input literals:\n" );
386 //Vec_WecPrintLits( vLits1 );
387 //printf( "Equiv classes:\n" );
388 //Vec_WecPrintLits( vRes1 );
389 //Acec_VerifyClasses( pGia0, vLits0, vRes0 );
390 //Acec_VerifyClasses( pGia1, vLits1, vRes1 );
391 Vec_WecFree( vRes0 );
392 Vec_WecFree( vRes1 );
393}
394int Acec_MatchBoxes( Acec_Box_t * pBox0, Acec_Box_t * pBox1 )
395{
396 Vec_Int_t * vMap0, * vMap1, * vLevel;
397 int i, nSize, nTotal;
398 Acec_ComputeEquivClasses( pBox0->pGia, pBox1->pGia, &vMap0, &vMap1 );
399 // sort nodes in the classes by their equivalences
400 Vec_WecForEachLevel( pBox0->vLeafLits, vLevel, i )
401 Acec_MatchBoxesSort( Vec_IntArray(vLevel), Vec_IntSize(vLevel), Vec_IntArray(vMap0) );
402 Vec_WecForEachLevel( pBox1->vLeafLits, vLevel, i )
403 Acec_MatchBoxesSort( Vec_IntArray(vLevel), Vec_IntSize(vLevel), Vec_IntArray(vMap1) );
404 Acec_MatchCheckShift( pBox0->pGia, pBox1->pGia, pBox0->vLeafLits, pBox1->vLeafLits, vMap0, vMap1, pBox0->vRootLits, pBox1->vRootLits );
405
406 //Acec_MatchPrintEquivLits( pBox0->pGia, pBox0->vLeafLits, Vec_IntArray(vMap0), 0 );
407 //Acec_MatchPrintEquivLits( pBox1->pGia, pBox1->vLeafLits, Vec_IntArray(vMap1), 0 );
408 //printf( "Outputs:\n" );
409 //Vec_WecPrintLits( pBox0->vRootLits );
410 //printf( "Outputs:\n" );
411 //Vec_WecPrintLits( pBox1->vRootLits );
412
413 // reorder nodes to have the same order
414 assert( pBox0->vShared == NULL );
415 assert( pBox1->vShared == NULL );
416 pBox0->vShared = Vec_WecStart( Vec_WecSize(pBox0->vLeafLits) );
417 pBox1->vShared = Vec_WecStart( Vec_WecSize(pBox1->vLeafLits) );
418 pBox0->vUnique = Vec_WecStart( Vec_WecSize(pBox0->vLeafLits) );
419 pBox1->vUnique = Vec_WecStart( Vec_WecSize(pBox1->vLeafLits) );
420 nSize = Abc_MinInt( Vec_WecSize(pBox0->vLeafLits), Vec_WecSize(pBox1->vLeafLits) );
421 Vec_WecForEachLevelStart( pBox0->vLeafLits, vLevel, i, nSize )
422 Vec_IntAppend( Vec_WecEntry(pBox0->vUnique, i), vLevel );
423 Vec_WecForEachLevelStart( pBox1->vLeafLits, vLevel, i, nSize )
424 Vec_IntAppend( Vec_WecEntry(pBox1->vUnique, i), vLevel );
425 for ( i = 0; i < nSize; i++ )
426 {
427 Vec_Int_t * vShared0 = Vec_WecEntry( pBox0->vShared, i );
428 Vec_Int_t * vShared1 = Vec_WecEntry( pBox1->vShared, i );
429 Vec_Int_t * vUnique0 = Vec_WecEntry( pBox0->vUnique, i );
430 Vec_Int_t * vUnique1 = Vec_WecEntry( pBox1->vUnique, i );
431
432 Vec_Int_t * vLevel0 = Vec_WecEntry( pBox0->vLeafLits, i );
433 Vec_Int_t * vLevel1 = Vec_WecEntry( pBox1->vLeafLits, i );
434 int * pBeg0 = Vec_IntArray(vLevel0);
435 int * pBeg1 = Vec_IntArray(vLevel1);
436 int * pEnd0 = Vec_IntLimit(vLevel0);
437 int * pEnd1 = Vec_IntLimit(vLevel1);
438 while ( pBeg0 < pEnd0 && pBeg1 < pEnd1 )
439 {
440 int Entry0 = Abc_Lit2LitL( Vec_IntArray(vMap0), *pBeg0 );
441 int Entry1 = Abc_Lit2LitL( Vec_IntArray(vMap1), *pBeg1 );
442 assert( *pBeg0 && *pBeg1 );
443 if ( Entry0 == Entry1 )
444 {
445 Vec_IntPush( vShared0, *pBeg0++ );
446 Vec_IntPush( vShared1, *pBeg1++ );
447 }
448 else if ( Entry0 > Entry1 )
449 Vec_IntPush( vUnique0, *pBeg0++ );
450 else
451 Vec_IntPush( vUnique1, *pBeg1++ );
452 }
453 while ( pBeg0 < pEnd0 )
454 Vec_IntPush( vUnique0, *pBeg0++ );
455 while ( pBeg1 < pEnd1 )
456 Vec_IntPush( vUnique1, *pBeg1++ );
457 assert( Vec_IntSize(vShared0) == Vec_IntSize(vShared1) );
458 assert( Vec_IntSize(vShared0) + Vec_IntSize(vUnique0) == Vec_IntSize(vLevel0) );
459 assert( Vec_IntSize(vShared1) + Vec_IntSize(vUnique1) == Vec_IntSize(vLevel1) );
460 }
461 nTotal = Vec_WecSizeSize(pBox0->vShared);
462 printf( "Box0: Matched %d entries out of %d.\n", nTotal, Vec_WecSizeSize(pBox0->vLeafLits) );
463 printf( "Box1: Matched %d entries out of %d.\n", nTotal, Vec_WecSizeSize(pBox1->vLeafLits) );
464
465 //Acec_MatchPrintEquivLits( pBox0->pGia, pBox0->vShared, Vec_IntArray(vMap0), 0 );
466 //Acec_MatchPrintEquivLits( pBox1->pGia, pBox1->vShared, Vec_IntArray(vMap1), 0 );
467 //printf( "\n" );
468
469 //Acec_MatchPrintEquivLits( pBox0->pGia, pBox0->vUnique, Vec_IntArray(vMap0), 0 );
470 //Acec_MatchPrintEquivLits( pBox1->pGia, pBox1->vUnique, Vec_IntArray(vMap1), 0 );
471
472 Vec_IntFree( vMap0 );
473 Vec_IntFree( vMap1 );
474 return nTotal;
475}
476
488int Acec_Solve( Gia_Man_t * pGia0, Gia_Man_t * pGia1, Acec_ParCec_t * pPars )
489{
490 int status = -1;
491 abctime clk = Abc_Clock();
492 Gia_Man_t * pMiter;
493 Gia_Man_t * pGia0n = pGia0, * pGia1n = pGia1;
494 Cec_ParCec_t ParsCec, * pCecPars = &ParsCec;
495// Vec_Bit_t * vIgnore0 = pPars->fBooth ? Acec_BoothFindPPG(pGia0) : NULL;
496// Vec_Bit_t * vIgnore1 = pPars->fBooth ? Acec_BoothFindPPG(pGia1) : NULL;
497// Acec_Box_t * pBox0 = Acec_DeriveBox( pGia0, vIgnore0, 0, 0, pPars->fVerbose );
498// Acec_Box_t * pBox1 = Acec_DeriveBox( pGia1, vIgnore1, 0, 0, pPars->fVerbose );
499// Vec_BitFreeP( &vIgnore0 );
500// Vec_BitFreeP( &vIgnore1 );
501 Acec_Box_t * pBox0 = Acec_ProduceBox( pGia0, pPars->fVerbose );
502 Acec_Box_t * pBox1 = Acec_ProduceBox( pGia1, pPars->fVerbose );
503 if ( pBox0 == NULL || pBox1 == NULL ) // cannot match
504 printf( "Cannot find arithmetic boxes in both LHS and RHS. Trying regular CEC.\n" );
505 else if ( !Acec_MatchBoxes( pBox0, pBox1 ) ) // cannot find matching
506 printf( "Cannot match arithmetic boxes in LHS and RHS. Trying regular CEC.\n" );
507 else
508 {
509 pGia0n = Acec_InsertBox( pBox0, 0 );
510 pGia1n = Acec_InsertBox( pBox1, 0 );
511 printf( "Matching of adder trees in LHS and RHS succeeded. " );
512 Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
513 // remove the last output
514 Gia_ManPatchCoDriver( pGia0n, Gia_ManCoNum(pGia0n)-1, 0 );
515 Gia_ManPatchCoDriver( pGia1n, Gia_ManCoNum(pGia1n)-1, 0 );
516
517 Gia_ManPatchCoDriver( pGia0n, Gia_ManCoNum(pGia0n)-2, 0 );
518 Gia_ManPatchCoDriver( pGia1n, Gia_ManCoNum(pGia1n)-2, 0 );
519 }
520 // solve regular CEC problem
521 Cec_ManCecSetDefaultParams( pCecPars );
522 pCecPars->nBTLimit = pPars->nBTLimit;
523 pMiter = Gia_ManMiter( pGia0n, pGia1n, 0, 1, 0, 0, pPars->fVerbose );
524 if ( pMiter )
525 {
526 int fDumpMiter = 0;
527 if ( fDumpMiter )
528 {
529 Abc_Print( 0, "The verification miter is written into file \"%s\".\n", "acec_miter.aig" );
530 Gia_AigerWrite( pMiter, "acec_miter.aig", 0, 0, 0 );
531 }
532 status = Cec_ManVerify( pMiter, pCecPars );
533 ABC_SWAP( Abc_Cex_t *, pGia0->pCexComb, pMiter->pCexComb );
534 Gia_ManStop( pMiter );
535 }
536 else
537 printf( "Miter computation has failed.\n" );
538 if ( pGia0n != pGia0 )
539 Gia_ManStop( pGia0n );
540 if ( pGia1n != pGia1 )
541 Gia_ManStop( pGia1n );
542 Acec_BoxFreeP( &pBox0 );
543 Acec_BoxFreeP( &pBox1 );
544 return status;
545}
546
550
551
553
#define ABC_SWAP(Type, a, b)
Definition abc_global.h:253
ABC_INT64_T abctime
Definition abc_global.h:332
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
Vec_Int_t * Acec_CountRemap(Gia_Man_t *pAdd, Gia_Man_t *pBase)
Definition acecCore.c:181
void Vec_IntInsertOrder(Vec_Int_t *vLits, Vec_Int_t *vClasses, int Lit, int Class)
Definition acecCore.c:310
void Acec_ManCecSetDefaultParams(Acec_ParCec_t *p)
FUNCTION DEFINITIONS ///.
Definition acecCore.c:50
void Acec_CommonFinish(Gia_Man_t *pBase)
Definition acecCore.c:173
void Acec_MatchCheckShift(Gia_Man_t *pGia0, Gia_Man_t *pGia1, Vec_Wec_t *vLits0, Vec_Wec_t *vLits1, Vec_Int_t *vMap0, Vec_Int_t *vMap1, Vec_Wec_t *vRoots0, Vec_Wec_t *vRoots1)
Definition acecCore.c:356
void Acec_MatchPrintEquivLits(Gia_Man_t *p, Vec_Wec_t *vLits, int *pCostLits, int fVerbose)
Definition acecCore.c:224
Gia_Man_t * Acec_CommonStart(Gia_Man_t *pBase, Gia_Man_t *pAdd)
Definition acecCore.c:148
int Acec_MatchCountCommon(Vec_Wec_t *vLits1, Vec_Wec_t *vLits2, int Shift)
Definition acecCore.c:295
void Acec_MoveDuplicates(Vec_Wec_t *vLits, Vec_Wec_t *vClasses)
Definition acecCore.c:319
int Acec_Solve(Gia_Man_t *pGia0, Gia_Man_t *pGia1, Acec_ParCec_t *pPars)
Definition acecCore.c:488
Vec_Wec_t * Acec_MatchCopy(Vec_Wec_t *vLits, Vec_Int_t *vMap)
Definition acecCore.c:286
void Acec_VerifyClasses(Gia_Man_t *p, Vec_Wec_t *vLits, Vec_Wec_t *vReprs)
Definition acecCore.c:75
void Acec_MatchBoxesSort(int *pArray, int nSize, int *pCostLits)
Definition acecCore.c:212
int Acec_MatchBoxes(Acec_Box_t *pBox0, Acec_Box_t *pBox1)
Definition acecCore.c:394
#define TRUTH_UNUSED
DECLARATIONS ///.
Definition acecCore.c:33
void Acec_ComputeEquivClasses(Gia_Man_t *pOne, Gia_Man_t *pTwo, Vec_Int_t **pvMap1, Vec_Int_t **pvMap2)
Definition acecCore.c:196
Gia_Man_t * Acec_InsertBox(Acec_Box_t *pBox, int fAll)
Definition acecNorm.c:156
typedefABC_NAMESPACE_HEADER_START struct Acec_Box_t_ Acec_Box_t
INCLUDES ///.
Definition acecInt.h:40
Acec_Box_t * Acec_ProduceBox(Gia_Man_t *p, int fVerbose)
Definition acecXor.c:375
void Acec_BoxFreeP(Acec_Box_t **ppBox)
Definition acecTree.c:54
typedefABC_NAMESPACE_HEADER_START struct Acec_ParCec_t_ Acec_ParCec_t
INCLUDES ///.
Definition acec.h:42
int nTotal
DECLARATIONS ///.
Definition cutTruth.c:37
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
void Cec_ManCecSetDefaultParams(Cec_ParCec_t *p)
Definition cecCore.c:159
struct Cec_ParCec_t_ Cec_ParCec_t
Definition cec.h:129
int Cec_ManVerify(Gia_Man_t *p, Cec_ParCec_t *pPars)
MACRO DEFINITIONS ///.
Definition cecCec.c:326
Cube * p
Definition exorList.c:222
void Extra_PrintHex(FILE *pFile, unsigned *pTruth, int nVars)
void Gia_ManStop(Gia_Man_t *p)
Definition giaMan.c:82
#define Gia_ManForEachAnd(p, pObj, i)
Definition gia.h:1214
#define Gia_ManForEachCand(p, pObj, i)
Definition gia.h:1220
void Gia_ManHashAlloc(Gia_Man_t *p)
Definition giaHash.c:105
Gia_Man_t * Gia_ManStart(int nObjsMax)
FUNCTION DEFINITIONS ///.
Definition giaMan.c:57
struct Gia_Obj_t_ Gia_Obj_t
Definition gia.h:76
void Gia_ManFillValue(Gia_Man_t *p)
Definition giaUtil.c:369
struct Gia_Man_t_ Gia_Man_t
Definition gia.h:96
Gia_Man_t * Gia_ManComputeGiaEquivs(Gia_Man_t *pGia, int nConfs, int fVerbose)
Definition giaEquiv.c:183
void Gia_ManCreateRefs(Gia_Man_t *p)
Definition giaUtil.c:779
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
Definition giaHash.c:576
word Gia_ObjComputeTruth6Cis(Gia_Man_t *p, int iLit, Vec_Int_t *vSupp, Vec_Wrd_t *vTemp)
Definition giaTruth.c:345
Gia_Man_t * Gia_ManMiter(Gia_Man_t *pAig0, Gia_Man_t *pAig1, int nInsDup, int fDualOut, int fSeq, int fImplic, int fVerbose)
Definition giaDup.c:2983
#define Gia_ManForEachCi(p, pObj, i)
Definition gia.h:1228
void Gia_ManSetPhase(Gia_Man_t *p)
Definition giaUtil.c:420
#define Gia_ManForEachAndId(p, i)
Definition gia.h:1216
void Gia_AigerWrite(Gia_Man_t *p, char *pFileName, int fWriteSymbols, int fCompact, int fWriteNewLine)
Definition giaAiger.c:1595
unsigned __int64 word
DECLARATIONS ///.
Definition kitPerm.c:36
int nBTLimit
Definition cec.h:132
int fVerbose
Definition gia.h:203
char * pSpec
Definition gia.h:100
Abc_Cex_t * pCexComb
Definition gia.h:149
char * pName
Definition gia.h:99
unsigned Value
Definition gia.h:89
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Definition utilCex.h:39
#define assert(ex)
Definition util_old.h:213
char * memset()
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition vecInt.h:54
#define Vec_IntForEachEntryStart(vVec, Entry, i, Start)
Definition vecInt.h:56
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Definition vecVec.h:42
#define Vec_WecForEachLevel(vGlob, vVec, i)
MACRO DEFINITIONS ///.
Definition vecWec.h:55
#define Vec_WecForEachLevelStart(vGlob, vVec, i, LevelStart)
Definition vecWec.h:59
typedefABC_NAMESPACE_HEADER_START struct Vec_Wec_t_ Vec_Wec_t
INCLUDES ///.
Definition vecWec.h:42
typedefABC_NAMESPACE_HEADER_START struct Vec_Wrd_t_ Vec_Wrd_t
INCLUDES ///.
Definition vecWrd.h:42