abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
abcHieCec.c File Reference
#include "abc.h"
#include "base/io/ioAbc.h"
#include "aig/gia/gia.h"

Go to the source code of this file.

Macros

#define Abc_ObjForEachFaninReal(pObj, pFanin, i)   for ( i = 0; (i < Abc_ObjFaninNum(pObj)) && (((pFanin) = Abc_ObjFaninReal(pObj, i)), 1); i++ )
 DECLARATIONS ///. More...
 

Functions

static Abc_Obj_tAbc_ObjFaninReal (Abc_Obj_t *pObj, int i)
 FUNCTION DEFINITIONS ///. More...
 
void Abc_NtkDfsBoxes_rec (Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
 
Vec_Ptr_tAbc_NtkDfsBoxes (Abc_Ntk_t *pNtk)
 
int Abc_NtkDeriveFlatGiaSop (Gia_Man_t *pGia, int *gFanins, char *pSop)
 
void Abc_NtkDeriveFlatGia_rec (Gia_Man_t *pGia, Abc_Ntk_t *pNtk)
 
Gia_Man_tAbc_NtkDeriveFlatGia (Abc_Ntk_t *pNtk)
 
int Abc_NtkCountAndNodes (Vec_Ptr_t *vOrder)
 
Gia_Man_tAbc_NtkDeriveFlatGia2Derive (Abc_Ntk_t *pNtk, Vec_Ptr_t *vOrder)
 
Gia_Man_tAbc_NtkDeriveFlatGia2 (Abc_Ntk_t *pNtk, Vec_Ptr_t *vModels)
 
void Abc_NtkCollectHie_rec (Abc_Ntk_t *pNtk, Vec_Ptr_t *vModels)
 
Vec_Ptr_tAbc_NtkCollectHie (Abc_Ntk_t *pNtk)
 
int Abc_NtkCountInst_rec (Abc_Ntk_t *pNtk)
 
void Abc_NtkCountInst (Abc_Ntk_t *pNtk)
 
double Abc_NtkCountNodes_rec (Abc_Ntk_t *pNtk)
 
void Abc_NtkCountNodes (Abc_Ntk_t *pNtk)
 
int Abc_NtkCheckRecursive (Abc_Ntk_t *pNtk)
 
Gia_Man_tAbc_NtkHieCecTest (char *pFileName, int fVerbose)
 

Macro Definition Documentation

#define Abc_ObjForEachFaninReal (   pObj,
  pFanin,
 
)    for ( i = 0; (i < Abc_ObjFaninNum(pObj)) && (((pFanin) = Abc_ObjFaninReal(pObj, i)), 1); i++ )

DECLARATIONS ///.

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

FileName [abcHieCec.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Network and node package.]

Synopsis [Hierarchical CEC manager.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

]

Definition at line 31 of file abcHieCec.c.

Function Documentation

int Abc_NtkCheckRecursive ( Abc_Ntk_t pNtk)

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

Synopsis [Checks if there is a recursive definition.]

Description []

SideEffects []

SeeAlso []

Definition at line 626 of file abcHieCec.c.

