abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
csat_apis.c
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [csat_apis.h]
4 
5  PackageName [Interface to CSAT.]
6 
7  Synopsis [APIs, enums, and data structures expected from the use of CSAT.]
8 
9  Author [Alan Mishchenko <alanmi@eecs.berkeley.edu>]
10 
11  Affiliation [UC Berkeley]
12 
13  Date [Ver. 1.0. Started - August 28, 2005]
14 
15  Revision [$Id: csat_apis.h,v 1.00 2005/08/28 00:00:00 alanmi Exp $]
16 
17 ***********************************************************************/
18 
19 #include "base/abc/abc.h"
20 #include "proof/fraig/fraig.h"
21 #include "csat_apis.h"
22 #include "misc/st/stmm.h"
23 #include "base/main/main.h"
24 
26 
27 
28 ////////////////////////////////////////////////////////////////////////
29 /// DECLARATIONS ///
30 ////////////////////////////////////////////////////////////////////////
31 
32 #define ABC_DEFAULT_CONF_LIMIT 0 // limit on conflicts
33 #define ABC_DEFAULT_IMP_LIMIT 0 // limit on implications
34 
35 
37 {
38  // information about the problem
39  stmm_table * tName2Node; // the hash table mapping names to nodes
40  stmm_table * tNode2Name; // the hash table mapping nodes to names
41  Abc_Ntk_t * pNtk; // the starting ABC network
42  Abc_Ntk_t * pTarget; // the AIG representing the target
43  char * pDumpFileName; // the name of the file to dump the target network
44  Mem_Flex_t * pMmNames; // memory manager for signal names
45  // solving parameters
46  int mode; // 0 = resource-aware integration; 1 = brute-force SAT
47  Prove_Params_t Params; // integrated CEC parameters
48  // information about the target
49  int nog; // the numbers of gates in the target
50  Vec_Ptr_t * vNodes; // the gates in the target
51  Vec_Int_t * vValues; // the values of gate's outputs in the target
52  // solution
53  CSAT_Target_ResultT * pResult; // the result of solving the target
54 };
55 
56 static CSAT_Target_ResultT * ABC_TargetResAlloc( int nVars );
57 static char * ABC_GetNodeName( ABC_Manager mng, Abc_Obj_t * pNode );
58 
59 // procedures to start and stop the ABC framework
60 extern void Abc_Start();
61 extern void Abc_Stop();
62 
63 // some external procedures
64 extern int Io_WriteBench( Abc_Ntk_t * pNtk, const char * FileName );
65 
66 ////////////////////////////////////////////////////////////////////////
67 /// FUNCTION DEFINITIONS ///
68 ////////////////////////////////////////////////////////////////////////
69 
70 /**Function*************************************************************
71 
72  Synopsis [Creates a new manager.]
73 
74  Description []
75 
76  SideEffects []
77 
78  SeeAlso []
79 
80 ***********************************************************************/
82 {
83  ABC_Manager_t * mng;
84  Abc_Start();
85  mng = ABC_ALLOC( ABC_Manager_t, 1 );
86  memset( mng, 0, sizeof(ABC_Manager_t) );
87  mng->pNtk = Abc_NtkAlloc( ABC_NTK_LOGIC, ABC_FUNC_SOP, 1 );
88  mng->pNtk->pName = Extra_UtilStrsav("csat_network");
89  mng->tName2Node = stmm_init_table(strcmp, stmm_strhash);
90  mng->tNode2Name = stmm_init_table(stmm_ptrcmp, stmm_ptrhash);
91  mng->pMmNames = Mem_FlexStart();
92  mng->vNodes = Vec_PtrAlloc( 100 );
93  mng->vValues = Vec_IntAlloc( 100 );
94  mng->mode = 0; // set "resource-aware integration" as the default mode
95  // set default parameters for CEC
96  Prove_ParamsSetDefault( &mng->Params );
97  // set infinite resource limit for the final mitering
98 // mng->Params.nMiteringLimitLast = ABC_INFINITY;
99  return mng;
100 }
101 
102 /**Function*************************************************************
103 
104  Synopsis [Deletes the manager.]
105 
106  Description []
107 
108  SideEffects []
109 
110  SeeAlso []
111 
112 ***********************************************************************/
114 {
115  CSAT_Target_ResultT * p_res = ABC_Get_Target_Result( mng,0 );
116  ABC_TargetResFree(p_res);
117  if ( mng->tNode2Name ) stmm_free_table( mng->tNode2Name );
118  if ( mng->tName2Node ) stmm_free_table( mng->tName2Node );
119  if ( mng->pMmNames ) Mem_FlexStop( mng->pMmNames, 0 );
120  if ( mng->pNtk ) Abc_NtkDelete( mng->pNtk );
121  if ( mng->pTarget ) Abc_NtkDelete( mng->pTarget );
122  if ( mng->vNodes ) Vec_PtrFree( mng->vNodes );
123  if ( mng->vValues ) Vec_IntFree( mng->vValues );
124  ABC_FREE( mng->pDumpFileName );
125  ABC_FREE( mng );
126  Abc_Stop();
127 }
128 
129 /**Function*************************************************************
130 
131  Synopsis [Sets solver options for learning.]
132 
133  Description []
134 
135  SideEffects []
136 
137  SeeAlso []
138 
139 ***********************************************************************/
141 {
142 }
143 
144 /**Function*************************************************************
145 
146  Synopsis [Sets solving mode by brute-force SAT.]
147 
148  Description []
149 
150  SideEffects []
151 
152  SeeAlso []
153 
154 ***********************************************************************/
156 {
157  mng->mode = 1; // switch to "brute-force SAT" as the solving option
158 }
159 
160 /**Function*************************************************************
161 
162  Synopsis [Adds a gate to the circuit.]
163 
164  Description [The meaning of the parameters are:
165  type: the type of the gate to be added
166  name: the name of the gate to be added, name should be unique in a circuit.
167  nofi: number of fanins of the gate to be added;
168  fanins: the name array of fanins of the gate to be added.]
169 
170  SideEffects []
171 
172  SeeAlso []
173 
174 ***********************************************************************/
175 int ABC_AddGate( ABC_Manager mng, enum GateType type, char * name, int nofi, char ** fanins, int dc_attr )
176 {
177  Abc_Obj_t * pObj = NULL; // Suppress "might be used uninitialized"
178  Abc_Obj_t * pFanin;
179  char * pSop = NULL; // Suppress "might be used uninitialized"
180  char * pNewName;
181  int i;
182 
183  // save the name in the local memory manager
184  pNewName = Mem_FlexEntryFetch( mng->pMmNames, strlen(name) + 1 );
185  strcpy( pNewName, name );
186  name = pNewName;
187 
188  // consider different cases, create the node, and map the node into the name
189  switch( type )
190  {
191  case CSAT_BPI:
192  case CSAT_BPPI:
193  if ( nofi != 0 )
194  { printf( "ABC_AddGate: The PI/PPI gate \"%s\" has fanins.\n", name ); return 0; }
195  // create the PI
196  pObj = Abc_NtkCreatePi( mng->pNtk );
197  stmm_insert( mng->tNode2Name, (char *)pObj, name );
198  break;
199  case CSAT_CONST:
200  case CSAT_BAND:
201  case CSAT_BNAND:
202  case CSAT_BOR:
203  case CSAT_BNOR:
204  case CSAT_BXOR:
205  case CSAT_BXNOR:
206  case CSAT_BINV:
207  case CSAT_BBUF:
208  // create the node
209  pObj = Abc_NtkCreateNode( mng->pNtk );
210  // create the fanins
211  for ( i = 0; i < nofi; i++ )
212  {
213  if ( !stmm_lookup( mng->tName2Node, fanins[i], (char **)&pFanin ) )
214  { printf( "ABC_AddGate: The fanin gate \"%s\" is not in the network.\n", fanins[i] ); return 0; }
215  Abc_ObjAddFanin( pObj, pFanin );
216  }
217  // create the node function
218  switch( type )
219  {
220  case CSAT_CONST:
221  if ( nofi != 0 )
222  { printf( "ABC_AddGate: The constant gate \"%s\" has fanins.\n", name ); return 0; }
223  pSop = Abc_SopCreateConst1( (Mem_Flex_t *)mng->pNtk->pManFunc );
224  break;
225  case CSAT_BAND:
226  if ( nofi < 1 )
227  { printf( "ABC_AddGate: The AND gate \"%s\" no fanins.\n", name ); return 0; }
228  pSop = Abc_SopCreateAnd( (Mem_Flex_t *)mng->pNtk->pManFunc, nofi, NULL );
229  break;
230  case CSAT_BNAND:
231  if ( nofi < 1 )
232  { printf( "ABC_AddGate: The NAND gate \"%s\" no fanins.\n", name ); return 0; }
233  pSop = Abc_SopCreateNand( (Mem_Flex_t *)mng->pNtk->pManFunc, nofi );
234  break;
235  case CSAT_BOR:
236  if ( nofi < 1 )
237  { printf( "ABC_AddGate: The OR gate \"%s\" no fanins.\n", name ); return 0; }
238  pSop = Abc_SopCreateOr( (Mem_Flex_t *)mng->pNtk->pManFunc, nofi, NULL );
239  break;
240  case CSAT_BNOR:
241  if ( nofi < 1 )
242  { printf( "ABC_AddGate: The NOR gate \"%s\" no fanins.\n", name ); return 0; }
243  pSop = Abc_SopCreateNor( (Mem_Flex_t *)mng->pNtk->pManFunc, nofi );
244  break;
245  case CSAT_BXOR:
246  if ( nofi < 1 )
247  { printf( "ABC_AddGate: The XOR gate \"%s\" no fanins.\n", name ); return 0; }
248  if ( nofi > 2 )
249  { printf( "ABC_AddGate: The XOR gate \"%s\" has more than two fanins.\n", name ); return 0; }
250  pSop = Abc_SopCreateXor( (Mem_Flex_t *)mng->pNtk->pManFunc, nofi );
251  break;
252  case CSAT_BXNOR:
253  if ( nofi < 1 )
254  { printf( "ABC_AddGate: The XNOR gate \"%s\" no fanins.\n", name ); return 0; }
255  if ( nofi > 2 )
256  { printf( "ABC_AddGate: The XNOR gate \"%s\" has more than two fanins.\n", name ); return 0; }
257  pSop = Abc_SopCreateNxor( (Mem_Flex_t *)mng->pNtk->pManFunc, nofi );
258  break;
259  case CSAT_BINV:
260  if ( nofi != 1 )
261  { printf( "ABC_AddGate: The inverter gate \"%s\" does not have exactly one fanin.\n", name ); return 0; }
262  pSop = Abc_SopCreateInv( (Mem_Flex_t *)mng->pNtk->pManFunc );
263  break;
264  case CSAT_BBUF:
265  if ( nofi != 1 )
266  { printf( "ABC_AddGate: The buffer gate \"%s\" does not have exactly one fanin.\n", name ); return 0; }
267  pSop = Abc_SopCreateBuf( (Mem_Flex_t *)mng->pNtk->pManFunc );
268  break;
269  default :
270  break;
271  }
272  Abc_ObjSetData( pObj, pSop );
273  break;
274  case CSAT_BPPO:
275  case CSAT_BPO:
276  if ( nofi != 1 )
277  { printf( "ABC_AddGate: The PO/PPO gate \"%s\" does not have exactly one fanin.\n", name ); return 0; }
278  // create the PO
279  pObj = Abc_NtkCreatePo( mng->pNtk );
280  stmm_insert( mng->tNode2Name, (char *)pObj, name );
281  // connect to the PO fanin
282  if ( !stmm_lookup( mng->tName2Node, fanins[0], (char **)&pFanin ) )
283  { printf( "ABC_AddGate: The fanin gate \"%s\" is not in the network.\n", fanins[0] ); return 0; }
284  Abc_ObjAddFanin( pObj, pFanin );
285  break;
286  default:
287  printf( "ABC_AddGate: Unknown gate type.\n" );
288  break;
289  }
290 
291  // map the name into the node
292  if ( stmm_insert( mng->tName2Node, name, (char *)pObj ) )
293  { printf( "ABC_AddGate: The same gate \"%s\" is added twice.\n", name ); return 0; }
294  return 1;
295 }
296 
297 /**Function*************************************************************
298 
299  Synopsis [This procedure also finalizes construction of the ABC network.]
300 
301  Description []
302 
303  SideEffects []
304 
305  SeeAlso []
306 
307 ***********************************************************************/
309 {
310  Abc_Ntk_t * pNtk = mng->pNtk;
311  Abc_Obj_t * pObj;
312  int i;
313  Abc_NtkForEachPi( pNtk, pObj, i )
314  Abc_ObjAssignName( pObj, ABC_GetNodeName(mng, pObj), NULL );
315  Abc_NtkForEachPo( pNtk, pObj, i )
316  Abc_ObjAssignName( pObj, ABC_GetNodeName(mng, pObj), NULL );
317  assert( Abc_NtkLatchNum(pNtk) == 0 );
318 }
319 
320 /**Function*************************************************************
321 
322  Synopsis [Checks integraty of the manager.]
323 
324  Description [Checks if there are gates that are not used by any primary output.
325  If no such gates exist, return 1 else return 0.]
326 
327  SideEffects []
328 
329  SeeAlso []
330 
331 ***********************************************************************/
333 {
334  Abc_Ntk_t * pNtk = mng->pNtk;
335  Abc_Obj_t * pObj;
336  int i;
337 
338  // check that there are no dangling nodes
339  Abc_NtkForEachNode( pNtk, pObj, i )
340  {
341  if ( i == 0 )
342  continue;
343  if ( Abc_ObjFanoutNum(pObj) == 0 )
344  {
345 // printf( "ABC_Check_Integrity: The network has dangling nodes.\n" );
346  return 0;
347  }
348  }
349 
350  // make sure everything is okay with the network structure
351  if ( !Abc_NtkDoCheck( pNtk ) )
352  {
353  printf( "ABC_Check_Integrity: The internal network check has failed.\n" );
354  return 0;
355  }
356  return 1;
357 }
358 
359 /**Function*************************************************************
360 
361  Synopsis [Sets time limit for solving a target.]
362 
363  Description [Runtime: time limit (in second).]
364 
365  SideEffects []
366 
367  SeeAlso []
368 
369 ***********************************************************************/
371 {
372 // printf( "ABC_SetTimeLimit: The resource limit is not implemented (warning).\n" );
373 }
374 
375 /**Function*************************************************************
376 
377  Synopsis []
378 
379  Description []
380 
381  SideEffects []
382 
383  SeeAlso []
384 
385 ***********************************************************************/
386 void ABC_SetLearnLimit( ABC_Manager mng, int num )
387 {
388 // printf( "ABC_SetLearnLimit: The resource limit is not implemented (warning).\n" );
389 }
390 
391 /**Function*************************************************************
392 
393  Synopsis []
394 
395  Description []
396 
397  SideEffects []
398 
399  SeeAlso []
400 
401 ***********************************************************************/
403 {
404 // printf( "ABC_SetLearnBacktrackLimit: The resource limit is not implemented (warning).\n" );
405 }
406 
407 /**Function*************************************************************
408 
409  Synopsis []
410 
411  Description []
412 
413  SideEffects []
414 
415  SeeAlso []
416 
417 ***********************************************************************/
419 {
420  mng->Params.nMiteringLimitLast = num;
421 }
422 
423 /**Function*************************************************************
424 
425  Synopsis []
426 
427  Description []
428 
429  SideEffects []
430 
431  SeeAlso []
432 
433 ***********************************************************************/
435 {
436 // printf( "ABC_SetSolveImplicationLimit: The resource limit is not implemented (warning).\n" );
437 }
438 
439 /**Function*************************************************************
440 
441  Synopsis []
442 
443  Description []
444 
445  SideEffects []
446 
447  SeeAlso []
448 
449 ***********************************************************************/
450 void ABC_SetTotalBacktrackLimit( ABC_Manager mng, ABC_UINT64_T num )
451 {
452  mng->Params.nTotalBacktrackLimit = num;
453 }
454 
455 /**Function*************************************************************
456 
457  Synopsis []
458 
459  Description []
460 
461  SideEffects []
462 
463  SeeAlso []
464 
465 ***********************************************************************/
466 void ABC_SetTotalInspectLimit( ABC_Manager mng, ABC_UINT64_T num )
467 {
468  mng->Params.nTotalInspectLimit = num;
469 }
470 /**Function*************************************************************
471 
472  Synopsis []
473 
474  Description []
475 
476  SideEffects []
477 
478  SeeAlso []
479 
480 ***********************************************************************/
482 {
483  return mng->Params.nTotalBacktracksMade;
484 }
485 
486 /**Function*************************************************************
487 
488  Synopsis []
489 
490  Description []
491 
492  SideEffects []
493 
494  SeeAlso []
495 
496 ***********************************************************************/
498 {
499  return mng->Params.nTotalInspectsMade;
500 }
501 
502 /**Function*************************************************************
503 
504  Synopsis [Sets the file name to dump the structurally hashed network used for solving.]
505 
506  Description []
507 
508  SideEffects []
509 
510  SeeAlso []
511 
512 ***********************************************************************/
513 void ABC_EnableDump( ABC_Manager mng, char * dump_file )
514 {
515  ABC_FREE( mng->pDumpFileName );
516  mng->pDumpFileName = Extra_UtilStrsav( dump_file );
517 }
518 
519 /**Function*************************************************************
520 
521  Synopsis [Adds a new target to the manager.]
522 
523  Description [The meaning of the parameters are:
524  nog: number of gates that are in the targets,
525  names: name array of gates,
526  values: value array of the corresponding gates given in "names" to be solved.
527  The relation of them is AND.]
528 
529  SideEffects []
530 
531  SeeAlso []
532 
533 ***********************************************************************/
534 int ABC_AddTarget( ABC_Manager mng, int nog, char ** names, int * values )
535 {
536  Abc_Obj_t * pObj;
537  int i;
538  if ( nog < 1 )
539  { printf( "ABC_AddTarget: The target has no gates.\n" ); return 0; }
540  // clear storage for the target
541  mng->nog = 0;
542  Vec_PtrClear( mng->vNodes );
543  Vec_IntClear( mng->vValues );
544  // save the target
545  for ( i = 0; i < nog; i++ )
546  {
547  if ( !stmm_lookup( mng->tName2Node, names[i], (char **)&pObj ) )
548  { printf( "ABC_AddTarget: The target gate \"%s\" is not in the network.\n", names[i] ); return 0; }
549  Vec_PtrPush( mng->vNodes, pObj );
550  if ( values[i] < 0 || values[i] > 1 )
551  { printf( "ABC_AddTarget: The value of gate \"%s\" is not 0 or 1.\n", names[i] ); return 0; }
552  Vec_IntPush( mng->vValues, values[i] );
553  }
554  mng->nog = nog;
555  return 1;
556 }
557 
558 /**Function*************************************************************
559 
560  Synopsis [Initialize the solver internal data structure.]
561 
562  Description [Prepares the solver to work on one specific target
563  set by calling ABC_AddTarget before.]
564 
565  SideEffects []
566 
567  SeeAlso []
568 
569 ***********************************************************************/
571 {
572  // check if the target is available
573  assert( mng->nog == Vec_PtrSize(mng->vNodes) );
574  if ( mng->nog == 0 )
575  { printf( "ABC_SolveInit: Target is not specified by ABC_AddTarget().\n" ); return; }
576 
577  // free the previous target network if present
578  if ( mng->pTarget ) Abc_NtkDelete( mng->pTarget );
579 
580  // set the new target network
581 // mng->pTarget = Abc_NtkCreateTarget( mng->pNtk, mng->vNodes, mng->vValues );
582  mng->pTarget = Abc_NtkStrash( mng->pNtk, 0, 1, 0 );
583 }
584 
585 /**Function*************************************************************
586 
587  Synopsis [Currently not implemented.]
588 
589  Description []
590 
591  SideEffects []
592 
593  SeeAlso []
594 
595 ***********************************************************************/
597 {
598 }
599 
600 /**Function*************************************************************
601 
602  Synopsis [Solves the targets added by ABC_AddTarget().]
603 
604  Description []
605 
606  SideEffects []
607 
608  SeeAlso []
609 
610 ***********************************************************************/
612 {
613  Prove_Params_t * pParams = &mng->Params;
614  int RetValue, i;
615 
616  // check if the target network is available
617  if ( mng->pTarget == NULL )
618  { printf( "ABC_Solve: Target network is not derived by ABC_SolveInit().\n" ); return UNDETERMINED; }
619 
620  // try to prove the miter using a number of techniques
621  if ( mng->mode )
622  RetValue = Abc_NtkMiterSat( mng->pTarget, (ABC_INT64_T)pParams->nMiteringLimitLast, (ABC_INT64_T)0, 0, NULL, NULL );
623  else
624 // RetValue = Abc_NtkMiterProve( &mng->pTarget, pParams ); // old CEC engine
625  RetValue = Abc_NtkIvyProve( &mng->pTarget, pParams ); // new CEC engine
626 
627  // analyze the result
629  if ( RetValue == -1 )
630  mng->pResult->status = UNDETERMINED;
631  else if ( RetValue == 1 )
632  mng->pResult->status = UNSATISFIABLE;
633  else if ( RetValue == 0 )
634  {
635  mng->pResult->status = SATISFIABLE;
636  // create the array of PI names and values
637  for ( i = 0; i < mng->pResult->no_sig; i++ )
638  {
639  mng->pResult->names[i] = Extra_UtilStrsav( ABC_GetNodeName(mng, Abc_NtkCi(mng->pNtk, i)) );
640  mng->pResult->values[i] = mng->pTarget->pModel[i];
641  }
642  ABC_FREE( mng->pTarget->pModel );
643  }
644  else assert( 0 );
645 
646  // delete the target
647  Abc_NtkDelete( mng->pTarget );
648  mng->pTarget = NULL;
649  // return the status
650  return mng->pResult->status;
651 }
652 
653 /**Function*************************************************************
654 
655  Synopsis [Gets the solve status of a target.]
656 
657  Description [TargetID: the target id returned by ABC_AddTarget().]
658 
659  SideEffects []
660 
661  SeeAlso []
662 
663 ***********************************************************************/
665 {
666  return mng->pResult;
667 }
668 
669 /**Function*************************************************************
670 
671  Synopsis [Dumps the original network into the BENCH file.]
672 
673  Description [This procedure should be modified to dump the target.]
674 
675  SideEffects []
676 
677  SeeAlso []
678 
679 ***********************************************************************/
681 {
682  Abc_Ntk_t * pNtkTemp, * pNtkAig;
683  const char * pFileName;
684 
685  // derive the netlist
686  pNtkAig = Abc_NtkStrash( mng->pNtk, 0, 0, 0 );
687  pNtkTemp = Abc_NtkToNetlistBench( pNtkAig );
688  Abc_NtkDelete( pNtkAig );
689  if ( pNtkTemp == NULL )
690  { printf( "ABC_Dump_Bench_File: Dumping BENCH has failed.\n" ); return; }
691  pFileName = mng->pDumpFileName? mng->pDumpFileName: "abc_test.bench";
692  Io_WriteBench( pNtkTemp, pFileName );
693  Abc_NtkDelete( pNtkTemp );
694 }
695 
696 
697 
698 /**Function*************************************************************
699 
700  Synopsis [Allocates the target result.]
701 
702  Description []
703 
704  SideEffects []
705 
706  SeeAlso []
707 
708 ***********************************************************************/
710 {
712  p = ABC_ALLOC( CSAT_Target_ResultT, 1 );
713  memset( p, 0, sizeof(CSAT_Target_ResultT) );
714  p->no_sig = nVars;
715  p->names = ABC_ALLOC( char *, nVars );
716  p->values = ABC_ALLOC( int, nVars );
717  memset( p->names, 0, sizeof(char *) * nVars );
718  memset( p->values, 0, sizeof(int) * nVars );
719  return p;
720 }
721 
722 /**Function*************************************************************
723 
724  Synopsis [Deallocates the target result.]
725 
726  Description []
727 
728  SideEffects []
729 
730  SeeAlso []
731 
732 ***********************************************************************/
734 {
735  if ( p == NULL )
736  return;
737  if( p->names )
738  {
739  int i = 0;
740  for ( i = 0; i < p->no_sig; i++ )
741  {
742  ABC_FREE(p->names[i]);
743  }
744  }
745  ABC_FREE( p->names );
746  ABC_FREE( p->values );
747  ABC_FREE( p );
748 }
749 
750 /**Function*************************************************************
751 
752  Synopsis [Dumps the target AIG into the BENCH file.]
753 
754  Description []
755 
756  SideEffects []
757 
758  SeeAlso []
759 
760 ***********************************************************************/
761 char * ABC_GetNodeName( ABC_Manager mng, Abc_Obj_t * pNode )
762 {
763  char * pName = NULL;
764  if ( !stmm_lookup( mng->tNode2Name, (char *)pNode, (char **)&pName ) )
765  {
766  assert( 0 );
767  }
768  return pName;
769 }
770 
771 
772 ////////////////////////////////////////////////////////////////////////
773 /// END OF FILE ///
774 ////////////////////////////////////////////////////////////////////////
775 
776 
778 
char * memset()
CSAT_StatusT
Definition: csat_apis.h:79
void ABC_Dump_Bench_File(ABC_Manager mng)
Definition: csat_apis.c:680
Prove_Params_t Params
Definition: csat_apis.c:47
void Abc_Stop()
Definition: mainLib.c:76
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
int Io_WriteBench(Abc_Ntk_t *pNtk, const char *FileName)
FUNCTION DEFINITIONS ///.
Definition: ioWriteBench.c:53
enum CSAT_StatusT ABC_Solve(ABC_Manager mng)
Definition: csat_apis.c:611
void ABC_SetSolveBacktrackLimit(ABC_Manager mng, int num)
Definition: csat_apis.c:418
CSAT_Target_ResultT * ABC_Get_Target_Result(ABC_Manager mng, int TargetID)
Definition: csat_apis.c:664
stmm_table * stmm_init_table(stmm_compare_func_type compare, stmm_hash_func_type hash)
Definition: stmm.c:69
void ABC_SetLearnLimit(ABC_Manager mng, int num)
Definition: csat_apis.c:386
static Llb_Mgr_t * p
Definition: llb3Image.c:950
stmm_table * tNode2Name
Definition: csat_apis.c:40
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static int Abc_ObjFanoutNum(Abc_Obj_t *pObj)
Definition: abc.h:365
void ABC_SetTotalBacktrackLimit(ABC_Manager mng, ABC_UINT64_T num)
Definition: csat_apis.c:450
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
int stmm_insert(stmm_table *table, char *key, char *value)
Definition: stmm.c:200
void ABC_AnalyzeTargets(ABC_Manager mng)
Definition: csat_apis.c:596
void ABC_TargetResFree(CSAT_Target_ResultT *p)
Definition: csat_apis.c:733
ABC_DLL char * Abc_SopCreateAnd(Mem_Flex_t *pMan, int nVars, int *pfCompl)
Definition: abcSop.c:162
ABC_DLL char * Abc_SopCreateInv(Mem_Flex_t *pMan)
Definition: abcSop.c:345
void ABC_SetSolveOption(ABC_Manager mng, enum CSAT_OptionT option)
Definition: csat_apis.c:140
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
static int Abc_NtkCiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:287
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
void ABC_SetLearnBacktrackLimit(ABC_Manager mng, int num)
Definition: csat_apis.c:402
static char * ABC_GetNodeName(ABC_Manager mng, Abc_Obj_t *pNode)
Definition: csat_apis.c:761
static Abc_Obj_t * Abc_NtkCi(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:317
ABC_DLL Abc_Ntk_t * Abc_NtkToNetlistBench(Abc_Ntk_t *pNtk)
Definition: abcNetlist.c:122
void Prove_ParamsSetDefault(Prove_Params_t *pParams)
FUNCTION DEFINITIONS ///.
Definition: fraigMan.c:46
ABC_DLL char * Abc_ObjAssignName(Abc_Obj_t *pObj, char *pName, char *pSuffix)
Definition: abcNames.c:68
void ABC_Network_Finalize(ABC_Manager mng)
Definition: csat_apis.c:308
GateType
Definition: csat_apis.h:49
int ABC_Check_Integrity(ABC_Manager mng)
Definition: csat_apis.c:332
char * pDumpFileName
Definition: csat_apis.c:43
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
void ABC_EnableDump(ABC_Manager mng, char *dump_file)
Definition: csat_apis.c:513
ABC_DLL char * Abc_SopCreateNand(Mem_Flex_t *pMan, int nVars)
Definition: abcSop.c:184
char * Mem_FlexEntryFetch(Mem_Flex_t *p, int nBytes)
Definition: mem.c:372
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
static void Abc_ObjSetData(Abc_Obj_t *pObj, void *pData)
Definition: abc.h:343
char * Extra_UtilStrsav(const char *s)
ABC_DLL char * Abc_SopCreateConst1(Mem_Flex_t *pMan)
Definition: abcSop.c:107
ABC_DLL void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
Definition: abcFanio.c:84
ABC_DLL char * Abc_SopCreateBuf(Mem_Flex_t *pMan)
Definition: abcSop.c:361
int * pModel
Definition: abc.h:198
ABC_DLL Abc_Ntk_t * Abc_NtkAlloc(Abc_NtkType_t Type, Abc_NtkFunc_t Func, int fUseMemMan)
DECLARATIONS ///.
Definition: abcNtk.c:50
int strcmp()
Mem_Flex_t * pMmNames
Definition: csat_apis.c:44
Vec_Ptr_t * vNodes
Definition: csat_apis.c:50
stmm_table * tName2Node
Definition: csat_apis.c:39
int ABC_AddTarget(ABC_Manager mng, int nog, char **names, int *values)
Definition: csat_apis.c:534
ABC_INT64_T nTotalInspectsMade
Definition: ivyFraig.c:137
void * pManFunc
Definition: abc.h:191
Mem_Flex_t * Mem_FlexStart()
Definition: mem.c:311
ABC_INT64_T nTotalBacktracksMade
Definition: ivyFraig.c:136
Vec_Int_t * vValues
Definition: csat_apis.c:51
Abc_Ntk_t * pNtk
Definition: csat_apis.c:41
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
int stmm_lookup(stmm_table *table, char *key, char **value)
Definition: stmm.c:134
int stmm_ptrhash(const char *x, int size)
Definition: stmm.c:533
Abc_Ntk_t * pTarget
Definition: csat_apis.c:42
ABC_DLL char * Abc_SopCreateNxor(Mem_Flex_t *pMan, int nVars)
Definition: abcSop.c:311
char * name
void ABC_SetTimeLimit(ABC_Manager mng, int runtime)
Definition: csat_apis.c:370
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
ABC_Manager ABC_InitManager()
FUNCTION DEFINITIONS ///.
Definition: csat_apis.c:81
ABC_DLL char * Abc_SopCreateXor(Mem_Flex_t *pMan, int nVars)
Definition: abcSop.c:274
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_INT64_T nTotalInspectLimit
Definition: ivyFraig.c:134
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
enum CSAT_StatusT status
Definition: csat_apis.h:123
static Abc_Obj_t * Abc_NtkCreatePi(Abc_Ntk_t *pNtk)
Definition: abc.h:303
ABC_DLL int Abc_NtkDoCheck(Abc_Ntk_t *pNtk)
Definition: abcCheck.c:93
typedefABC_NAMESPACE_HEADER_START struct ABC_ManagerStruct_t ABC_Manager_t
INCLUDES ///.
Definition: csat_apis.h:41
int stmm_strhash(const char *string, int modulus)
Definition: stmm.c:514
char * strcpy()
static CSAT_Target_ResultT * ABC_TargetResAlloc(int nVars)
Definition: csat_apis.c:709
#define Abc_NtkForEachNode(pNtk, pNode, i)
Definition: abc.h:461
void Mem_FlexStop(Mem_Flex_t *p, int fVerbose)
Definition: mem.c:343
void ABC_SetSolveImplicationLimit(ABC_Manager mng, int num)
Definition: csat_apis.c:434
#define ABC_NAMESPACE_IMPL_START
Definition: abc_global.h:107
int stmm_ptrcmp(const char *x, const char *y)
Definition: stmm.c:545
ABC_DLL char * Abc_SopCreateNor(Mem_Flex_t *pMan, int nVars)
Definition: abcSop.c:253
CSAT_OptionT
Definition: csat_apis.h:109
void stmm_free_table(stmm_table *table)
Definition: stmm.c:79
ABC_INT64_T nTotalBacktrackLimit
Definition: ivyFraig.c:133
runtime()
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
#define ABC_FREE(obj)
Definition: abc_global.h:232
static Abc_Obj_t * Abc_NtkCreateNode(Abc_Ntk_t *pNtk)
Definition: abc.h:308
#define assert(ex)
Definition: util_old.h:213
static void Vec_PtrClear(Vec_Ptr_t *p)
Definition: vecPtr.h:545
ABC_UINT64_T ABC_GetTotalInspectsMade(ABC_Manager mng)
Definition: csat_apis.c:497
int strlen()
int ABC_AddGate(ABC_Manager mng, enum GateType type, char *name, int nofi, char **fanins, int dc_attr)
Definition: csat_apis.c:175
#define Abc_NtkForEachPo(pNtk, pPo, i)
Definition: abc.h:517
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
void Abc_Start()
DECLARATIONS ///.
Definition: mainLib.c:52
static void Vec_IntClear(Vec_Int_t *p)
Definition: bblif.c:452
CSAT_Target_ResultT * pResult
Definition: csat_apis.c:53
static Abc_Obj_t * Abc_NtkCreatePo(Abc_Ntk_t *pNtk)
Definition: abc.h:304
ABC_DLL char * Abc_SopCreateOr(Mem_Flex_t *pMan, int nVars, int *pfCompl)
Definition: abcSop.c:206
ABC_UINT64_T ABC_GetTotalBacktracksMade(ABC_Manager mng)
Definition: csat_apis.c:481
void ABC_SolveInit(ABC_Manager mng)
Definition: csat_apis.c:570
void ABC_UseOnlyCoreSatSolver(ABC_Manager mng)
Definition: csat_apis.c:155
#define Abc_NtkForEachPi(pNtk, pPi, i)
Definition: abc.h:513
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
void ABC_SetTotalInspectLimit(ABC_Manager mng, ABC_UINT64_T num)
Definition: csat_apis.c:466
void ABC_ReleaseManager(ABC_Manager mng)
Definition: csat_apis.c:113