31#define Abc_ObjForEachFaninReal( pObj, pFanin, i ) \
32 for ( i = 0; (i < Abc_ObjFaninNum(pObj)) && (((pFanin) = Abc_ObjFaninReal(pObj, i)), 1); i++ )
52 if ( Abc_ObjIsBox(pObj) )
53 pRes = Abc_ObjFanin0( Abc_ObjFanin0( Abc_ObjFanin(pObj, i) ) );
56 assert( Abc_ObjIsPo(pObj) || Abc_ObjIsNode(pObj) );
57 pRes = Abc_ObjFanin0( Abc_ObjFanin(pObj, i) );
59 if ( Abc_ObjIsBo(pRes) )
60 return Abc_ObjFanin0(pRes);
79 if ( Abc_ObjIsPi(pNode) )
81 assert( Abc_ObjIsNode(pNode) || Abc_ObjIsBox(pNode) );
83 if ( Abc_NodeIsTravIdCurrent( pNode ) )
85 Abc_NodeSetTravIdCurrent( pNode );
90 Vec_PtrPush( vNodes, pNode );
109 assert( Abc_NtkIsNetlist(pNtk) );
111 Abc_NtkIncrementTravId( pNtk );
113 vNodes = Vec_PtrAlloc( 100 );
135 int i, Value, nFanins;
141 for ( i = 0; i < nFanins; i++ )
156 else if ( Value ==
'0' )
160 gSum =
Gia_ManHashAnd( pGia, Abc_LitNot(gSum), Abc_LitNot(gAnd) );
161 gSum = Abc_LitNot( gSum );
166 gSum = Abc_LitNot(gSum);
189 assert( Abc_ObjFanout0(pTerm)->iTemp >= 0 );
192 if ( Abc_ObjIsNode(pObj) )
194 char * pSop = (
char *)pObj->
pData;
219 assert( Abc_ObjFaninNum(pObj) <= 16 );
223 gFanins[k] = pTerm->
iTemp;
224 assert( gFanins[k] >= 0 );
229 assert( Abc_ObjIsBox(pObj) );
233 assert( Abc_ObjFaninNum(pObj) == Abc_NtkPiNum(pNtkModel) );
234 assert( Abc_ObjFanoutNum(pObj) == Abc_NtkPoNum(pNtkModel) );
237 Abc_ObjFanout0( Abc_NtkPi(pNtkModel, k) )->iTemp = Abc_ObjFanin0(pTerm)->iTemp;
242 Abc_ObjFanout0(pTerm)->iTemp = Abc_ObjFanin0( Abc_NtkPo(pNtkModel, k) )->iTemp;
245 assert( Abc_ObjFanin0(pTerm)->iTemp >= 0 );
265 assert( Abc_NtkIsNetlist(pNtk) );
266 assert( !Abc_NtkLatchNum(pNtk) );
270 pGia->
pName = Abc_UtilStrsav( Abc_NtkName(pNtk) );
271 pGia->
pSpec = Abc_UtilStrsav( Abc_NtkSpec(pNtk) );
275 Abc_ObjFanout0(pTerm)->iTemp = Gia_ManAppendCi( pGia );
280 Gia_ManAppendCo( pGia, Abc_ObjFanin0(pTerm)->iTemp );
308 if ( Abc_ObjIsNode(pObj) )
313 assert( Abc_ObjIsBox(pObj) );
316 Counter += Gia_ManAndNum(pGiaBox);
341 assert( Abc_NtkIsNetlist(pNtk) );
342 assert( !Abc_NtkLatchNum(pNtk) );
347 pGia->
pName = Abc_UtilStrsav( Abc_NtkName(pNtk) );
348 pGia->
pSpec = Abc_UtilStrsav( Abc_NtkSpec(pNtk) );
352 Abc_ObjFanout0(pTerm)->iTemp = Gia_ManAppendCi( pGia );
356 if ( Abc_ObjIsNode(pObj) )
358 char * pSop = (
char *)pObj->
pData;
359 assert( Abc_ObjFaninNum(pObj) <= 16 );
363 gFanins[k] = pTerm->
iTemp;
364 assert( gFanins[k] >= 0 );
369 assert( Abc_ObjIsBox(pObj) );
372 assert( Abc_ObjFaninNum(pObj) == Abc_NtkPiNum(pNtkModel) );
373 assert( Abc_ObjFanoutNum(pObj) == Abc_NtkPoNum(pNtkModel) );
386 assert( Abc_ObjFaninNum(pObj) == Gia_ManPiNum(pGiaBox) );
387 assert( Abc_ObjFanoutNum(pObj) == Gia_ManPoNum(pGiaBox) );
389 Gia_ManConst0(pGiaBox)->Value = 0;
391 Gia_ManPi(pGiaBox, k)->Value = Abc_ObjFanin0(pTerm)->iTemp;
393 pGiaObj->
Value =
Gia_ManHashAnd( pGia, Gia_ObjFanin0Copy(pGiaObj), Gia_ObjFanin1Copy(pGiaObj) );
395 Abc_ObjFanout0(pTerm)->iTemp = Gia_ObjFanin0Copy(Gia_ManPo(pGiaBox, k));
399 Gia_ManAppendCo( pGia, Abc_ObjFanin0(pTerm)->iTemp );
460 Vec_PtrFree( vOrder );
488 if ( pNtk->
iStep >= 0 )
494 Vec_PtrFree( vOrder );
495 pNtk->
iStep = Vec_PtrSize(vModels);
496 Vec_PtrPush( vModels, pNtk );
505 assert( Abc_NtkIsNetlist(pNtk) );
506 assert( !Abc_NtkLatchNum(pNtk) );
508 vResult = Vec_PtrAlloc( 1000 );
511 Vec_PtrPush( vResult, pNtk );
539 if ( pNtk->
iStep >= 0 )
545 Vec_PtrFree( vOrder );
546 return pNtk->
iStep = 1 + Counter;
556 Counter = Abc_NtkNodeNum(pNtk);
564 printf(
"Instances = %10d.\n", Counter );
584 if ( pNtk->
dTemp >= 0 )
588 if ( Abc_ObjIsNode(pObj) )
590 else if ( Abc_ObjIsBox(pObj) && (
Abc_Ntk_t *)pObj->
pData != pNtk )
592 Vec_PtrFree( vOrder );
593 return pNtk->
dTemp = Counter;
604 Counter = Abc_NtkNodeNum(pNtk);
612 printf(
"Nodes = %.0f\n", Counter );
631 int i, k, RetValue = 0;
633 assert( Abc_NtkIsNetlist(pNtk) );
634 assert( !Abc_NtkLatchNum(pNtk) );
643 if ( Abc_ObjIsBox(pObj) && pObj->
pData == (
void *)pModel )
645 printf(
"WARNING: Model \"%s\" contains a recursive definition.\n", Abc_NtkName(pModel) );
679 printf(
"Reading BLIF file has failed.\n" );
684 printf(
"There is no hierarchy information.\n" );
688 Abc_PrintTime( 1,
"Reading file", Abc_Clock() - clk );
690 assert( Abc_NtkIsNetlist(pNtk) );
691 assert( !Abc_NtkLatchNum(pNtk) );
721 Abc_PrintTime( 1,
"Collect DFS ", Abc_Clock() - clk );
726 Abc_PrintTime( 1,
"Deriving GIA", Abc_Clock() - clk );
730 Vec_PtrFree( vOrder );
742 Abc_PrintTime( 1,
"Deriving GIA", Abc_Clock() - clk );
752 Abc_PrintTime( 1,
"Gather stats", Abc_Clock() - clk );
double Abc_NtkCountNodes_rec(Abc_Ntk_t *pNtk)
Vec_Ptr_t * Abc_NtkDfsBoxes(Abc_Ntk_t *pNtk)
int Abc_NtkCountInst_rec(Abc_Ntk_t *pNtk)
void Abc_NtkDeriveFlatGia_rec(Gia_Man_t *pGia, Abc_Ntk_t *pNtk)
int Abc_NtkDeriveFlatGiaSop(Gia_Man_t *pGia, int *gFanins, char *pSop)
int Abc_NtkCountAndNodes(Vec_Ptr_t *vOrder)
int Abc_NtkCheckRecursive(Abc_Ntk_t *pNtk)
#define Abc_ObjForEachFaninReal(pObj, pFanin, i)
DECLARATIONS ///.
Gia_Man_t * Abc_NtkHieCecTest(char *pFileName, int fVerbose)
void Abc_NtkCountInst(Abc_Ntk_t *pNtk)
Gia_Man_t * Abc_NtkDeriveFlatGia2Derive(Abc_Ntk_t *pNtk, Vec_Ptr_t *vOrder)
Vec_Ptr_t * Abc_NtkCollectHie(Abc_Ntk_t *pNtk)
void Abc_NtkCollectHie_rec(Abc_Ntk_t *pNtk, Vec_Ptr_t *vModels)
Gia_Man_t * Abc_NtkDeriveFlatGia(Abc_Ntk_t *pNtk)
void Abc_NtkCountNodes(Abc_Ntk_t *pNtk)
void Abc_NtkDfsBoxes_rec(Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
Gia_Man_t * Abc_NtkDeriveFlatGia2(Abc_Ntk_t *pNtk, Vec_Ptr_t *vModels)
Gia_Man_t * Au_ManDeriveTest(Abc_Ntk_t *pRoot)
struct Abc_Obj_t_ Abc_Obj_t
#define Abc_NtkForEachPo(pNtk, pPo, i)
#define Abc_NtkForEachObj(pNtk, pObj, i)
ITERATORS ///.
#define Abc_ObjForEachFanin(pObj, pFanin, i)
#define Abc_ObjForEachFanout(pObj, pFanout, i)
#define Abc_CubeForEachVar(pCube, Value, i)
struct Abc_Ntk_t_ Abc_Ntk_t
#define Abc_SopForEachCube(pSop, nFanins, pCube)
#define Abc_NtkForEachPi(pNtk, pPi, i)
ABC_DLL void Abc_NtkPrintBoxInfo(Abc_Ntk_t *pNtk)
ABC_DLL int Abc_SopGetVarNum(char *pSop)
ABC_DLL int Abc_SopIsExorType(char *pSop)
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
ABC_DLL int Abc_SopIsComplement(char *pSop)
ABC_DLL void Abc_NtkFillTemp(Abc_Ntk_t *pNtk)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
void Gia_ManStop(Gia_Man_t *p)
#define Gia_ManForEachAnd(p, pObj, i)
void Gia_ManStopP(Gia_Man_t **p)
void Gia_ManSetRegNum(Gia_Man_t *p, int nRegs)
void Gia_ManHashAlloc(Gia_Man_t *p)
Gia_Man_t * Gia_ManStart(int nObjsMax)
FUNCTION DEFINITIONS ///.
struct Gia_Obj_t_ Gia_Obj_t
int Gia_ManHashXor(Gia_Man_t *p, int iLit0, int iLit1)
void Gia_ManFillValue(Gia_Man_t *p)
struct Gia_Man_t_ Gia_Man_t
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
void Gia_ManHashStop(Gia_Man_t *p)
void Gia_ManPrintStats(Gia_Man_t *p, Gps_Par_t *pPars)
Abc_Ntk_t * Io_ReadBlifMv(char *pFileName, int fBlifMv, int fCheck)
FUNCTION DEFINITIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.