627 {
628  Vec_Ptr_t * vMods;
629  Abc_Ntk_t * pModel;
630  Abc_Obj_t * pObj;
631  int i, k, RetValue = 0;
632 
633  assert( Abc_NtkIsNetlist(pNtk) );
634  assert( !Abc_NtkLatchNum(pNtk) );
635 
636  if ( pNtk->pDesign == NULL )
637  return RetValue;
638 
639  vMods = pNtk->pDesign->vModules;
640  Vec_PtrForEachEntry( Abc_Ntk_t *, vMods, pModel, i )
641  {
642  Abc_NtkForEachObj( pModel, pObj, k )
643  if ( Abc_ObjIsBox(pObj) && pObj->pData == (void *)pModel )
644  {
645  printf( "WARNING: Model \"%s\" contains a recursive defition.\n", Abc_NtkName(pModel) );
646  RetValue = 1;
647  break;
648  }
649  }
650  return RetValue;
651 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
static int Abc_NtkIsNetlist(Abc_Ntk_t *pNtk)
Definition: abc.h:249
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
if(last==0)
Definition: sparse_int.h:34
static char * Abc_NtkName(Abc_Ntk_t *pNtk)
Definition: abc.h:270
Vec_Ptr_t * vModules
Definition: abc.h:223
#define assert(ex)
Definition: util_old.h:213
static int Abc_ObjIsBox(Abc_Obj_t *pObj)
Definition: abc.h:357
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
Abc_Des_t * pDesign
Definition: abc.h:180
#define Abc_NtkForEachObj(pNtk, pObj, i)
ITERATORS ///.
Definition: abc.h:446
Vec_Ptr_t* Abc_NtkCollectHie ( Abc_Ntk_t pNtk)

Definition at line 499 of file abcHieCec.c.

500 {
501  Vec_Ptr_t * vMods, * vResult;
502  Abc_Ntk_t * pModel;
503  int i;
504 
505  assert( Abc_NtkIsNetlist(pNtk) );
506  assert( !Abc_NtkLatchNum(pNtk) );
507 
508  vResult = Vec_PtrAlloc( 1000 );
509  if ( pNtk->pDesign == NULL )
510  {
511  Vec_PtrPush( vResult, pNtk );
512  return vResult;
513  }
514 
515  vMods = pNtk->pDesign->vModules;
516  Vec_PtrForEachEntry( Abc_Ntk_t *, vMods, pModel, i )
517  pModel->iStep = -1;
518 
519  Abc_NtkCollectHie_rec( pNtk, vResult );
520  return vResult;
521 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
static int Abc_NtkIsNetlist(Abc_Ntk_t *pNtk)
Definition: abc.h:249
void Abc_NtkCollectHie_rec(Abc_Ntk_t *pNtk, Vec_Ptr_t *vModels)
Definition: abcHieCec.c:483
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
Vec_Ptr_t * vModules
Definition: abc.h:223
#define assert(ex)
Definition: util_old.h:213
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
Abc_Des_t * pDesign
Definition: abc.h:180
void Abc_NtkCollectHie_rec ( Abc_Ntk_t pNtk,
Vec_Ptr_t vModels 
)

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

Synopsis [Collect models in the DFS order.]

Description []

SideEffects []

SeeAlso []

Definition at line 483 of file abcHieCec.c.

484 {
485  Vec_Ptr_t * vOrder;
486  Abc_Obj_t * pObj;
487  int i;
488  if ( pNtk->iStep >= 0 )
489  return;
490  vOrder = Abc_NtkDfsBoxes( pNtk );
491  Vec_PtrForEachEntry( Abc_Obj_t *, vOrder, pObj, i )
492  if ( Abc_ObjIsBox(pObj) && (Abc_Ntk_t *)pObj->pData != pNtk )
493  Abc_NtkCollectHie_rec( (Abc_Ntk_t *)pObj->pData, vModels );
494  Vec_PtrFree( vOrder );
495  pNtk->iStep = Vec_PtrSize(vModels);
496  Vec_PtrPush( vModels, pNtk );
497 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
void Abc_NtkCollectHie_rec(Abc_Ntk_t *pNtk, Vec_Ptr_t *vModels)
Definition: abcHieCec.c:483
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
int iStep
Definition: abc.h:178
if(last==0)
Definition: sparse_int.h:34
Vec_Ptr_t * Abc_NtkDfsBoxes(Abc_Ntk_t *pNtk)
Definition: abcHieCec.c:104
static int Abc_ObjIsBox(Abc_Obj_t *pObj)
Definition: abc.h:357
#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
int Abc_NtkCountAndNodes ( Vec_Ptr_t vOrder)

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

Synopsis [Counts the total number of AIG nodes before flattening.]

Description []

SideEffects []

SeeAlso []

Definition at line 300 of file abcHieCec.c.

301 {
302  Gia_Man_t * pGiaBox;
303  Abc_Ntk_t * pNtkModel;
304  Abc_Obj_t * pObj;
305  int i, Counter = 0;
306  Vec_PtrForEachEntry( Abc_Obj_t *, vOrder, pObj, i )
307  {
308  if ( Abc_ObjIsNode(pObj) )
309  {
310  Counter++;
311  continue;
312  }
313  assert( Abc_ObjIsBox(pObj) );
314  pNtkModel = (Abc_Ntk_t *)pObj->pData;
315  pGiaBox = (Gia_Man_t *)pNtkModel->pData;
316  Counter += Gia_ManAndNum(pGiaBox);
317  }
318  return Counter;
319 }
void * pData
Definition: abc.h:203
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
static int Gia_ManAndNum(Gia_Man_t *p)
Definition: gia.h:389
static int Counter
Definition: gia.h:95
#define assert(ex)
Definition: util_old.h:213
static int Abc_ObjIsBox(Abc_Obj_t *pObj)
Definition: abc.h:357
void * pData
Definition: abc.h:145
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
void Abc_NtkCountInst ( Abc_Ntk_t pNtk)

Definition at line 549 of file abcHieCec.c.

550 {
551  Vec_Ptr_t * vMods;
552  Abc_Ntk_t * pModel;
553  int i, Counter;
554 
555  if ( pNtk->pDesign == NULL )
556  Counter = Abc_NtkNodeNum(pNtk);
557  else
558  {
559  vMods = pNtk->pDesign->vModules;
560  Vec_PtrForEachEntry( Abc_Ntk_t *, vMods, pModel, i )
561  pModel->iStep = -1;
562  Counter = Abc_NtkCountInst_rec( pNtk );
563  }
564  printf( "Instances = %10d.\n", Counter );
565 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
static int Abc_NtkNodeNum(Abc_Ntk_t *pNtk)
Definition: abc.h:293
static int Counter
Vec_Ptr_t * vModules
Definition: abc.h:223
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
Abc_Des_t * pDesign
Definition: abc.h:180
int Abc_NtkCountInst_rec(Abc_Ntk_t *pNtk)
Definition: abcHieCec.c:534
int Abc_NtkCountInst_rec ( Abc_Ntk_t pNtk)

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

Synopsis [Counts the number of intstances.]

Description []

SideEffects []

SeeAlso []

Definition at line 534 of file abcHieCec.c.

535 {
536  Vec_Ptr_t * vOrder;
537  Abc_Obj_t * pObj;
538  int i, Counter = 0;
539  if ( pNtk->iStep >= 0 )
540  return pNtk->iStep;
541  vOrder = Abc_NtkDfsBoxes( pNtk );
542  Vec_PtrForEachEntry( Abc_Obj_t *, vOrder, pObj, i )
543  if ( Abc_ObjIsBox(pObj) && (Abc_Ntk_t *)pObj->pData != pNtk )
544  Counter += Abc_NtkCountInst_rec( (Abc_Ntk_t *)pObj->pData );
545  Vec_PtrFree( vOrder );
546  return pNtk->iStep = 1 + Counter;
547 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
int iStep
Definition: abc.h:178
if(last==0)
Definition: sparse_int.h:34
static int Counter
Vec_Ptr_t * Abc_NtkDfsBoxes(Abc_Ntk_t *pNtk)
Definition: abcHieCec.c:104
static int Abc_ObjIsBox(Abc_Obj_t *pObj)
Definition: abc.h:357
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
int Abc_NtkCountInst_rec(Abc_Ntk_t *pNtk)
Definition: abcHieCec.c:534
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
void Abc_NtkCountNodes ( Abc_Ntk_t pNtk)

Definition at line 596 of file abcHieCec.c.

597 {
598  Vec_Ptr_t * vMods;
599  Abc_Ntk_t * pModel;
600  double Counter;
601  int i;
602 
603  if ( pNtk->pDesign == NULL )
604  Counter = Abc_NtkNodeNum(pNtk);
605  else
606  {
607  vMods = pNtk->pDesign->vModules;
608  Vec_PtrForEachEntry( Abc_Ntk_t *, vMods, pModel, i )
609  pModel->dTemp = -1;
610  Counter = Abc_NtkCountNodes_rec( pNtk );
611  }
612  printf( "Nodes = %.0f\n", Counter );
613 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
double Abc_NtkCountNodes_rec(Abc_Ntk_t *pNtk)
Definition: abcHieCec.c:578
static int Abc_NtkNodeNum(Abc_Ntk_t *pNtk)
Definition: abc.h:293
static int Counter
Vec_Ptr_t * vModules
Definition: abc.h:223
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
Abc_Des_t * pDesign
Definition: abc.h:180
double Abc_NtkCountNodes_rec ( Abc_Ntk_t pNtk)

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

Synopsis [Counts the number of nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 578 of file abcHieCec.c.

579 {
580  Vec_Ptr_t * vOrder;
581  Abc_Obj_t * pObj;
582  double Counter = 0;
583  int i;
584  if ( pNtk->dTemp >= 0 )
585  return pNtk->dTemp;
586  vOrder = Abc_NtkDfsBoxes( pNtk );
587  Vec_PtrForEachEntry( Abc_Obj_t *, vOrder, pObj, i )
588  if ( Abc_ObjIsNode(pObj) )
589  Counter++;
590  else if ( Abc_ObjIsBox(pObj) && (Abc_Ntk_t *)pObj->pData != pNtk )
591  Counter += Abc_NtkCountNodes_rec( (Abc_Ntk_t *)pObj->pData );
592  Vec_PtrFree( vOrder );
593  return pNtk->dTemp = Counter;
594 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
double dTemp
Definition: abc.h:185
double Abc_NtkCountNodes_rec(Abc_Ntk_t *pNtk)
Definition: abcHieCec.c:578
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
if(last==0)
Definition: sparse_int.h:34
else
Definition: sparse_int.h:55
static int Counter
Vec_Ptr_t * Abc_NtkDfsBoxes(Abc_Ntk_t *pNtk)
Definition: abcHieCec.c:104
static int Abc_ObjIsBox(Abc_Obj_t *pObj)
Definition: abc.h:357
#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
Gia_Man_t* Abc_NtkDeriveFlatGia ( Abc_Ntk_t pNtk)

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

Synopsis [Flattens the logic hierarchy of the netlist.]

Description []

SideEffects []

SeeAlso []

Definition at line 259 of file abcHieCec.c.

260 {
261  Gia_Man_t * pTemp, * pGia = NULL;
262  Abc_Obj_t * pTerm;
263  int i;
264 
265  assert( Abc_NtkIsNetlist(pNtk) );
266  assert( !Abc_NtkLatchNum(pNtk) );
267  Abc_NtkFillTemp( pNtk );
268  // start the network
269  pGia = Gia_ManStart( (1<<16) );
270  pGia->pName = Abc_UtilStrsav( Abc_NtkName(pNtk) );
271  pGia->pSpec = Abc_UtilStrsav( Abc_NtkSpec(pNtk) );
272  Gia_ManHashAlloc( pGia );
273  // create PIs
274  Abc_NtkForEachPi( pNtk, pTerm, i )
275  Abc_ObjFanout0(pTerm)->iTemp = Gia_ManAppendCi( pGia );
276  // recursively flatten hierarchy
277  Abc_NtkDeriveFlatGia_rec( pGia, pNtk );
278  // create POs
279  Abc_NtkForEachPo( pNtk, pTerm, i )
280  Gia_ManAppendCo( pGia, Abc_ObjFanin0(pTerm)->iTemp );
281  // prepare return value
282  Gia_ManHashStop( pGia );
283  Gia_ManSetRegNum( pGia, 0 );
284  pGia = Gia_ManCleanup( pTemp = pGia );
285  Gia_ManStop( pTemp );
286  return pGia;
287 }
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
static int Gia_ManAppendCo(Gia_Man_t *p, int iLit0)
Definition: gia.h:703
static int Abc_NtkIsNetlist(Abc_Ntk_t *pNtk)
Definition: abc.h:249
ABC_DLL void Abc_NtkFillTemp(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:553
static int Gia_ManAppendCi(Gia_Man_t *p)
Definition: gia.h:583
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
void Gia_ManSetRegNum(Gia_Man_t *p, int nRegs)
Definition: giaMan.c:628
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
char * pName
Definition: gia.h:97
char * pSpec
Definition: gia.h:98
Gia_Man_t * Gia_ManStart(int nObjsMax)
DECLARATIONS ///.
Definition: giaMan.c:52
void Abc_NtkDeriveFlatGia_rec(Gia_Man_t *pGia, Abc_Ntk_t *pNtk)
Definition: abcHieCec.c:181
static char * Abc_NtkName(Abc_Ntk_t *pNtk)
Definition: abc.h:270
Definition: gia.h:95
#define assert(ex)
Definition: util_old.h:213
void Gia_ManHashAlloc(Gia_Man_t *p)
Definition: giaHash.c:99
static char * Abc_NtkSpec(Abc_Ntk_t *pNtk)
Definition: abc.h:271
#define Abc_NtkForEachPo(pNtk, pPo, i)
Definition: abc.h:517
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
Definition: giaScl.c:84
char * Abc_UtilStrsav(char *s)
Definition: starter.c:47
static Abc_Obj_t * Abc_ObjFanout0(Abc_Obj_t *pObj)
Definition: abc.h:371
#define Abc_NtkForEachPi(pNtk, pPi, i)
Definition: abc.h:513
void Gia_ManHashStop(Gia_Man_t *p)
Definition: giaHash.c:142
Gia_Man_t* Abc_NtkDeriveFlatGia2 ( Abc_Ntk_t pNtk,
Vec_Ptr_t vModels 
)

Definition at line 449 of file abcHieCec.c.

450 {
451  Vec_Ptr_t * vOrder;
452  Abc_Ntk_t * pModel = NULL;
453  Gia_Man_t * pGia = NULL;
454  int i;
455 
456  Vec_PtrForEachEntry( Abc_Ntk_t *, vModels, pModel, i )
457  {
458  vOrder = Abc_NtkDfsBoxes( pModel );
459  pModel->pData = Abc_NtkDeriveFlatGia2Derive( pModel, vOrder );
460  Vec_PtrFree( vOrder );
461  }
462 
463  pGia = (Gia_Man_t *)pModel->pData; pModel->pData = NULL;
464 
465  Vec_PtrForEachEntry( Abc_Ntk_t *, vModels, pModel, i )
466  Gia_ManStopP( (Gia_Man_t **)&pModel->pData );
467 
468  return pGia;
469 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
Gia_Man_t * Abc_NtkDeriveFlatGia2Derive(Abc_Ntk_t *pNtk, Vec_Ptr_t *vOrder)
Definition: abcHieCec.c:332
void Gia_ManStopP(Gia_Man_t **p)
Definition: giaMan.c:177
void * pData
Definition: abc.h:203
Vec_Ptr_t * Abc_NtkDfsBoxes(Abc_Ntk_t *pNtk)
Definition: abcHieCec.c:104
Definition: gia.h:95
#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
Gia_Man_t* Abc_NtkDeriveFlatGia2Derive ( Abc_Ntk_t pNtk,
Vec_Ptr_t vOrder 
)

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

Synopsis [Flattens the logic hierarchy of the netlist.]

Description []

SideEffects []

SeeAlso []

Definition at line 332 of file abcHieCec.c.

333 {
334  int gFanins[16];
335  Abc_Ntk_t * pNtkModel;
336  Gia_Man_t * pGiaBox, * pGia = NULL;
337  Gia_Obj_t * pGiaObj;
338  Abc_Obj_t * pTerm, * pObj;
339  int i, k;
340 
341  assert( Abc_NtkIsNetlist(pNtk) );
342  assert( !Abc_NtkLatchNum(pNtk) );
343  Abc_NtkFillTemp( pNtk );
344 
345  // start the network
346  pGia = Gia_ManStart( (1<<15) );
347  pGia->pName = Abc_UtilStrsav( Abc_NtkName(pNtk) );
348  pGia->pSpec = Abc_UtilStrsav( Abc_NtkSpec(pNtk) );
349  Gia_ManHashAlloc( pGia );
350  // create PIs
351  Abc_NtkForEachPi( pNtk, pTerm, i )
352  Abc_ObjFanout0(pTerm)->iTemp = Gia_ManAppendCi( pGia );
353  // recursively flatten hierarchy
354  Vec_PtrForEachEntry( Abc_Obj_t *, vOrder, pObj, i )
355  {
356  if ( Abc_ObjIsNode(pObj) )
357  {
358  char * pSop = (char *)pObj->pData;
359  assert( Abc_ObjFaninNum(pObj) <= 16 );
360  assert( Abc_ObjFaninNum(pObj) == Abc_SopGetVarNum(pSop) );
361  Abc_ObjForEachFanin( pObj, pTerm, k )
362  {
363  gFanins[k] = pTerm->iTemp;
364  assert( gFanins[k] >= 0 );
365  }
366  Abc_ObjFanout0(pObj)->iTemp = Abc_NtkDeriveFlatGiaSop( pGia, gFanins, pSop );
367  continue;
368  }
369  assert( Abc_ObjIsBox(pObj) );
370  pNtkModel = (Abc_Ntk_t *)pObj->pData;
371  // check the match between the number of actual and formal parameters
372  assert( Abc_ObjFaninNum(pObj) == Abc_NtkPiNum(pNtkModel) );
373  assert( Abc_ObjFanoutNum(pObj) == Abc_NtkPoNum(pNtkModel) );
374 /*
375  // assign PIs
376  Abc_ObjForEachFanin( pObj, pTerm, k )
377  Abc_ObjFanout0( Abc_NtkPi(pNtkModel, k) )->iTemp = Abc_ObjFanin0(pTerm)->iTemp;
378  // call recursively
379  Abc_NtkDeriveFlatGia_rec( pGia, pNtkModel );
380  // assign POs
381  Abc_ObjForEachFanout( pObj, pTerm, k )
382  Abc_ObjFanout0(pTerm)->iTemp = Abc_ObjFanin0( Abc_NtkPo(pNtkModel, k) )->iTemp;
383 */
384  // duplicate the AIG
385  pGiaBox = (Gia_Man_t *)pNtkModel->pData;
386  assert( Abc_ObjFaninNum(pObj) == Gia_ManPiNum(pGiaBox) );
387  assert( Abc_ObjFanoutNum(pObj) == Gia_ManPoNum(pGiaBox) );
388  Gia_ManFillValue( pGiaBox );
389  Gia_ManConst0(pGiaBox)->Value = 0;
390  Abc_ObjForEachFanin( pObj, pTerm, k )
391  Gia_ManPi(pGiaBox, k)->Value = Abc_ObjFanin0(pTerm)->iTemp;
392  Gia_ManForEachAnd( pGiaBox, pGiaObj, k )
393  pGiaObj->Value = Gia_ManHashAnd( pGia, Gia_ObjFanin0Copy(pGiaObj), Gia_ObjFanin1Copy(pGiaObj) );
394  Abc_ObjForEachFanout( pObj, pTerm, k )
395  Abc_ObjFanout0(pTerm)->iTemp = Gia_ObjFanin0Copy(Gia_ManPo(pGiaBox, k));
396  }
397  // create POs
398  Abc_NtkForEachPo( pNtk, pTerm, i )
399  Gia_ManAppendCo( pGia, Abc_ObjFanin0(pTerm)->iTemp );
400  // prepare return value
401  Gia_ManHashStop( pGia );
402  Gia_ManSetRegNum( pGia, 0 );
403  pGia = Gia_ManCleanup( pGiaBox = pGia );
404  Gia_ManStop( pGiaBox );
405 
406  printf( "%8d -> ", Abc_NtkCountAndNodes(vOrder) );
407  Gia_ManPrintStats( pGia, NULL );
408  return pGia;
409 }
int iTemp
Definition: abc.h:149
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
void Gia_ManPrintStats(Gia_Man_t *p, Gps_Par_t *pPars)
Definition: giaMan.c:389
static int Gia_ManPoNum(Gia_Man_t *p)
Definition: gia.h:386
static int Gia_ManAppendCo(Gia_Man_t *p, int iLit0)
Definition: gia.h:703
static int Abc_NtkIsNetlist(Abc_Ntk_t *pNtk)
Definition: abc.h:249
static Gia_Obj_t * Gia_ManPo(Gia_Man_t *p, int v)
Definition: gia.h:406
ABC_DLL void Abc_NtkFillTemp(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:553
static int Abc_ObjFanoutNum(Abc_Obj_t *pObj)
Definition: abc.h:365
static int Gia_ManAppendCi(Gia_Man_t *p)
Definition: gia.h:583
static int Abc_ObjFaninNum(Abc_Obj_t *pObj)
Definition: abc.h:364
int Abc_NtkCountAndNodes(Vec_Ptr_t *vOrder)
Definition: abcHieCec.c:300
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
void Gia_ManSetRegNum(Gia_Man_t *p, int nRegs)
Definition: giaMan.c:628
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
Definition: gia.h:75
void * pData
Definition: abc.h:203
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
static Gia_Obj_t * Gia_ManPi(Gia_Man_t *p, int v)
Definition: gia.h:405
char * pName
Definition: gia.h:97
static int Gia_ObjFanin1Copy(Gia_Obj_t *pObj)
Definition: gia.h:482
int Abc_NtkDeriveFlatGiaSop(Gia_Man_t *pGia, int *gFanins, char *pSop)
Definition: abcHieCec.c:131
char * pSpec
Definition: gia.h:98
Gia_Man_t * Gia_ManStart(int nObjsMax)
DECLARATIONS ///.
Definition: giaMan.c:52
#define Gia_ManForEachAnd(p, pObj, i)
Definition: gia.h:1002
void Gia_ManFillValue(Gia_Man_t *p)
Definition: giaUtil.c:328
static int Gia_ObjFanin0Copy(Gia_Obj_t *pObj)
Definition: gia.h:481
#define Abc_ObjForEachFanout(pObj, pFanout, i)
Definition: abc.h:526
static char * Abc_NtkName(Abc_Ntk_t *pNtk)
Definition: abc.h:270
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition: abc.h:524
Definition: gia.h:95
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:285
static Gia_Obj_t * Gia_ManConst0(Gia_Man_t *p)
Definition: gia.h:400
ABC_DLL int Abc_SopGetVarNum(char *pSop)
Definition: abcSop.c:536
#define assert(ex)
Definition: util_old.h:213
static int Abc_ObjIsBox(Abc_Obj_t *pObj)
Definition: abc.h:357
unsigned Value
Definition: gia.h:87
void Gia_ManHashAlloc(Gia_Man_t *p)
Definition: giaHash.c:99
static char * Abc_NtkSpec(Abc_Ntk_t *pNtk)
Definition: abc.h:271
#define Abc_NtkForEachPo(pNtk, pPo, i)
Definition: abc.h:517
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
static int Gia_ManPiNum(Gia_Man_t *p)
Definition: gia.h:385
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
Definition: giaScl.c:84
char * Abc_UtilStrsav(char *s)
Definition: starter.c:47
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
Definition: giaHash.c:572
static Abc_Obj_t * Abc_ObjFanout0(Abc_Obj_t *pObj)
Definition: abc.h:371
#define Abc_NtkForEachPi(pNtk, pPi, i)
Definition: abc.h:513
void Gia_ManHashStop(Gia_Man_t *p)
Definition: giaHash.c:142
void Abc_NtkDeriveFlatGia_rec ( Gia_Man_t pGia,
Abc_Ntk_t pNtk 
)

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

Synopsis [Flattens the logic hierarchy of the netlist.]

Description []

SideEffects []

SeeAlso []

Definition at line 181 of file abcHieCec.c.

182 {
183  int gFanins[16];
184  Vec_Ptr_t * vOrder = (Vec_Ptr_t *)pNtk->pData;
185  Abc_Obj_t * pObj, * pTerm;
186  Abc_Ntk_t * pNtkModel;
187  int i, k;
188  Abc_NtkForEachPi( pNtk, pTerm, i )
189  assert( Abc_ObjFanout0(pTerm)->iTemp >= 0 );
190  Vec_PtrForEachEntry( Abc_Obj_t *, vOrder, pObj, i )
191  {
192  if ( Abc_ObjIsNode(pObj) )
193  {
194  char * pSop = (char *)pObj->pData;
195 /*
196  int nLength = strlen(pSop);
197  if ( nLength == 4 ) // buf/inv
198  {
199  assert( pSop[2] == '1' );
200  assert( pSop[0] == '0' || pSop[0] == '1' );
201  assert( Abc_ObjFanin0(pObj)->iTemp >= 0 );
202  Abc_ObjFanout0(pObj)->iTemp = Abc_LitNotCond( Abc_ObjFanin0(pObj)->iTemp, pSop[0]=='0' );
203  continue;
204  }
205  if ( nLength == 5 ) // and2
206  {
207  assert( pSop[3] == '1' );
208  assert( pSop[0] == '0' || pSop[0] == '1' );
209  assert( pSop[1] == '0' || pSop[1] == '1' );
210  assert( Abc_ObjFanin0(pObj)->iTemp >= 0 );
211  assert( Abc_ObjFanin1(pObj)->iTemp >= 0 );
212  Abc_ObjFanout0(pObj)->iTemp = Gia_ManHashAnd( pGia,
213  Abc_LitNotCond( Abc_ObjFanin0(pObj)->iTemp, pSop[0]=='0' ),
214  Abc_LitNotCond( Abc_ObjFanin1(pObj)->iTemp, pSop[1]=='0' )
215  );
216  continue;
217  }
218 */
219  assert( Abc_ObjFaninNum(pObj) <= 16 );
220  assert( Abc_ObjFaninNum(pObj) == Abc_SopGetVarNum(pSop) );
221  Abc_ObjForEachFanin( pObj, pTerm, k )
222  {
223  gFanins[k] = pTerm->iTemp;
224  assert( gFanins[k] >= 0 );
225  }
226  Abc_ObjFanout0(pObj)->iTemp = Abc_NtkDeriveFlatGiaSop( pGia, gFanins, pSop );
227  continue;
228  }
229  assert( Abc_ObjIsBox(pObj) );
230  pNtkModel = (Abc_Ntk_t *)pObj->pData;
231  Abc_NtkFillTemp( pNtkModel );
232  // check the match between the number of actual and formal parameters
233  assert( Abc_ObjFaninNum(pObj) == Abc_NtkPiNum(pNtkModel) );
234  assert( Abc_ObjFanoutNum(pObj) == Abc_NtkPoNum(pNtkModel) );
235  // assign PIs
236  Abc_ObjForEachFanin( pObj, pTerm, k )
237  Abc_ObjFanout0( Abc_NtkPi(pNtkModel, k) )->iTemp = Abc_ObjFanin0(pTerm)->iTemp;
238  // call recursively
239  Abc_NtkDeriveFlatGia_rec( pGia, pNtkModel );
240  // assign POs
241  Abc_ObjForEachFanout( pObj, pTerm, k )
242  Abc_ObjFanout0(pTerm)->iTemp = Abc_ObjFanin0( Abc_NtkPo(pNtkModel, k) )->iTemp;
243  }
244  Abc_NtkForEachPo( pNtk, pTerm, i )
245  assert( Abc_ObjFanin0(pTerm)->iTemp >= 0 );
246 }
int iTemp
Definition: abc.h:149
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
ABC_DLL void Abc_NtkFillTemp(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:553
static int Abc_ObjFanoutNum(Abc_Obj_t *pObj)
Definition: abc.h:365
static int Abc_ObjFaninNum(Abc_Obj_t *pObj)
Definition: abc.h:364
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
void * pData
Definition: abc.h:203
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
int Abc_NtkDeriveFlatGiaSop(Gia_Man_t *pGia, int *gFanins, char *pSop)
Definition: abcHieCec.c:131
void Abc_NtkDeriveFlatGia_rec(Gia_Man_t *pGia, Abc_Ntk_t *pNtk)
Definition: abcHieCec.c:181
#define Abc_ObjForEachFanout(pObj, pFanout, i)
Definition: abc.h:526
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
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition: abc.h:524
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:285
ABC_DLL int Abc_SopGetVarNum(char *pSop)
Definition: abcSop.c:536
#define assert(ex)
Definition: util_old.h:213
static int Abc_ObjIsBox(Abc_Obj_t *pObj)
Definition: abc.h:357
static Abc_Obj_t * Abc_NtkPi(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:315
void * pData
Definition: abc.h:145
#define Abc_NtkForEachPo(pNtk, pPo, i)
Definition: abc.h:517
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
static Abc_Obj_t * Abc_ObjFanout0(Abc_Obj_t *pObj)
Definition: abc.h:371
#define Abc_NtkForEachPi(pNtk, pPi, i)
Definition: abc.h:513
int Abc_NtkDeriveFlatGiaSop ( Gia_Man_t pGia,
int *  gFanins,
char *  pSop 
)

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

Synopsis [Strashes one logic node using its SOP.]

Description []

SideEffects []

SeeAlso []

Definition at line 131 of file abcHieCec.c.

132 {
133  char * pCube;
134  int gAnd, gSum;
135  int i, Value, nFanins;
136  // get the number of variables
137  nFanins = Abc_SopGetVarNum(pSop);
138  if ( Abc_SopIsExorType(pSop) )
139  {
140  gSum = 0;
141  for ( i = 0; i < nFanins; i++ )
142  gSum = Gia_ManHashXor( pGia, gSum, gFanins[i] );
143  }
144  else
145  {
146  // go through the cubes of the node's SOP
147  gSum = 0;
148  Abc_SopForEachCube( pSop, nFanins, pCube )
149  {
150  // create the AND of literals
151  gAnd = 1;
152  Abc_CubeForEachVar( pCube, Value, i )
153  {
154  if ( Value == '1' )
155  gAnd = Gia_ManHashAnd( pGia, gAnd, gFanins[i] );
156  else if ( Value == '0' )
157  gAnd = Gia_ManHashAnd( pGia, gAnd, Abc_LitNot(gFanins[i]) );
158  }
159  // add to the sum of cubes
160  gSum = Gia_ManHashAnd( pGia, Abc_LitNot(gSum), Abc_LitNot(gAnd) );
161  gSum = Abc_LitNot( gSum );
162  }
163  }
164  // decide whether to complement the result
165  if ( Abc_SopIsComplement(pSop) )
166  gSum = Abc_LitNot(gSum);
167  return gSum;
168 }
int Gia_ManHashXor(Gia_Man_t *p, int iLit0, int iLit1)
Definition: giaHash.c:658
#define Abc_SopForEachCube(pSop, nFanins, pCube)
Definition: abc.h:531
#define Abc_CubeForEachVar(pCube, Value, i)
Definition: abc.h:529
ABC_DLL int Abc_SopIsExorType(char *pSop)
Definition: abcSop.c:802
static int Abc_LitNot(int Lit)
Definition: abc_global.h:266
ABC_DLL int Abc_SopGetVarNum(char *pSop)
Definition: abcSop.c:536
ABC_DLL int Abc_SopIsComplement(char *pSop)
Definition: abcSop.c:655
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
Definition: giaHash.c:572
Vec_Ptr_t* Abc_NtkDfsBoxes ( Abc_Ntk_t pNtk)

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

Synopsis [Returns the array of node and boxes reachable from POs.]

Description []

SideEffects []

SeeAlso []

Definition at line 104 of file abcHieCec.c.

105 {
106  Vec_Ptr_t * vNodes;
107  Abc_Obj_t * pObj;
108  int i;
109  assert( Abc_NtkIsNetlist(pNtk) );
110  // set the traversal ID
111  Abc_NtkIncrementTravId( pNtk );
112  // start the array of nodes
113  vNodes = Vec_PtrAlloc( 100 );
114  Abc_NtkForEachPo( pNtk, pObj, i )
115  Abc_NtkDfsBoxes_rec( Abc_ObjFaninReal(pObj, 0), vNodes );
116  return vNodes;
117 }
void Abc_NtkDfsBoxes_rec(Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
Definition: abcHieCec.c:75
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
static int Abc_NtkIsNetlist(Abc_Ntk_t *pNtk)
Definition: abc.h:249
static Abc_Obj_t * Abc_ObjFaninReal(Abc_Obj_t *pObj, int i)
FUNCTION DEFINITIONS ///.
Definition: abcHieCec.c:49
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
static void Abc_NtkIncrementTravId(Abc_Ntk_t *p)
Definition: abc.h:406
#define assert(ex)
Definition: util_old.h:213
#define Abc_NtkForEachPo(pNtk, pPo, i)
Definition: abc.h:517
void Abc_NtkDfsBoxes_rec ( Abc_Obj_t pNode,
Vec_Ptr_t vNodes 
)

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

Synopsis [Performs DFS for one node.]

Description []

SideEffects []

SeeAlso []

Definition at line 75 of file abcHieCec.c.

76 {
77  Abc_Obj_t * pFanin;
78  int i;
79  if ( Abc_ObjIsPi(pNode) )
80  return;
81  assert( Abc_ObjIsNode(pNode) || Abc_ObjIsBox(pNode) );
82  // if this node is already visited, skip
83  if ( Abc_NodeIsTravIdCurrent( pNode ) )
84  return;
85  Abc_NodeSetTravIdCurrent( pNode );
86  // visit the transitive fanin of the node
87  Abc_ObjForEachFaninReal( pNode, pFanin, i )
88  Abc_NtkDfsBoxes_rec( pFanin, vNodes );
89  // add the node after the fanins have been added
90  Vec_PtrPush( vNodes, pNode );
91 }
void Abc_NtkDfsBoxes_rec(Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
Definition: abcHieCec.c:75
static int Abc_ObjIsPi(Abc_Obj_t *pObj)
Definition: abc.h:347
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
static int Abc_NodeIsTravIdCurrent(Abc_Obj_t *p)
Definition: abc.h:411
#define Abc_ObjForEachFaninReal(pObj, pFanin, i)
DECLARATIONS ///.
Definition: abcHieCec.c:31
#define assert(ex)
Definition: util_old.h:213
static int Abc_ObjIsBox(Abc_Obj_t *pObj)
Definition: abc.h:357
static void Abc_NodeSetTravIdCurrent(Abc_Obj_t *p)
Definition: abc.h:409
Gia_Man_t* Abc_NtkHieCecTest ( char *  pFileName,
int  fVerbose 
)

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

Synopsis [Performs hierarchical equivalence checking.]

Description []

SideEffects []

SeeAlso []

Definition at line 664 of file abcHieCec.c.

665 {
666  int fUseTest = 1;
667  int fUseNew = 0;
668  int fCheck = 1;
669  Vec_Ptr_t * vMods, * vOrder;
670  Abc_Ntk_t * pNtk, * pModel;
671  Gia_Man_t * pGia;
672  int i;
673  abctime clk = Abc_Clock();
674 
675  // read hierarchical netlist
676  pNtk = Io_ReadBlifMv( pFileName, 0, fCheck );
677  if ( pNtk == NULL )
678  {
679  printf( "Reading BLIF file has failed.\n" );
680  return NULL;
681  }
682  if ( pNtk->pDesign == NULL || pNtk->pDesign->vModules == NULL )
683  {
684  printf( "There is no hierarchy information.\n" );
685 // Abc_NtkDelete( pNtk );
686 // return NULL;
687  }
688  Abc_PrintTime( 1, "Reading file", Abc_Clock() - clk );
689 
690  assert( Abc_NtkIsNetlist(pNtk) );
691  assert( !Abc_NtkLatchNum(pNtk) );
692 /*
693  if ( pNtk->pDesign != NULL )
694  {
695  clk = Abc_Clock();
696  Abc_NtkCountNodes( pNtk );
697  Abc_PrintTime( 1, "Count nodes", Abc_Clock() - clk );
698  }
699 */
700  // print stats
701  if ( fVerbose )
702  Abc_NtkPrintBoxInfo( pNtk );
703 
704  // test the new data-structure
705  if ( fUseTest )
706  {
707  extern Gia_Man_t * Au_ManDeriveTest( Abc_Ntk_t * pRoot );
708  Gia_Man_t * pGia;
709  pGia = Au_ManDeriveTest( pNtk );
710  Abc_NtkDelete( pNtk );
711  return pGia;
712  }
713 
714  if ( Abc_NtkCheckRecursive(pNtk) )
715  return NULL;
716 
717  if ( fUseNew )
718  {
719  clk = Abc_Clock();
720  vOrder = Abc_NtkCollectHie( pNtk );
721  Abc_PrintTime( 1, "Collect DFS ", Abc_Clock() - clk );
722 
723  // derive GIA
724  clk = Abc_Clock();
725  pGia = Abc_NtkDeriveFlatGia2( pNtk, vOrder );
726  Abc_PrintTime( 1, "Deriving GIA", Abc_Clock() - clk );
727  Gia_ManPrintStats( pGia, NULL );
728  // Gia_ManStop( pGia );
729 
730  Vec_PtrFree( vOrder );
731  }
732  else
733  {
734  // order nodes/boxes of all models
735  vMods = pNtk->pDesign->vModules;
736  Vec_PtrForEachEntry( Abc_Ntk_t *, vMods, pModel, i )
737  pModel->pData = Abc_NtkDfsBoxes( pModel );
738 
739  // derive GIA
740  clk = Abc_Clock();
741  pGia = Abc_NtkDeriveFlatGia( pNtk );
742  Abc_PrintTime( 1, "Deriving GIA", Abc_Clock() - clk );
743  Gia_ManPrintStats( pGia, NULL );
744 
745  // clean nodes/boxes of all nodes
746  Vec_PtrForEachEntry( Abc_Ntk_t *, vMods, pModel, i )
747  Vec_PtrFree( (Vec_Ptr_t *)pModel->pData );
748  }
749 
750  clk = Abc_Clock();
751  Abc_NtkCountInst( pNtk );
752  Abc_PrintTime( 1, "Gather stats", Abc_Clock() - clk );
753 
754  Abc_NtkDelete( pNtk );
755  return pGia;
756 }
Vec_Ptr_t * Abc_NtkCollectHie(Abc_Ntk_t *pNtk)
Definition: abcHieCec.c:499
Abc_Ntk_t * Io_ReadBlifMv(char *pFileName, int fBlifMv, int fCheck)
FUNCTION DEFINITIONS ///.
Definition: ioReadBlifMv.c:142
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
void Gia_ManPrintStats(Gia_Man_t *p, Gps_Par_t *pPars)
Definition: giaMan.c:389
static int Abc_NtkIsNetlist(Abc_Ntk_t *pNtk)
Definition: abc.h:249
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
static abctime Abc_Clock()
Definition: abc_global.h:279
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
static void Abc_PrintTime(int level, const char *pStr, abctime time)
Definition: abc_global.h:367
Vec_Ptr_t * Abc_NtkDfsBoxes(Abc_Ntk_t *pNtk)
Definition: abcHieCec.c:104
Definition: gia.h:95
Gia_Man_t * Abc_NtkDeriveFlatGia(Abc_Ntk_t *pNtk)
Definition: abcHieCec.c:259
Gia_Man_t * Au_ManDeriveTest(Abc_Ntk_t *pRoot)
Definition: abcHieNew.c:1486
ABC_DLL void Abc_NtkPrintBoxInfo(Abc_Ntk_t *pNtk)
Definition: abcHie.c:431
Vec_Ptr_t * vModules
Definition: abc.h:223
#define assert(ex)
Definition: util_old.h:213
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
Gia_Man_t * Abc_NtkDeriveFlatGia2(Abc_Ntk_t *pNtk, Vec_Ptr_t *vModels)
Definition: abcHieCec.c:449
ABC_INT64_T abctime
Definition: abc_global.h:278
Abc_Des_t * pDesign
Definition: abc.h:180
void Abc_NtkCountInst(Abc_Ntk_t *pNtk)
Definition: abcHieCec.c:549
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
int Abc_NtkCheckRecursive(Abc_Ntk_t *pNtk)
Definition: abcHieCec.c:626
static Abc_Obj_t* Abc_ObjFaninReal ( Abc_Obj_t pObj,
int  i 
)
inlinestatic

FUNCTION DEFINITIONS ///.

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

Synopsis [Returns the real faniin of the object.]

Description []

SideEffects []

SeeAlso []

Definition at line 49 of file abcHieCec.c.

50 {
51  Abc_Obj_t * pRes;
52  if ( Abc_ObjIsBox(pObj) )
53  pRes = Abc_ObjFanin0( Abc_ObjFanin0( Abc_ObjFanin(pObj, i) ) );
54  else
55  {
56  assert( Abc_ObjIsPo(pObj) || Abc_ObjIsNode(pObj) );
57  pRes = Abc_ObjFanin0( Abc_ObjFanin(pObj, i) );
58  }
59  if ( Abc_ObjIsBo(pRes) )
60  return Abc_ObjFanin0(pRes);
61  return pRes;
62 }
static int Abc_ObjIsBo(Abc_Obj_t *pObj)
Definition: abc.h:350
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
static int Abc_ObjIsPo(Abc_Obj_t *pObj)
Definition: abc.h:348
#define assert(ex)
Definition: util_old.h:213
static int Abc_ObjIsBox(Abc_Obj_t *pObj)
Definition: abc.h:357
static Abc_Obj_t * Abc_ObjFanin(Abc_Obj_t *pObj, int i)
Definition: abc.h:372