abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
abcObj.c
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [abcObj.c]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [Network and node package.]
8 
9  Synopsis [Object creation/duplication/deletion procedures.]
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - June 20, 2005.]
16 
17  Revision [$Id: abcObj.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #include "abc.h"
22 #include "abcInt.h"
23 #include "base/main/main.h"
24 #include "map/mio/mio.h"
25 #include "misc/extra/extraBdd.h"
26 
28 
29 
30 ////////////////////////////////////////////////////////////////////////
31 /// DECLARATIONS ///
32 ////////////////////////////////////////////////////////////////////////
33 
34 ////////////////////////////////////////////////////////////////////////
35 /// FUNCTION DEFINITIONS ///
36 ////////////////////////////////////////////////////////////////////////
37 
38 /**Function*************************************************************
39 
40  Synopsis [Creates a new object.]
41 
42  Description []
43 
44  SideEffects []
45 
46  SeeAlso []
47 
48 ***********************************************************************/
50 {
51  Abc_Obj_t * pObj;
52  if ( pNtk->pMmObj )
53  pObj = (Abc_Obj_t *)Mem_FixedEntryFetch( pNtk->pMmObj );
54  else
55  pObj = (Abc_Obj_t *)ABC_ALLOC( Abc_Obj_t, 1 );
56  memset( pObj, 0, sizeof(Abc_Obj_t) );
57  pObj->pNtk = pNtk;
58  pObj->Type = Type;
59  pObj->Id = -1;
60  return pObj;
61 }
62 
63 /**Function*************************************************************
64 
65  Synopsis [Recycles the object.]
66 
67  Description []
68 
69  SideEffects []
70 
71  SeeAlso []
72 
73 ***********************************************************************/
74 void Abc_ObjRecycle( Abc_Obj_t * pObj )
75 {
76  Abc_Ntk_t * pNtk = pObj->pNtk;
77 // int LargePiece = (4 << ABC_NUM_STEPS);
78  // free large fanout arrays
79 // if ( pNtk->pMmStep && pObj->vFanouts.nCap * 4 > LargePiece )
80 // free( pObj->vFanouts.pArray );
81  if ( pNtk->pMmStep == NULL )
82  {
83  ABC_FREE( pObj->vFanouts.pArray );
84  ABC_FREE( pObj->vFanins.pArray );
85  }
86  // clean the memory to make deleted object distinct from the live one
87  memset( pObj, 0, sizeof(Abc_Obj_t) );
88  // recycle the object
89  if ( pNtk->pMmObj )
90  Mem_FixedEntryRecycle( pNtk->pMmObj, (char *)pObj );
91  else
92  ABC_FREE( pObj );
93 }
94 
95 /**Function*************************************************************
96 
97  Synopsis [Adds the node to the network.]
98 
99  Description []
100 
101  SideEffects []
102 
103  SeeAlso []
104 
105 ***********************************************************************/
107 {
108  Abc_Obj_t * pObj;
109  // create new object, assign ID, and add to the array
110  pObj = Abc_ObjAlloc( pNtk, Type );
111  pObj->Id = pNtk->vObjs->nSize;
112  Vec_PtrPush( pNtk->vObjs, pObj );
113  pNtk->nObjCounts[Type]++;
114  pNtk->nObjs++;
115  // perform specialized operations depending on the object type
116  switch (Type)
117  {
118  case ABC_OBJ_NONE:
119  assert(0);
120  break;
121  case ABC_OBJ_CONST1:
122  assert(0);
123  break;
124  case ABC_OBJ_PI:
125 // pObj->iTemp = Vec_PtrSize(pNtk->vCis);
126  Vec_PtrPush( pNtk->vPis, pObj );
127  Vec_PtrPush( pNtk->vCis, pObj );
128  break;
129  case ABC_OBJ_PO:
130 // pObj->iTemp = Vec_PtrSize(pNtk->vCos);
131  Vec_PtrPush( pNtk->vPos, pObj );
132  Vec_PtrPush( pNtk->vCos, pObj );
133  break;
134  case ABC_OBJ_BI:
135  if ( pNtk->vCos ) Vec_PtrPush( pNtk->vCos, pObj );
136  break;
137  case ABC_OBJ_BO:
138  if ( pNtk->vCis ) Vec_PtrPush( pNtk->vCis, pObj );
139  break;
140  case ABC_OBJ_NET:
141  case ABC_OBJ_NODE:
142  break;
143  case ABC_OBJ_LATCH:
144  pObj->pData = (void *)ABC_INIT_NONE;
145  case ABC_OBJ_WHITEBOX:
146  case ABC_OBJ_BLACKBOX:
147  if ( pNtk->vBoxes ) Vec_PtrPush( pNtk->vBoxes, pObj );
148  break;
149  default:
150  assert(0);
151  break;
152  }
153  return pObj;
154 }
155 
156 /**Function*************************************************************
157 
158  Synopsis [Deletes the object from the network.]
159 
160  Description []
161 
162  SideEffects []
163 
164  SeeAlso []
165 
166 ***********************************************************************/
168 {
169  Abc_Ntk_t * pNtk = pObj->pNtk;
170  Vec_Ptr_t * vNodes;
171  int i;
172  assert( !Abc_ObjIsComplement(pObj) );
173  // remove from the table of names
174  if ( Nm_ManFindNameById(pObj->pNtk->pManName, pObj->Id) )
175  Nm_ManDeleteIdName(pObj->pNtk->pManName, pObj->Id);
176  // delete fanins and fanouts
177  vNodes = Vec_PtrAlloc( 100 );
178  Abc_NodeCollectFanouts( pObj, vNodes );
179  for ( i = 0; i < vNodes->nSize; i++ )
180  Abc_ObjDeleteFanin( (Abc_Obj_t *)vNodes->pArray[i], pObj );
181  Abc_NodeCollectFanins( pObj, vNodes );
182  for ( i = 0; i < vNodes->nSize; i++ )
183  Abc_ObjDeleteFanin( pObj, (Abc_Obj_t *)vNodes->pArray[i] );
184  Vec_PtrFree( vNodes );
185  // remove from the list of objects
186  Vec_PtrWriteEntry( pNtk->vObjs, pObj->Id, NULL );
187  pObj->Id = (1<<26)-1;
188  pNtk->nObjCounts[pObj->Type]--;
189  pNtk->nObjs--;
190  // perform specialized operations depending on the object type
191  switch (pObj->Type)
192  {
193  case ABC_OBJ_NONE:
194  assert(0);
195  break;
196  case ABC_OBJ_CONST1:
197  assert(0);
198  break;
199  case ABC_OBJ_PI:
200  Vec_PtrRemove( pNtk->vPis, pObj );
201  Vec_PtrRemove( pNtk->vCis, pObj );
202  break;
203  case ABC_OBJ_PO:
204  Vec_PtrRemove( pNtk->vPos, pObj );
205  Vec_PtrRemove( pNtk->vCos, pObj );
206  break;
207  case ABC_OBJ_BI:
208  if ( pNtk->vCos ) Vec_PtrRemove( pNtk->vCos, pObj );
209  break;
210  case ABC_OBJ_BO:
211  if ( pNtk->vCis ) Vec_PtrRemove( pNtk->vCis, pObj );
212  break;
213  case ABC_OBJ_NET:
214  break;
215  case ABC_OBJ_NODE:
216  if ( Abc_NtkHasBdd(pNtk) )
217  Cudd_RecursiveDeref( (DdManager *)pNtk->pManFunc, (DdNode *)pObj->pData );
218  pObj->pData = NULL;
219  break;
220  case ABC_OBJ_LATCH:
221  case ABC_OBJ_WHITEBOX:
222  case ABC_OBJ_BLACKBOX:
223  if ( pNtk->vBoxes ) Vec_PtrRemove( pNtk->vBoxes, pObj );
224  break;
225  default:
226  assert(0);
227  break;
228  }
229  // recycle the object memory
230  Abc_ObjRecycle( pObj );
231 }
232 
233 /**Function*************************************************************
234 
235  Synopsis [Deletes the PO from the network.]
236 
237  Description []
238 
239  SideEffects []
240 
241  SeeAlso []
242 
243 ***********************************************************************/
245 {
246  assert( Abc_ObjIsPo(pObj) );
247  // remove from the table of names
248  if ( Nm_ManFindNameById(pObj->pNtk->pManName, pObj->Id) )
249  Nm_ManDeleteIdName(pObj->pNtk->pManName, pObj->Id);
250  // delete fanins
251  Abc_ObjDeleteFanin( pObj, Abc_ObjFanin0(pObj) );
252  // remove from the list of objects
253  Vec_PtrWriteEntry( pObj->pNtk->vObjs, pObj->Id, NULL );
254  pObj->Id = (1<<26)-1;
255  pObj->pNtk->nObjCounts[pObj->Type]--;
256  pObj->pNtk->nObjs--;
257  // recycle the object memory
258  Abc_ObjRecycle( pObj );
259 }
260 
261 
262 /**Function*************************************************************
263 
264  Synopsis [Deletes the node and MFFC of the node.]
265 
266  Description []
267 
268  SideEffects []
269 
270  SeeAlso []
271 
272 ***********************************************************************/
273 void Abc_NtkDeleteObj_rec( Abc_Obj_t * pObj, int fOnlyNodes )
274 {
275  Vec_Ptr_t * vNodes;
276  int i;
277  assert( !Abc_ObjIsComplement(pObj) );
278  assert( !Abc_ObjIsPi(pObj) );
279  assert( Abc_ObjFanoutNum(pObj) == 0 );
280  // delete fanins and fanouts
281  vNodes = Vec_PtrAlloc( 100 );
282  Abc_NodeCollectFanins( pObj, vNodes );
283  Abc_NtkDeleteObj( pObj );
284  if ( fOnlyNodes )
285  {
286  Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
287  if ( Abc_ObjIsNode(pObj) && Abc_ObjFanoutNum(pObj) == 0 )
288  Abc_NtkDeleteObj_rec( pObj, fOnlyNodes );
289  }
290  else
291  {
292  Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
293  if ( !Abc_ObjIsPi(pObj) && Abc_ObjFanoutNum(pObj) == 0 )
294  Abc_NtkDeleteObj_rec( pObj, fOnlyNodes );
295  }
296  Vec_PtrFree( vNodes );
297 }
298 
299 /**Function*************************************************************
300 
301  Synopsis [Deletes the node and MFFC of the node.]
302 
303  Description []
304 
305  SideEffects []
306 
307  SeeAlso []
308 
309 ***********************************************************************/
311 {
312  Vec_Ptr_t * vNodes;
313  int i;
314  assert( !Abc_ObjIsComplement(pObj) );
315  assert( Abc_ObjFanoutNum(pObj) == 0 );
316  // delete fanins and fanouts
317  vNodes = Vec_PtrAlloc( 100 );
318  Abc_NodeCollectFanins( pObj, vNodes );
319  Abc_NtkDeleteObj( pObj );
320  Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
321  if ( !Abc_ObjIsNode(pObj) && Abc_ObjFanoutNum(pObj) == 0 )
322  Abc_NtkDeleteAll_rec( pObj );
323  Vec_PtrFree( vNodes );
324 }
325 
326 /**Function*************************************************************
327 
328  Synopsis [Duplicate the Obj.]
329 
330  Description []
331 
332  SideEffects []
333 
334  SeeAlso []
335 
336 ***********************************************************************/
337 Abc_Obj_t * Abc_NtkDupObj( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pObj, int fCopyName )
338 {
339  Abc_Obj_t * pObjNew;
340  // create the new object
341  pObjNew = Abc_NtkCreateObj( pNtkNew, (Abc_ObjType_t)pObj->Type );
342  // transfer names of the terminal objects
343  if ( fCopyName )
344  {
345  if ( Abc_ObjIsCi(pObj) )
346  {
347  if ( !Abc_NtkIsNetlist(pNtkNew) )
348  Abc_ObjAssignName( pObjNew, Abc_ObjName(Abc_ObjFanout0Ntk(pObj)), NULL );
349  }
350  else if ( Abc_ObjIsCo(pObj) )
351  {
352  if ( !Abc_NtkIsNetlist(pNtkNew) )
353  {
354  if ( Abc_ObjIsPo(pObj) )
355  Abc_ObjAssignName( pObjNew, Abc_ObjName(Abc_ObjFanin0Ntk(pObj)), NULL );
356  else
357  {
359  Abc_ObjAssignName( pObjNew, Abc_ObjName(pObj), NULL );
360  }
361  }
362  }
363  else if ( Abc_ObjIsBox(pObj) || Abc_ObjIsNet(pObj) )
364  Abc_ObjAssignName( pObjNew, Abc_ObjName(pObj), NULL );
365  }
366  // copy functionality/names
367  if ( Abc_ObjIsNode(pObj) ) // copy the function if functionality is compatible
368  {
369  if ( pNtkNew->ntkFunc == pObj->pNtk->ntkFunc )
370  {
371  if ( Abc_NtkIsStrash(pNtkNew) )
372  {}
373  else if ( Abc_NtkHasSop(pNtkNew) || Abc_NtkHasBlifMv(pNtkNew) )
374  pObjNew->pData = Abc_SopRegister( (Mem_Flex_t *)pNtkNew->pManFunc, (char *)pObj->pData );
375  else if ( Abc_NtkHasBdd(pNtkNew) )
376  pObjNew->pData = Cudd_bddTransfer((DdManager *)pObj->pNtk->pManFunc, (DdManager *)pNtkNew->pManFunc, (DdNode *)pObj->pData), Cudd_Ref((DdNode *)pObjNew->pData);
377  else if ( Abc_NtkHasAig(pNtkNew) )
378  pObjNew->pData = Hop_Transfer((Hop_Man_t *)pObj->pNtk->pManFunc, (Hop_Man_t *)pNtkNew->pManFunc, (Hop_Obj_t *)pObj->pData, Abc_ObjFaninNum(pObj));
379  else if ( Abc_NtkHasMapping(pNtkNew) )
380  pObjNew->pData = pObj->pData;
381  else assert( 0 );
382  }
383  }
384  else if ( Abc_ObjIsNet(pObj) ) // copy the name
385  {
386  }
387  else if ( Abc_ObjIsLatch(pObj) ) // copy the reset value
388  pObjNew->pData = pObj->pData;
389  // transfer HAIG
390 // pObjNew->pEquiv = pObj->pEquiv;
391  // remember the new node in the old node
392  pObj->pCopy = pObjNew;
393  return pObjNew;
394 }
395 
396 /**Function*************************************************************
397 
398  Synopsis [Duplicates the latch with its input/output terminals.]
399 
400  Description []
401 
402  SideEffects []
403 
404  SeeAlso []
405 
406 ***********************************************************************/
407 Abc_Obj_t * Abc_NtkDupBox( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pBox, int fCopyName )
408 {
409  Abc_Obj_t * pTerm, * pBoxNew;
410  int i;
411  assert( Abc_ObjIsBox(pBox) );
412  // duplicate the box
413  pBoxNew = Abc_NtkDupObj( pNtkNew, pBox, fCopyName );
414  // duplicate the fanins and connect them
415  Abc_ObjForEachFanin( pBox, pTerm, i )
416  Abc_ObjAddFanin( pBoxNew, Abc_NtkDupObj(pNtkNew, pTerm, fCopyName) );
417  // duplicate the fanouts and connect them
418  Abc_ObjForEachFanout( pBox, pTerm, i )
419  Abc_ObjAddFanin( Abc_NtkDupObj(pNtkNew, pTerm, fCopyName), pBoxNew );
420  return pBoxNew;
421 }
422 
423 /**Function*************************************************************
424 
425  Synopsis [Clones the objects in the same network but does not assign its function.]
426 
427  Description []
428 
429  SideEffects []
430 
431  SeeAlso []
432 
433 ***********************************************************************/
435 {
436  Abc_Obj_t * pClone, * pFanin;
437  int i;
438  pClone = Abc_NtkCreateObj( pObj->pNtk, (Abc_ObjType_t)pObj->Type );
439  Abc_ObjForEachFanin( pObj, pFanin, i )
440  Abc_ObjAddFanin( pClone, pFanin );
441  return pClone;
442 }
443 
444 
445 /**Function*************************************************************
446 
447  Synopsis [Returns the net with the given name.]
448 
449  Description []
450 
451  SideEffects []
452 
453  SeeAlso []
454 
455 ***********************************************************************/
456 Abc_Obj_t * Abc_NtkFindNode( Abc_Ntk_t * pNtk, char * pName )
457 {
458  Abc_Obj_t * pObj;
459  int Num;
460  // try to find the terminal
461  Num = Nm_ManFindIdByName( pNtk->pManName, pName, ABC_OBJ_PO );
462  if ( Num >= 0 )
463  return Abc_ObjFanin0( Abc_NtkObj( pNtk, Num ) );
464  Num = Nm_ManFindIdByName( pNtk->pManName, pName, ABC_OBJ_BI );
465  if ( Num >= 0 )
466  return Abc_ObjFanin0( Abc_NtkObj( pNtk, Num ) );
467  Num = Nm_ManFindIdByName( pNtk->pManName, pName, ABC_OBJ_NODE );
468  if ( Num >= 0 )
469  return Abc_NtkObj( pNtk, Num );
470  // find the internal node
471  if ( pName[0] != 'n' )
472  {
473  printf( "Name \"%s\" is not found among CO or node names (internal names often look as \"n<num>\").\n", pName );
474  return NULL;
475  }
476  Num = atoi( pName + 1 );
477  if ( Num < 0 || Num >= Abc_NtkObjNumMax(pNtk) )
478  {
479  printf( "The node \"%s\" with ID %d is not in the current network.\n", pName, Num );
480  return NULL;
481  }
482  pObj = Abc_NtkObj( pNtk, Num );
483  if ( pObj == NULL )
484  {
485  printf( "The node \"%s\" with ID %d has been removed from the current network.\n", pName, Num );
486  return NULL;
487  }
488  if ( !Abc_ObjIsNode(pObj) )
489  {
490  printf( "Object with ID %d is not a node.\n", Num );
491  return NULL;
492  }
493  return pObj;
494 }
495 
496 /**Function*************************************************************
497 
498  Synopsis [Returns the net with the given name.]
499 
500  Description []
501 
502  SideEffects []
503 
504  SeeAlso []
505 
506 ***********************************************************************/
507 Abc_Obj_t * Abc_NtkFindNet( Abc_Ntk_t * pNtk, char * pName )
508 {
509  Abc_Obj_t * pNet;
510  int ObjId;
511  assert( Abc_NtkIsNetlist(pNtk) );
512  ObjId = Nm_ManFindIdByName( pNtk->pManName, pName, ABC_OBJ_NET );
513  if ( ObjId == -1 )
514  return NULL;
515  pNet = Abc_NtkObj( pNtk, ObjId );
516  return pNet;
517 }
518 
519 /**Function*************************************************************
520 
521  Synopsis [Returns CI with the given name.]
522 
523  Description []
524 
525  SideEffects []
526 
527  SeeAlso []
528 
529 ***********************************************************************/
530 Abc_Obj_t * Abc_NtkFindCi( Abc_Ntk_t * pNtk, char * pName )
531 {
532  int Num;
533  assert( !Abc_NtkIsNetlist(pNtk) );
534  Num = Nm_ManFindIdByName( pNtk->pManName, pName, ABC_OBJ_PI );
535  if ( Num >= 0 )
536  return Abc_NtkObj( pNtk, Num );
537  Num = Nm_ManFindIdByName( pNtk->pManName, pName, ABC_OBJ_BO );
538  if ( Num >= 0 )
539  return Abc_NtkObj( pNtk, Num );
540  return NULL;
541 }
542 
543 /**Function*************************************************************
544 
545  Synopsis [Returns CO with the given name.]
546 
547  Description []
548 
549  SideEffects []
550 
551  SeeAlso []
552 
553 ***********************************************************************/
554 Abc_Obj_t * Abc_NtkFindCo( Abc_Ntk_t * pNtk, char * pName )
555 {
556  int Num;
557  assert( !Abc_NtkIsNetlist(pNtk) );
558  Num = Nm_ManFindIdByName( pNtk->pManName, pName, ABC_OBJ_PO );
559  if ( Num >= 0 )
560  return Abc_NtkObj( pNtk, Num );
561  Num = Nm_ManFindIdByName( pNtk->pManName, pName, ABC_OBJ_BI );
562  if ( Num >= 0 )
563  return Abc_NtkObj( pNtk, Num );
564  return NULL;
565 }
566 
567 
568 /**Function*************************************************************
569 
570  Synopsis [Finds or creates the net.]
571 
572  Description []
573 
574  SideEffects []
575 
576  SeeAlso []
577 
578 ***********************************************************************/
579 Abc_Obj_t * Abc_NtkFindOrCreateNet( Abc_Ntk_t * pNtk, char * pName )
580 {
581  Abc_Obj_t * pNet;
582  assert( Abc_NtkIsNetlist(pNtk) );
583  if ( pName && (pNet = Abc_NtkFindNet( pNtk, pName )) )
584  return pNet;
585 //printf( "Creating net %s.\n", pName );
586  // create a new net
587  pNet = Abc_NtkCreateNet( pNtk );
588  if ( pName )
589  Nm_ManStoreIdName( pNtk->pManName, pNet->Id, pNet->Type, pName, NULL );
590  return pNet;
591 }
592 
593 /**Function*************************************************************
594 
595  Synopsis [Creates constant 0 node.]
596 
597  Description []
598 
599  SideEffects []
600 
601  SeeAlso []
602 
603 ***********************************************************************/
605 {
606  Abc_Obj_t * pNode;
607  assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsNetlist(pNtk) );
608  pNode = Abc_NtkCreateNode( pNtk );
609  if ( Abc_NtkHasSop(pNtk) || Abc_NtkHasBlifMv(pNtk) )
610  pNode->pData = Abc_SopRegister( (Mem_Flex_t *)pNtk->pManFunc, " 0\n" );
611  else if ( Abc_NtkHasBdd(pNtk) )
612  pNode->pData = Cudd_ReadLogicZero((DdManager *)pNtk->pManFunc), Cudd_Ref( (DdNode *)pNode->pData );
613  else if ( Abc_NtkHasAig(pNtk) )
614  pNode->pData = Hop_ManConst0((Hop_Man_t *)pNtk->pManFunc);
615  else if ( Abc_NtkHasMapping(pNtk) )
617  else if ( !Abc_NtkHasBlackbox(pNtk) )
618  assert( 0 );
619  return pNode;
620 }
621 
622 /**Function*************************************************************
623 
624  Synopsis [Creates constant 1 node.]
625 
626  Description []
627 
628  SideEffects []
629 
630  SeeAlso []
631 
632 ***********************************************************************/
634 {
635  Abc_Obj_t * pNode;
636  assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsNetlist(pNtk) );
637  pNode = Abc_NtkCreateNode( pNtk );
638  if ( Abc_NtkHasSop(pNtk) || Abc_NtkHasBlifMv(pNtk) )
639  pNode->pData = Abc_SopRegister( (Mem_Flex_t *)pNtk->pManFunc, " 1\n" );
640  else if ( Abc_NtkHasBdd(pNtk) )
641  pNode->pData = Cudd_ReadOne((DdManager *)pNtk->pManFunc), Cudd_Ref( (DdNode *)pNode->pData );
642  else if ( Abc_NtkHasAig(pNtk) )
643  pNode->pData = Hop_ManConst1((Hop_Man_t *)pNtk->pManFunc);
644  else if ( Abc_NtkHasMapping(pNtk) )
646  else if ( !Abc_NtkHasBlackbox(pNtk) )
647  assert( 0 );
648  return pNode;
649 }
650 
651 /**Function*************************************************************
652 
653  Synopsis [Creates inverter.]
654 
655  Description []
656 
657  SideEffects []
658 
659  SeeAlso []
660 
661 ***********************************************************************/
663 {
664  Abc_Obj_t * pNode;
665  assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsNetlist(pNtk) );
666  pNode = Abc_NtkCreateNode( pNtk );
667  if ( pFanin ) Abc_ObjAddFanin( pNode, pFanin );
668  if ( Abc_NtkHasSop(pNtk) )
669  pNode->pData = Abc_SopRegister( (Mem_Flex_t *)pNtk->pManFunc, "0 1\n" );
670  else if ( Abc_NtkHasBdd(pNtk) )
671  pNode->pData = Cudd_Not(Cudd_bddIthVar((DdManager *)pNtk->pManFunc,0)), Cudd_Ref( (DdNode *)pNode->pData );
672  else if ( Abc_NtkHasAig(pNtk) )
673  pNode->pData = Hop_Not(Hop_IthVar((Hop_Man_t *)pNtk->pManFunc,0));
674  else if ( Abc_NtkHasMapping(pNtk) )
676  else
677  assert( 0 );
678  return pNode;
679 }
680 
681 /**Function*************************************************************
682 
683  Synopsis [Creates buffer.]
684 
685  Description []
686 
687  SideEffects []
688 
689  SeeAlso []
690 
691 ***********************************************************************/
693 {
694  Abc_Obj_t * pNode;
695  assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsNetlist(pNtk) );
696  pNode = Abc_NtkCreateNode( pNtk );
697  if ( pFanin ) Abc_ObjAddFanin( pNode, pFanin );
698  if ( Abc_NtkHasSop(pNtk) )
699  pNode->pData = Abc_SopRegister( (Mem_Flex_t *)pNtk->pManFunc, "1 1\n" );
700  else if ( Abc_NtkHasBdd(pNtk) )
701  pNode->pData = Cudd_bddIthVar((DdManager *)pNtk->pManFunc,0), Cudd_Ref( (DdNode *)pNode->pData );
702  else if ( Abc_NtkHasAig(pNtk) )
703  pNode->pData = Hop_IthVar((Hop_Man_t *)pNtk->pManFunc,0);
704  else if ( Abc_NtkHasMapping(pNtk) )
706  else
707  assert( 0 );
708  return pNode;
709 }
710 
711 /**Function*************************************************************
712 
713  Synopsis [Creates AND.]
714 
715  Description []
716 
717  SideEffects []
718 
719  SeeAlso []
720 
721 ***********************************************************************/
723 {
724  Abc_Obj_t * pNode;
725  int i;
726  assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsNetlist(pNtk) );
727  pNode = Abc_NtkCreateNode( pNtk );
728  for ( i = 0; i < vFanins->nSize; i++ )
729  Abc_ObjAddFanin( pNode, (Abc_Obj_t *)vFanins->pArray[i] );
730  if ( Abc_NtkHasSop(pNtk) )
731  pNode->pData = Abc_SopCreateAnd( (Mem_Flex_t *)pNtk->pManFunc, Vec_PtrSize(vFanins), NULL );
732  else if ( Abc_NtkHasBdd(pNtk) )
733  pNode->pData = Extra_bddCreateAnd( (DdManager *)pNtk->pManFunc, Vec_PtrSize(vFanins) ), Cudd_Ref((DdNode *)pNode->pData);
734  else if ( Abc_NtkHasAig(pNtk) )
735  pNode->pData = Hop_CreateAnd( (Hop_Man_t *)pNtk->pManFunc, Vec_PtrSize(vFanins) );
736  else
737  assert( 0 );
738  return pNode;
739 }
740 
741 /**Function*************************************************************
742 
743  Synopsis [Creates OR.]
744 
745  Description []
746 
747  SideEffects []
748 
749  SeeAlso []
750 
751 ***********************************************************************/
753 {
754  Abc_Obj_t * pNode;
755  int i;
756  assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsNetlist(pNtk) );
757  pNode = Abc_NtkCreateNode( pNtk );
758  for ( i = 0; i < vFanins->nSize; i++ )
759  Abc_ObjAddFanin( pNode, (Abc_Obj_t *)vFanins->pArray[i] );
760  if ( Abc_NtkHasSop(pNtk) )
761  pNode->pData = Abc_SopCreateOr( (Mem_Flex_t *)pNtk->pManFunc, Vec_PtrSize(vFanins), NULL );
762  else if ( Abc_NtkHasBdd(pNtk) )
763  pNode->pData = Extra_bddCreateOr( (DdManager *)pNtk->pManFunc, Vec_PtrSize(vFanins) ), Cudd_Ref((DdNode *)pNode->pData);
764  else if ( Abc_NtkHasAig(pNtk) )
765  pNode->pData = Hop_CreateOr( (Hop_Man_t *)pNtk->pManFunc, Vec_PtrSize(vFanins) );
766  else
767  assert( 0 );
768  return pNode;
769 }
770 
771 /**Function*************************************************************
772 
773  Synopsis [Creates EXOR.]
774 
775  Description []
776 
777  SideEffects []
778 
779  SeeAlso []
780 
781 ***********************************************************************/
783 {
784  Abc_Obj_t * pNode;
785  int i;
786  assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsNetlist(pNtk) );
787  pNode = Abc_NtkCreateNode( pNtk );
788  for ( i = 0; i < vFanins->nSize; i++ )
789  Abc_ObjAddFanin( pNode, (Abc_Obj_t *)vFanins->pArray[i] );
790  if ( Abc_NtkHasSop(pNtk) )
791  pNode->pData = Abc_SopCreateXorSpecial( (Mem_Flex_t *)pNtk->pManFunc, Vec_PtrSize(vFanins) );
792  else if ( Abc_NtkHasBdd(pNtk) )
793  pNode->pData = Extra_bddCreateExor( (DdManager *)pNtk->pManFunc, Vec_PtrSize(vFanins) ), Cudd_Ref((DdNode *)pNode->pData);
794  else if ( Abc_NtkHasAig(pNtk) )
795  pNode->pData = Hop_CreateExor( (Hop_Man_t *)pNtk->pManFunc, Vec_PtrSize(vFanins) );
796  else
797  assert( 0 );
798  return pNode;
799 }
800 
801 /**Function*************************************************************
802 
803  Synopsis [Creates MUX.]
804 
805  Description []
806 
807  SideEffects []
808 
809  SeeAlso []
810 
811 ***********************************************************************/
812 Abc_Obj_t * Abc_NtkCreateNodeMux( Abc_Ntk_t * pNtk, Abc_Obj_t * pNodeC, Abc_Obj_t * pNode1, Abc_Obj_t * pNode0 )
813 {
814  Abc_Obj_t * pNode;
815  assert( Abc_NtkIsLogic(pNtk) );
816  pNode = Abc_NtkCreateNode( pNtk );
817  Abc_ObjAddFanin( pNode, pNodeC );
818  Abc_ObjAddFanin( pNode, pNode1 );
819  Abc_ObjAddFanin( pNode, pNode0 );
820  if ( Abc_NtkHasSop(pNtk) )
821  pNode->pData = Abc_SopRegister( (Mem_Flex_t *)pNtk->pManFunc, "11- 1\n0-1 1\n" );
822  else if ( Abc_NtkHasBdd(pNtk) )
824  else if ( Abc_NtkHasAig(pNtk) )
825  pNode->pData = Hop_Mux((Hop_Man_t *)pNtk->pManFunc,Hop_IthVar((Hop_Man_t *)pNtk->pManFunc,0),Hop_IthVar((Hop_Man_t *)pNtk->pManFunc,1),Hop_IthVar((Hop_Man_t *)pNtk->pManFunc,2));
826  else
827  assert( 0 );
828  return pNode;
829 }
830 
831 
832 /**Function*************************************************************
833 
834  Synopsis [Returns 1 if the node is a constant 0 node.]
835 
836  Description []
837 
838  SideEffects []
839 
840  SeeAlso []
841 
842 ***********************************************************************/
843 int Abc_NodeIsConst( Abc_Obj_t * pNode )
844 {
845  assert( Abc_NtkIsLogic(pNode->pNtk) || Abc_NtkIsNetlist(pNode->pNtk) );
846  return Abc_ObjIsNode(pNode) && Abc_ObjFaninNum(pNode) == 0;
847 }
848 
849 /**Function*************************************************************
850 
851  Synopsis [Returns 1 if the node is a constant 0 node.]
852 
853  Description []
854 
855  SideEffects []
856 
857  SeeAlso []
858 
859 ***********************************************************************/
861 {
862  Abc_Ntk_t * pNtk = pNode->pNtk;
863  assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsNetlist(pNtk) );
864  assert( Abc_ObjIsNode(pNode) );
865  if ( !Abc_NodeIsConst(pNode) )
866  return 0;
867  if ( Abc_NtkHasSop(pNtk) )
868  return Abc_SopIsConst0((char *)pNode->pData);
869  if ( Abc_NtkHasBdd(pNtk) )
870  return Cudd_IsComplement(pNode->pData);
871  if ( Abc_NtkHasAig(pNtk) )
872  return Hop_IsComplement((Hop_Obj_t *)pNode->pData)? 1:0;
873  if ( Abc_NtkHasMapping(pNtk) )
875  assert( 0 );
876  return 0;
877 }
878 
879 /**Function*************************************************************
880 
881  Synopsis [Returns 1 if the node is a constant 1 node.]
882 
883  Description []
884 
885  SideEffects []
886 
887  SeeAlso []
888 
889 ***********************************************************************/
891 {
892  Abc_Ntk_t * pNtk = pNode->pNtk;
893  assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsNetlist(pNtk) );
894  assert( Abc_ObjIsNode(pNode) );
895  if ( !Abc_NodeIsConst(pNode) )
896  return 0;
897  if ( Abc_NtkHasSop(pNtk) )
898  return Abc_SopIsConst1((char *)pNode->pData);
899  if ( Abc_NtkHasBdd(pNtk) )
900  return !Cudd_IsComplement(pNode->pData);
901  if ( Abc_NtkHasAig(pNtk) )
902  return !Hop_IsComplement((Hop_Obj_t *)pNode->pData);
903  if ( Abc_NtkHasMapping(pNtk) )
905  assert( 0 );
906  return 0;
907 }
908 
909 /**Function*************************************************************
910 
911  Synopsis [Returns 1 if the node is a buffer.]
912 
913  Description []
914 
915  SideEffects []
916 
917  SeeAlso []
918 
919 ***********************************************************************/
920 int Abc_NodeIsBuf( Abc_Obj_t * pNode )
921 {
922  Abc_Ntk_t * pNtk = pNode->pNtk;
923  assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsNetlist(pNtk) );
924  assert( Abc_ObjIsNode(pNode) );
925  if ( Abc_ObjFaninNum(pNode) != 1 )
926  return 0;
927  if ( Abc_NtkHasSop(pNtk) )
928  return Abc_SopIsBuf((char *)pNode->pData);
929  if ( Abc_NtkHasBdd(pNtk) )
930  return !Cudd_IsComplement(pNode->pData);
931  if ( Abc_NtkHasAig(pNtk) )
932  return !Hop_IsComplement((Hop_Obj_t *)pNode->pData);
933  if ( Abc_NtkHasMapping(pNtk) )
935  assert( 0 );
936  return 0;
937 }
938 
939 /**Function*************************************************************
940 
941  Synopsis [Returns 1 if the node is an inverter.]
942 
943  Description []
944 
945  SideEffects []
946 
947  SeeAlso []
948 
949 ***********************************************************************/
950 int Abc_NodeIsInv( Abc_Obj_t * pNode )
951 {
952  Abc_Ntk_t * pNtk = pNode->pNtk;
953  assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsNetlist(pNtk) );
954  assert( Abc_ObjIsNode(pNode) );
955  if ( Abc_ObjFaninNum(pNode) != 1 )
956  return 0;
957  if ( Abc_NtkHasSop(pNtk) )
958  return Abc_SopIsInv((char *)pNode->pData);
959  if ( Abc_NtkHasBdd(pNtk) )
960  return Cudd_IsComplement(pNode->pData);
961  if ( Abc_NtkHasAig(pNtk) )
962  return Hop_IsComplement((Hop_Obj_t *)pNode->pData)? 1:0;
963  if ( Abc_NtkHasMapping(pNtk) )
965  assert( 0 );
966  return 0;
967 }
968 
969 /**Function*************************************************************
970 
971  Synopsis [Complements the local functions of the node.]
972 
973  Description []
974 
975  SideEffects []
976 
977  SeeAlso []
978 
979 ***********************************************************************/
981 {
982  assert( Abc_NtkIsLogic(pNode->pNtk) || Abc_NtkIsNetlist(pNode->pNtk) );
983  assert( Abc_ObjIsNode(pNode) );
984  if ( Abc_NtkHasSop(pNode->pNtk) )
985  Abc_SopComplement( (char *)pNode->pData );
986  else if ( Abc_NtkHasAig(pNode->pNtk) )
987  pNode->pData = Hop_Not( (Hop_Obj_t *)pNode->pData );
988  else if ( Abc_NtkHasBdd(pNode->pNtk) )
989  pNode->pData = Cudd_Not( pNode->pData );
990  else
991  assert( 0 );
992 }
993 
994 /**Function*************************************************************
995 
996  Synopsis [Changes the polarity of one fanin.]
997 
998  Description []
999 
1000  SideEffects []
1001 
1002  SeeAlso []
1003 
1004 ***********************************************************************/
1006 {
1007  int iFanin;
1008  if ( (iFanin = Vec_IntFind( &pNode->vFanins, pFanin->Id )) == -1 )
1009  {
1010  printf( "Node %s should be among", Abc_ObjName(pFanin) );
1011  printf( " the fanins of node %s...\n", Abc_ObjName(pNode) );
1012  return;
1013  }
1014  if ( Abc_NtkHasSop(pNode->pNtk) )
1015  Abc_SopComplementVar( (char *)pNode->pData, iFanin );
1016  else if ( Abc_NtkHasAig(pNode->pNtk) )
1017  pNode->pData = Hop_Complement( (Hop_Man_t *)pNode->pNtk->pManFunc, (Hop_Obj_t *)pNode->pData, iFanin );
1018  else if ( Abc_NtkHasBdd(pNode->pNtk) )
1019  {
1020  DdManager * dd = (DdManager *)pNode->pNtk->pManFunc;
1021  DdNode * bVar, * bCof0, * bCof1;
1022  bVar = Cudd_bddIthVar( dd, iFanin );
1023  bCof0 = Cudd_Cofactor( dd, (DdNode *)pNode->pData, Cudd_Not(bVar) ); Cudd_Ref( bCof0 );
1024  bCof1 = Cudd_Cofactor( dd, (DdNode *)pNode->pData, bVar ); Cudd_Ref( bCof1 );
1025  Cudd_RecursiveDeref( dd, (DdNode *)pNode->pData );
1026  pNode->pData = Cudd_bddIte( dd, bVar, bCof0, bCof1 ); Cudd_Ref( (DdNode *)pNode->pData );
1027  Cudd_RecursiveDeref( dd, bCof0 );
1028  Cudd_RecursiveDeref( dd, bCof1 );
1029  }
1030  else
1031  assert( 0 );
1032 }
1033 
1034 
1035 ////////////////////////////////////////////////////////////////////////
1036 /// END OF FILE ///
1037 ////////////////////////////////////////////////////////////////////////
1038 
1040 
Mio_Gate_t * Mio_LibraryReadBuf(Mio_Library_t *pLib)
Definition: mioApi.c:47
char * memset()
int nObjCounts[ABC_OBJ_NUMBER]
Definition: abc.h:171
int Nm_ManFindIdByName(Nm_Man_t *p, char *pName, int Type)
Definition: nmApi.c:219
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
Definition: abc.h:91
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
void Nm_ManDeleteIdName(Nm_Man_t *p, int ObjId)
Definition: nmApi.c:149
static int Abc_NtkHasBdd(Abc_Ntk_t *pNtk)
Definition: abc.h:254
ABC_DLL void * Abc_FrameReadLibGen()
Definition: mainFrame.c:56
int Abc_NodeIsConst1(Abc_Obj_t *pNode)
Definition: abcObj.c:890
Abc_Obj_t * Abc_NtkCreateNodeBuf(Abc_Ntk_t *pNtk, Abc_Obj_t *pFanin)
Definition: abcObj.c:692
static int Abc_NtkHasSop(Abc_Ntk_t *pNtk)
Definition: abc.h:253
static int Abc_ObjIsCi(Abc_Obj_t *pObj)
Definition: abc.h:351
Nm_Man_t * pManName
Definition: abc.h:160
void Cudd_RecursiveDeref(DdManager *table, DdNode *n)
Definition: cuddRef.c:154
Definition: cudd.h:278
#define Cudd_Not(node)
Definition: cudd.h:367
static int Abc_NtkObjNumMax(Abc_Ntk_t *pNtk)
Definition: abc.h:284
static Hop_Obj_t * Hop_ManConst1(Hop_Man_t *p)
Definition: hop.h:132
Vec_Ptr_t * vBoxes
Definition: abc.h:168
void Abc_NtkDeleteAll_rec(Abc_Obj_t *pObj)
Definition: abcObj.c:310
static int Abc_NtkIsNetlist(Abc_Ntk_t *pNtk)
Definition: abc.h:249
static int Abc_ObjIsLatch(Abc_Obj_t *pObj)
Definition: abc.h:356
static int Abc_ObjFanoutNum(Abc_Obj_t *pObj)
Definition: abc.h:365
DdNode * Cudd_ReadLogicZero(DdManager *dd)
Definition: cuddAPI.c:1058
static Abc_Obj_t * Abc_ObjFanin0Ntk(Abc_Obj_t *pObj)
Definition: abc.h:375
Hop_Obj_t * Hop_Transfer(Hop_Man_t *pSour, Hop_Man_t *pDest, Hop_Obj_t *pObj, int nVars)
Definition: hopDfs.c:353
ABC_DLL char * Abc_SopCreateAnd(Mem_Flex_t *pMan, int nVars, int *pfCompl)
Definition: abcSop.c:162
Abc_Obj_t * Abc_NtkFindCo(Abc_Ntk_t *pNtk, char *pName)
Definition: abcObj.c:554
static int Abc_ObjFaninNum(Abc_Obj_t *pObj)
Definition: abc.h:364
static int Abc_NtkHasMapping(Abc_Ntk_t *pNtk)
Definition: abc.h:256
void Abc_ObjRecycle(Abc_Obj_t *pObj)
Definition: abcObj.c:74
Abc_Obj_t * Abc_NtkDupObj(Abc_Ntk_t *pNtkNew, Abc_Obj_t *pObj, int fCopyName)
Definition: abcObj.c:337
ABC_DLL int Abc_SopIsInv(char *pSop)
Definition: abcSop.c:728
static int Abc_ObjIsPi(Abc_Obj_t *pObj)
Definition: abc.h:347
static int Vec_IntFind(Vec_Int_t *p, int Entry)
Definition: vecInt.h:895
Abc_Obj_t * Abc_NtkDupBox(Abc_Ntk_t *pNtkNew, Abc_Obj_t *pBox, int fCopyName)
Definition: abcObj.c:407
Abc_Obj_t * Abc_NtkFindCi(Abc_Ntk_t *pNtk, char *pName)
Definition: abcObj.c:530
Hop_Obj_t * Hop_CreateExor(Hop_Man_t *p, int nVars)
Definition: hopOper.c:362
Vec_Int_t vFanins
Definition: abc.h:143
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
Vec_Ptr_t * vObjs
Definition: abc.h:162
Abc_Obj_t * Abc_NtkCreateNodeAnd(Abc_Ntk_t *pNtk, Vec_Ptr_t *vFanins)
Definition: abcObj.c:722
Abc_Obj_t * Abc_NtkCreateObj(Abc_Ntk_t *pNtk, Abc_ObjType_t Type)
Definition: abcObj.c:106
ABC_DLL char * Abc_ObjAssignName(Abc_Obj_t *pObj, char *pName, char *pSuffix)
Definition: abcNames.c:68
DdNode * Cudd_bddIte(DdManager *dd, DdNode *f, DdNode *g, DdNode *h)
Definition: cuddBddIte.c:143
Vec_Ptr_t * vPis
Definition: abc.h:163
void Abc_NtkDeleteObj_rec(Abc_Obj_t *pObj, int fOnlyNodes)
Definition: abcObj.c:273
static int Abc_NtkHasBlifMv(Abc_Ntk_t *pNtk)
Definition: abc.h:257
static Abc_Obj_t * Abc_NtkObj(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:314
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
unsigned Type
Definition: abc.h:133
Abc_Obj_t * Abc_NtkFindNet(Abc_Ntk_t *pNtk, char *pName)
Definition: abcObj.c:507
void Abc_NtkDeleteObj(Abc_Obj_t *pObj)
Definition: abcObj.c:167
static Hop_Obj_t * Hop_Not(Hop_Obj_t *p)
Definition: hop.h:127
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
Definition: hop.h:65
Hop_Obj_t * Hop_Mux(Hop_Man_t *p, Hop_Obj_t *pC, Hop_Obj_t *p1, Hop_Obj_t *p0)
Definition: hopOper.c:187
ABC_DLL int Abc_SopIsBuf(char *pSop)
Definition: abcSop.c:708
static void Vec_PtrRemove(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:714
DdNode * Extra_bddCreateOr(DdManager *dd, int nVars)
Definition: extraBddMisc.c:883
static int Abc_ObjIsCo(Abc_Obj_t *pObj)
Definition: abc.h:352
DdNode * Cudd_bddTransfer(DdManager *ddSource, DdManager *ddDestination, DdNode *f)
Definition: cuddBridge.c:409
int nObjs
Definition: abc.h:172
ABC_DLL void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
Definition: abcFanio.c:84
Abc_Obj_t * Abc_NtkFindNode(Abc_Ntk_t *pNtk, char *pName)
Definition: abcObj.c:456
Vec_Ptr_t * vCis
Definition: abc.h:165
ABC_DLL void Abc_SopComplementVar(char *pSop, int iVar)
Definition: abcSop.c:630
Mio_Gate_t * Mio_LibraryReadConst1(Mio_Library_t *pLib)
Definition: mioApi.c:50
Abc_Obj_t * Abc_NtkCreateNodeExor(Abc_Ntk_t *pNtk, Vec_Ptr_t *vFanins)
Definition: abcObj.c:782
char * Nm_ManStoreIdName(Nm_Man_t *p, int ObjId, int Type, char *pName, char *pSuffix)
Definition: nmApi.c:112
void * pManFunc
Definition: abc.h:191
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
ABC_DLL char * Abc_SopRegister(Mem_Flex_t *pMan, char *pName)
DECLARATIONS ///.
Definition: abcSop.c:56
#define Cudd_IsComplement(node)
Definition: cudd.h:425
Abc_Obj_t * pCopy
Definition: abc.h:148
Mem_Fixed_t * pMmObj
Definition: abc.h:189
Vec_Ptr_t * vPos
Definition: abc.h:164
DdNode * Cudd_Cofactor(DdManager *dd, DdNode *f, DdNode *g)
Definition: cuddCof.c:123
Abc_Obj_t * Abc_NtkCreateNodeInv(Abc_Ntk_t *pNtk, Abc_Obj_t *pFanin)
Definition: abcObj.c:662
Vec_Ptr_t * vCos
Definition: abc.h:166
Hop_Obj_t * Hop_CreateAnd(Hop_Man_t *p, int nVars)
Definition: hopOper.c:320
static int Abc_NtkHasBlackbox(Abc_Ntk_t *pNtk)
Definition: abc.h:258
void Abc_NodeComplementInput(Abc_Obj_t *pNode, Abc_Obj_t *pFanin)
Definition: abcObj.c:1005
int Abc_NodeIsConst(Abc_Obj_t *pNode)
Definition: abcObj.c:843
int Abc_NodeIsInv(Abc_Obj_t *pNode)
Definition: abcObj.c:950
#define ABC_NAMESPACE_IMPL_END
Definition: abc_global.h:108
char * Nm_ManFindNameById(Nm_Man_t *p, int ObjId)
Definition: nmApi.c:199
void Abc_NodeComplement(Abc_Obj_t *pNode)
Definition: abcObj.c:980
static int Hop_IsComplement(Hop_Obj_t *p)
Definition: hop.h:129
Abc_ObjType_t
Definition: abc.h:86
STRUCTURE DEFINITIONS ///.
Definition: mioInt.h:61
ABC_DLL int Abc_SopIsConst0(char *pSop)
Definition: abcSop.c:676
ABC_DLL int Abc_SopIsConst1(char *pSop)
Definition: abcSop.c:692
Abc_Obj_t * Abc_NtkCreateNodeMux(Abc_Ntk_t *pNtk, Abc_Obj_t *pNodeC, Abc_Obj_t *pNode1, Abc_Obj_t *pNode0)
Definition: abcObj.c:812
void Mem_FixedEntryRecycle(Mem_Fixed_t *p, char *pEntry)
Definition: mem.c:219
static Abc_Obj_t * Abc_ObjFanout0Ntk(Abc_Obj_t *pObj)
Definition: abc.h:376
DdNode * Extra_bddCreateExor(DdManager *dd, int nVars)
Definition: extraBddMisc.c:908
int Abc_NodeIsBuf(Abc_Obj_t *pNode)
Definition: abcObj.c:920
void Abc_NtkDeleteObjPo(Abc_Obj_t *pObj)
Definition: abcObj.c:244
ABC_NAMESPACE_IMPL_START Abc_Obj_t * Abc_ObjAlloc(Abc_Ntk_t *pNtk, Abc_ObjType_t Type)
DECLARATIONS ///.
Definition: abcObj.c:49
static void Vec_PtrWriteEntry(Vec_Ptr_t *p, int i, void *Entry)
Definition: vecPtr.h:396
#define ABC_NAMESPACE_IMPL_START
Definition: abc_global.h:107
Vec_Int_t vFanouts
Definition: abc.h:144
Abc_Obj_t * Abc_NtkFindOrCreateNet(Abc_Ntk_t *pNtk, char *pName)
Definition: abcObj.c:579
DdNode * Cudd_ReadOne(DdManager *dd)
Definition: cuddAPI.c:987
Hop_Obj_t * Hop_CreateOr(Hop_Man_t *p, int nVars)
Definition: hopOper.c:341
Abc_Ntk_t * pNtk
Definition: abc.h:130
Definition: abc.h:89
ABC_DLL void Abc_SopComplement(char *pSop)
Definition: abcSop.c:600
#define Abc_ObjForEachFanout(pObj, pFanout, i)
Definition: abc.h:526
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
Abc_NtkFunc_t ntkFunc
Definition: abc.h:157
#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
Abc_Obj_t * Abc_NtkCloneObj(Abc_Obj_t *pObj)
Definition: abcObj.c:434
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
Definition: abcNames.c:48
DdNode * Extra_bddCreateAnd(DdManager *dd, int nVars)
Definition: extraBddMisc.c:858
DdNode * Cudd_bddIthVar(DdManager *dd, int i)
Definition: cuddAPI.c:416
ABC_DLL char * Abc_SopCreateXorSpecial(Mem_Flex_t *pMan, int nVars)
Definition: abcSop.c:291
static Abc_Obj_t * Abc_NtkCreateNode(Abc_Ntk_t *pNtk)
Definition: abc.h:308
static int Abc_ObjIsNet(Abc_Obj_t *pObj)
Definition: abc.h:354
Definition: abc.h:90
ABC_DLL void Abc_NodeCollectFanins(Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
Definition: abcUtil.c:1587
Abc_Obj_t * Abc_NtkCreateNodeOr(Abc_Ntk_t *pNtk, Vec_Ptr_t *vFanins)
Definition: abcObj.c:752
Mem_Step_t * pMmStep
Definition: abc.h:190
static int Abc_ObjIsPo(Abc_Obj_t *pObj)
Definition: abc.h:348
Abc_Obj_t * Abc_NtkCreateNodeConst0(Abc_Ntk_t *pNtk)
Definition: abcObj.c:604
Definition: abc.h:92
ABC_DLL void Abc_ObjDeleteFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
Definition: abcFanio.c:111
#define assert(ex)
Definition: util_old.h:213
static int Abc_NtkHasAig(Abc_Ntk_t *pNtk)
Definition: abc.h:255
static int Abc_ObjIsBox(Abc_Obj_t *pObj)
Definition: abc.h:357
static Hop_Obj_t * Hop_ManConst0(Hop_Man_t *p)
Definition: hop.h:131
int Abc_NodeIsConst0(Abc_Obj_t *pNode)
Definition: abcObj.c:860
void * pData
Definition: abc.h:145
void Cudd_Ref(DdNode *n)
Definition: cuddRef.c:129
ABC_DLL void Abc_NodeCollectFanouts(Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
Definition: abcUtil.c:1607
#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
char * Mem_FixedEntryFetch(Mem_Fixed_t *p)
Definition: mem.c:168
Mio_Gate_t * Mio_LibraryReadConst0(Mio_Library_t *pLib)
Definition: mioApi.c:49
ABC_DLL char * Abc_SopCreateOr(Mem_Flex_t *pMan, int nVars, int *pfCompl)
Definition: abcSop.c:206
Mio_Gate_t * Mio_LibraryReadInv(Mio_Library_t *pLib)
Definition: mioApi.c:48
typedefABC_NAMESPACE_HEADER_START struct Hop_Man_t_ Hop_Man_t
INCLUDES ///.
Definition: hop.h:49
Hop_Obj_t * Hop_IthVar(Hop_Man_t *p, int i)
FUNCTION DEFINITIONS ///.
Definition: hopOper.c:63
static Abc_Obj_t * Abc_ObjFanout0(Abc_Obj_t *pObj)
Definition: abc.h:371
Hop_Obj_t * Hop_Complement(Hop_Man_t *p, Hop_Obj_t *pRoot, int iVar)
Definition: hopDfs.c:469
Abc_Obj_t * Abc_NtkCreateNodeConst1(Abc_Ntk_t *pNtk)
Definition: abcObj.c:633
static Abc_Obj_t * Abc_NtkCreateNet(Abc_Ntk_t *pNtk)
Definition: abc.h:307
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223