abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
abcNames.c
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [abcNames.c]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [Network and node package.]
8 
9  Synopsis [Procedures working with net and node names.]
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - June 20, 2005.]
16 
17  Revision [$Id: abcNames.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #include "abc.h"
22 
24 
25 
26 ////////////////////////////////////////////////////////////////////////
27 /// DECLARATIONS ///
28 ////////////////////////////////////////////////////////////////////////
29 
30 ////////////////////////////////////////////////////////////////////////
31 /// FUNCTION DEFINITIONS ///
32 ////////////////////////////////////////////////////////////////////////
33 
34 /**Function*************************************************************
35 
36  Synopsis [Returns the unique name for the object.]
37 
38  Description [If the name previously did not exist, creates a new unique
39  name but does not assign this name to the object. The temporary unique
40  name is stored in a static buffer inside this procedure. It is important
41  that the name is used before the function is called again!]
42 
43  SideEffects []
44 
45  SeeAlso []
46 
47 ***********************************************************************/
48 char * Abc_ObjName( Abc_Obj_t * pObj )
49 {
50  return Nm_ManCreateUniqueName( pObj->pNtk->pManName, pObj->Id );
51 }
52 
53 /**Function*************************************************************
54 
55  Synopsis [Assigns the given name to the object.]
56 
57  Description [The object should not have a name assigned. The same
58  name may be used for several objects, which they share the same net
59  in the original netlist. (For example, latch output and primary output
60  may have the same name.) This procedure returns the pointer to the
61  internally stored representation of the given name.]
62 
63  SideEffects []
64 
65  SeeAlso []
66 
67 ***********************************************************************/
68 char * Abc_ObjAssignName( Abc_Obj_t * pObj, char * pName, char * pSuffix )
69 {
70  assert( pName != NULL );
71  return Nm_ManStoreIdName( pObj->pNtk->pManName, pObj->Id, pObj->Type, pName, pSuffix );
72 }
73 
74 /**Function*************************************************************
75 
76  Synopsis [Appends name to the prefix]
77 
78  Description []
79 
80  SideEffects []
81 
82  SeeAlso []
83 
84 ***********************************************************************/
85 char * Abc_ObjNamePrefix( Abc_Obj_t * pObj, char * pPrefix )
86 {
87  static char Buffer[2000];
88  sprintf( Buffer, "%s%s", pPrefix, Abc_ObjName(pObj) );
89  return Buffer;
90 }
91 
92 /**Function*************************************************************
93 
94  Synopsis [Appends suffic to the name.]
95 
96  Description []
97 
98  SideEffects []
99 
100  SeeAlso []
101 
102 ***********************************************************************/
103 char * Abc_ObjNameSuffix( Abc_Obj_t * pObj, char * pSuffix )
104 {
105  static char Buffer[2000];
106  sprintf( Buffer, "%s%s", Abc_ObjName(pObj), pSuffix );
107  return Buffer;
108 }
109 
110 /**Function*************************************************************
111 
112  Synopsis [Returns the dummy PI name.]
113 
114  Description []
115 
116  SideEffects []
117 
118  SeeAlso []
119 
120 ***********************************************************************/
121 char * Abc_ObjNameDummy( char * pPrefix, int Num, int nDigits )
122 {
123  static char Buffer[2000];
124  sprintf( Buffer, "%s%0*d", pPrefix, nDigits, Num );
125  return Buffer;
126 }
127 
128 /**Function*************************************************************
129 
130  Synopsis [Tranfers names to the old network.]
131 
132  Description [Assumes that the new nodes are attached using pObj->pCopy.]
133 
134  SideEffects []
135 
136  SeeAlso []
137 
138 ***********************************************************************/
139 void Abc_NtkTrasferNames( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkNew )
140 {
141  Abc_Obj_t * pObj;
142  int i;
143  assert( Abc_NtkPiNum(pNtk) == Abc_NtkPiNum(pNtkNew) );
144  assert( Abc_NtkPoNum(pNtk) == Abc_NtkPoNum(pNtkNew) );
145  assert( Abc_NtkBoxNum(pNtk) == Abc_NtkBoxNum(pNtkNew) );
146  assert( Nm_ManNumEntries(pNtk->pManName) > 0 );
147  assert( Nm_ManNumEntries(pNtkNew->pManName) == 0 );
148  // copy the CI/CO/box names
149  Abc_NtkForEachCi( pNtk, pObj, i )
150  Abc_ObjAssignName( pObj->pCopy, Abc_ObjName(Abc_ObjFanout0Ntk(pObj)), NULL );
151  Abc_NtkForEachCo( pNtk, pObj, i )
152  Abc_ObjAssignName( pObj->pCopy, Abc_ObjName(Abc_ObjFanin0Ntk(pObj)), NULL );
153  Abc_NtkForEachBox( pNtk, pObj, i )
154  Abc_ObjAssignName( pObj->pCopy, Abc_ObjName(pObj), NULL );
155 }
156 
157 /**Function*************************************************************
158 
159  Synopsis [Tranfers names to the old network.]
160 
161  Description [Assumes that the new nodes are attached using pObj->pCopy.]
162 
163  SideEffects []
164 
165  SeeAlso []
166 
167 ***********************************************************************/
169 {
170  Abc_Obj_t * pObj;
171  int i;
172  assert( Abc_NtkPiNum(pNtk) == Abc_NtkPiNum(pNtkNew) );
173  assert( Abc_NtkPoNum(pNtk) == Abc_NtkPoNum(pNtkNew) );
174  assert( Nm_ManNumEntries(pNtk->pManName) > 0 );
175  assert( Nm_ManNumEntries(pNtkNew->pManName) == 0 );
176  // copy the CI/CO/box name and skip latches and theirs inputs/outputs
177  Abc_NtkForEachCi( pNtk, pObj, i )
178  if ( Abc_ObjFaninNum(pObj) == 0 || !Abc_ObjIsLatch(Abc_ObjFanin0(pObj)) )
179  Abc_ObjAssignName( pObj->pCopy, Abc_ObjName(Abc_ObjFanout0Ntk(pObj)), NULL );
180  Abc_NtkForEachCo( pNtk, pObj, i )
181  if ( Abc_ObjFanoutNum(pObj) == 0 || !Abc_ObjIsLatch(Abc_ObjFanout0(pObj)) )
182  Abc_ObjAssignName( pObj->pCopy, Abc_ObjName(Abc_ObjFanin0Ntk(pObj)), NULL );
183  Abc_NtkForEachBox( pNtk, pObj, i )
184  if ( !Abc_ObjIsLatch(pObj) )
185  Abc_ObjAssignName( pObj->pCopy, Abc_ObjName(pObj), NULL );
186 }
187 
188 /**Function*************************************************************
189 
190  Synopsis [Gets fanin node names.]
191 
192  Description []
193 
194  SideEffects []
195 
196  SeeAlso []
197 
198 ***********************************************************************/
200 {
201  Vec_Ptr_t * vNodes;
202  Abc_Obj_t * pFanin;
203  int i;
204  vNodes = Vec_PtrAlloc( 100 );
205  Abc_ObjForEachFanin( pNode, pFanin, i )
206  Vec_PtrPush( vNodes, Abc_UtilStrsav(Abc_ObjName(pFanin)) );
207  return vNodes;
208 }
209 
210 /**Function*************************************************************
211 
212  Synopsis [Gets fanin node names.]
213 
214  Description []
215 
216  SideEffects []
217 
218  SeeAlso []
219 
220 ***********************************************************************/
222 {
223  Vec_Ptr_t * vNames;
224  char Buffer[5];
225  int i;
226 
227  vNames = Vec_PtrAlloc( nNames );
228  for ( i = 0; i < nNames; i++ )
229  {
230  if ( nNames < 26 )
231  {
232  Buffer[0] = 'a' + i;
233  Buffer[1] = 0;
234  }
235  else
236  {
237  Buffer[0] = 'a' + i%26;
238  Buffer[1] = '0' + i/26;
239  Buffer[2] = 0;
240  }
241  Vec_PtrPush( vNames, Extra_UtilStrsav(Buffer) );
242  }
243  return vNames;
244 }
245 
246 /**Function*************************************************************
247 
248  Synopsis [Gets fanin node names.]
249 
250  Description []
251 
252  SideEffects []
253 
254  SeeAlso []
255 
256 ***********************************************************************/
257 void Abc_NodeFreeNames( Vec_Ptr_t * vNames )
258 {
259  int i;
260  if ( vNames == NULL )
261  return;
262  for ( i = 0; i < vNames->nSize; i++ )
263  ABC_FREE( vNames->pArray[i] );
264  Vec_PtrFree( vNames );
265 }
266 
267 /**Function*************************************************************
268 
269  Synopsis [Collects the CI or CO names.]
270 
271  Description []
272 
273  SideEffects []
274 
275  SeeAlso []
276 
277 ***********************************************************************/
278 char ** Abc_NtkCollectCioNames( Abc_Ntk_t * pNtk, int fCollectCos )
279 {
280  Abc_Obj_t * pObj;
281  char ** ppNames;
282  int i;
283  if ( fCollectCos )
284  {
285  ppNames = ABC_ALLOC( char *, Abc_NtkCoNum(pNtk) );
286  Abc_NtkForEachCo( pNtk, pObj, i )
287  ppNames[i] = Abc_ObjName(pObj);
288  }
289  else
290  {
291  ppNames = ABC_ALLOC( char *, Abc_NtkCiNum(pNtk) );
292  Abc_NtkForEachCi( pNtk, pObj, i )
293  ppNames[i] = Abc_ObjName(pObj);
294  }
295  return ppNames;
296 }
297 
298 /**Function*************************************************************
299 
300  Synopsis [Procedure used for sorting the nodes in decreasing order of levels.]
301 
302  Description []
303 
304  SideEffects []
305 
306  SeeAlso []
307 
308 ***********************************************************************/
310 {
311  int Diff = strcmp( (char *)(*pp1)->pCopy, (char *)(*pp2)->pCopy );
312  if ( Diff < 0 )
313  return -1;
314  if ( Diff > 0 )
315  return 1;
316  Diff = (*pp1)->Id - (*pp2)->Id;
317  if ( Diff < 0 )
318  return -1;
319  if ( Diff > 0 )
320  return 1;
321  return 0;
322 }
323 
324 /**Function*************************************************************
325 
326  Synopsis [Orders PIs/POs/latches alphabetically.]
327 
328  Description []
329 
330  SideEffects []
331 
332  SeeAlso []
333 
334 ***********************************************************************/
335 void Abc_NtkOrderObjsByName( Abc_Ntk_t * pNtk, int fComb )
336 {
337  Abc_Obj_t * pObj;
338  int i;
340  // temporarily store the names in the copy field
341  Abc_NtkForEachPi( pNtk, pObj, i )
342  pObj->pCopy = (Abc_Obj_t *)Abc_ObjName(pObj);
343  Abc_NtkForEachPo( pNtk, pObj, i )
344  pObj->pCopy = (Abc_Obj_t *)Abc_ObjName(pObj);
345  Abc_NtkForEachBox( pNtk, pObj, i )
346  pObj->pCopy = (Abc_Obj_t *)Abc_ObjName(Abc_ObjFanout0(pObj));
347  // order objects alphabetically
348  qsort( (void *)Vec_PtrArray(pNtk->vPis), Vec_PtrSize(pNtk->vPis), sizeof(Abc_Obj_t *),
349  (int (*)(const void *, const void *)) Abc_NodeCompareNames );
350  qsort( (void *)Vec_PtrArray(pNtk->vPos), Vec_PtrSize(pNtk->vPos), sizeof(Abc_Obj_t *),
351  (int (*)(const void *, const void *)) Abc_NodeCompareNames );
352  // if the comparison if combinational (latches as PIs/POs), order them too
353  if ( fComb )
354  qsort( (void *)Vec_PtrArray(pNtk->vBoxes), Vec_PtrSize(pNtk->vBoxes), sizeof(Abc_Obj_t *),
355  (int (*)(const void *, const void *)) Abc_NodeCompareNames );
356  // order CIs/COs first PIs/POs(Asserts) then latches
357  Abc_NtkOrderCisCos( pNtk );
358  // clean the copy fields
359  Abc_NtkForEachPi( pNtk, pObj, i )
360  pObj->pCopy = NULL;
361  Abc_NtkForEachPo( pNtk, pObj, i )
362  pObj->pCopy = NULL;
363  Abc_NtkForEachBox( pNtk, pObj, i )
364  pObj->pCopy = NULL;
365 }
366 
367 /**Function*************************************************************
368 
369  Synopsis [Adds dummy names.]
370 
371  Description []
372 
373  SideEffects []
374 
375  SeeAlso []
376 
377 ***********************************************************************/
379 {
380  Abc_Obj_t * pObj;
381  int nDigits, i;
382  nDigits = Abc_Base10Log( Abc_NtkPiNum(pNtk) );
383  Abc_NtkForEachPi( pNtk, pObj, i )
384  Abc_ObjAssignName( pObj, Abc_ObjNameDummy("pi", i, nDigits), NULL );
385 }
386 
387 /**Function*************************************************************
388 
389  Synopsis [Adds dummy names.]
390 
391  Description []
392 
393  SideEffects []
394 
395  SeeAlso []
396 
397 ***********************************************************************/
399 {
400  Abc_Obj_t * pObj;
401  int nDigits, i;
402  nDigits = Abc_Base10Log( Abc_NtkPoNum(pNtk) );
403  Abc_NtkForEachPo( pNtk, pObj, i )
404  Abc_ObjAssignName( pObj, Abc_ObjNameDummy("po", i, nDigits), NULL );
405 }
406 
407 /**Function*************************************************************
408 
409  Synopsis [Adds dummy names.]
410 
411  Description []
412 
413  SideEffects []
414 
415  SeeAlso []
416 
417 ***********************************************************************/
419 {
420  char * pName, PrefLi[100], PrefLo[100];
421  Abc_Obj_t * pObj;
422  int nDigits, i, k, CountCur, CountMax = 0;
423  // if PIs/POs already have nodes with what looks like latch names
424  // we need to add different prefix for the new latches
425  Abc_NtkForEachPi( pNtk, pObj, i )
426  {
427  CountCur = 0;
428  pName = Abc_ObjName(pObj);
429  for ( k = 0; pName[k]; k++ )
430  if ( pName[k] == 'l' )
431  CountCur++;
432  else
433  break;
434  CountMax = Abc_MaxInt( CountMax, CountCur );
435  }
436  Abc_NtkForEachPo( pNtk, pObj, i )
437  {
438  CountCur = 0;
439  pName = Abc_ObjName(pObj);
440  for ( k = 0; pName[k]; k++ )
441  if ( pName[k] == 'l' )
442  CountCur++;
443  else
444  break;
445  CountMax = Abc_MaxInt( CountMax, CountCur );
446  }
447 //printf( "CountMax = %d\n", CountMax );
448  assert( CountMax < 100-2 );
449  for ( i = 0; i <= CountMax; i++ )
450  PrefLi[i] = PrefLo[i] = 'l';
451  PrefLi[i] = 'i';
452  PrefLo[i] = 'o';
453  PrefLi[i+1] = 0;
454  PrefLo[i+1] = 0;
455  // create latch names
456  assert( !Abc_NtkIsNetlist(pNtk) );
457  nDigits = Abc_Base10Log( Abc_NtkLatchNum(pNtk) );
458  Abc_NtkForEachLatch( pNtk, pObj, i )
459  {
460  Abc_ObjAssignName( pObj, Abc_ObjNameDummy("l", i, nDigits), NULL );
461  Abc_ObjAssignName( Abc_ObjFanin0(pObj), Abc_ObjNameDummy(PrefLi, i, nDigits), NULL );
462  Abc_ObjAssignName( Abc_ObjFanout0(pObj), Abc_ObjNameDummy(PrefLo, i, nDigits), NULL );
463  }
464 /*
465  nDigits = Abc_Base10Log( Abc_NtkBlackboxNum(pNtk) );
466  Abc_NtkForEachBlackbox( pNtk, pObj, i )
467  {
468  pName = Abc_ObjAssignName( pObj, Abc_ObjNameDummy("B", i, nDigits), NULL );
469  nDigitsF = Abc_Base10Log( Abc_ObjFaninNum(pObj) );
470  Abc_ObjForEachFanin( pObj, pTerm, k )
471  Abc_ObjAssignName( Abc_ObjFanin0(pObj), pName, Abc_ObjNameDummy("i", k, nDigitsF) );
472  nDigitsF = Abc_Base10Log( Abc_ObjFanoutNum(pObj) );
473  Abc_ObjForEachFanout( pObj, pTerm, k )
474  Abc_ObjAssignName( Abc_ObjFanin0(pObj), pName, Abc_ObjNameDummy("o", k, nDigitsF) );
475  }
476 */
477 }
478 
479 /**Function*************************************************************
480 
481  Synopsis [Replaces names by short names.]
482 
483  Description []
484 
485  SideEffects []
486 
487  SeeAlso []
488 
489 ***********************************************************************/
491 {
492  Nm_ManFree( pNtk->pManName );
493  pNtk->pManName = Nm_ManCreate( Abc_NtkCiNum(pNtk) + Abc_NtkCoNum(pNtk) + Abc_NtkBoxNum(pNtk) );
494  Abc_NtkAddDummyPiNames( pNtk );
495  Abc_NtkAddDummyPoNames( pNtk );
496  Abc_NtkAddDummyBoxNames( pNtk );
497 }
498 
499 /**Function*************************************************************
500 
501  Synopsis [Moves names from the other network.]
502 
503  Description []
504 
505  SideEffects []
506 
507  SeeAlso []
508 
509 ***********************************************************************/
510 void Abc_NtkMoveNames( Abc_Ntk_t * pNtk, Abc_Ntk_t * pOld )
511 {
512  Abc_Obj_t * pObj; int i;
513  Nm_ManFree( pNtk->pManName );
514  pNtk->pManName = Nm_ManCreate( Abc_NtkCiNum(pNtk) + Abc_NtkCoNum(pNtk) + Abc_NtkBoxNum(pNtk) );
515  Abc_NtkForEachPi( pNtk, pObj, i )
516  Abc_ObjAssignName( pObj, Abc_ObjName(Abc_NtkPi(pOld, i)), NULL );
517  Abc_NtkForEachPo( pNtk, pObj, i )
518  Abc_ObjAssignName( pObj, Abc_ObjName(Abc_NtkPo(pOld, i)), NULL );
519  Abc_NtkForEachLatch( pNtk, pObj, i )
520  {
523  }
524 }
525 
526 
527 /**Function*************************************************************
528 
529  Synopsis [Saves name IDs into a file.]
530 
531  Description []
532 
533  SideEffects []
534 
535  SeeAlso []
536 
537 ***********************************************************************/
539 {
540  char pFileName[1000];
541  FILE * pFile;
542  Abc_Obj_t * pObj, * pFanin;
543  Vec_Ptr_t * vNodes;
544  int i, Counter = 1;
545  assert( Abc_NtkIsNetlist(p) );
546  assert( p->vNameIds == NULL );
547  assert( strlen(p->pSpec) < 1000 );
548  sprintf( pFileName, "%s_%s_names.txt", Extra_FileNameGenericAppend(p->pSpec,""), Extra_FileNameExtension(p->pSpec) );
549  pFile = fopen( pFileName, "wb" );
551  // add inputs
552  Abc_NtkForEachCi( p, pObj, i )
553  fprintf( pFile, "%s \n", Abc_ObjName(Abc_ObjFanout0(pObj)) ), Vec_IntWriteEntry(p->vNameIds, Abc_ObjId(pObj), 2*Counter++);
554  // add outputs
555  Abc_NtkForEachCo( p, pObj, i )
556  {
557  pFanin = Abc_ObjFanin0(Abc_ObjFanin0(pObj));
558  if ( !Vec_IntEntry(p->vNameIds, Abc_ObjId(pFanin)) )
559  fprintf( pFile, "%s \n", Abc_ObjName(Abc_ObjFanout0(pFanin)) ), Vec_IntWriteEntry(p->vNameIds, Abc_ObjId(pFanin), 2*Counter++);
560  }
561  // add nodes in a topo order
562  vNodes = Abc_NtkDfs( p, 1 );
563  Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
564  if ( !Vec_IntEntry(p->vNameIds, Abc_ObjId(pObj)) )
565  fprintf( pFile, "%s \n", Abc_ObjName(Abc_ObjFanout0(pObj)) ), Vec_IntWriteEntry(p->vNameIds, Abc_ObjId(pObj), 2*Counter++);
566  Vec_PtrFree( vNodes );
567  fclose( pFile );
568  // transfer driver node names to COs
569  Abc_NtkForEachCo( p, pObj, i )
570  {
571  pFanin = Abc_ObjFanin0(Abc_ObjFanin0(pObj));
573  Vec_IntWriteEntry( p->vNameIds, Abc_ObjId(pFanin), 0 );
574  }
575 }
576 
577 /**Function*************************************************************
578 
579  Synopsis [Remaps the AIG from the old manager into the new manager.]
580 
581  Description []
582 
583  SideEffects []
584 
585  SeeAlso []
586 
587 ***********************************************************************/
589 {
590  Abc_Obj_t * pObj, * pObjNew;
591  int i;
592  assert( p->vNameIds != NULL );
593  assert( pNew->vNameIds == NULL );
594  pNew->vNameIds = Vec_IntStart( Abc_NtkObjNumMax(pNew) );
595 // Abc_NtkForEachCi( p, pObj, i )
596 // printf( "%d ", Vec_IntEntry(p->vNameIds, Abc_ObjId(pObj)) );
597 // printf( "\n" );
598  Abc_NtkForEachObj( p, pObj, i )
599  if ( pObj->pCopy && i < Vec_IntSize(p->vNameIds) && Vec_IntEntry(p->vNameIds, i) )
600  {
601  pObjNew = Abc_ObjRegular(pObj->pCopy);
602  assert( Abc_ObjNtk(pObjNew) == pNew );
603  if ( Abc_ObjIsCi(pObjNew) && !Abc_ObjIsCi(pObj) ) // do not overwrite CI name by internal node name
604  continue;
606  }
607 }
608 
609 /**Function*************************************************************
610 
611  Synopsis [Updates file with name IDs.]
612 
613  Description []
614 
615  SideEffects []
616 
617  SeeAlso []
618 
619 ***********************************************************************/
621 {
622  char pFileName[1000];
623  Vec_Int_t * vStarts;
624  Abc_Obj_t * pObj;
625  FILE * pFile;
626  int i, c, iVar, fCompl, fSeenSpace, Counter = 0;
627  assert( !Abc_NtkIsNetlist(p) );
628  assert( strlen(p->pSpec) < 1000 );
629  assert( p->vNameIds != NULL );
630  sprintf( pFileName, "%s_%s_names.txt", Extra_FileNameGenericAppend(p->pSpec,""), Extra_FileNameExtension(p->pSpec) );
631  pFile = fopen( pFileName, "r+" );
632  // collect info about lines
633  fSeenSpace = 0;
634  vStarts = Vec_IntAlloc( 1000 );
635  Vec_IntPush( vStarts, -1 );
636  while ( (c = fgetc(pFile)) != EOF && ++Counter )
637  if ( c == ' ' && !fSeenSpace )
638  Vec_IntPush(vStarts, Counter), fSeenSpace = 1;
639  else if ( c == '\n' )
640  fSeenSpace = 0;
641  // add info about names
642  Abc_NtkForEachObj( p, pObj, i )
643  {
644  if ( i == 0 || i >= Vec_IntSize(p->vNameIds) || !Vec_IntEntry(p->vNameIds, i) )
645  continue;
646  iVar = Abc_Lit2Var( Vec_IntEntry(p->vNameIds, i) );
647  fCompl = Abc_LitIsCompl( Vec_IntEntry(p->vNameIds, i) );
648  assert( iVar < Vec_IntSize(vStarts) );
649  fseek( pFile, Vec_IntEntry(vStarts, iVar), SEEK_SET );
650  fprintf( pFile, "%s%d", fCompl? "-":"", i );
651  }
652  printf( "Saved %d names into file \"%s\".\n", Vec_IntSize(vStarts)-1, pFileName );
653  fclose( pFile );
654  Vec_IntFree( vStarts );
655  Vec_IntFreeP( &p->vNameIds );
656 // Abc_NtkForEachObj( p, pObj, i )
657 // Abc_ObjPrint( stdout, pObj );
658 }
659 
660 ////////////////////////////////////////////////////////////////////////
661 /// END OF FILE ///
662 ////////////////////////////////////////////////////////////////////////
663 
664 
666 
Vec_Ptr_t * Abc_NodeGetFaninNames(Abc_Obj_t *pNode)
Definition: abcNames.c:199
static unsigned Abc_ObjId(Abc_Obj_t *pObj)
Definition: abc.h:329
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
char * Abc_ObjNamePrefix(Abc_Obj_t *pObj, char *pPrefix)
Definition: abcNames.c:85
static int Abc_ObjIsCi(Abc_Obj_t *pObj)
Definition: abc.h:351
Nm_Man_t * pManName
Definition: abc.h:160
Vec_Int_t * vNameIds
Definition: abc.h:215
void Abc_NtkTrasferNamesNoLatches(Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtkNew)
Definition: abcNames.c:168
static int Abc_NtkObjNumMax(Abc_Ntk_t *pNtk)
Definition: abc.h:284
void Abc_NtkTransferNameIds(Abc_Ntk_t *p, Abc_Ntk_t *pNew)
Definition: abcNames.c:588
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
Vec_Ptr_t * vBoxes
Definition: abc.h:168
void Abc_NtkStartNameIds(Abc_Ntk_t *p)
Definition: abcNames.c:538
static int Abc_NtkIsNetlist(Abc_Ntk_t *pNtk)
Definition: abc.h:249
int Nm_ManNumEntries(Nm_Man_t *p)
Definition: nmApi.c:95
static int Abc_ObjIsLatch(Abc_Obj_t *pObj)
Definition: abc.h:356
static int Abc_ObjFanoutNum(Abc_Obj_t *pObj)
Definition: abc.h:365
static int Abc_NtkBoxNum(Abc_Ntk_t *pNtk)
Definition: abc.h:289
static Abc_Obj_t * Abc_ObjFanin0Ntk(Abc_Obj_t *pObj)
Definition: abc.h:375
static int Abc_ObjFaninNum(Abc_Obj_t *pObj)
Definition: abc.h:364
void Abc_NtkMoveNames(Abc_Ntk_t *pNtk, Abc_Ntk_t *pOld)
Definition: abcNames.c:510
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
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition: abc.h:519
void Abc_NtkAddDummyPoNames(Abc_Ntk_t *pNtk)
Definition: abcNames.c:398
ABC_DLL Vec_Ptr_t * Abc_NtkDfs(Abc_Ntk_t *pNtk, int fCollectAll)
Definition: abcDfs.c:81
Vec_Ptr_t * vPis
Definition: abc.h:163
static int Abc_MaxInt(int a, int b)
Definition: abc_global.h:238
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
unsigned Type
Definition: abc.h:133
char * Abc_ObjAssignName(Abc_Obj_t *pObj, char *pName, char *pSuffix)
Definition: abcNames.c:68
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
void Abc_NtkAddDummyPiNames(Abc_Ntk_t *pNtk)
Definition: abcNames.c:378
Vec_Ptr_t * Abc_NodeGetFakeNames(int nNames)
Definition: abcNames.c:221
static int Abc_NtkCoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:288
char * Extra_UtilStrsav(const char *s)
int strcmp()
char * Nm_ManStoreIdName(Nm_Man_t *p, int ObjId, int Type, char *pName, char *pSuffix)
Definition: nmApi.c:112
void Abc_NodeFreeNames(Vec_Ptr_t *vNames)
Definition: abcNames.c:257
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
Definition: bblif.c:285
static Vec_Int_t * Vec_IntStart(int nSize)
Definition: bblif.c:172
static int Abc_LitIsCompl(int Lit)
Definition: abc_global.h:265
Abc_Obj_t * pCopy
Definition: abc.h:148
int Abc_NodeCompareNames(Abc_Obj_t **pp1, Abc_Obj_t **pp2)
Definition: abcNames.c:309
Vec_Ptr_t * vPos
Definition: abc.h:164
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
static int Abc_Base10Log(unsigned n)
Definition: abc_global.h:252
#define ABC_NAMESPACE_IMPL_END
Definition: abc_global.h:108
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
char * sprintf()
static int Counter
void Abc_NtkTrasferNames(Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtkNew)
Definition: abcNames.c:139
ABC_NAMESPACE_IMPL_START char * Abc_ObjName(Abc_Obj_t *pObj)
DECLARATIONS ///.
Definition: abcNames.c:48
#define Abc_NtkForEachLatch(pNtk, pObj, i)
Definition: abc.h:497
static Abc_Obj_t * Abc_ObjFanout0Ntk(Abc_Obj_t *pObj)
Definition: abc.h:376
static void Vec_IntFreeP(Vec_Int_t **p)
Definition: vecInt.h:289
void Abc_NtkOrderObjsByName(Abc_Ntk_t *pNtk, int fComb)
Definition: abcNames.c:335
#define Abc_NtkForEachBox(pNtk, pObj, i)
Definition: abc.h:495
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
#define SEEK_SET
Definition: zconf.h:390
void Abc_NtkAddDummyBoxNames(Abc_Ntk_t *pNtk)
Definition: abcNames.c:418
char * pSpec
Definition: abc.h:159
static Abc_Obj_t * Abc_ObjRegular(Abc_Obj_t *p)
Definition: abc.h:323
Abc_Ntk_t * pNtk
Definition: abc.h:130
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
void Abc_NtkUpdateNameIds(Abc_Ntk_t *p)
Definition: abcNames.c:620
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
char * Abc_ObjNameDummy(char *pPrefix, int Num, int nDigits)
Definition: abcNames.c:121
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition: abc.h:524
#define ABC_FREE(obj)
Definition: abc_global.h:232
int Id
Definition: abc.h:132
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:285
char * Nm_ManCreateUniqueName(Nm_Man_t *p, int ObjId)
Definition: nmApi.c:175
char ** Abc_NtkCollectCioNames(Abc_Ntk_t *pNtk, int fCollectCos)
Definition: abcNames.c:278
static int Abc_Lit2Var(int Lit)
Definition: abc_global.h:264
static int Abc_NtkHasOnlyLatchBoxes(Abc_Ntk_t *pNtk)
Definition: abc.h:298
Nm_Man_t * Nm_ManCreate(int nSize)
MACRO DEFINITIONS ///.
Definition: nmApi.c:45
#define assert(ex)
Definition: util_old.h:213
char * Extra_FileNameGenericAppend(char *pBase, char *pSuffix)
int strlen()
void Nm_ManFree(Nm_Man_t *p)
Definition: nmApi.c:76
void Abc_NtkShortNames(Abc_Ntk_t *pNtk)
Definition: abcNames.c:490
char * Extra_FileNameExtension(char *FileName)
static Abc_Ntk_t * Abc_ObjNtk(Abc_Obj_t *pObj)
Definition: abc.h:334
static Abc_Obj_t * Abc_NtkPi(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:315
#define Abc_NtkForEachPo(pNtk, pPo, i)
Definition: abc.h:517
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
static int Abc_ObjIsComplement(Abc_Obj_t *p)
Definition: abc.h:322
#define Abc_NtkForEachObj(pNtk, pObj, i)
ITERATORS ///.
Definition: abc.h:446
char * Abc_UtilStrsav(char *s)
Definition: starter.c:47
ABC_DLL void Abc_NtkOrderCisCos(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:71
static void ** Vec_PtrArray(Vec_Ptr_t *p)
Definition: vecPtr.h:279
char * Abc_ObjNameSuffix(Abc_Obj_t *pObj, char *pSuffix)
Definition: abcNames.c:103
static Abc_Obj_t * Abc_ObjFanout0(Abc_Obj_t *pObj)
Definition: abc.h:371
#define Abc_NtkForEachPi(pNtk, pPi, i)
Definition: abc.h:513
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223