abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
abcVerify.c
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [abcVerify.c]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [Network and node package.]
8 
9  Synopsis [Combinational and sequential verification for two networks.]
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - June 20, 2005.]
16 
17  Revision [$Id: abcVerify.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #include "base/abc/abc.h"
22 #include "base/main/main.h"
23 #include "base/cmd/cmd.h"
24 #include "proof/fraig/fraig.h"
25 #include "opt/sim/sim.h"
26 #include "aig/aig/aig.h"
27 #include "aig/saig/saig.h"
28 #include "aig/gia/gia.h"
29 #include "proof/ssw/ssw.h"
30 
32 
33 
34 ////////////////////////////////////////////////////////////////////////
35 /// DECLARATIONS ///
36 ////////////////////////////////////////////////////////////////////////
37 
38 static void Abc_NtkVerifyReportError( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int * pModel );
39 extern void Abc_NtkVerifyReportErrorSeq( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int * pModel, int nFrames );
40 
41 ////////////////////////////////////////////////////////////////////////
42 /// FUNCTION DEFINITIONS ///
43 ////////////////////////////////////////////////////////////////////////
44 
45 /**Function*************************************************************
46 
47  Synopsis [Verifies combinational equivalence by brute-force SAT.]
48 
49  Description []
50 
51  SideEffects []
52 
53  SeeAlso []
54 
55 ***********************************************************************/
56 void Abc_NtkCecSat( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nConfLimit, int nInsLimit )
57 {
58  extern Abc_Ntk_t * Abc_NtkMulti( Abc_Ntk_t * pNtk, int nThresh, int nFaninMax, int fCnf, int fMulti, int fSimple, int fFactor );
59  Abc_Ntk_t * pMiter;
60  Abc_Ntk_t * pCnf;
61  int RetValue;
62 
63  // get the miter of the two networks
64  pMiter = Abc_NtkMiter( pNtk1, pNtk2, 1, 0, 0, 0 );
65  if ( pMiter == NULL )
66  {
67  printf( "Miter computation has failed.\n" );
68  return;
69  }
70  RetValue = Abc_NtkMiterIsConstant( pMiter );
71  if ( RetValue == 0 )
72  {
73  printf( "Networks are NOT EQUIVALENT after structural hashing.\n" );
74  // report the error
75  pMiter->pModel = Abc_NtkVerifyGetCleanModel( pMiter, 1 );
76  Abc_NtkVerifyReportError( pNtk1, pNtk2, pMiter->pModel );
77  ABC_FREE( pMiter->pModel );
78  Abc_NtkDelete( pMiter );
79  return;
80  }
81  if ( RetValue == 1 )
82  {
83  Abc_NtkDelete( pMiter );
84  printf( "Networks are equivalent after structural hashing.\n" );
85  return;
86  }
87 
88  // convert the miter into a CNF
89  pCnf = Abc_NtkMulti( pMiter, 0, 100, 1, 0, 0, 0 );
90  Abc_NtkDelete( pMiter );
91  if ( pCnf == NULL )
92  {
93  printf( "Renoding for CNF has failed.\n" );
94  return;
95  }
96 
97  // solve the CNF using the SAT solver
98  RetValue = Abc_NtkMiterSat( pCnf, (ABC_INT64_T)nConfLimit, (ABC_INT64_T)nInsLimit, 0, NULL, NULL );
99  if ( RetValue == -1 )
100  printf( "Networks are undecided (SAT solver timed out).\n" );
101  else if ( RetValue == 0 )
102  printf( "Networks are NOT EQUIVALENT after SAT.\n" );
103  else
104  printf( "Networks are equivalent after SAT.\n" );
105  if ( pCnf->pModel )
106  Abc_NtkVerifyReportError( pNtk1, pNtk2, pCnf->pModel );
107  ABC_FREE( pCnf->pModel );
108  Abc_NtkDelete( pCnf );
109 }
110 
111 
112 /**Function*************************************************************
113 
114  Synopsis [Verifies sequential equivalence by fraiging followed by SAT.]
115 
116  Description []
117 
118  SideEffects []
119 
120  SeeAlso []
121 
122 ***********************************************************************/
123 void Abc_NtkCecFraig( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nSeconds, int fVerbose )
124 {
125  Prove_Params_t Params, * pParams = &Params;
126 // Fraig_Params_t Params;
127 // Fraig_Man_t * pMan;
128  Abc_Ntk_t * pMiter, * pTemp;
129  Abc_Ntk_t * pExdc = NULL;
130  int RetValue;
131 
132  if ( pNtk1->pExdc != NULL || pNtk2->pExdc != NULL )
133  {
134  if ( pNtk1->pExdc != NULL && pNtk2->pExdc != NULL )
135  {
136  printf( "Comparing EXDC of the two networks:\n" );
137  Abc_NtkCecFraig( pNtk1->pExdc, pNtk2->pExdc, nSeconds, fVerbose );
138  printf( "Comparing networks under EXDC of the first network.\n" );
139  pExdc = pNtk1->pExdc;
140  }
141  else if ( pNtk1->pExdc != NULL )
142  {
143  printf( "Second network has no EXDC. Comparing main networks under EXDC of the first network.\n" );
144  pExdc = pNtk1->pExdc;
145  }
146  else if ( pNtk2->pExdc != NULL )
147  {
148  printf( "First network has no EXDC. Comparing main networks under EXDC of the second network.\n" );
149  pExdc = pNtk2->pExdc;
150  }
151  else assert( 0 );
152  }
153 
154  // get the miter of the two networks
155  pMiter = Abc_NtkMiter( pNtk1, pNtk2, 1, 0, 0, 0 );
156  if ( pMiter == NULL )
157  {
158  printf( "Miter computation has failed.\n" );
159  return;
160  }
161  // add EXDC to the miter
162  if ( pExdc )
163  {
164  assert( Abc_NtkPoNum(pMiter) == 1 );
165  assert( Abc_NtkPoNum(pExdc) == 1 );
166  pMiter = Abc_NtkMiter( pTemp = pMiter, pExdc, 1, 0, 1, 0 );
167  Abc_NtkDelete( pTemp );
168  }
169  // handle trivial case
170  RetValue = Abc_NtkMiterIsConstant( pMiter );
171  if ( RetValue == 0 )
172  {
173  printf( "Networks are NOT EQUIVALENT after structural hashing.\n" );
174  // report the error
175  pMiter->pModel = Abc_NtkVerifyGetCleanModel( pMiter, 1 );
176  Abc_NtkVerifyReportError( pNtk1, pNtk2, pMiter->pModel );
177  ABC_FREE( pMiter->pModel );
178  Abc_NtkDelete( pMiter );
179  return;
180  }
181  if ( RetValue == 1 )
182  {
183  printf( "Networks are equivalent after structural hashing.\n" );
184  Abc_NtkDelete( pMiter );
185  return;
186  }
187 /*
188  // convert the miter into a FRAIG
189  Fraig_ParamsSetDefault( &Params );
190  Params.fVerbose = fVerbose;
191  Params.nSeconds = nSeconds;
192 // Params.fFuncRed = 0;
193 // Params.nPatsRand = 0;
194 // Params.nPatsDyna = 0;
195  pMan = (Fraig_Man_t *)Abc_NtkToFraig( pMiter, &Params, 0, 0 );
196  Fraig_ManProveMiter( pMan );
197 
198  // analyze the result
199  RetValue = Fraig_ManCheckMiter( pMan );
200  // report the result
201  if ( RetValue == -1 )
202  printf( "Networks are undecided (SAT solver timed out on the final miter).\n" );
203  else if ( RetValue == 1 )
204  printf( "Networks are equivalent after fraiging.\n" );
205  else if ( RetValue == 0 )
206  {
207  printf( "Networks are NOT EQUIVALENT after fraiging.\n" );
208  Abc_NtkVerifyReportError( pNtk1, pNtk2, Fraig_ManReadModel(pMan) );
209  }
210  else assert( 0 );
211  // delete the fraig manager
212  Fraig_ManFree( pMan );
213  // delete the miter
214  Abc_NtkDelete( pMiter );
215 */
216  // solve the CNF using the SAT solver
217  Prove_ParamsSetDefault( pParams );
218  pParams->nItersMax = 5;
219 // RetValue = Abc_NtkMiterProve( &pMiter, pParams );
220 // pParams->fVerbose = 1;
221  RetValue = Abc_NtkIvyProve( &pMiter, pParams );
222  if ( RetValue == -1 )
223  printf( "Networks are undecided (resource limits is reached).\n" );
224  else if ( RetValue == 0 )
225  {
226  int * pSimInfo = Abc_NtkVerifySimulatePattern( pMiter, pMiter->pModel );
227  if ( pSimInfo[0] != 1 )
228  printf( "ERROR in Abc_NtkMiterProve(): Generated counter-example is invalid.\n" );
229  else
230  printf( "Networks are NOT EQUIVALENT.\n" );
231  ABC_FREE( pSimInfo );
232  }
233  else
234  printf( "Networks are equivalent.\n" );
235  if ( pMiter->pModel )
236  Abc_NtkVerifyReportError( pNtk1, pNtk2, pMiter->pModel );
237  Abc_NtkDelete( pMiter );
238 }
239 
240 /**Function*************************************************************
241 
242  Synopsis [Verifies sequential equivalence by fraiging followed by SAT.]
243 
244  Description []
245 
246  SideEffects []
247 
248  SeeAlso []
249 
250 ***********************************************************************/
251 void Abc_NtkCecFraigPart( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nSeconds, int nPartSize, int fVerbose )
252 {
253  Prove_Params_t Params, * pParams = &Params;
254  Abc_Ntk_t * pMiter, * pMiterPart;
255  Abc_Obj_t * pObj;
256  int i, RetValue, Status, nOutputs;
257 
258  // solve the CNF using the SAT solver
259  Prove_ParamsSetDefault( pParams );
260  pParams->nItersMax = 5;
261  // pParams->fVerbose = 1;
262 
263  assert( nPartSize > 0 );
264 
265  // get the miter of the two networks
266  pMiter = Abc_NtkMiter( pNtk1, pNtk2, 1, nPartSize, 0, 0 );
267  if ( pMiter == NULL )
268  {
269  printf( "Miter computation has failed.\n" );
270  return;
271  }
272  RetValue = Abc_NtkMiterIsConstant( pMiter );
273  if ( RetValue == 0 )
274  {
275  printf( "Networks are NOT EQUIVALENT after structural hashing.\n" );
276  // report the error
277  pMiter->pModel = Abc_NtkVerifyGetCleanModel( pMiter, 1 );
278  Abc_NtkVerifyReportError( pNtk1, pNtk2, pMiter->pModel );
279  ABC_FREE( pMiter->pModel );
280  Abc_NtkDelete( pMiter );
281  return;
282  }
283  if ( RetValue == 1 )
284  {
285  printf( "Networks are equivalent after structural hashing.\n" );
286  Abc_NtkDelete( pMiter );
287  return;
288  }
289 
290  Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "unset progressbar" );
291 
292  // solve the problem iteratively for each output of the miter
293  Status = 1;
294  nOutputs = 0;
295  Abc_NtkForEachPo( pMiter, pObj, i )
296  {
297  if ( Abc_ObjFanin0(pObj) == Abc_AigConst1(pMiter) )
298  {
299  if ( Abc_ObjFaninC0(pObj) ) // complemented -> const 0
300  RetValue = 1;
301  else
302  RetValue = 0;
303  pMiterPart = NULL;
304  }
305  else
306  {
307  // get the cone of this output
308  pMiterPart = Abc_NtkCreateCone( pMiter, Abc_ObjFanin0(pObj), Abc_ObjName(pObj), 0 );
309  if ( Abc_ObjFaninC0(pObj) )
310  Abc_ObjXorFaninC( Abc_NtkPo(pMiterPart,0), 0 );
311  // solve the cone
312  // RetValue = Abc_NtkMiterProve( &pMiterPart, pParams );
313  RetValue = Abc_NtkIvyProve( &pMiterPart, pParams );
314  }
315 
316  if ( RetValue == -1 )
317  {
318  printf( "Networks are undecided (resource limits is reached).\r" );
319  Status = -1;
320  }
321  else if ( RetValue == 0 )
322  {
323  int * pSimInfo = Abc_NtkVerifySimulatePattern( pMiterPart, pMiterPart->pModel );
324  if ( pSimInfo[0] != 1 )
325  printf( "ERROR in Abc_NtkMiterProve(): Generated counter-example is invalid.\n" );
326  else
327  printf( "Networks are NOT EQUIVALENT. \n" );
328  ABC_FREE( pSimInfo );
329  Status = 0;
330  break;
331  }
332  else
333  {
334  printf( "Finished part %5d (out of %5d)\r", i+1, Abc_NtkPoNum(pMiter) );
335  nOutputs += nPartSize;
336  }
337 // if ( pMiter->pModel )
338 // Abc_NtkVerifyReportError( pNtk1, pNtk2, pMiter->pModel );
339  if ( pMiterPart )
340  Abc_NtkDelete( pMiterPart );
341  }
342 
343  Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "set progressbar" );
344 
345  if ( Status == 1 )
346  printf( "Networks are equivalent. \n" );
347  else if ( Status == -1 )
348  printf( "Timed out after verifying %d outputs (out of %d).\n", nOutputs, Abc_NtkCoNum(pNtk1) );
349  Abc_NtkDelete( pMiter );
350 }
351 
352 /**Function*************************************************************
353 
354  Synopsis [Verifies sequential equivalence by fraiging followed by SAT.]
355 
356  Description []
357 
358  SideEffects []
359 
360  SeeAlso []
361 
362 ***********************************************************************/
363 void Abc_NtkCecFraigPartAuto( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nSeconds, int fVerbose )
364 {
365  extern Vec_Ptr_t * Abc_NtkPartitionSmart( Abc_Ntk_t * pNtk, int nPartSizeLimit, int fVerbose );
366  extern void Abc_NtkConvertCos( Abc_Ntk_t * pNtk, Vec_Int_t * vOuts, Vec_Ptr_t * vOnePtr );
367 
368  Vec_Ptr_t * vParts, * vOnePtr;
369  Vec_Int_t * vOne;
370  Prove_Params_t Params, * pParams = &Params;
371  Abc_Ntk_t * pMiter, * pMiterPart;
372  int i, RetValue, Status, nOutputs;
373 
374  // solve the CNF using the SAT solver
375  Prove_ParamsSetDefault( pParams );
376  pParams->nItersMax = 5;
377  // pParams->fVerbose = 1;
378 
379  // get the miter of the two networks
380  pMiter = Abc_NtkMiter( pNtk1, pNtk2, 1, 1, 0, 0 );
381  if ( pMiter == NULL )
382  {
383  printf( "Miter computation has failed.\n" );
384  return;
385  }
386  RetValue = Abc_NtkMiterIsConstant( pMiter );
387  if ( RetValue == 0 )
388  {
389  printf( "Networks are NOT EQUIVALENT after structural hashing.\n" );
390  // report the error
391  pMiter->pModel = Abc_NtkVerifyGetCleanModel( pMiter, 1 );
392  Abc_NtkVerifyReportError( pNtk1, pNtk2, pMiter->pModel );
393  ABC_FREE( pMiter->pModel );
394  Abc_NtkDelete( pMiter );
395  return;
396  }
397  if ( RetValue == 1 )
398  {
399  printf( "Networks are equivalent after structural hashing.\n" );
400  Abc_NtkDelete( pMiter );
401  return;
402  }
403 
404  Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "unset progressbar" );
405 
406  // partition the outputs
407  vParts = Abc_NtkPartitionSmart( pMiter, 300, 0 );
408 
409  // fraig each partition
410  Status = 1;
411  nOutputs = 0;
412  vOnePtr = Vec_PtrAlloc( 1000 );
413  Vec_PtrForEachEntry( Vec_Int_t *, vParts, vOne, i )
414  {
415  // get this part of the miter
416  Abc_NtkConvertCos( pMiter, vOne, vOnePtr );
417  pMiterPart = Abc_NtkCreateConeArray( pMiter, vOnePtr, 0 );
418  Abc_NtkCombinePos( pMiterPart, 0, 0 );
419  // check the miter for being constant
420  RetValue = Abc_NtkMiterIsConstant( pMiterPart );
421  if ( RetValue == 0 )
422  {
423  printf( "Networks are NOT EQUIVALENT after partitioning.\n" );
424  Abc_NtkDelete( pMiterPart );
425  break;
426  }
427  if ( RetValue == 1 )
428  {
429  Abc_NtkDelete( pMiterPart );
430  continue;
431  }
432  printf( "Verifying part %4d (out of %4d) PI = %5d. PO = %5d. And = %6d. Lev = %4d.\r",
433  i+1, Vec_PtrSize(vParts), Abc_NtkPiNum(pMiterPart), Abc_NtkPoNum(pMiterPart),
434  Abc_NtkNodeNum(pMiterPart), Abc_AigLevel(pMiterPart) );
435  fflush( stdout );
436  // solve the problem
437  RetValue = Abc_NtkIvyProve( &pMiterPart, pParams );
438  if ( RetValue == -1 )
439  {
440  printf( "Networks are undecided (resource limits is reached).\r" );
441  Status = -1;
442  }
443  else if ( RetValue == 0 )
444  {
445  int * pSimInfo = Abc_NtkVerifySimulatePattern( pMiterPart, pMiterPart->pModel );
446  if ( pSimInfo[0] != 1 )
447  printf( "ERROR in Abc_NtkMiterProve(): Generated counter-example is invalid.\n" );
448  else
449  printf( "Networks are NOT EQUIVALENT. \n" );
450  ABC_FREE( pSimInfo );
451  Status = 0;
452  Abc_NtkDelete( pMiterPart );
453  break;
454  }
455  else
456  {
457 // printf( "Finished part %5d (out of %5d)\r", i+1, Vec_PtrSize(vParts) );
458  nOutputs += Vec_IntSize(vOne);
459  }
460  Abc_NtkDelete( pMiterPart );
461  }
462  printf( " \r" );
463  Vec_VecFree( (Vec_Vec_t *)vParts );
464  Vec_PtrFree( vOnePtr );
465 
466  Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "set progressbar" );
467 
468  if ( Status == 1 )
469  printf( "Networks are equivalent. \n" );
470  else if ( Status == -1 )
471  printf( "Timed out after verifying %d outputs (out of %d).\n", nOutputs, Abc_NtkCoNum(pNtk1) );
472  Abc_NtkDelete( pMiter );
473 }
474 
475 /**Function*************************************************************
476 
477  Synopsis [Verifies sequential equivalence by brute-force SAT.]
478 
479  Description []
480 
481  SideEffects []
482 
483  SeeAlso []
484 
485 ***********************************************************************/
486 void Abc_NtkSecSat( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nConfLimit, int nInsLimit, int nFrames )
487 {
488  extern Abc_Ntk_t * Abc_NtkMulti( Abc_Ntk_t * pNtk, int nThresh, int nFaninMax, int fCnf, int fMulti, int fSimple, int fFactor );
489  Abc_Ntk_t * pMiter;
490  Abc_Ntk_t * pFrames;
491  Abc_Ntk_t * pCnf;
492  int RetValue;
493 
494  // get the miter of the two networks
495  pMiter = Abc_NtkMiter( pNtk1, pNtk2, 0, 0, 0, 0 );
496  if ( pMiter == NULL )
497  {
498  printf( "Miter computation has failed.\n" );
499  return;
500  }
501  RetValue = Abc_NtkMiterIsConstant( pMiter );
502  if ( RetValue == 0 )
503  {
504  Abc_NtkDelete( pMiter );
505  printf( "Networks are NOT EQUIVALENT after structural hashing.\n" );
506  return;
507  }
508  if ( RetValue == 1 )
509  {
510  Abc_NtkDelete( pMiter );
511  printf( "Networks are equivalent after structural hashing.\n" );
512  return;
513  }
514 
515  // create the timeframes
516  pFrames = Abc_NtkFrames( pMiter, nFrames, 1, 0 );
517  Abc_NtkDelete( pMiter );
518  if ( pFrames == NULL )
519  {
520  printf( "Frames computation has failed.\n" );
521  return;
522  }
523  RetValue = Abc_NtkMiterIsConstant( pFrames );
524  if ( RetValue == 0 )
525  {
526  Abc_NtkDelete( pFrames );
527  printf( "Networks are NOT EQUIVALENT after framing.\n" );
528  return;
529  }
530  if ( RetValue == 1 )
531  {
532  Abc_NtkDelete( pFrames );
533  printf( "Networks are equivalent after framing.\n" );
534  return;
535  }
536 
537  // convert the miter into a CNF
538  pCnf = Abc_NtkMulti( pFrames, 0, 100, 1, 0, 0, 0 );
539  Abc_NtkDelete( pFrames );
540  if ( pCnf == NULL )
541  {
542  printf( "Renoding for CNF has failed.\n" );
543  return;
544  }
545 
546  // solve the CNF using the SAT solver
547  RetValue = Abc_NtkMiterSat( pCnf, (ABC_INT64_T)nConfLimit, (ABC_INT64_T)nInsLimit, 0, NULL, NULL );
548  if ( RetValue == -1 )
549  printf( "Networks are undecided (SAT solver timed out).\n" );
550  else if ( RetValue == 0 )
551  printf( "Networks are NOT EQUIVALENT after SAT.\n" );
552  else
553  printf( "Networks are equivalent after SAT.\n" );
554  Abc_NtkDelete( pCnf );
555 }
556 
557 /**Function*************************************************************
558 
559  Synopsis [Verifies combinational equivalence by fraiging followed by SAT]
560 
561  Description []
562 
563  SideEffects []
564 
565  SeeAlso []
566 
567 ***********************************************************************/
568 int Abc_NtkSecFraig( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nSeconds, int nFrames, int fVerbose )
569 {
570  Fraig_Params_t Params;
571  Fraig_Man_t * pMan;
572  Abc_Ntk_t * pMiter;
573  Abc_Ntk_t * pFrames;
574  int RetValue;
575 
576  // get the miter of the two networks
577  pMiter = Abc_NtkMiter( pNtk1, pNtk2, 0, 0, 0, 0 );
578  if ( pMiter == NULL )
579  {
580  printf( "Miter computation has failed.\n" );
581  return 0;
582  }
583  RetValue = Abc_NtkMiterIsConstant( pMiter );
584  if ( RetValue == 0 )
585  {
586  printf( "Networks are NOT EQUIVALENT after structural hashing.\n" );
587  // report the error
588  pMiter->pModel = Abc_NtkVerifyGetCleanModel( pMiter, nFrames );
589  Abc_NtkVerifyReportErrorSeq( pNtk1, pNtk2, pMiter->pModel, nFrames );
590  ABC_FREE( pMiter->pModel );
591  Abc_NtkDelete( pMiter );
592  return 0;
593  }
594  if ( RetValue == 1 )
595  {
596  Abc_NtkDelete( pMiter );
597  printf( "Networks are equivalent after structural hashing.\n" );
598  return 1;
599  }
600 
601  // create the timeframes
602  pFrames = Abc_NtkFrames( pMiter, nFrames, 1, 0 );
603  Abc_NtkDelete( pMiter );
604  if ( pFrames == NULL )
605  {
606  printf( "Frames computation has failed.\n" );
607  return 0;
608  }
609  RetValue = Abc_NtkMiterIsConstant( pFrames );
610  if ( RetValue == 0 )
611  {
612  printf( "Networks are NOT EQUIVALENT after framing.\n" );
613  // report the error
614  pFrames->pModel = Abc_NtkVerifyGetCleanModel( pFrames, 1 );
615 // Abc_NtkVerifyReportErrorSeq( pNtk1, pNtk2, pFrames->pModel, nFrames );
616  ABC_FREE( pFrames->pModel );
617  Abc_NtkDelete( pFrames );
618  return 0;
619  }
620  if ( RetValue == 1 )
621  {
622  Abc_NtkDelete( pFrames );
623  printf( "Networks are equivalent after framing.\n" );
624  return 1;
625  }
626 
627  // convert the miter into a FRAIG
628  Fraig_ParamsSetDefault( &Params );
629  Params.fVerbose = fVerbose;
630  Params.nSeconds = nSeconds;
631 // Params.fFuncRed = 0;
632 // Params.nPatsRand = 0;
633 // Params.nPatsDyna = 0;
634  pMan = (Fraig_Man_t *)Abc_NtkToFraig( pFrames, &Params, 0, 0 );
635  Fraig_ManProveMiter( pMan );
636 
637  // analyze the result
638  RetValue = Fraig_ManCheckMiter( pMan );
639  // report the result
640  if ( RetValue == -1 )
641  printf( "Networks are undecided (SAT solver timed out on the final miter).\n" );
642  else if ( RetValue == 1 )
643  printf( "Networks are equivalent after fraiging.\n" );
644  else if ( RetValue == 0 )
645  {
646  printf( "Networks are NOT EQUIVALENT after fraiging.\n" );
647 // Abc_NtkVerifyReportErrorSeq( pNtk1, pNtk2, Fraig_ManReadModel(pMan), nFrames );
648  }
649  else assert( 0 );
650  // delete the fraig manager
651  Fraig_ManFree( pMan );
652  // delete the miter
653  Abc_NtkDelete( pFrames );
654  return RetValue == 1;
655 }
656 
657 /**Function*************************************************************
658 
659  Synopsis [Returns a dummy pattern full of zeros.]
660 
661  Description []
662 
663  SideEffects []
664 
665  SeeAlso []
666 
667 ***********************************************************************/
668 int * Abc_NtkVerifyGetCleanModel( Abc_Ntk_t * pNtk, int nFrames )
669 {
670  int * pModel = ABC_ALLOC( int, Abc_NtkCiNum(pNtk) * nFrames );
671  memset( pModel, 0, sizeof(int) * Abc_NtkCiNum(pNtk) * nFrames );
672  return pModel;
673 }
674 
675 /**Function*************************************************************
676 
677  Synopsis [Returns the PO values under the given input pattern.]
678 
679  Description []
680 
681  SideEffects []
682 
683  SeeAlso []
684 
685 ***********************************************************************/
686 int * Abc_NtkVerifySimulatePattern( Abc_Ntk_t * pNtk, int * pModel )
687 {
688  Abc_Obj_t * pNode;
689  int * pValues, Value0, Value1, i;
690  int fStrashed = 0;
691  if ( !Abc_NtkIsStrash(pNtk) )
692  {
693  pNtk = Abc_NtkStrash(pNtk, 0, 0, 0);
694  fStrashed = 1;
695  }
696 /*
697  printf( "Counter example: " );
698  Abc_NtkForEachCi( pNtk, pNode, i )
699  printf( " %d", pModel[i] );
700  printf( "\n" );
701 */
702  // increment the trav ID
703  Abc_NtkIncrementTravId( pNtk );
704  // set the CI values
705  Abc_AigConst1(pNtk)->pCopy = (Abc_Obj_t *)1;
706  Abc_NtkForEachCi( pNtk, pNode, i )
707  pNode->pCopy = (Abc_Obj_t *)(ABC_PTRINT_T)pModel[i];
708  // simulate in the topological order
709  Abc_NtkForEachNode( pNtk, pNode, i )
710  {
711  Value0 = ((int)(ABC_PTRINT_T)Abc_ObjFanin0(pNode)->pCopy) ^ (int)Abc_ObjFaninC0(pNode);
712  Value1 = ((int)(ABC_PTRINT_T)Abc_ObjFanin1(pNode)->pCopy) ^ (int)Abc_ObjFaninC1(pNode);
713  pNode->pCopy = (Abc_Obj_t *)(ABC_PTRINT_T)(Value0 & Value1);
714  }
715  // fill the output values
716  pValues = ABC_ALLOC( int, Abc_NtkCoNum(pNtk) );
717  Abc_NtkForEachCo( pNtk, pNode, i )
718  pValues[i] = ((int)(ABC_PTRINT_T)Abc_ObjFanin0(pNode)->pCopy) ^ (int)Abc_ObjFaninC0(pNode);
719  if ( fStrashed )
720  Abc_NtkDelete( pNtk );
721  return pValues;
722 }
723 
724 
725 /**Function*************************************************************
726 
727  Synopsis [Reports mismatch between the two networks.]
728 
729  Description []
730 
731  SideEffects []
732 
733  SeeAlso []
734 
735 ***********************************************************************/
736 void Abc_NtkVerifyReportError( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int * pModel )
737 {
738  Vec_Ptr_t * vNodes;
739  Abc_Obj_t * pNode;
740  int * pValues1, * pValues2;
741  int nErrors, nPrinted, i, iNode = -1;
742 
743  assert( Abc_NtkCiNum(pNtk1) == Abc_NtkCiNum(pNtk2) );
744  assert( Abc_NtkCoNum(pNtk1) == Abc_NtkCoNum(pNtk2) );
745  // get the CO values under this model
746  pValues1 = Abc_NtkVerifySimulatePattern( pNtk1, pModel );
747  pValues2 = Abc_NtkVerifySimulatePattern( pNtk2, pModel );
748  // count the mismatches
749  nErrors = 0;
750  for ( i = 0; i < Abc_NtkCoNum(pNtk1); i++ )
751  nErrors += (int)( pValues1[i] != pValues2[i] );
752  printf( "Verification failed for at least %d outputs: ", nErrors );
753  // print the first 3 outputs
754  nPrinted = 0;
755  for ( i = 0; i < Abc_NtkCoNum(pNtk1); i++ )
756  if ( pValues1[i] != pValues2[i] )
757  {
758  if ( iNode == -1 )
759  iNode = i;
760  printf( " %s", Abc_ObjName(Abc_NtkCo(pNtk1,i)) );
761  if ( ++nPrinted == 3 )
762  break;
763  }
764  if ( nPrinted != nErrors )
765  printf( " ..." );
766  printf( "\n" );
767  // report mismatch for the first output
768  if ( iNode >= 0 )
769  {
770  printf( "Output %s: Value in Network1 = %d. Value in Network2 = %d.\n",
771  Abc_ObjName(Abc_NtkCo(pNtk1,iNode)), pValues1[iNode], pValues2[iNode] );
772  printf( "Input pattern: " );
773  // collect PIs in the cone
774  pNode = Abc_NtkCo(pNtk1,iNode);
775  vNodes = Abc_NtkNodeSupport( pNtk1, &pNode, 1 );
776  // set the PI numbers
777  Abc_NtkForEachCi( pNtk1, pNode, i )
778  pNode->pCopy = (Abc_Obj_t *)(ABC_PTRINT_T)i;
779  // print the model
780  pNode = (Abc_Obj_t *)Vec_PtrEntry( vNodes, 0 );
781  if ( Abc_ObjIsCi(pNode) )
782  {
783  Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
784  {
785  assert( Abc_ObjIsCi(pNode) );
786  printf( " %s=%d", Abc_ObjName(pNode), pModel[(int)(ABC_PTRINT_T)pNode->pCopy] );
787  }
788  }
789  printf( "\n" );
790  Vec_PtrFree( vNodes );
791  }
792  ABC_FREE( pValues1 );
793  ABC_FREE( pValues2 );
794 }
795 
796 
797 /**Function*************************************************************
798 
799  Synopsis [Computes the COs in the support of the PO in the given frame.]
800 
801  Description []
802 
803  SideEffects []
804 
805  SeeAlso []
806 
807 ***********************************************************************/
808 void Abc_NtkGetSeqPoSupp( Abc_Ntk_t * pNtk, int iFrame, int iNumPo )
809 {
810  Abc_Ntk_t * pFrames;
811  Abc_Obj_t * pObj, * pNodePo;
812  Vec_Ptr_t * vSupp;
813  int i, k;
814  // get the timeframes of the network
815  pFrames = Abc_NtkFrames( pNtk, iFrame + 1, 0, 0 );
816 //Abc_NtkShowAig( pFrames );
817 
818  // get the PO of the timeframes
819  pNodePo = Abc_NtkPo( pFrames, iFrame * Abc_NtkPoNum(pNtk) + iNumPo );
820  // set the support
821  vSupp = Abc_NtkNodeSupport( pFrames, &pNodePo, 1 );
822  // mark the support of the frames
823  Abc_NtkForEachCi( pFrames, pObj, i )
824  pObj->pCopy = NULL;
825  Vec_PtrForEachEntry( Abc_Obj_t *, vSupp, pObj, i )
826  pObj->pCopy = (Abc_Obj_t *)1;
827  // mark the support of the network if the support of the timeframes is marked
828  Abc_NtkForEachCi( pNtk, pObj, i )
829  pObj->pCopy = NULL;
830  Abc_NtkForEachLatch( pNtk, pObj, i )
831  if ( Abc_NtkBox(pFrames, i)->pCopy )
832  pObj->pCopy = (Abc_Obj_t *)1;
833  Abc_NtkForEachPi( pNtk, pObj, i )
834  for ( k = 0; k <= iFrame; k++ )
835  if ( Abc_NtkPi(pFrames, k*Abc_NtkPiNum(pNtk) + i)->pCopy )
836  pObj->pCopy = (Abc_Obj_t *)1;
837  // free stuff
838  Vec_PtrFree( vSupp );
839  Abc_NtkDelete( pFrames );
840 }
841 
842 /**Function*************************************************************
843 
844  Synopsis [Reports mismatch between the two sequential networks.]
845 
846  Description []
847 
848  SideEffects []
849 
850  SeeAlso []
851 
852 ***********************************************************************/
853 void Abc_NtkVerifyReportErrorSeq( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int * pModel, int nFrames )
854 {
855  Vec_Ptr_t * vInfo1, * vInfo2;
856  Abc_Obj_t * pObj, * pObjError, * pObj1, * pObj2;
857  int ValueError1 = -1, ValueError2 = -1;
858  unsigned * pPats1, * pPats2;
859  int i, o, k, nErrors, iFrameError = -1, iNodePo = -1, nPrinted;
860  int fRemove1 = 0, fRemove2 = 0;
861 
862  if ( !Abc_NtkIsStrash(pNtk1) )
863  fRemove1 = 1, pNtk1 = Abc_NtkStrash( pNtk1, 0, 0, 0 );
864  if ( !Abc_NtkIsStrash(pNtk2) )
865  fRemove2 = 1, pNtk2 = Abc_NtkStrash( pNtk2, 0, 0, 0 );
866 
867  // simulate sequential circuits
868  vInfo1 = Sim_SimulateSeqModel( pNtk1, nFrames, pModel );
869  vInfo2 = Sim_SimulateSeqModel( pNtk2, nFrames, pModel );
870 
871  // look for a discrepancy in the PO values
872  nErrors = 0;
873  pObjError = NULL;
874  for ( i = 0; i < nFrames; i++ )
875  {
876  if ( pObjError )
877  break;
878  Abc_NtkForEachPo( pNtk1, pObj1, o )
879  {
880  pObj2 = Abc_NtkPo( pNtk2, o );
881  pPats1 = Sim_SimInfoGet(vInfo1, pObj1);
882  pPats2 = Sim_SimInfoGet(vInfo2, pObj2);
883  if ( pPats1[i] == pPats2[i] )
884  continue;
885  nErrors++;
886  if ( pObjError == NULL )
887  {
888  pObjError = pObj1;
889  iFrameError = i;
890  iNodePo = o;
891  ValueError1 = (pPats1[i] > 0);
892  ValueError2 = (pPats2[i] > 0);
893  }
894  }
895  }
896 
897  if ( pObjError == NULL )
898  {
899  printf( "No output mismatches detected.\n" );
900  Sim_UtilInfoFree( vInfo1 );
901  Sim_UtilInfoFree( vInfo2 );
902  if ( fRemove1 ) Abc_NtkDelete( pNtk1 );
903  if ( fRemove2 ) Abc_NtkDelete( pNtk2 );
904  return;
905  }
906 
907  printf( "Verification failed for at least %d output%s of frame %d: ", nErrors, (nErrors>1? "s":""), iFrameError+1 );
908  // print the first 3 outputs
909  nPrinted = 0;
910  Abc_NtkForEachPo( pNtk1, pObj1, o )
911  {
912  pObj2 = Abc_NtkPo( pNtk2, o );
913  pPats1 = Sim_SimInfoGet(vInfo1, pObj1);
914  pPats2 = Sim_SimInfoGet(vInfo2, pObj2);
915  if ( pPats1[iFrameError] == pPats2[iFrameError] )
916  continue;
917  printf( " %s", Abc_ObjName(pObj1) );
918  if ( ++nPrinted == 3 )
919  break;
920  }
921  if ( nPrinted != nErrors )
922  printf( " ..." );
923  printf( "\n" );
924 
925  // mark CIs of the networks in the cone of influence of this output
926  Abc_NtkGetSeqPoSupp( pNtk1, iFrameError, iNodePo );
927  Abc_NtkGetSeqPoSupp( pNtk2, iFrameError, iNodePo );
928 
929  // report mismatch for the first output
930  printf( "Output %s: Value in Network1 = %d. Value in Network2 = %d.\n",
931  Abc_ObjName(pObjError), ValueError1, ValueError2 );
932 
933  printf( "The cone of influence of output %s in Network1:\n", Abc_ObjName(pObjError) );
934  printf( "PIs: " );
935  Abc_NtkForEachPi( pNtk1, pObj, i )
936  if ( pObj->pCopy )
937  printf( "%s ", Abc_ObjName(pObj) );
938  printf( "\n" );
939  printf( "Latches: " );
940  Abc_NtkForEachLatch( pNtk1, pObj, i )
941  if ( pObj->pCopy )
942  printf( "%s ", Abc_ObjName(pObj) );
943  printf( "\n" );
944 
945  printf( "The cone of influence of output %s in Network2:\n", Abc_ObjName(pObjError) );
946  printf( "PIs: " );
947  Abc_NtkForEachPi( pNtk2, pObj, i )
948  if ( pObj->pCopy )
949  printf( "%s ", Abc_ObjName(pObj) );
950  printf( "\n" );
951  printf( "Latches: " );
952  Abc_NtkForEachLatch( pNtk2, pObj, i )
953  if ( pObj->pCopy )
954  printf( "%s ", Abc_ObjName(pObj) );
955  printf( "\n" );
956 
957  // print the patterns
958  for ( i = 0; i <= iFrameError; i++ )
959  {
960  printf( "Frame %d: ", i+1 );
961 
962  printf( "PI(1):" );
963  Abc_NtkForEachPi( pNtk1, pObj, k )
964  if ( pObj->pCopy )
965  printf( "%d", Sim_SimInfoGet(vInfo1, pObj)[i] > 0 );
966  printf( " " );
967  printf( "L(1):" );
968  Abc_NtkForEachLatch( pNtk1, pObj, k )
969  if ( pObj->pCopy )
970  printf( "%d", Sim_SimInfoGet(vInfo1, pObj)[i] > 0 );
971  printf( " " );
972  printf( "%s(1):", Abc_ObjName(pObjError) );
973  printf( "%d", Sim_SimInfoGet(vInfo1, pObjError)[i] > 0 );
974 
975  printf( " " );
976 
977  printf( "PI(2):" );
978  Abc_NtkForEachPi( pNtk2, pObj, k )
979  if ( pObj->pCopy )
980  printf( "%d", Sim_SimInfoGet(vInfo2, pObj)[i] > 0 );
981  printf( " " );
982  printf( "L(2):" );
983  Abc_NtkForEachLatch( pNtk2, pObj, k )
984  if ( pObj->pCopy )
985  printf( "%d", Sim_SimInfoGet(vInfo2, pObj)[i] > 0 );
986  printf( " " );
987  printf( "%s(2):", Abc_ObjName(pObjError) );
988  printf( "%d", Sim_SimInfoGet(vInfo2, pObjError)[i] > 0 );
989 
990  printf( "\n" );
991  }
992  Abc_NtkForEachCi( pNtk1, pObj, i )
993  pObj->pCopy = NULL;
994  Abc_NtkForEachCi( pNtk2, pObj, i )
995  pObj->pCopy = NULL;
996 
997  Sim_UtilInfoFree( vInfo1 );
998  Sim_UtilInfoFree( vInfo2 );
999  if ( fRemove1 ) Abc_NtkDelete( pNtk1 );
1000  if ( fRemove2 ) Abc_NtkDelete( pNtk2 );
1001 }
1002 
1003 /**Function*************************************************************
1004 
1005  Synopsis [Simulates buggy miter emailed by Mike.]
1006 
1007  Description []
1008 
1009  SideEffects []
1010 
1011  SeeAlso []
1012 
1013 ***********************************************************************/
1015 {
1016  Abc_Obj_t * pObj;
1017  int i;
1018  int * pModel1, * pModel2, * pResult1, * pResult2;
1019  char * vPiValues1 = "01001011100000000011010110101000000";
1020  char * vPiValues2 = "11001101011101011111110100100010001";
1021 
1022  assert( strlen(vPiValues1) == (unsigned)Abc_NtkPiNum(pNtk) );
1023  assert( 1 == Abc_NtkPoNum(pNtk) );
1024 
1025  pModel1 = ABC_ALLOC( int, Abc_NtkCiNum(pNtk) );
1026  Abc_NtkForEachPi( pNtk, pObj, i )
1027  pModel1[i] = vPiValues1[i] - '0';
1028  Abc_NtkForEachLatch( pNtk, pObj, i )
1029  pModel1[Abc_NtkPiNum(pNtk)+i] = ((int)(ABC_PTRINT_T)pObj->pData) - 1;
1030 
1031  pResult1 = Abc_NtkVerifySimulatePattern( pNtk, pModel1 );
1032  printf( "Value = %d\n", pResult1[0] );
1033 
1034  pModel2 = ABC_ALLOC( int, Abc_NtkCiNum(pNtk) );
1035  Abc_NtkForEachPi( pNtk, pObj, i )
1036  pModel2[i] = vPiValues2[i] - '0';
1037  Abc_NtkForEachLatch( pNtk, pObj, i )
1038  pModel2[Abc_NtkPiNum(pNtk)+i] = pResult1[Abc_NtkPoNum(pNtk)+i];
1039 
1040  pResult2 = Abc_NtkVerifySimulatePattern( pNtk, pModel2 );
1041  printf( "Value = %d\n", pResult2[0] );
1042 
1043  ABC_FREE( pModel1 );
1044  ABC_FREE( pModel2 );
1045  ABC_FREE( pResult1 );
1046  ABC_FREE( pResult2 );
1047 }
1048 
1049 
1050 /**Function*************************************************************
1051 
1052  Synopsis [Returns the PO values under the given input pattern.]
1053 
1054  Description []
1055 
1056  SideEffects []
1057 
1058  SeeAlso []
1059 
1060 ***********************************************************************/
1061 int Abc_NtkIsTrueCex( Abc_Ntk_t * pNtk, Abc_Cex_t * pCex )
1062 {
1063  extern Aig_Man_t * Abc_NtkToDar( Abc_Ntk_t * pNtk, int fExors, int fRegisters );
1064  Aig_Man_t * pMan;
1065  int status = 0, fStrashed = 0;
1066  if ( !Abc_NtkIsStrash(pNtk) )
1067  {
1068  pNtk = Abc_NtkStrash(pNtk, 0, 0, 0);
1069  fStrashed = 1;
1070  }
1071  pMan = Abc_NtkToDar( pNtk, 0, 1 );
1072  if ( pMan )
1073  {
1074  status = Saig_ManVerifyCex( pMan, pCex );
1075  Aig_ManStop( pMan );
1076  }
1077  if ( fStrashed )
1078  Abc_NtkDelete( pNtk );
1079  return status;
1080 }
1081 
1082 /**Function*************************************************************
1083 
1084  Synopsis [Returns 1 if the number of PIs matches.]
1085 
1086  Description []
1087 
1088  SideEffects []
1089 
1090  SeeAlso []
1091 
1092 ***********************************************************************/
1094 {
1095  return Abc_NtkPiNum(pNtk) == pCex->nPis;
1096 }
1097 
1098 
1099 ////////////////////////////////////////////////////////////////////////
1100 /// END OF FILE ///
1101 ////////////////////////////////////////////////////////////////////////
1102 
1103 
1105 
char * memset()
ABC_DLL Abc_Ntk_t * Abc_NtkFrames(Abc_Ntk_t *pNtk, int nFrames, int fInitial, int fVerbose)
Definition: abcMiter.c:772
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
void Abc_NtkCecFraigPartAuto(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int nSeconds, int fVerbose)
Definition: abcVerify.c:363
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
static Abc_Obj_t * Abc_ObjFanin1(Abc_Obj_t *pObj)
Definition: abc.h:374
static int Abc_ObjIsCi(Abc_Obj_t *pObj)
Definition: abc.h:351
int Abc_NtkIsTrueCex(Abc_Ntk_t *pNtk, Abc_Cex_t *pCex)
Definition: abcVerify.c:1061
typedefABC_NAMESPACE_HEADER_START struct Fraig_ManStruct_t_ Fraig_Man_t
INCLUDES ///.
Definition: fraig.h:40
void Abc_NtkSecSat(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int nConfLimit, int nInsLimit, int nFrames)
Definition: abcVerify.c:486
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Definition: vecVec.h:42
#define Sim_SimInfoGet(vInfo, pNode)
Definition: sim.h:172
ABC_DLL Abc_Obj_t * Abc_AigConst1(Abc_Ntk_t *pNtk)
Definition: abcAig.c:683
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
Abc_Ntk_t * pExdc
Definition: abc.h:201
static int Abc_ObjFaninC1(Abc_Obj_t *pObj)
Definition: abc.h:378
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
int Cmd_CommandExecute(void *pAbc, char *pCommandLine)
int Saig_ManVerifyCex(Aig_Man_t *pAig, Abc_Cex_t *p)
Definition: saigDup.c:279
ABC_DLL Abc_Ntk_t * Abc_NtkCreateConeArray(Abc_Ntk_t *pNtk, Vec_Ptr_t *vRoots, int fUseAllCis)
Definition: abcNtk.c:889
Abc_Ntk_t * Abc_NtkMulti(Abc_Ntk_t *pNtk, int nThresh, int nFaninMax, int fCnf, int fMulti, int fSimple, int fFactor)
FUNCTION DEFINITIONS ///.
Definition: abcMulti.c:59
void Fraig_ManFree(Fraig_Man_t *pMan)
Definition: fraigMan.c:262
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
static int Abc_ObjFaninC0(Abc_Obj_t *pObj)
Definition: abc.h:377
static int Abc_NtkCiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:287
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition: abc.h:519
void Prove_ParamsSetDefault(Prove_Params_t *pParams)
FUNCTION DEFINITIONS ///.
Definition: fraigMan.c:46
int * Abc_NtkVerifyGetCleanModel(Abc_Ntk_t *pNtk, int nFrames)
Definition: abcVerify.c:668
Vec_Ptr_t * Abc_NtkPartitionSmart(Abc_Ntk_t *pNtk, int nSuppSizeLimit, int fVerbose)
Definition: abcPart.c:722
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
static void Vec_VecFree(Vec_Vec_t *p)
Definition: vecVec.h:347
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
static int Abc_NtkCoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:288
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
static Abc_Obj_t * Abc_NtkCo(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:318
int * pModel
Definition: abc.h:198
void Sim_UtilInfoFree(Vec_Ptr_t *p)
Definition: simUtils.c:83
static int Abc_NtkNodeNum(Abc_Ntk_t *pNtk)
Definition: abc.h:293
Abc_Obj_t * pCopy
Definition: abc.h:148
int Abc_NtkSecFraig(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int nSeconds, int nFrames, int fVerbose)
Definition: abcVerify.c:568
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
Definition: abcDar.c:233
ABC_DLL Abc_Ntk_t * Abc_NtkMiter(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int fComb, int nPartSize, int fImplic, int fMulti)
FUNCTION DEFINITIONS ///.
Definition: abcMiter.c:56
ABC_DLL int Abc_AigLevel(Abc_Ntk_t *pNtk)
Definition: abcAig.c:292
ABC_DLL int Abc_NtkIvyProve(Abc_Ntk_t **ppNtk, void *pPars)
Definition: abcIvy.c:498
#define ABC_NAMESPACE_IMPL_END
Definition: abc_global.h:108
void * Abc_FrameGetGlobalFrame()
Definition: mainFrame.c:593
ABC_DLL Vec_Ptr_t * Abc_NtkNodeSupport(Abc_Ntk_t *pNtk, Abc_Obj_t **ppNodes, int nNodes)
Definition: abcDfs.c:859
void Fraig_ParamsSetDefault(Fraig_Params_t *pParams)
Definition: fraigMan.c:122
ABC_DLL int Abc_NtkMiterSat(Abc_Ntk_t *pNtk, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, int fVerbose, ABC_INT64_T *pNumConfs, ABC_INT64_T *pNumInspects)
FUNCTION DEFINITIONS ///.
Definition: abcSat.c:53
ABC_DLL Abc_Ntk_t * Abc_NtkCreateCone(Abc_Ntk_t *pNtk, Abc_Obj_t *pNode, char *pNodeName, int fUseAllCis)
Definition: abcNtk.c:819
void Abc_NtkConvertCos(Abc_Ntk_t *pNtk, Vec_Int_t *vOuts, Vec_Ptr_t *vOutsPtr)
Definition: abcPart.c:877
Vec_Ptr_t * Sim_SimulateSeqModel(Abc_Ntk_t *pNtk, int nFrames, int *pModel)
Definition: simSeq.c:92
#define Abc_NtkForEachLatch(pNtk, pObj, i)
Definition: abc.h:497
int Abc_NtkIsValidCex(Abc_Ntk_t *pNtk, Abc_Cex_t *pCex)
Definition: abcVerify.c:1093
int * Abc_NtkVerifySimulatePattern(Abc_Ntk_t *pNtk, int *pModel)
Definition: abcVerify.c:686
void Abc_NtkGetSeqPoSupp(Abc_Ntk_t *pNtk, int iFrame, int iNumPo)
Definition: abcVerify.c:808
#define Abc_NtkForEachNode(pNtk, pNode, i)
Definition: abc.h:461
static Abc_Obj_t * Abc_NtkBox(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:319
#define ABC_NAMESPACE_IMPL_START
Definition: abc_global.h:107
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
void Abc_NtkCecFraig(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int nSeconds, int fVerbose)
Definition: abcVerify.c:123
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
ABC_DLL int Abc_NtkCombinePos(Abc_Ntk_t *pNtk, int fAnd, int fXor)
Definition: abcMiter.c:1151
ABC_DLL int Abc_NtkMiterIsConstant(Abc_Ntk_t *pMiter)
Definition: abcMiter.c:679
static Abc_Obj_t * Abc_NtkPo(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:316
#define Abc_NtkForEachCi(pNtk, pCi, i)
Definition: abc.h:515
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
static ABC_NAMESPACE_IMPL_START void Abc_NtkVerifyReportError(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int *pModel)
DECLARATIONS ///.
Definition: abcVerify.c:736
#define ABC_FREE(obj)
Definition: abc_global.h:232
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:285
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
Definition: abcNames.c:48
void Abc_NtkCecSat(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int nConfLimit, int nInsLimit)
FUNCTION DEFINITIONS ///.
Definition: abcVerify.c:56
static void Abc_NtkIncrementTravId(Abc_Ntk_t *p)
Definition: abc.h:406
void Abc_NtkCecFraigPart(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int nSeconds, int nPartSize, int fVerbose)
Definition: abcVerify.c:251
static void Abc_ObjXorFaninC(Abc_Obj_t *pObj, int i)
Definition: abc.h:381
#define assert(ex)
Definition: util_old.h:213
int strlen()
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Definition: utilCex.h:39
static Abc_Obj_t * Abc_NtkPi(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:315
void * pData
Definition: abc.h:145
#define Abc_NtkForEachPo(pNtk, pPo, i)
Definition: abc.h:517
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
int Fraig_ManCheckMiter(Fraig_Man_t *p)
Definition: fraigSat.c:130
void Abc_NtkVerifyReportErrorSeq(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int *pModel, int nFrames)
Definition: abcVerify.c:853
void Abc_NtkSimulteBuggyMiter(Abc_Ntk_t *pNtk)
Definition: abcVerify.c:1014
#define Abc_NtkForEachPi(pNtk, pPi, i)
Definition: abc.h:513
ABC_DLL void * Abc_NtkToFraig(Abc_Ntk_t *pNtk, void *pParams, int fAllNodes, int fExdc)
Definition: abcFraig.c:103
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
void Fraig_ManProveMiter(Fraig_Man_t *p)
Definition: fraigSat.c:85