abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
hopUtil.c
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [hopUtil.c]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [And-Inverter Graph package.]
8 
9  Synopsis [Various procedures.]
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - May 11, 2006.]
16 
17  Revision [$Id: hopUtil.c,v 1.00 2006/05/11 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #include "hop.h"
22 
24 
25 
26 ////////////////////////////////////////////////////////////////////////
27 /// DECLARATIONS ///
28 ////////////////////////////////////////////////////////////////////////
29 
30 ////////////////////////////////////////////////////////////////////////
31 /// FUNCTION DEFINITIONS ///
32 ////////////////////////////////////////////////////////////////////////
33 
34 /**Function*************************************************************
35 
36  Synopsis [Increments the current traversal ID of the network.]
37 
38  Description []
39 
40  SideEffects []
41 
42  SeeAlso []
43 
44 ***********************************************************************/
46 {
47  if ( p->nTravIds >= (1<<30)-1 )
48  Hop_ManCleanData( p );
49  p->nTravIds++;
50 }
51 
52 /**Function*************************************************************
53 
54  Synopsis [Cleans the data pointers for the nodes.]
55 
56  Description []
57 
58  SideEffects []
59 
60  SeeAlso []
61 
62 ***********************************************************************/
64 {
65  Hop_Obj_t * pObj;
66  int i;
67  p->nTravIds = 1;
68  Hop_ManConst1(p)->pData = NULL;
69  Hop_ManForEachPi( p, pObj, i )
70  pObj->pData = NULL;
71  Hop_ManForEachPo( p, pObj, i )
72  pObj->pData = NULL;
73  Hop_ManForEachNode( p, pObj, i )
74  pObj->pData = NULL;
75 }
76 
77 /**Function*************************************************************
78 
79  Synopsis [Recursively cleans the data pointers in the cone of the node.]
80 
81  Description [Applicable to small AIGs only because no caching is performed.]
82 
83  SideEffects []
84 
85  SeeAlso []
86 
87 ***********************************************************************/
89 {
90  assert( !Hop_IsComplement(pObj) );
91  assert( !Hop_ObjIsPo(pObj) );
92  if ( Hop_ObjIsAnd(pObj) )
93  {
96  }
97  pObj->pData = NULL;
98 }
99 
100 /**Function*************************************************************
101 
102  Synopsis [Detects multi-input gate rooted at this node.]
103 
104  Description []
105 
106  SideEffects []
107 
108  SeeAlso []
109 
110 ***********************************************************************/
111 void Hop_ObjCollectMulti_rec( Hop_Obj_t * pRoot, Hop_Obj_t * pObj, Vec_Ptr_t * vSuper )
112 {
113  if ( pRoot != pObj && (Hop_IsComplement(pObj) || Hop_ObjIsPi(pObj) || Hop_ObjType(pRoot) != Hop_ObjType(pObj)) )
114  {
115  Vec_PtrPushUnique(vSuper, pObj);
116  return;
117  }
118  Hop_ObjCollectMulti_rec( pRoot, Hop_ObjChild0(pObj), vSuper );
119  Hop_ObjCollectMulti_rec( pRoot, Hop_ObjChild1(pObj), vSuper );
120 }
121 
122 /**Function*************************************************************
123 
124  Synopsis [Detects multi-input gate rooted at this node.]
125 
126  Description []
127 
128  SideEffects []
129 
130  SeeAlso []
131 
132 ***********************************************************************/
133 void Hop_ObjCollectMulti( Hop_Obj_t * pRoot, Vec_Ptr_t * vSuper )
134 {
135  assert( !Hop_IsComplement(pRoot) );
136  Vec_PtrClear( vSuper );
137  Hop_ObjCollectMulti_rec( pRoot, pRoot, vSuper );
138 }
139 
140 /**Function*************************************************************
141 
142  Synopsis [Returns 1 if the node is the root of MUX or EXOR/NEXOR.]
143 
144  Description []
145 
146  SideEffects []
147 
148  SeeAlso []
149 
150 ***********************************************************************/
152 {
153  Hop_Obj_t * pNode0, * pNode1;
154  // check that the node is regular
155  assert( !Hop_IsComplement(pNode) );
156  // if the node is not AND, this is not MUX
157  if ( !Hop_ObjIsAnd(pNode) )
158  return 0;
159  // if the children are not complemented, this is not MUX
160  if ( !Hop_ObjFaninC0(pNode) || !Hop_ObjFaninC1(pNode) )
161  return 0;
162  // get children
163  pNode0 = Hop_ObjFanin0(pNode);
164  pNode1 = Hop_ObjFanin1(pNode);
165  // if the children are not ANDs, this is not MUX
166  if ( !Hop_ObjIsAnd(pNode0) || !Hop_ObjIsAnd(pNode1) )
167  return 0;
168  // otherwise the node is MUX iff it has a pair of equal grandchildren
169  return (Hop_ObjFanin0(pNode0) == Hop_ObjFanin0(pNode1) && (Hop_ObjFaninC0(pNode0) ^ Hop_ObjFaninC0(pNode1))) ||
170  (Hop_ObjFanin0(pNode0) == Hop_ObjFanin1(pNode1) && (Hop_ObjFaninC0(pNode0) ^ Hop_ObjFaninC1(pNode1))) ||
171  (Hop_ObjFanin1(pNode0) == Hop_ObjFanin0(pNode1) && (Hop_ObjFaninC1(pNode0) ^ Hop_ObjFaninC0(pNode1))) ||
172  (Hop_ObjFanin1(pNode0) == Hop_ObjFanin1(pNode1) && (Hop_ObjFaninC1(pNode0) ^ Hop_ObjFaninC1(pNode1)));
173 }
174 
175 
176 /**Function*************************************************************
177 
178  Synopsis [Recognizes what nodes are inputs of the EXOR.]
179 
180  Description []
181 
182  SideEffects []
183 
184  SeeAlso []
185 
186 ***********************************************************************/
187 int Hop_ObjRecognizeExor( Hop_Obj_t * pObj, Hop_Obj_t ** ppFan0, Hop_Obj_t ** ppFan1 )
188 {
189  Hop_Obj_t * p0, * p1;
190  assert( !Hop_IsComplement(pObj) );
191  if ( !Hop_ObjIsNode(pObj) )
192  return 0;
193  if ( Hop_ObjIsExor(pObj) )
194  {
195  *ppFan0 = Hop_ObjChild0(pObj);
196  *ppFan1 = Hop_ObjChild1(pObj);
197  return 1;
198  }
199  assert( Hop_ObjIsAnd(pObj) );
200  p0 = Hop_ObjChild0(pObj);
201  p1 = Hop_ObjChild1(pObj);
202  if ( !Hop_IsComplement(p0) || !Hop_IsComplement(p1) )
203  return 0;
204  p0 = Hop_Regular(p0);
205  p1 = Hop_Regular(p1);
206  if ( !Hop_ObjIsAnd(p0) || !Hop_ObjIsAnd(p1) )
207  return 0;
208  if ( Hop_ObjFanin0(p0) != Hop_ObjFanin0(p1) || Hop_ObjFanin1(p0) != Hop_ObjFanin1(p1) )
209  return 0;
210  if ( Hop_ObjFaninC0(p0) == Hop_ObjFaninC0(p1) || Hop_ObjFaninC1(p0) == Hop_ObjFaninC1(p1) )
211  return 0;
212  *ppFan0 = Hop_ObjChild0(p0);
213  *ppFan1 = Hop_ObjChild1(p0);
214  return 1;
215 }
216 
217 /**Function*************************************************************
218 
219  Synopsis [Recognizes what nodes are control and data inputs of a MUX.]
220 
221  Description [If the node is a MUX, returns the control variable C.
222  Assigns nodes T and E to be the then and else variables of the MUX.
223  Node C is never complemented. Nodes T and E can be complemented.
224  This function also recognizes EXOR/NEXOR gates as MUXes.]
225 
226  SideEffects []
227 
228  SeeAlso []
229 
230 ***********************************************************************/
231 Hop_Obj_t * Hop_ObjRecognizeMux( Hop_Obj_t * pNode, Hop_Obj_t ** ppNodeT, Hop_Obj_t ** ppNodeE )
232 {
233  Hop_Obj_t * pNode0, * pNode1;
234  assert( !Hop_IsComplement(pNode) );
235  assert( Hop_ObjIsMuxType(pNode) );
236  // get children
237  pNode0 = Hop_ObjFanin0(pNode);
238  pNode1 = Hop_ObjFanin1(pNode);
239 
240  // find the control variable
241  if ( Hop_ObjFanin1(pNode0) == Hop_ObjFanin1(pNode1) && (Hop_ObjFaninC1(pNode0) ^ Hop_ObjFaninC1(pNode1)) )
242  {
243 // if ( Fraig_IsComplement(pNode1->p2) )
244  if ( Hop_ObjFaninC1(pNode0) )
245  { // pNode2->p2 is positive phase of C
246  *ppNodeT = Hop_Not(Hop_ObjChild0(pNode1));//pNode2->p1);
247  *ppNodeE = Hop_Not(Hop_ObjChild0(pNode0));//pNode1->p1);
248  return Hop_ObjChild1(pNode1);//pNode2->p2;
249  }
250  else
251  { // pNode1->p2 is positive phase of C
252  *ppNodeT = Hop_Not(Hop_ObjChild0(pNode0));//pNode1->p1);
253  *ppNodeE = Hop_Not(Hop_ObjChild0(pNode1));//pNode2->p1);
254  return Hop_ObjChild1(pNode0);//pNode1->p2;
255  }
256  }
257  else if ( Hop_ObjFanin0(pNode0) == Hop_ObjFanin0(pNode1) && (Hop_ObjFaninC0(pNode0) ^ Hop_ObjFaninC0(pNode1)) )
258  {
259 // if ( Fraig_IsComplement(pNode1->p1) )
260  if ( Hop_ObjFaninC0(pNode0) )
261  { // pNode2->p1 is positive phase of C
262  *ppNodeT = Hop_Not(Hop_ObjChild1(pNode1));//pNode2->p2);
263  *ppNodeE = Hop_Not(Hop_ObjChild1(pNode0));//pNode1->p2);
264  return Hop_ObjChild0(pNode1);//pNode2->p1;
265  }
266  else
267  { // pNode1->p1 is positive phase of C
268  *ppNodeT = Hop_Not(Hop_ObjChild1(pNode0));//pNode1->p2);
269  *ppNodeE = Hop_Not(Hop_ObjChild1(pNode1));//pNode2->p2);
270  return Hop_ObjChild0(pNode0);//pNode1->p1;
271  }
272  }
273  else if ( Hop_ObjFanin0(pNode0) == Hop_ObjFanin1(pNode1) && (Hop_ObjFaninC0(pNode0) ^ Hop_ObjFaninC1(pNode1)) )
274  {
275 // if ( Fraig_IsComplement(pNode1->p1) )
276  if ( Hop_ObjFaninC0(pNode0) )
277  { // pNode2->p2 is positive phase of C
278  *ppNodeT = Hop_Not(Hop_ObjChild0(pNode1));//pNode2->p1);
279  *ppNodeE = Hop_Not(Hop_ObjChild1(pNode0));//pNode1->p2);
280  return Hop_ObjChild1(pNode1);//pNode2->p2;
281  }
282  else
283  { // pNode1->p1 is positive phase of C
284  *ppNodeT = Hop_Not(Hop_ObjChild1(pNode0));//pNode1->p2);
285  *ppNodeE = Hop_Not(Hop_ObjChild0(pNode1));//pNode2->p1);
286  return Hop_ObjChild0(pNode0);//pNode1->p1;
287  }
288  }
289  else if ( Hop_ObjFanin1(pNode0) == Hop_ObjFanin0(pNode1) && (Hop_ObjFaninC1(pNode0) ^ Hop_ObjFaninC0(pNode1)) )
290  {
291 // if ( Fraig_IsComplement(pNode1->p2) )
292  if ( Hop_ObjFaninC1(pNode0) )
293  { // pNode2->p1 is positive phase of C
294  *ppNodeT = Hop_Not(Hop_ObjChild1(pNode1));//pNode2->p2);
295  *ppNodeE = Hop_Not(Hop_ObjChild0(pNode0));//pNode1->p1);
296  return Hop_ObjChild0(pNode1);//pNode2->p1;
297  }
298  else
299  { // pNode1->p2 is positive phase of C
300  *ppNodeT = Hop_Not(Hop_ObjChild0(pNode0));//pNode1->p1);
301  *ppNodeE = Hop_Not(Hop_ObjChild1(pNode1));//pNode2->p2);
302  return Hop_ObjChild1(pNode0);//pNode1->p2;
303  }
304  }
305  assert( 0 ); // this is not MUX
306  return NULL;
307 }
308 
309 
310 /**Function*************************************************************
311 
312  Synopsis [Prints Eqn formula for the AIG rooted at this node.]
313 
314  Description [The formula is in terms of PIs, which should have
315  their names assigned in pObj->pData fields.]
316 
317  SideEffects []
318 
319  SeeAlso []
320 
321 ***********************************************************************/
322 void Hop_ObjPrintEqn( FILE * pFile, Hop_Obj_t * pObj, Vec_Vec_t * vLevels, int Level )
323 {
324  Vec_Ptr_t * vSuper;
325  Hop_Obj_t * pFanin;
326  int fCompl, i;
327  // store the complemented attribute
328  fCompl = Hop_IsComplement(pObj);
329  pObj = Hop_Regular(pObj);
330  // constant case
331  if ( Hop_ObjIsConst1(pObj) )
332  {
333  fprintf( pFile, "%d", !fCompl );
334  return;
335  }
336  // PI case
337  if ( Hop_ObjIsPi(pObj) )
338  {
339  fprintf( pFile, "%s%s", fCompl? "!" : "", (char*)pObj->pData );
340  return;
341  }
342  // AND case
343  Vec_VecExpand( vLevels, Level );
344  vSuper = Vec_VecEntry(vLevels, Level);
345  Hop_ObjCollectMulti( pObj, vSuper );
346  fprintf( pFile, "%s", (Level==0? "" : "(") );
347  Vec_PtrForEachEntry( Hop_Obj_t *, vSuper, pFanin, i )
348  {
349  Hop_ObjPrintEqn( pFile, Hop_NotCond(pFanin, fCompl), vLevels, Level+1 );
350  if ( i < Vec_PtrSize(vSuper) - 1 )
351  fprintf( pFile, " %s ", fCompl? "+" : "*" );
352  }
353  fprintf( pFile, "%s", (Level==0? "" : ")") );
354  return;
355 }
356 
357 /**Function*************************************************************
358 
359  Synopsis [Prints Verilog formula for the AIG rooted at this node.]
360 
361  Description [The formula is in terms of PIs, which should have
362  their names assigned in pObj->pData fields.]
363 
364  SideEffects []
365 
366  SeeAlso []
367 
368 ***********************************************************************/
369 void Hop_ObjPrintVerilog( FILE * pFile, Hop_Obj_t * pObj, Vec_Vec_t * vLevels, int Level )
370 {
371  Vec_Ptr_t * vSuper;
372  Hop_Obj_t * pFanin, * pFanin0, * pFanin1, * pFaninC;
373  int fCompl, i;
374  // store the complemented attribute
375  fCompl = Hop_IsComplement(pObj);
376  pObj = Hop_Regular(pObj);
377  // constant case
378  if ( Hop_ObjIsConst1(pObj) )
379  {
380  fprintf( pFile, "1\'b%d", !fCompl );
381  return;
382  }
383  // PI case
384  if ( Hop_ObjIsPi(pObj) )
385  {
386  fprintf( pFile, "%s%s", fCompl? "~" : "", (char*)pObj->pData );
387  return;
388  }
389  // EXOR case
390  if ( Hop_ObjIsExor(pObj) )
391  {
392  Vec_VecExpand( vLevels, Level );
393  vSuper = Vec_VecEntry( vLevels, Level );
394  Hop_ObjCollectMulti( pObj, vSuper );
395  fprintf( pFile, "%s", (Level==0? "" : "(") );
396  Vec_PtrForEachEntry( Hop_Obj_t *, vSuper, pFanin, i )
397  {
398  Hop_ObjPrintVerilog( pFile, Hop_NotCond(pFanin, (fCompl && i==0)), vLevels, Level+1 );
399  if ( i < Vec_PtrSize(vSuper) - 1 )
400  fprintf( pFile, " ^ " );
401  }
402  fprintf( pFile, "%s", (Level==0? "" : ")") );
403  return;
404  }
405  // MUX case
406  if ( Hop_ObjIsMuxType(pObj) )
407  {
408  if ( Hop_ObjRecognizeExor( pObj, &pFanin0, &pFanin1 ) )
409  {
410  fprintf( pFile, "%s", (Level==0? "" : "(") );
411  Hop_ObjPrintVerilog( pFile, Hop_NotCond(pFanin0, fCompl), vLevels, Level+1 );
412  fprintf( pFile, " ^ " );
413  Hop_ObjPrintVerilog( pFile, pFanin1, vLevels, Level+1 );
414  fprintf( pFile, "%s", (Level==0? "" : ")") );
415  }
416  else
417  {
418  pFaninC = Hop_ObjRecognizeMux( pObj, &pFanin1, &pFanin0 );
419  fprintf( pFile, "%s", (Level==0? "" : "(") );
420  Hop_ObjPrintVerilog( pFile, pFaninC, vLevels, Level+1 );
421  fprintf( pFile, " ? " );
422  Hop_ObjPrintVerilog( pFile, Hop_NotCond(pFanin1, fCompl), vLevels, Level+1 );
423  fprintf( pFile, " : " );
424  Hop_ObjPrintVerilog( pFile, Hop_NotCond(pFanin0, fCompl), vLevels, Level+1 );
425  fprintf( pFile, "%s", (Level==0? "" : ")") );
426  }
427  return;
428  }
429  // AND case
430  Vec_VecExpand( vLevels, Level );
431  vSuper = Vec_VecEntry(vLevels, Level);
432  Hop_ObjCollectMulti( pObj, vSuper );
433  fprintf( pFile, "%s", (Level==0? "" : "(") );
434  Vec_PtrForEachEntry( Hop_Obj_t *, vSuper, pFanin, i )
435  {
436  Hop_ObjPrintVerilog( pFile, Hop_NotCond(pFanin, fCompl), vLevels, Level+1 );
437  if ( i < Vec_PtrSize(vSuper) - 1 )
438  fprintf( pFile, " %s ", fCompl? "|" : "&" );
439  }
440  fprintf( pFile, "%s", (Level==0? "" : ")") );
441  return;
442 }
443 
444 
445 /**Function*************************************************************
446 
447  Synopsis [Prints node in HAIG.]
448 
449  Description []
450 
451  SideEffects []
452 
453  SeeAlso []
454 
455 ***********************************************************************/
456 void Hop_ObjPrintVerbose( Hop_Obj_t * pObj, int fHaig )
457 {
458  assert( !Hop_IsComplement(pObj) );
459  printf( "Node %p : ", pObj );
460  if ( Hop_ObjIsConst1(pObj) )
461  printf( "constant 1" );
462  else if ( Hop_ObjIsPi(pObj) )
463  printf( "PI" );
464  else
465  printf( "AND( %p%s, %p%s )",
466  Hop_ObjFanin0(pObj), (Hop_ObjFaninC0(pObj)? "\'" : " "),
467  Hop_ObjFanin1(pObj), (Hop_ObjFaninC1(pObj)? "\'" : " ") );
468  printf( " (refs = %3d)", Hop_ObjRefs(pObj) );
469 }
470 
471 /**Function*************************************************************
472 
473  Synopsis [Prints node in HAIG.]
474 
475  Description []
476 
477  SideEffects []
478 
479  SeeAlso []
480 
481 ***********************************************************************/
482 void Hop_ManPrintVerbose( Hop_Man_t * p, int fHaig )
483 {
484  Vec_Ptr_t * vNodes;
485  Hop_Obj_t * pObj;
486  int i;
487  printf( "PIs: " );
488  Hop_ManForEachPi( p, pObj, i )
489  printf( " %p", pObj );
490  printf( "\n" );
491  vNodes = Hop_ManDfs( p );
492  Vec_PtrForEachEntry( Hop_Obj_t *, vNodes, pObj, i )
493  Hop_ObjPrintVerbose( pObj, fHaig ), printf( "\n" );
494  printf( "\n" );
495  Vec_PtrFree( vNodes );
496 }
497 
498 /**Function*************************************************************
499 
500  Synopsis [Writes the AIG into the BLIF file.]
501 
502  Description []
503 
504  SideEffects []
505 
506  SeeAlso []
507 
508 ***********************************************************************/
509 void Hop_ManDumpBlif( Hop_Man_t * p, char * pFileName )
510 {
511  FILE * pFile;
512  Vec_Ptr_t * vNodes;
513  Hop_Obj_t * pObj, * pConst1 = NULL;
514  int i, nDigits, Counter = 0;
515  if ( Hop_ManPoNum(p) == 0 )
516  {
517  printf( "Hop_ManDumpBlif(): AIG manager does not have POs.\n" );
518  return;
519  }
520  // collect nodes in the DFS order
521  vNodes = Hop_ManDfs( p );
522  // assign IDs to objects
523  Hop_ManConst1(p)->pData = (void *)(ABC_PTRUINT_T)Counter++;
524  Hop_ManForEachPi( p, pObj, i )
525  pObj->pData = (void *)(ABC_PTRUINT_T)Counter++;
526  Hop_ManForEachPo( p, pObj, i )
527  pObj->pData = (void *)(ABC_PTRUINT_T)Counter++;
528  Vec_PtrForEachEntry( Hop_Obj_t *, vNodes, pObj, i )
529  pObj->pData = (void *)(ABC_PTRUINT_T)Counter++;
530  nDigits = Hop_Base10Log( Counter );
531  // write the file
532  pFile = fopen( pFileName, "w" );
533  fprintf( pFile, "# BLIF file written by procedure Hop_ManDumpBlif() in ABC\n" );
534  fprintf( pFile, "# http://www.eecs.berkeley.edu/~alanmi/abc/\n" );
535  fprintf( pFile, ".model test\n" );
536  // write PIs
537  fprintf( pFile, ".inputs" );
538  Hop_ManForEachPi( p, pObj, i )
539  fprintf( pFile, " n%0*d", nDigits, (int)(ABC_PTRUINT_T)pObj->pData );
540  fprintf( pFile, "\n" );
541  // write POs
542  fprintf( pFile, ".outputs" );
543  Hop_ManForEachPo( p, pObj, i )
544  fprintf( pFile, " n%0*d", nDigits, (int)(ABC_PTRUINT_T)pObj->pData );
545  fprintf( pFile, "\n" );
546  // write nodes
547  Vec_PtrForEachEntry( Hop_Obj_t *, vNodes, pObj, i )
548  {
549  fprintf( pFile, ".names n%0*d n%0*d n%0*d\n",
550  nDigits, (int)(ABC_PTRUINT_T)Hop_ObjFanin0(pObj)->pData,
551  nDigits, (int)(ABC_PTRUINT_T)Hop_ObjFanin1(pObj)->pData,
552  nDigits, (int)(ABC_PTRUINT_T)pObj->pData );
553  fprintf( pFile, "%d%d 1\n", !Hop_ObjFaninC0(pObj), !Hop_ObjFaninC1(pObj) );
554  }
555  // write POs
556  Hop_ManForEachPo( p, pObj, i )
557  {
558  fprintf( pFile, ".names n%0*d n%0*d\n",
559  nDigits, (int)(ABC_PTRUINT_T)Hop_ObjFanin0(pObj)->pData,
560  nDigits, (int)(ABC_PTRUINT_T)pObj->pData );
561  fprintf( pFile, "%d 1\n", !Hop_ObjFaninC0(pObj) );
562  if ( Hop_ObjIsConst1(Hop_ObjFanin0(pObj)) )
563  pConst1 = Hop_ManConst1(p);
564  }
565  if ( pConst1 )
566  fprintf( pFile, ".names n%0*d\n 1\n", nDigits, (int)(ABC_PTRUINT_T)pConst1->pData );
567  fprintf( pFile, ".end\n\n" );
568  fclose( pFile );
569  Vec_PtrFree( vNodes );
570 }
571 
572 ////////////////////////////////////////////////////////////////////////
573 /// END OF FILE ///
574 ////////////////////////////////////////////////////////////////////////
575 
576 
578 
static Hop_Obj_t * Hop_ObjChild0(Hop_Obj_t *pObj)
Definition: hop.h:184
static Hop_Obj_t * Hop_ObjFanin1(Hop_Obj_t *pObj)
Definition: hop.h:183
int Hop_ObjRecognizeExor(Hop_Obj_t *pObj, Hop_Obj_t **ppFan0, Hop_Obj_t **ppFan1)
Definition: hopUtil.c:187
int Hop_ObjIsMuxType(Hop_Obj_t *pNode)
Definition: hopUtil.c:151
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
Vec_Ptr_t * Hop_ManDfs(Hop_Man_t *p)
Definition: hopDfs.c:68
static int Hop_ObjRefs(Hop_Obj_t *pObj)
Definition: hop.h:176
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Definition: vecVec.h:42
static Hop_Obj_t * Hop_ManConst1(Hop_Man_t *p)
Definition: hop.h:132
void Hop_ManPrintVerbose(Hop_Man_t *p, int fHaig)
Definition: hopUtil.c:482
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Vec_PtrPushUnique(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:656
static int Hop_ObjIsPi(Hop_Obj_t *pObj)
Definition: hop.h:156
#define Hop_ManForEachNode(p, pObj, i)
Definition: hop.h:265
static int Hop_ObjIsNode(Hop_Obj_t *pObj)
Definition: hop.h:160
static Hop_Type_t Hop_ObjType(Hop_Obj_t *pObj)
Definition: hop.h:153
#define Hop_ManForEachPi(p, pObj, i)
ITERATORS ///.
Definition: hop.h:259
#define Hop_ManForEachPo(p, pObj, i)
Definition: hop.h:262
static int Hop_ManPoNum(Hop_Man_t *p)
Definition: hop.h:146
static int Hop_ObjFaninC1(Hop_Obj_t *pObj)
Definition: hop.h:181
void Hop_ObjPrintVerbose(Hop_Obj_t *pObj, int fHaig)
Definition: hopUtil.c:456
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
static Hop_Obj_t * Hop_Not(Hop_Obj_t *p)
Definition: hop.h:127
static int Hop_ObjIsAnd(Hop_Obj_t *pObj)
Definition: hop.h:158
Definition: hop.h:65
void Hop_ManDumpBlif(Hop_Man_t *p, char *pFileName)
Definition: hopUtil.c:509
void Hop_ObjPrintEqn(FILE *pFile, Hop_Obj_t *pObj, Vec_Vec_t *vLevels, int Level)
Definition: hopUtil.c:322
static int Hop_Base10Log(unsigned n)
Definition: hop.h:124
#define ABC_NAMESPACE_IMPL_END
Definition: abc_global.h:108
void Hop_ObjPrintVerilog(FILE *pFile, Hop_Obj_t *pObj, Vec_Vec_t *vLevels, int Level)
Definition: hopUtil.c:369
static Hop_Obj_t * Hop_ObjChild1(Hop_Obj_t *pObj)
Definition: hop.h:185
ABC_NAMESPACE_IMPL_START void Hop_ManIncrementTravId(Hop_Man_t *p)
DECLARATIONS ///.
Definition: hopUtil.c:45
static int Hop_IsComplement(Hop_Obj_t *p)
Definition: hop.h:129
static int Counter
static int Hop_ObjIsPo(Hop_Obj_t *pObj)
Definition: hop.h:157
void * pData
Definition: hop.h:68
static int Hop_ObjIsExor(Hop_Obj_t *pObj)
Definition: hop.h:159
static Hop_Obj_t * Hop_ObjFanin0(Hop_Obj_t *pObj)
Definition: hop.h:182
static int Hop_ObjIsConst1(Hop_Obj_t *pObj)
Definition: hop.h:155
#define ABC_NAMESPACE_IMPL_START
Definition: abc_global.h:107
Hop_Obj_t * Hop_ObjRecognizeMux(Hop_Obj_t *pNode, Hop_Obj_t **ppNodeT, Hop_Obj_t **ppNodeE)
Definition: hopUtil.c:231
static int Hop_ObjFaninC0(Hop_Obj_t *pObj)
Definition: hop.h:180
static void Vec_VecExpand(Vec_Vec_t *p, int Level)
Definition: vecVec.h:190
static Hop_Obj_t * Hop_NotCond(Hop_Obj_t *p, int c)
Definition: hop.h:128
void Hop_ManCleanData(Hop_Man_t *p)
Definition: hopUtil.c:63
#define assert(ex)
Definition: util_old.h:213
static void Vec_PtrClear(Vec_Ptr_t *p)
Definition: vecPtr.h:545
static Vec_Ptr_t * Vec_VecEntry(Vec_Vec_t *p, int i)
Definition: vecVec.h:271
void Hop_ObjCollectMulti_rec(Hop_Obj_t *pRoot, Hop_Obj_t *pObj, Vec_Ptr_t *vSuper)
Definition: hopUtil.c:111
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
static Hop_Obj_t * Hop_Regular(Hop_Obj_t *p)
Definition: hop.h:126
typedefABC_NAMESPACE_HEADER_START struct Hop_Man_t_ Hop_Man_t
INCLUDES ///.
Definition: hop.h:49
void Hop_ObjCleanData_rec(Hop_Obj_t *pObj)
Definition: hopUtil.c:88
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
void Hop_ObjCollectMulti(Hop_Obj_t *pRoot, Vec_Ptr_t *vSuper)
Definition: hopUtil.c:133