abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
abcStrash.c File Reference
#include "base/abc/abc.h"
#include "bool/dec/dec.h"

Go to the source code of this file.

Functions

static
ABC_NAMESPACE_IMPL_START void 
Abc_NtkStrashPerform (Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtkNew, int fAllNodes, int fRecord)
 DECLARATIONS ///. More...
 
Abc_Ntk_tAbc_NtkRestrash (Abc_Ntk_t *pNtk, int fCleanup)
 FUNCTION DEFINITIONS ///. More...
 
void Abc_NtkRestrashRandom_rec (Abc_Ntk_t *pNtk, Abc_Obj_t *pObj)
 
Abc_Ntk_tAbc_NtkRestrashRandom (Abc_Ntk_t *pNtk)
 
Abc_Ntk_tAbc_NtkRestrashZero (Abc_Ntk_t *pNtk, int fCleanup)
 
Abc_Ntk_tAbc_NtkStrash (Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
 
int Abc_NtkAppend (Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int fAddPos)
 
void Abc_NodeStrash_rec (Abc_Aig_t *pMan, Hop_Obj_t *pObj)
 
Abc_Obj_tAbc_NodeStrash (Abc_Ntk_t *pNtkNew, Abc_Obj_t *pNodeOld, int fRecord)
 
Abc_Obj_tAbc_NtkTopmost_rec (Abc_Ntk_t *pNtkNew, Abc_Obj_t *pNode, int LevelCut)
 
Abc_Ntk_tAbc_NtkTopmost (Abc_Ntk_t *pNtk, int nLevels)
 
static int Vec_CompareNodeIds (Abc_Obj_t **pp1, Abc_Obj_t **pp2)
 
Vec_Ptr_tAbc_NodeGetSuper (Abc_Obj_t *pNode)
 
Abc_Ntk_tAbc_NtkTopAnd (Abc_Ntk_t *pNtk)
 
void Abc_NtkWriteAig (Abc_Ntk_t *pNtk, char *pFileName)
 
Abc_Ntk_tAbc_NtkPutOnTop (Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtk2)
 

Function Documentation

Vec_Ptr_t* Abc_NodeGetSuper ( Abc_Obj_t pNode)

Function*************************************************************

Synopsis [Collects the large supergate.]

Description []

SideEffects []

SeeAlso []

Definition at line 613 of file abcStrash.c.

614 {
615  Vec_Ptr_t * vSuper, * vFront;
616  Abc_Obj_t * pAnd, * pFanin;
617  int i;
618  assert( Abc_ObjIsNode(pNode) && !Abc_ObjIsComplement(pNode) );
619  vSuper = Vec_PtrAlloc( 100 );
620  // explore the frontier
621  vFront = Vec_PtrAlloc( 100 );
622  Vec_PtrPush( vFront, pNode );
623  Vec_PtrForEachEntry( Abc_Obj_t *, vFront, pAnd, i )
624  {
625  pFanin = Abc_ObjChild0(pAnd);
626  if ( Abc_ObjIsNode(pFanin) && !Abc_ObjIsComplement(pFanin) && Abc_ObjFanoutNum(pFanin) == 1 )
627  Vec_PtrPush( vFront, pFanin );
628  else
629  Vec_PtrPush( vSuper, pFanin );
630 
631  pFanin = Abc_ObjChild1(pAnd);
632  if ( Abc_ObjIsNode(pFanin) && !Abc_ObjIsComplement(pFanin) && Abc_ObjFanoutNum(pFanin) == 1 )
633  Vec_PtrPush( vFront, pFanin );
634  else
635  Vec_PtrPush( vSuper, pFanin );
636  }
637  Vec_PtrFree( vFront );
638  // reverse the array of pointers to start with lower IDs
639  vFront = Vec_PtrAlloc( Vec_PtrSize(vSuper) );
640  Vec_PtrForEachEntryReverse( Abc_Obj_t *, vSuper, pNode, i )
641  Vec_PtrPush( vFront, pNode );
642  Vec_PtrFree( vSuper );
643  vSuper = vFront;
644  // uniquify and return the frontier
645  Vec_PtrUniqify( vSuper, (int (*)())Vec_CompareNodeIds );
646  return vSuper;
647 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
#define Vec_PtrForEachEntryReverse(Type, vVec, pEntry, i)
Definition: vecPtr.h:63
static int Abc_ObjFanoutNum(Abc_Obj_t *pObj)
Definition: abc.h:365
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
static void Vec_PtrUniqify(Vec_Ptr_t *p, int(*Vec_PtrSortCompare)()) ___unused
Definition: vecPtr.h:875
static Abc_Obj_t * Abc_ObjChild0(Abc_Obj_t *pObj)
Definition: abc.h:383
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
static int Vec_CompareNodeIds(Abc_Obj_t **pp1, Abc_Obj_t **pp2)
Definition: abcStrash.c:593
#define assert(ex)
Definition: util_old.h:213
#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
static Abc_Obj_t * Abc_ObjChild1(Abc_Obj_t *pObj)
Definition: abc.h:384
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
Abc_Obj_t* Abc_NodeStrash ( Abc_Ntk_t pNtkNew,
Abc_Obj_t pNodeOld,
int  fRecord 
)

Function*************************************************************

Synopsis [Strashes one logic node.]

Description [Assume the network is in the AIG form]

SideEffects []

SeeAlso []

Definition at line 468 of file abcStrash.c.

469 {
470  Hop_Man_t * pMan;
471  Hop_Obj_t * pRoot;
472  Abc_Obj_t * pFanin;
473  int i;
474  assert( Abc_ObjIsNode(pNodeOld) );
475  assert( Abc_NtkHasAig(pNodeOld->pNtk) && !Abc_NtkIsStrash(pNodeOld->pNtk) );
476  // get the local AIG manager and the local root node
477  pMan = (Hop_Man_t *)pNodeOld->pNtk->pManFunc;
478  pRoot = (Hop_Obj_t *)pNodeOld->pData;
479  // check the constant case
480  if ( Abc_NodeIsConst(pNodeOld) || Hop_Regular(pRoot) == Hop_ManConst1(pMan) )
481  return Abc_ObjNotCond( Abc_AigConst1(pNtkNew), Hop_IsComplement(pRoot) );
482  // perform special case-strashing using the record of AIG subgraphs
483 /*
484  if ( fRecord && Abc_NtkRecIsRunning() && Abc_ObjFaninNum(pNodeOld) > 2 && Abc_ObjFaninNum(pNodeOld) <= Abc_NtkRecVarNum() )
485  {
486  extern Vec_Int_t * Abc_NtkRecMemory();
487  extern int Abc_NtkRecStrashNode( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pObj, unsigned * pTruth, int nVars );
488  int nVars = Abc_NtkRecVarNum();
489  Vec_Int_t * vMemory = Abc_NtkRecMemory();
490  unsigned * pTruth = Hop_ManConvertAigToTruth( pMan, Hop_Regular(pRoot), nVars, vMemory, 0 );
491  assert( Extra_TruthSupportSize(pTruth, nVars) == Abc_ObjFaninNum(pNodeOld) ); // should be swept
492  if ( Hop_IsComplement(pRoot) )
493  Extra_TruthNot( pTruth, pTruth, nVars );
494  if ( Abc_NtkRecStrashNode( pNtkNew, pNodeOld, pTruth, nVars ) )
495  return pNodeOld->pCopy;
496  }
497 */
498  // set elementary variables
499  Abc_ObjForEachFanin( pNodeOld, pFanin, i )
500  Hop_IthVar(pMan, i)->pData = pFanin->pCopy;
501  // strash the AIG of this node
502  Abc_NodeStrash_rec( (Abc_Aig_t *)pNtkNew->pManFunc, Hop_Regular(pRoot) );
504  // return the final node
505  return Abc_ObjNotCond( (Abc_Obj_t *)Hop_Regular(pRoot)->pData, Hop_IsComplement(pRoot) );
506 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL int Abc_NodeIsConst(Abc_Obj_t *pNode)
Definition: abcObj.c:843
static Hop_Obj_t * Hop_ManConst1(Hop_Man_t *p)
Definition: hop.h:132
ABC_DLL Abc_Obj_t * Abc_AigConst1(Abc_Ntk_t *pNtk)
Definition: abcAig.c:683
Definition: hop.h:65
DECLARATIONS ///.
Definition: abcAig.c:52
void Hop_ConeUnmark_rec(Hop_Obj_t *pObj)
Definition: hopDfs.c:257
void * pManFunc
Definition: abc.h:191
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
static int Hop_IsComplement(Hop_Obj_t *p)
Definition: hop.h:129
void Abc_NodeStrash_rec(Abc_Aig_t *pMan, Hop_Obj_t *pObj)
Definition: abcStrash.c:445
Abc_Ntk_t * pNtk
Definition: abc.h:130
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition: abc.h:524
static Abc_Obj_t * Abc_ObjNotCond(Abc_Obj_t *p, int c)
Definition: abc.h:325
#define assert(ex)
Definition: util_old.h:213
static int Abc_NtkHasAig(Abc_Ntk_t *pNtk)
Definition: abc.h:255
void * pData
Definition: abc.h:145
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
Hop_Obj_t * Hop_IthVar(Hop_Man_t *p, int i)
FUNCTION DEFINITIONS ///.
Definition: hopOper.c:63
void Abc_NodeStrash_rec ( Abc_Aig_t pMan,
Hop_Obj_t pObj 
)

Function*************************************************************

Synopsis [Transfers the AIG from one manager into another.]

Description []

SideEffects []

SeeAlso []

Definition at line 445 of file abcStrash.c.

446 {
447  assert( !Hop_IsComplement(pObj) );
448  if ( !Hop_ObjIsNode(pObj) || Hop_ObjIsMarkA(pObj) )
449  return;
450  Abc_NodeStrash_rec( pMan, Hop_ObjFanin0(pObj) );
451  Abc_NodeStrash_rec( pMan, Hop_ObjFanin1(pObj) );
452  pObj->pData = Abc_AigAnd( pMan, (Abc_Obj_t *)Hop_ObjChild0Copy(pObj), (Abc_Obj_t *)Hop_ObjChild1Copy(pObj) );
453  assert( !Hop_ObjIsMarkA(pObj) ); // loop detection
454  Hop_ObjSetMarkA( pObj );
455 }
static Hop_Obj_t * Hop_ObjFanin1(Hop_Obj_t *pObj)
Definition: hop.h:183
static int Hop_ObjIsMarkA(Hop_Obj_t *pObj)
Definition: hop.h:164
static void Hop_ObjSetMarkA(Hop_Obj_t *pObj)
Definition: hop.h:165
static int Hop_ObjIsNode(Hop_Obj_t *pObj)
Definition: hop.h:160
ABC_DLL Abc_Obj_t * Abc_AigAnd(Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
Definition: abcAig.c:700
static Hop_Obj_t * Hop_ObjChild1Copy(Hop_Obj_t *pObj)
Definition: hop.h:187
static int Hop_IsComplement(Hop_Obj_t *p)
Definition: hop.h:129
static Hop_Obj_t * Hop_ObjChild0Copy(Hop_Obj_t *pObj)
Definition: hop.h:186
void Abc_NodeStrash_rec(Abc_Aig_t *pMan, Hop_Obj_t *pObj)
Definition: abcStrash.c:445
void * pData
Definition: hop.h:68
static Hop_Obj_t * Hop_ObjFanin0(Hop_Obj_t *pObj)
Definition: hop.h:182
#define assert(ex)
Definition: util_old.h:213
int Abc_NtkAppend ( Abc_Ntk_t pNtk1,
Abc_Ntk_t pNtk2,
int  fAddPos 
)

Function*************************************************************

Synopsis [Appends the second network to the first.]

Description [Modifies the first network by adding the logic of the second. Performs structural hashing while appending the networks. Does not change the second network. Returns 0 if the appending failed, 1 otherise.]

SideEffects []

SeeAlso []

Definition at line 320 of file abcStrash.c.

321 {
322  Abc_Obj_t * pObj;
323  char * pName;
324  int i, nNewCis;
325  // the first network should be an AIG
326  assert( Abc_NtkIsStrash(pNtk1) );
327  assert( Abc_NtkIsLogic(pNtk2) || Abc_NtkIsStrash(pNtk2) );
328  if ( Abc_NtkIsLogic(pNtk2) && !Abc_NtkToAig(pNtk2) )
329  {
330  printf( "Converting to AIGs has failed.\n" );
331  return 0;
332  }
333  // check that the networks have the same PIs
334  // reorder PIs of pNtk2 according to pNtk1
335  if ( !Abc_NtkCompareSignals( pNtk1, pNtk2, 1, 1 ) )
336  printf( "Abc_NtkAppend(): The union of the network PIs is computed (warning).\n" );
337  // perform strashing
338  nNewCis = 0;
339  Abc_NtkCleanCopy( pNtk2 );
340  if ( Abc_NtkIsStrash(pNtk2) )
341  Abc_AigConst1(pNtk2)->pCopy = Abc_AigConst1(pNtk1);
342  Abc_NtkForEachCi( pNtk2, pObj, i )
343  {
344  pName = Abc_ObjName(pObj);
345  pObj->pCopy = Abc_NtkFindCi(pNtk1, Abc_ObjName(pObj));
346  if ( pObj->pCopy == NULL )
347  {
348  pObj->pCopy = Abc_NtkDupObj(pNtk1, pObj, 1);
349  nNewCis++;
350  }
351  }
352  if ( nNewCis )
353  printf( "Warning: Procedure Abc_NtkAppend() added %d new CIs.\n", nNewCis );
354  // add pNtk2 to pNtk1 while strashing
355  if ( Abc_NtkIsLogic(pNtk2) )
356  Abc_NtkStrashPerform( pNtk2, pNtk1, 1, 0 );
357  else
358  Abc_NtkForEachNode( pNtk2, pObj, i )
359  pObj->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtk1->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
360  // add the COs of the second network
361  if ( fAddPos )
362  {
363  Abc_NtkForEachPo( pNtk2, pObj, i )
364  {
365  Abc_NtkDupObj( pNtk1, pObj, 0 );
366  Abc_ObjAddFanin( pObj->pCopy, Abc_ObjChild0Copy(pObj) );
367  Abc_ObjAssignName( pObj->pCopy, Abc_ObjName(pObj), NULL );
368  }
369  }
370  else
371  {
372  Abc_Obj_t * pObjOld, * pDriverOld, * pDriverNew;
373  int fCompl, iNodeId;
374  // OR the choices
375  Abc_NtkForEachCo( pNtk2, pObj, i )
376  {
378 // if ( iNodeId < 0 )
379 // continue;
380  assert( iNodeId >= 0 );
381  pObjOld = Abc_NtkObj( pNtk1, iNodeId );
382  // derive the new driver
383  pDriverOld = Abc_ObjChild0( pObjOld );
384  pDriverNew = Abc_ObjChild0Copy( pObj );
385  pDriverNew = Abc_AigOr( (Abc_Aig_t *)pNtk1->pManFunc, pDriverOld, pDriverNew );
386  if ( Abc_ObjRegular(pDriverOld) == Abc_ObjRegular(pDriverNew) )
387  continue;
388  // replace the old driver by the new driver
389  fCompl = Abc_ObjRegular(pDriverOld)->fPhase ^ Abc_ObjRegular(pDriverNew)->fPhase;
390  Abc_ObjPatchFanin( pObjOld, Abc_ObjRegular(pDriverOld), Abc_ObjNotCond(Abc_ObjRegular(pDriverNew), fCompl) );
391  }
392  }
393  // make sure that everything is okay
394  if ( !Abc_NtkCheck( pNtk1 ) )
395  {
396  printf( "Abc_NtkAppend: The network check has failed.\n" );
397  return 0;
398  }
399  return 1;
400 }
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
ABC_DLL Abc_Obj_t * Abc_AigOr(Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
Definition: abcAig.c:719
static ABC_NAMESPACE_IMPL_START void Abc_NtkStrashPerform(Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtkNew, int fAllNodes, int fRecord)
DECLARATIONS ///.
Definition: abcStrash.c:413
Nm_Man_t * pManName
Definition: abc.h:160
ABC_DLL Abc_Obj_t * Abc_AigConst1(Abc_Ntk_t *pNtk)
Definition: abcAig.c:683
static Abc_Obj_t * Abc_ObjChild1Copy(Abc_Obj_t *pObj)
Definition: abc.h:387
ABC_DLL Abc_Obj_t * Abc_NtkDupObj(Abc_Ntk_t *pNtkNew, Abc_Obj_t *pObj, int fCopyName)
Definition: abcObj.c:337
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition: abc.h:519
ABC_DLL int Abc_NtkCompareSignals(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int fOnlyPis, int fComb)
Definition: abcCheck.c:741
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition: abcCheck.c:61
ABC_DLL char * Abc_ObjAssignName(Abc_Obj_t *pObj, char *pName, char *pSuffix)
Definition: abcNames.c:68
static Abc_Obj_t * Abc_NtkObj(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:314
DECLARATIONS ///.
Definition: abcAig.c:52
ABC_DLL Abc_Obj_t * Abc_NtkFindCi(Abc_Ntk_t *pNtk, char *pName)
Definition: abcObj.c:530
ABC_DLL void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
Definition: abcFanio.c:84
static Abc_Obj_t * Abc_ObjChild0(Abc_Obj_t *pObj)
Definition: abc.h:383
ABC_DLL void Abc_ObjPatchFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFaninOld, Abc_Obj_t *pFaninNew)
Definition: abcFanio.c:172
void * pManFunc
Definition: abc.h:191
ABC_DLL Abc_Obj_t * Abc_AigAnd(Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
Definition: abcAig.c:700
static Abc_Obj_t * Abc_ObjChild0Copy(Abc_Obj_t *pObj)
Definition: abc.h:386
Abc_Obj_t * pCopy
Definition: abc.h:148
int Nm_ManFindIdByNameTwoTypes(Nm_Man_t *p, char *pName, int Type1, int Type2)
Definition: nmApi.c:239
if(last==0)
Definition: sparse_int.h:34
#define Abc_NtkForEachNode(pNtk, pNode, i)
Definition: abc.h:461
static Abc_Obj_t * Abc_ObjRegular(Abc_Obj_t *p)
Definition: abc.h:323
#define Abc_NtkForEachCi(pNtk, pCi, i)
Definition: abc.h:515
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
Definition: abcNames.c:48
Definition: abc.h:90
ABC_DLL int Abc_NtkToAig(Abc_Ntk_t *pNtk)
Definition: abcFunc.c:1192
ABC_DLL void Abc_NtkCleanCopy(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:507
static Abc_Obj_t * Abc_ObjNotCond(Abc_Obj_t *p, int c)
Definition: abc.h:325
#define assert(ex)
Definition: util_old.h:213
#define Abc_NtkForEachPo(pNtk, pPo, i)
Definition: abc.h:517
unsigned fPhase
Definition: abc.h:137
Abc_Ntk_t* Abc_NtkPutOnTop ( Abc_Ntk_t pNtk,
Abc_Ntk_t pNtk2 
)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 791 of file abcStrash.c.

792 {
793  Vec_Ptr_t * vNodes;
794  Abc_Ntk_t * pNtkNew;
795  Abc_Obj_t * pObj, * pFanin;
796  int i, k;
797  assert( Abc_NtkIsLogic(pNtk) );
798  assert( Abc_NtkIsLogic(pNtk2) );
799  assert( Abc_NtkPoNum(pNtk) == Abc_NtkPiNum(pNtk2) );
800  // clean the node copy fields
801  Abc_NtkCleanCopy( pNtk );
802  Abc_NtkCleanCopy( pNtk2 );
803  // duplicate the name and the spec
804  pNtkNew = Abc_NtkAlloc( pNtk->ntkType, pNtk->ntkFunc, 1 );
805  pNtkNew->pName = Extra_UtilStrsav(pNtk->pName);
806  pNtkNew->pSpec = Extra_UtilStrsav(pNtk->pSpec);
807  // clone CIs/CIs/boxes
808  Abc_NtkForEachPi( pNtk, pObj, i )
809  Abc_NtkDupObj( pNtkNew, pObj, 1 );
810  // add internal nodes
811  vNodes = Abc_NtkDfs( pNtk, 0 );
812  Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
813  {
814  Abc_NtkDupObj( pNtkNew, pObj, 0 );
815  Abc_ObjForEachFanin( pObj, pFanin, k )
816  Abc_ObjAddFanin( pObj->pCopy, pFanin->pCopy );
817  }
818  Vec_PtrFree( vNodes );
819  // transfer to the POs
820  Abc_NtkForEachPi( pNtk2, pObj, i )
821  pObj->pCopy = Abc_ObjChild0Copy( Abc_NtkPo(pNtk, i) );
822  // add internal nodes
823  vNodes = Abc_NtkDfs( pNtk2, 0 );
824  Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
825  {
826  Abc_NtkDupObj( pNtkNew, pObj, 0 );
827  Abc_ObjForEachFanin( pObj, pFanin, k )
828  Abc_ObjAddFanin( pObj->pCopy, pFanin->pCopy );
829  }
830  Vec_PtrFree( vNodes );
831  // clone CIs/CIs/boxes
832  Abc_NtkForEachPo( pNtk2, pObj, i )
833  {
834  Abc_NtkDupObj( pNtkNew, pObj, 1 );
835  Abc_ObjAddFanin( pObj->pCopy, Abc_ObjChild0Copy(pObj) );
836  }
837  if ( !Abc_NtkCheck( pNtkNew ) )
838  fprintf( stdout, "Abc_NtkPutOnTop(): Network check has failed.\n" );
839  return pNtkNew;
840 }
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
ABC_DLL Abc_Obj_t * Abc_NtkDupObj(Abc_Ntk_t *pNtkNew, Abc_Obj_t *pObj, int fCopyName)
Definition: abcObj.c:337
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition: abcCheck.c:61
ABC_DLL Vec_Ptr_t * Abc_NtkDfs(Abc_Ntk_t *pNtk, int fCollectAll)
Definition: abcDfs.c:81
char * Extra_UtilStrsav(const char *s)
ABC_DLL void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
Definition: abcFanio.c:84
ABC_DLL Abc_Ntk_t * Abc_NtkAlloc(Abc_NtkType_t Type, Abc_NtkFunc_t Func, int fUseMemMan)
DECLARATIONS ///.
Definition: abcNtk.c:50
static Abc_Obj_t * Abc_ObjChild0Copy(Abc_Obj_t *pObj)
Definition: abc.h:386
char * pSpec
Definition: abc.h:159
static Abc_Obj_t * Abc_NtkPo(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:316
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
Abc_NtkFunc_t ntkFunc
Definition: abc.h:157
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition: abc.h:524
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:285
ABC_DLL void Abc_NtkCleanCopy(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:507
#define assert(ex)
Definition: util_old.h:213
#define Abc_NtkForEachPo(pNtk, pPo, i)
Definition: abc.h:517
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
char * pName
Definition: abc.h:158
Abc_NtkType_t ntkType
Definition: abc.h:156
#define Abc_NtkForEachPi(pNtk, pPi, i)
Definition: abc.h:513
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
Abc_Ntk_t* Abc_NtkRestrash ( Abc_Ntk_t pNtk,
int  fCleanup 
)

FUNCTION DEFINITIONS ///.

Function*************************************************************

Synopsis [Reapplies structural hashing to the AIG.]

Description [Because of the structural hashing, this procedure should not change the number of nodes. It is useful to detect the bugs in the original AIG.]

SideEffects []

SeeAlso []

Definition at line 49 of file abcStrash.c.

50 {
51 // extern int timeRetime;
52  Vec_Ptr_t * vNodes;
53  Abc_Ntk_t * pNtkAig;
54  Abc_Obj_t * pObj;
55  int i, nNodes;//, RetValue;
56  assert( Abc_NtkIsStrash(pNtk) );
57 //timeRetime = Abc_Clock();
58  // print warning about choice nodes
59  if ( Abc_NtkGetChoiceNum( pNtk ) )
60  printf( "Warning: The choice nodes in the original AIG are removed by strashing.\n" );
61  // start the new network (constants and CIs of the old network will point to the their counterparts in the new network)
62  pNtkAig = Abc_NtkStartFrom( pNtk, ABC_NTK_STRASH, ABC_FUNC_AIG );
63  // restrash the nodes (assuming a topological order of the old network)
64  vNodes = Abc_NtkDfs( pNtk, 0 );
65  Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
66  pObj->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkAig->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
67  Vec_PtrFree( vNodes );
68  // finalize the network
69  Abc_NtkFinalize( pNtk, pNtkAig );
70  // print warning about self-feed latches
71 // if ( Abc_NtkCountSelfFeedLatches(pNtkAig) )
72 // printf( "Warning: The network has %d self-feeding latches.\n", Abc_NtkCountSelfFeedLatches(pNtkAig) );
73  // perform cleanup if requested
74  if ( fCleanup && (nNodes = Abc_AigCleanup((Abc_Aig_t *)pNtkAig->pManFunc)) )
75  {
76 // printf( "Abc_NtkRestrash(): AIG cleanup removed %d nodes (this is a bug).\n", nNodes );
77  }
78  // duplicate EXDC
79  if ( pNtk->pExdc )
80  pNtkAig->pExdc = Abc_NtkDup( pNtk->pExdc );
81  // make sure everything is okay
82  if ( !Abc_NtkCheck( pNtkAig ) )
83  {
84  printf( "Abc_NtkStrash: The network check has failed.\n" );
85  Abc_NtkDelete( pNtkAig );
86  return NULL;
87  }
88 //timeRetime = Abc_Clock() - timeRetime;
89 // if ( RetValue = Abc_NtkRemoveSelfFeedLatches(pNtkAig) )
90 // printf( "Modified %d self-feeding latches. The result may not verify.\n", RetValue );
91  return pNtkAig;
92 
93 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
Abc_Ntk_t * pExdc
Definition: abc.h:201
static Abc_Obj_t * Abc_ObjChild1Copy(Abc_Obj_t *pObj)
Definition: abc.h:387
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:419
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition: abcCheck.c:61
ABC_DLL Vec_Ptr_t * Abc_NtkDfs(Abc_Ntk_t *pNtk, int fCollectAll)
Definition: abcDfs.c:81
ABC_DLL int Abc_NtkGetChoiceNum(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:430
DECLARATIONS ///.
Definition: abcAig.c:52
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
ABC_DLL Abc_Obj_t * Abc_AigAnd(Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
Definition: abcAig.c:700
static Abc_Obj_t * Abc_ObjChild0Copy(Abc_Obj_t *pObj)
Definition: abc.h:386
ABC_DLL Abc_Ntk_t * Abc_NtkStartFrom(Abc_Ntk_t *pNtk, Abc_NtkType_t Type, Abc_NtkFunc_t Func)
Definition: abcNtk.c:106
ABC_DLL int Abc_AigCleanup(Abc_Aig_t *pMan)
Definition: abcAig.c:194
if(last==0)
Definition: sparse_int.h:34
ABC_DLL void Abc_NtkFinalize(Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtkNew)
Definition: abcNtk.c:302
#define assert(ex)
Definition: util_old.h:213
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
Abc_Ntk_t* Abc_NtkRestrashRandom ( Abc_Ntk_t pNtk)

Function*************************************************************

Synopsis [Reapplies structural hashing to the AIG.]

Description [Because of the structural hashing, this procedure should not change the number of nodes. It is useful to detect the bugs in the original AIG.]

SideEffects []

SeeAlso []

Definition at line 138 of file abcStrash.c.

139 {
140  Abc_Ntk_t * pNtkAig;
141  Abc_Obj_t * pObj;
142  int i;
143  assert( Abc_NtkIsStrash(pNtk) );
144  // print warning about choice nodes
145  if ( Abc_NtkGetChoiceNum( pNtk ) )
146  printf( "Warning: The choice nodes in the original AIG are removed by strashing.\n" );
147  // start the new network (constants and CIs of the old network will point to the their counterparts in the new network)
148  pNtkAig = Abc_NtkStartFrom( pNtk, ABC_NTK_STRASH, ABC_FUNC_AIG );
149  // restrash the nodes (assuming a topological order of the old network)
150  Abc_NtkIncrementTravId( pNtk );
151  Abc_NtkForEachCo( pNtk, pObj, i )
152  Abc_NtkRestrashRandom_rec( pNtkAig, Abc_ObjFanin0(pObj) );
153  // finalize the network
154  Abc_NtkFinalize( pNtk, pNtkAig );
155  // duplicate EXDC
156  if ( pNtk->pExdc )
157  pNtkAig->pExdc = Abc_NtkDup( pNtk->pExdc );
158  // make sure everything is okay
159  if ( !Abc_NtkCheck( pNtkAig ) )
160  {
161  printf( "Abc_NtkStrash: The network check has failed.\n" );
162  Abc_NtkDelete( pNtkAig );
163  return NULL;
164  }
165  return pNtkAig;
166 
167 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:419
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition: abc.h:519
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition: abcCheck.c:61
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
ABC_DLL int Abc_NtkGetChoiceNum(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:430
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
ABC_DLL Abc_Ntk_t * Abc_NtkStartFrom(Abc_Ntk_t *pNtk, Abc_NtkType_t Type, Abc_NtkFunc_t Func)
Definition: abcNtk.c:106
if(last==0)
Definition: sparse_int.h:34
ABC_DLL void Abc_NtkFinalize(Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtkNew)
Definition: abcNtk.c:302
static void Abc_NtkIncrementTravId(Abc_Ntk_t *p)
Definition: abc.h:406
#define assert(ex)
Definition: util_old.h:213
void Abc_NtkRestrashRandom_rec(Abc_Ntk_t *pNtk, Abc_Obj_t *pObj)
Definition: abcStrash.c:106
void Abc_NtkRestrashRandom_rec ( Abc_Ntk_t pNtk,
Abc_Obj_t pObj 
)

Function*************************************************************

Synopsis [Performs structural hashing by generating random number.]

Description []

SideEffects []

SeeAlso []

Definition at line 106 of file abcStrash.c.

107 {
108  if ( Abc_NodeIsTravIdCurrent( pObj ) )
109  return;
110  Abc_NodeSetTravIdCurrent( pObj );
111  if ( !Abc_ObjIsNode(pObj) )
112  return;
113  if ( rand() & 1 )
114  {
117  }
118  else
119  {
122  }
123  pObj->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtk->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
124 }
static Abc_Obj_t * Abc_ObjFanin1(Abc_Obj_t *pObj)
Definition: abc.h:374
static Abc_Obj_t * Abc_ObjChild1Copy(Abc_Obj_t *pObj)
Definition: abc.h:387
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
DECLARATIONS ///.
Definition: abcAig.c:52
void * pManFunc
Definition: abc.h:191
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
ABC_DLL Abc_Obj_t * Abc_AigAnd(Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
Definition: abcAig.c:700
static Abc_Obj_t * Abc_ObjChild0Copy(Abc_Obj_t *pObj)
Definition: abc.h:386
Abc_Obj_t * pCopy
Definition: abc.h:148
static int Abc_NodeIsTravIdCurrent(Abc_Obj_t *p)
Definition: abc.h:411
void Abc_NtkRestrashRandom_rec(Abc_Ntk_t *pNtk, Abc_Obj_t *pObj)
Definition: abcStrash.c:106
static void Abc_NodeSetTravIdCurrent(Abc_Obj_t *p)
Definition: abc.h:409
Abc_Ntk_t* Abc_NtkRestrashZero ( Abc_Ntk_t pNtk,
int  fCleanup 
)

Function*************************************************************

Synopsis [Reapplies structural hashing to the AIG.]

Description [Because of the structural hashing, this procedure should not change the number of nodes. It is useful to detect the bugs in the original AIG.]

SideEffects []

SeeAlso []

Definition at line 181 of file abcStrash.c.

182 {
183 // extern int timeRetime;
184  Abc_Ntk_t * pNtkAig;
185  Abc_Obj_t * pObj;
186  int i, nNodes;//, RetValue;
187  int Counter = 0;
188  assert( Abc_NtkIsStrash(pNtk) );
189 //timeRetime = Abc_Clock();
190  // print warning about choice nodes
191  if ( Abc_NtkGetChoiceNum( pNtk ) )
192  printf( "Warning: The choice nodes in the original AIG are removed by strashing.\n" );
193  // start the new network (constants and CIs of the old network will point to the their counterparts in the new network)
194  pNtkAig = Abc_NtkStartFrom( pNtk, ABC_NTK_STRASH, ABC_FUNC_AIG );
195  // complement the 1-values registers
196  Abc_NtkForEachLatch( pNtk, pObj, i )
197  {
198  if ( Abc_LatchIsInitDc(pObj) )
199  Counter++;
200  else if ( Abc_LatchIsInit1(pObj) )
201  Abc_ObjFanout0(pObj)->pCopy = Abc_ObjNot(Abc_ObjFanout0(pObj)->pCopy);
202  }
203  if ( Counter )
204  printf( "Converting %d flops from don't-care to zero initial value.\n", Counter );
205  // restrash the nodes (assuming a topological order of the old network)
206  Abc_NtkForEachNode( pNtk, pObj, i )
207  pObj->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkAig->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
208  // finalize the network
209  Abc_NtkFinalize( pNtk, pNtkAig );
210  // complement the 1-valued registers
211  Abc_NtkForEachLatch( pNtkAig, pObj, i )
212  if ( Abc_LatchIsInit1(pObj) )
213  {
214  Abc_ObjXorFaninC( Abc_ObjFanin0(pObj), 0 );
215  // if latch has PO as one of its fanouts change latch name
216  if ( Abc_NodeFindCoFanout( Abc_ObjFanout0(pObj) ) )
217  {
218  Nm_ManDeleteIdName( pObj->pNtk->pManName, Abc_ObjFanout0(pObj)->Id );
220  }
221  }
222  // set all constant-0 values
223  Abc_NtkForEachLatch( pNtkAig, pObj, i )
224  Abc_LatchSetInit0( pObj );
225 
226  // print warning about self-feed latches
227 // if ( Abc_NtkCountSelfFeedLatches(pNtkAig) )
228 // printf( "Warning: The network has %d self-feeding latches.\n", Abc_NtkCountSelfFeedLatches(pNtkAig) );
229  // perform cleanup if requested
230  if ( fCleanup && (nNodes = Abc_AigCleanup((Abc_Aig_t *)pNtkAig->pManFunc)) )
231  printf( "Abc_NtkRestrash(): AIG cleanup removed %d nodes (this is a bug).\n", nNodes );
232  // duplicate EXDC
233  if ( pNtk->pExdc )
234  pNtkAig->pExdc = Abc_NtkDup( pNtk->pExdc );
235  // transfer name IDs
236  if ( pNtk->vNameIds )
237  Abc_NtkTransferNameIds( pNtk, pNtkAig );
238  if ( pNtk->vNameIds )
239  Abc_NtkUpdateNameIds( pNtkAig );
240  // make sure everything is okay
241  if ( !Abc_NtkCheck( pNtkAig ) )
242  {
243  printf( "Abc_NtkStrash: The network check has failed.\n" );
244  Abc_NtkDelete( pNtkAig );
245  return NULL;
246  }
247 //timeRetime = Abc_Clock() - timeRetime;
248 // if ( RetValue = Abc_NtkRemoveSelfFeedLatches(pNtkAig) )
249 // printf( "Modified %d self-feeding latches. The result may not verify.\n", RetValue );
250  return pNtkAig;
251 
252 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
void Nm_ManDeleteIdName(Nm_Man_t *p, int ObjId)
Definition: nmApi.c:149
Abc_Ntk_t * Abc_NtkRestrash(Abc_Ntk_t *pNtk, int fCleanup)
FUNCTION DEFINITIONS ///.
Definition: abcStrash.c:49
int nodes
Definition: abcSaucy.c:61
static Abc_Obj_t * Abc_ObjChild1Copy(Abc_Obj_t *pObj)
Definition: abc.h:387
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:419
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition: abcCheck.c:61
ABC_DLL 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
ABC_DLL int Abc_NtkGetChoiceNum(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:430
DECLARATIONS ///.
Definition: abcAig.c:52
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
ABC_DLL Abc_Obj_t * Abc_AigAnd(Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
Definition: abcAig.c:700
static Abc_Obj_t * Abc_ObjChild0Copy(Abc_Obj_t *pObj)
Definition: abc.h:386
ABC_DLL Abc_Ntk_t * Abc_NtkStartFrom(Abc_Ntk_t *pNtk, Abc_NtkType_t Type, Abc_NtkFunc_t Func)
Definition: abcNtk.c:106
Abc_Obj_t * pCopy
Definition: abc.h:148
ABC_DLL int Abc_AigCleanup(Abc_Aig_t *pMan)
Definition: abcAig.c:194
static int Abc_LatchIsInitDc(Abc_Obj_t *pLatch)
Definition: abc.h:424
ABC_DLL void Abc_NtkUpdateNameIds(Abc_Ntk_t *p)
Definition: abcNames.c:620
if(last==0)
Definition: sparse_int.h:34
ABC_DLL void Abc_NtkFinalize(Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtkNew)
Definition: abcNtk.c:302
static int Counter
#define Abc_NtkForEachLatch(pNtk, pObj, i)
Definition: abc.h:497
static int Abc_LatchIsInit1(Abc_Obj_t *pLatch)
Definition: abc.h:423
#define Abc_NtkForEachNode(pNtk, pNode, i)
Definition: abc.h:461
ABC_DLL Abc_Obj_t * Abc_NodeFindCoFanout(Abc_Obj_t *pNode)
Definition: abcUtil.c:779
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
Definition: abcNames.c:48
static void Abc_ObjXorFaninC(Abc_Obj_t *pObj, int i)
Definition: abc.h:381
ABC_DLL void Abc_NtkTransferNameIds(Abc_Ntk_t *p, Abc_Ntk_t *pNew)
Definition: abcNames.c:588
#define assert(ex)
Definition: util_old.h:213
static Abc_Obj_t * Abc_ObjNot(Abc_Obj_t *p)
Definition: abc.h:324
static void Abc_LatchSetInit0(Abc_Obj_t *pLatch)
Definition: abc.h:418
static Abc_Obj_t * Abc_ObjFanout0(Abc_Obj_t *pObj)
Definition: abc.h:371
Abc_Ntk_t* Abc_NtkStrash ( Abc_Ntk_t pNtk,
int  fAllNodes,
int  fCleanup,
int  fRecord 
)

Function*************************************************************

Synopsis [Transforms logic network into structurally hashed AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 265 of file abcStrash.c.

266 {
267  Abc_Ntk_t * pNtkAig;
268  int nNodes;
269  assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsStrash(pNtk) );
270  // consider the special case when the network is already structurally hashed
271  if ( Abc_NtkIsStrash(pNtk) )
272  return Abc_NtkRestrash( pNtk, fCleanup );
273  // convert the node representation in the logic network to the AIG form
274  if ( !Abc_NtkToAig(pNtk) )
275  {
276  printf( "Converting to AIGs has failed.\n" );
277  return NULL;
278  }
279  // perform strashing
280 // Abc_NtkCleanCopy( pNtk );
281  pNtkAig = Abc_NtkStartFrom( pNtk, ABC_NTK_STRASH, ABC_FUNC_AIG );
282  Abc_NtkStrashPerform( pNtk, pNtkAig, fAllNodes, fRecord );
283  Abc_NtkFinalize( pNtk, pNtkAig );
284  // transfer name IDs
285  if ( pNtk->vNameIds )
286  Abc_NtkTransferNameIds( pNtk, pNtkAig );
287  // print warning about self-feed latches
288 // if ( Abc_NtkCountSelfFeedLatches(pNtkAig) )
289 // printf( "Warning: The network has %d self-feeding latches.\n", Abc_NtkCountSelfFeedLatches(pNtkAig) );
290  // perform cleanup if requested
291  nNodes = fCleanup? Abc_AigCleanup((Abc_Aig_t *)pNtkAig->pManFunc) : 0;
292 // if ( nNodes )
293 // printf( "Warning: AIG cleanup removed %d nodes (this is not a bug).\n", nNodes );
294  // duplicate EXDC
295  if ( pNtk->pExdc )
296  pNtkAig->pExdc = Abc_NtkStrash( pNtk->pExdc, fAllNodes, fCleanup, fRecord );
297  // make sure everything is okay
298  if ( !Abc_NtkCheck( pNtkAig ) )
299  {
300  printf( "Abc_NtkStrash: The network check has failed.\n" );
301  Abc_NtkDelete( pNtkAig );
302  return NULL;
303  }
304  return pNtkAig;
305 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
static ABC_NAMESPACE_IMPL_START void Abc_NtkStrashPerform(Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtkNew, int fAllNodes, int fRecord)
DECLARATIONS ///.
Definition: abcStrash.c:413
Vec_Int_t * vNameIds
Definition: abc.h:215
Abc_Ntk_t * pExdc
Definition: abc.h:201
Abc_Ntk_t * Abc_NtkRestrash(Abc_Ntk_t *pNtk, int fCleanup)
FUNCTION DEFINITIONS ///.
Definition: abcStrash.c:49
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition: abcCheck.c:61
DECLARATIONS ///.
Definition: abcAig.c:52
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
void * pManFunc
Definition: abc.h:191
ABC_DLL Abc_Ntk_t * Abc_NtkStartFrom(Abc_Ntk_t *pNtk, Abc_NtkType_t Type, Abc_NtkFunc_t Func)
Definition: abcNtk.c:106
ABC_DLL int Abc_AigCleanup(Abc_Aig_t *pMan)
Definition: abcAig.c:194
ABC_DLL void Abc_NtkFinalize(Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtkNew)
Definition: abcNtk.c:302
ABC_DLL int Abc_NtkToAig(Abc_Ntk_t *pNtk)
Definition: abcFunc.c:1192
ABC_DLL void Abc_NtkTransferNameIds(Abc_Ntk_t *p, Abc_Ntk_t *pNew)
Definition: abcNames.c:588
#define assert(ex)
Definition: util_old.h:213
Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
void Abc_NtkStrashPerform ( Abc_Ntk_t pNtkOld,
Abc_Ntk_t pNtkNew,
int  fAllNodes,
int  fRecord 
)
static

DECLARATIONS ///.

CFile****************************************************************

FileName [abcStrash.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Network and node package.]

Synopsis [Strashing of the current network.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

Id:
abcStrash.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

]

Function*************************************************************

Synopsis [Prepares the network for strashing.]

Description []

SideEffects []

SeeAlso []

Definition at line 413 of file abcStrash.c.

414 {
415  Vec_Ptr_t * vNodes;
416  Abc_Obj_t * pNodeOld;
417  int i; //, clk = Abc_Clock();
418  assert( Abc_NtkIsLogic(pNtkOld) );
419  assert( Abc_NtkIsStrash(pNtkNew) );
420 // vNodes = Abc_NtkDfs( pNtkOld, fAllNodes );
421  vNodes = Abc_NtkDfsIter( pNtkOld, fAllNodes );
422 //printf( "Nodes = %d. ", Vec_PtrSize(vNodes) );
423 //ABC_PRT( "Time", Abc_Clock() - clk );
424  Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNodeOld, i )
425  {
426  if ( Abc_ObjIsBarBuf(pNodeOld) )
427  pNodeOld->pCopy = Abc_ObjChild0Copy(pNodeOld);
428  else
429  pNodeOld->pCopy = Abc_NodeStrash( pNtkNew, pNodeOld, fRecord );
430  }
431  Vec_PtrFree( vNodes );
432 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
static int Abc_ObjIsBarBuf(Abc_Obj_t *pObj)
Definition: abc.h:360
static Abc_Obj_t * Abc_ObjChild0Copy(Abc_Obj_t *pObj)
Definition: abc.h:386
Abc_Obj_t * pCopy
Definition: abc.h:148
Abc_Obj_t * Abc_NodeStrash(Abc_Ntk_t *pNtkNew, Abc_Obj_t *pNodeOld, int fRecord)
Definition: abcStrash.c:468
ABC_DLL Vec_Ptr_t * Abc_NtkDfsIter(Abc_Ntk_t *pNtk, int fCollectAll)
Definition: abcDfs.c:542
#define assert(ex)
Definition: util_old.h:213
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
Abc_Ntk_t* Abc_NtkTopAnd ( Abc_Ntk_t pNtk)

Function*************************************************************

Synopsis [Copies the topmost levels of the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 660 of file abcStrash.c.

661 {
662  Vec_Ptr_t * vNodes, * vOrder;
663  Abc_Ntk_t * pNtkAig;
664  Abc_Obj_t * pObj, * pDriver, * pObjPo;
665  int i, nNodes;
666  assert( Abc_NtkIsStrash(pNtk) );
667  // get the first PO
668  pObjPo = Abc_NtkPo(pNtk, 0);
669  vNodes = Abc_NodeGetSuper( Abc_ObjChild0(pObjPo) );
670  assert( Vec_PtrSize(vNodes) >= 2 );
671  // start the new network (constants and CIs of the old network will point to the their counterparts in the new network)
672  Abc_NtkCleanCopy( pNtk );
673  pNtkAig = Abc_NtkAlloc( ABC_NTK_STRASH, ABC_FUNC_AIG, 1 );
674  pNtkAig->pName = Extra_UtilStrsav(pNtk->pName);
675  pNtkAig->pSpec = Extra_UtilStrsav(pNtk->pSpec);
676  Abc_AigConst1(pNtk)->pCopy = Abc_AigConst1(pNtkAig);
677  Abc_NtkForEachPi( pNtk, pObj, i )
678  Abc_NtkDupObj( pNtkAig, pObj, 1 );
679  // restrash the nodes reachable from the roots
680  vOrder = Abc_NtkDfsIterNodes( pNtk, vNodes );
681  Vec_PtrForEachEntry( Abc_Obj_t *, vOrder, pObj, i )
682  pObj->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkAig->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
683  Vec_PtrFree( vOrder );
684  // finalize the network
685  Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
686  {
687  pObjPo = Abc_NtkCreatePo(pNtkAig);
688  pDriver = Abc_ObjNotCond(Abc_ObjRegular(pObj)->pCopy, Abc_ObjIsComplement(pObj));
689  Abc_ObjAddFanin( pObjPo, pDriver );
690  Abc_ObjAssignName( pObjPo, Abc_ObjName(pObjPo), NULL );
691  }
692  Vec_PtrFree( vNodes );
693  // perform cleanup if requested
694  if ( (nNodes = Abc_AigCleanup((Abc_Aig_t *)pNtkAig->pManFunc)) )
695  printf( "Abc_NtkTopAnd(): AIG cleanup removed %d nodes (this is a bug).\n", nNodes );
696  // make sure everything is okay
697  if ( !Abc_NtkCheck( pNtkAig ) )
698  {
699  printf( "Abc_NtkStrash: The network check has failed.\n" );
700  Abc_NtkDelete( pNtkAig );
701  return NULL;
702  }
703  return pNtkAig;
704 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
ABC_DLL Abc_Obj_t * Abc_AigConst1(Abc_Ntk_t *pNtk)
Definition: abcAig.c:683
static Abc_Obj_t * Abc_ObjChild1Copy(Abc_Obj_t *pObj)
Definition: abc.h:387
Vec_Ptr_t * Abc_NodeGetSuper(Abc_Obj_t *pNode)
Definition: abcStrash.c:613
ABC_DLL Abc_Obj_t * Abc_NtkDupObj(Abc_Ntk_t *pNtkNew, Abc_Obj_t *pObj, int fCopyName)
Definition: abcObj.c:337
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition: abcCheck.c:61
ABC_DLL char * Abc_ObjAssignName(Abc_Obj_t *pObj, char *pName, char *pSuffix)
Definition: abcNames.c:68
ABC_DLL Vec_Ptr_t * Abc_NtkDfsIterNodes(Abc_Ntk_t *pNtk, Vec_Ptr_t *vRoots)
Definition: abcDfs.c:580
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
DECLARATIONS ///.
Definition: abcAig.c:52
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
char * Extra_UtilStrsav(const char *s)
ABC_DLL void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
Definition: abcFanio.c:84
ABC_DLL Abc_Ntk_t * Abc_NtkAlloc(Abc_NtkType_t Type, Abc_NtkFunc_t Func, int fUseMemMan)
DECLARATIONS ///.
Definition: abcNtk.c:50
static Abc_Obj_t * Abc_ObjChild0(Abc_Obj_t *pObj)
Definition: abc.h:383
ABC_DLL Abc_Obj_t * Abc_AigAnd(Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
Definition: abcAig.c:700
static Abc_Obj_t * Abc_ObjChild0Copy(Abc_Obj_t *pObj)
Definition: abc.h:386
Abc_Obj_t * pCopy
Definition: abc.h:148
ABC_DLL int Abc_AigCleanup(Abc_Aig_t *pMan)
Definition: abcAig.c:194
char * pSpec
Definition: abc.h:159
static Abc_Obj_t * Abc_ObjRegular(Abc_Obj_t *p)
Definition: abc.h:323
static Abc_Obj_t * Abc_NtkPo(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:316
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
Definition: abcNames.c:48
ABC_DLL void Abc_NtkCleanCopy(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:507
static Abc_Obj_t * Abc_ObjNotCond(Abc_Obj_t *p, int c)
Definition: abc.h:325
#define assert(ex)
Definition: util_old.h:213
#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
static Abc_Obj_t * Abc_NtkCreatePo(Abc_Ntk_t *pNtk)
Definition: abc.h:304
char * pName
Definition: abc.h:158
#define Abc_NtkForEachPi(pNtk, pPi, i)
Definition: abc.h:513
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
Abc_Ntk_t* Abc_NtkTopmost ( Abc_Ntk_t pNtk,
int  nLevels 
)

Function*************************************************************

Synopsis [Copies the topmost levels of the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 548 of file abcStrash.c.

549 {
550  Abc_Ntk_t * pNtkNew;
551  Abc_Obj_t * pObjNew, * pObjPo;
552  int LevelCut;
553  assert( Abc_NtkIsStrash(pNtk) );
554  assert( Abc_NtkCoNum(pNtk) == 1 );
555  // get the cutoff level
556  LevelCut = Abc_MaxInt( 0, Abc_AigLevel(pNtk) - nLevels );
557  // start the network
558  pNtkNew = Abc_NtkAlloc( ABC_NTK_STRASH, ABC_FUNC_AIG, 1 );
559  pNtkNew->pName = Extra_UtilStrsav(pNtk->pName);
560  Abc_AigConst1(pNtk)->pCopy = Abc_AigConst1(pNtkNew);
561  // create PIs below the cut and nodes above the cut
562  Abc_NtkCleanCopy( pNtk );
563  pObjNew = Abc_NtkTopmost_rec( pNtkNew, Abc_ObjFanin0(Abc_NtkPo(pNtk, 0)), LevelCut );
564  pObjNew = Abc_ObjNotCond( pObjNew, Abc_ObjFaninC0(Abc_NtkPo(pNtk, 0)) );
565  // add the PO node and name
566  pObjPo = Abc_NtkCreatePo(pNtkNew);
567  Abc_ObjAddFanin( pObjPo, pObjNew );
568  Abc_NtkAddDummyPiNames( pNtkNew );
569  Abc_ObjAssignName( pObjPo, Abc_ObjName(Abc_NtkPo(pNtk, 0)), NULL );
570  // make sure everything is okay
571  if ( !Abc_NtkCheck( pNtkNew ) )
572  {
573  printf( "Abc_NtkTopmost: The network check has failed.\n" );
574  Abc_NtkDelete( pNtkNew );
575  return NULL;
576  }
577  return pNtkNew;
578 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL Abc_Obj_t * Abc_AigConst1(Abc_Ntk_t *pNtk)
Definition: abcAig.c:683
static int Abc_ObjFaninC0(Abc_Obj_t *pObj)
Definition: abc.h:377
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition: abcCheck.c:61
ABC_DLL char * Abc_ObjAssignName(Abc_Obj_t *pObj, char *pName, char *pSuffix)
Definition: abcNames.c:68
static int Abc_MaxInt(int a, int b)
Definition: abc_global.h:238
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
static int Abc_NtkCoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:288
Abc_Obj_t * Abc_NtkTopmost_rec(Abc_Ntk_t *pNtkNew, Abc_Obj_t *pNode, int LevelCut)
Definition: abcStrash.c:525
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
char * Extra_UtilStrsav(const char *s)
ABC_DLL void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
Definition: abcFanio.c:84
ABC_DLL Abc_Ntk_t * Abc_NtkAlloc(Abc_NtkType_t Type, Abc_NtkFunc_t Func, int fUseMemMan)
DECLARATIONS ///.
Definition: abcNtk.c:50
Abc_Obj_t * pCopy
Definition: abc.h:148
ABC_DLL int Abc_AigLevel(Abc_Ntk_t *pNtk)
Definition: abcAig.c:292
static Abc_Obj_t * Abc_NtkPo(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:316
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
Definition: abcNames.c:48
ABC_DLL void Abc_NtkCleanCopy(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:507
static Abc_Obj_t * Abc_ObjNotCond(Abc_Obj_t *p, int c)
Definition: abc.h:325
#define assert(ex)
Definition: util_old.h:213
ABC_DLL void Abc_NtkAddDummyPiNames(Abc_Ntk_t *pNtk)
Definition: abcNames.c:378
static Abc_Obj_t * Abc_NtkCreatePo(Abc_Ntk_t *pNtk)
Definition: abc.h:304
char * pName
Definition: abc.h:158
Abc_Obj_t* Abc_NtkTopmost_rec ( Abc_Ntk_t pNtkNew,
Abc_Obj_t pNode,
int  LevelCut 
)

Function*************************************************************

Synopsis [Copies the topmost levels of the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 525 of file abcStrash.c.

526 {
527  assert( !Abc_ObjIsComplement(pNode) );
528  if ( pNode->pCopy )
529  return pNode->pCopy;
530  if ( pNode->Level <= (unsigned)LevelCut )
531  return pNode->pCopy = Abc_NtkCreatePi( pNtkNew );
532  Abc_NtkTopmost_rec( pNtkNew, Abc_ObjFanin0(pNode), LevelCut );
533  Abc_NtkTopmost_rec( pNtkNew, Abc_ObjFanin1(pNode), LevelCut );
534  return pNode->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, Abc_ObjChild0Copy(pNode), Abc_ObjChild1Copy(pNode) );
535 }
static Abc_Obj_t * Abc_ObjFanin1(Abc_Obj_t *pObj)
Definition: abc.h:374
static Abc_Obj_t * Abc_ObjChild1Copy(Abc_Obj_t *pObj)
Definition: abc.h:387
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
DECLARATIONS ///.
Definition: abcAig.c:52
Abc_Obj_t * Abc_NtkTopmost_rec(Abc_Ntk_t *pNtkNew, Abc_Obj_t *pNode, int LevelCut)
Definition: abcStrash.c:525
unsigned Level
Definition: abc.h:142
void * pManFunc
Definition: abc.h:191
ABC_DLL Abc_Obj_t * Abc_AigAnd(Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
Definition: abcAig.c:700
static Abc_Obj_t * Abc_ObjChild0Copy(Abc_Obj_t *pObj)
Definition: abc.h:386
Abc_Obj_t * pCopy
Definition: abc.h:148
static Abc_Obj_t * Abc_NtkCreatePi(Abc_Ntk_t *pNtk)
Definition: abc.h:303
#define assert(ex)
Definition: util_old.h:213
static int Abc_ObjIsComplement(Abc_Obj_t *p)
Definition: abc.h:322
void Abc_NtkWriteAig ( Abc_Ntk_t pNtk,
char *  pFileName 
)

Function*************************************************************

Synopsis [Writes the AIG into a file for parsing.]

Description [Ordering: c0, pis, ands, pos. ]

SideEffects []

SeeAlso []

Definition at line 717 of file abcStrash.c.

718 {
719  FILE * pFile;
720  Vec_Int_t * vId2Num;
721  Abc_Obj_t * pObj;
722  int i, iLit;
723  assert( Abc_NtkIsStrash(pNtk) );
724  assert( Abc_NtkLatchNum(pNtk) == 0 );
725  if ( pFileName == NULL )
726  pFile = stdout;
727  else
728  pFile = fopen( pFileName, "w" );
729  if ( pFile == NULL )
730  {
731  printf( "Cannot open output file.\n" );
732  return;
733  }
734  vId2Num = Vec_IntAlloc( 2*Abc_NtkObjNumMax(pNtk) );
735  Vec_IntFill( vId2Num, 2*Abc_NtkObjNumMax(pNtk), -1 );
736 
737  iLit = 0;
738  Vec_IntWriteEntry( vId2Num, 2*Abc_ObjId(Abc_AigConst1(pNtk))+1, iLit++ );
739  Vec_IntWriteEntry( vId2Num, 2*Abc_ObjId(Abc_AigConst1(pNtk))+0, iLit++ );
740  Abc_NtkForEachPi( pNtk, pObj, i )
741  {
742  Vec_IntWriteEntry( vId2Num, 2*Abc_ObjId(pObj)+0, iLit++ );
743  Vec_IntWriteEntry( vId2Num, 2*Abc_ObjId(pObj)+1, iLit++ );
744  }
745  Abc_AigForEachAnd( pNtk, pObj, i )
746  {
747  Vec_IntWriteEntry( vId2Num, 2*Abc_ObjId(pObj)+0, iLit++ );
748  Vec_IntWriteEntry( vId2Num, 2*Abc_ObjId(pObj)+1, iLit++ );
749  }
750  fprintf( pFile, "{\n" );
751  fprintf( pFile, " \"%s\", ", Abc_NtkName(pNtk) );
752  fprintf( pFile, "// pi=%d po=%d and=%d", Abc_NtkPiNum(pNtk), Abc_NtkPoNum(pNtk), Abc_NtkNodeNum(pNtk) );
753  fprintf( pFile, "\n" );
754  fprintf( pFile, " { " );
755  Abc_NtkForEachPi( pNtk, pObj, i )
756  fprintf( pFile, "\"%s\",", Abc_ObjName(pObj) );
757  fprintf( pFile, "NULL },\n" );
758  fprintf( pFile, " { " );
759  Abc_NtkForEachPo( pNtk, pObj, i )
760  fprintf( pFile, "\"%s\",", Abc_ObjName(pObj) );
761  fprintf( pFile, "NULL },\n" );
762  fprintf( pFile, " { " );
763  Abc_AigForEachAnd( pNtk, pObj, i )
764  fprintf( pFile, "%d,", Vec_IntEntry(vId2Num, 2*Abc_ObjFaninId0(pObj) + Abc_ObjFaninC0(pObj)) );
765  fprintf( pFile, "0 },\n" );
766  fprintf( pFile, " { " );
767  Abc_AigForEachAnd( pNtk, pObj, i )
768  fprintf( pFile, "%d,", Vec_IntEntry(vId2Num, 2*Abc_ObjFaninId1(pObj) + Abc_ObjFaninC1(pObj)) );
769  fprintf( pFile, "0 },\n" );
770  fprintf( pFile, " { " );
771  Abc_NtkForEachPo( pNtk, pObj, i )
772  fprintf( pFile, "%d,", Vec_IntEntry(vId2Num, 2*Abc_ObjFaninId0(pObj) + Abc_ObjFaninC0(pObj)) );
773  fprintf( pFile, "0 },\n" );
774  fprintf( pFile, "},\n" );
775  if ( pFile != stdout )
776  fclose( pFile );
777  Vec_IntFree( vId2Num );
778 }
static unsigned Abc_ObjId(Abc_Obj_t *pObj)
Definition: abc.h:329
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkObjNumMax(Abc_Ntk_t *pNtk)
Definition: abc.h:284
ABC_DLL Abc_Obj_t * Abc_AigConst1(Abc_Ntk_t *pNtk)
Definition: abcAig.c:683
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
static int Abc_ObjFaninC0(Abc_Obj_t *pObj)
Definition: abc.h:377
static int Abc_ObjFaninId0(Abc_Obj_t *pObj)
Definition: abc.h:367
#define Abc_AigForEachAnd(pNtk, pNode, i)
Definition: abc.h:485
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
Definition: bblif.c:285
static int Abc_NtkNodeNum(Abc_Ntk_t *pNtk)
Definition: abc.h:293
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 void Vec_IntFill(Vec_Int_t *p, int nSize, int Fill)
Definition: bblif.c:356
static char * Abc_NtkName(Abc_Ntk_t *pNtk)
Definition: abc.h:270
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:285
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
Definition: abcNames.c:48
#define assert(ex)
Definition: util_old.h:213
#define Abc_NtkForEachPi(pNtk, pPi, i)
Definition: abc.h:513
static int Vec_CompareNodeIds ( Abc_Obj_t **  pp1,
Abc_Obj_t **  pp2 
)
static

Function*************************************************************

Synopsis [Comparison procedure for two integers.]

Description []

SideEffects []

SeeAlso []

Definition at line 593 of file abcStrash.c.

594 {
595  if ( Abc_ObjRegular(*pp1)->Id < Abc_ObjRegular(*pp2)->Id )
596  return -1;
597  if ( Abc_ObjRegular(*pp1)->Id > Abc_ObjRegular(*pp2)->Id ) //
598  return 1;
599  return 0;
600 }
static Abc_Obj_t * Abc_ObjRegular(Abc_Obj_t *p)
Definition: abc.h:323
int Id
Definition: abc.h:132