ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
abcStrash.c File Reference
#include "base/abc/abc.h"
#include "bool/dec/dec.h"
Include dependency graph for abcStrash.c:

Go to the source code of this file.

Functions

Abc_Ntk_tAbc_NtkRestrash (Abc_Ntk_t *pNtk, int fCleanup)
 FUNCTION DEFINITIONS ///.
 
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)
 
Abc_Obj_tAbc_NtkBottommost_rec (Abc_Ntk_t *pNtkNew, Abc_Obj_t *pNode, int LevelCut)
 
Abc_Ntk_tAbc_NtkBottommost (Abc_Ntk_t *pNtk, int nLevels)
 
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

◆ Abc_NodeGetSuper()

Vec_Ptr_t * Abc_NodeGetSuper ( Abc_Obj_t * pNode)

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

Synopsis [Collects the large supergate.]

Description []

SideEffects []

SeeAlso []

Definition at line 683 of file abcStrash.c.

684{
685 Vec_Ptr_t * vSuper, * vFront;
686 Abc_Obj_t * pAnd, * pFanin;
687 int i;
688 assert( Abc_ObjIsNode(pNode) && !Abc_ObjIsComplement(pNode) );
689 vSuper = Vec_PtrAlloc( 100 );
690 // explore the frontier
691 vFront = Vec_PtrAlloc( 100 );
692 Vec_PtrPush( vFront, pNode );
693 Vec_PtrForEachEntry( Abc_Obj_t *, vFront, pAnd, i )
694 {
695 pFanin = Abc_ObjChild0(pAnd);
696 if ( Abc_ObjIsNode(pFanin) && !Abc_ObjIsComplement(pFanin) && Abc_ObjFanoutNum(pFanin) == 1 )
697 Vec_PtrPush( vFront, pFanin );
698 else
699 Vec_PtrPush( vSuper, pFanin );
700
701 pFanin = Abc_ObjChild1(pAnd);
702 if ( Abc_ObjIsNode(pFanin) && !Abc_ObjIsComplement(pFanin) && Abc_ObjFanoutNum(pFanin) == 1 )
703 Vec_PtrPush( vFront, pFanin );
704 else
705 Vec_PtrPush( vSuper, pFanin );
706 }
707 Vec_PtrFree( vFront );
708 // reverse the array of pointers to start with lower IDs
709 vFront = Vec_PtrAlloc( Vec_PtrSize(vSuper) );
710 Vec_PtrForEachEntryReverse( Abc_Obj_t *, vSuper, pNode, i )
711 Vec_PtrPush( vFront, pNode );
712 Vec_PtrFree( vSuper );
713 vSuper = vFront;
714 // uniquify and return the frontier
715 Vec_PtrUniqify( vSuper, (int (*)(const void *, const void *))Vec_CompareNodeIds );
716 return vSuper;
717}
struct Abc_Obj_t_ Abc_Obj_t
Definition abc.h:116
#define assert(ex)
Definition util_old.h:213
#define Vec_PtrForEachEntryReverse(Type, vVec, pEntry, i)
Definition vecPtr.h:63
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55
Here is the caller graph for this function:

◆ Abc_NodeStrash()

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) );
503 Hop_ConeUnmark_rec( Hop_Regular(pRoot) );
504 // return the final node
505 return Abc_ObjNotCond( (Abc_Obj_t *)Hop_Regular(pRoot)->pData, Hop_IsComplement(pRoot) );
506}
void Abc_NodeStrash_rec(Abc_Aig_t *pMan, Hop_Obj_t *pObj)
Definition abcStrash.c:445
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition abc.h:527
struct Abc_Aig_t_ Abc_Aig_t
Definition abc.h:117
ABC_DLL int Abc_NodeIsConst(Abc_Obj_t *pNode)
Definition abcObj.c:867
ABC_DLL Abc_Obj_t * Abc_AigConst1(Abc_Ntk_t *pNtk)
Definition abcAig.c:683
void Hop_ConeUnmark_rec(Hop_Obj_t *pObj)
Definition hopDfs.c:257
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
struct Hop_Obj_t_ Hop_Obj_t
Definition hop.h:50
void * pManFunc
Definition abc.h:191
void * pData
Definition abc.h:145
Abc_Ntk_t * pNtk
Definition abc.h:130
Abc_Obj_t * pCopy
Definition abc.h:148
void * pData
Definition hop.h:68
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeStrash_rec()

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}
ABC_DLL Abc_Obj_t * Abc_AigAnd(Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
Definition abcAig.c:700
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkAppend()

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}
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition abc.h:522
ABC_DLL Abc_Obj_t * Abc_NtkFindCi(Abc_Ntk_t *pNtk, char *pName)
Definition abcObj.c:538
ABC_DLL void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
Definition abcFanio.c:84
#define Abc_NtkForEachPo(pNtk, pPo, i)
Definition abc.h:520
ABC_DLL Abc_Obj_t * Abc_NtkDupObj(Abc_Ntk_t *pNtkNew, Abc_Obj_t *pObj, int fCopyName)
Definition abcObj.c:342
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition abcCheck.c:64
@ ABC_OBJ_BI
Definition abc.h:91
@ ABC_OBJ_PO
Definition abc.h:90
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
Definition abcNames.c:49
ABC_DLL char * Abc_ObjAssignName(Abc_Obj_t *pObj, char *pName, char *pSuffix)
Definition abcNames.c:69
ABC_DLL int Abc_NtkToAig(Abc_Ntk_t *pNtk)
Definition abcFunc.c:1333
ABC_DLL Abc_Obj_t * Abc_AigOr(Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
Definition abcAig.c:719
#define Abc_NtkForEachCi(pNtk, pCi, i)
Definition abc.h:518
ABC_DLL void Abc_NtkCleanCopy(Abc_Ntk_t *pNtk)
Definition abcUtil.c:540
ABC_DLL void Abc_ObjPatchFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFaninOld, Abc_Obj_t *pFaninNew)
Definition abcFanio.c:172
ABC_DLL int Abc_NtkCompareSignals(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int fOnlyPis, int fComb)
Definition abcCheck.c:749
#define Abc_NtkForEachNode(pNtk, pNode, i)
Definition abc.h:464
int Nm_ManFindIdByNameTwoTypes(Nm_Man_t *p, char *pName, int Type1, int Type2)
Definition nmApi.c:239
Nm_Man_t * pManName
Definition abc.h:160
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkBottommost()

Abc_Ntk_t * Abc_NtkBottommost ( Abc_Ntk_t * pNtk,
int nLevels )

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

Synopsis [Copies the topmost levels of the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 617 of file abcStrash.c.

618{
619 Abc_Ntk_t * pNtkNew;
620 Abc_Obj_t * pObj, * pObjNew;
621 int i;
622 assert( Abc_NtkIsStrash(pNtk) );
623 assert( nLevels >= 0 );
624 // start the network
626 pNtkNew->pName = Extra_UtilStrsav(pNtk->pName);
627 // create PIs below the cut and nodes above the cut
628 Abc_NtkCleanCopy( pNtk );
629 Abc_AigConst1(pNtk)->pCopy = Abc_AigConst1(pNtkNew);
630 Abc_NtkForEachCi( pNtk, pObj, i )
631 pObj->pCopy = Abc_NtkCreatePi( pNtkNew );
632 Abc_NtkForEachCo( pNtk, pObj, i )
633 Abc_NtkBottommost_rec( pNtkNew, Abc_ObjFanin0(pObj), nLevels );
634 // add POs to nodes without fanout
635 Abc_NtkForEachNode( pNtkNew, pObjNew, i )
636 if ( Abc_ObjFanoutNum(pObjNew) == 0 )
637 Abc_ObjAddFanin( Abc_NtkCreatePo(pNtkNew), pObjNew );
638 Abc_NtkAddDummyPiNames( pNtkNew );
639 Abc_NtkAddDummyPoNames( pNtkNew );
640 // make sure everything is okay
641 if ( !Abc_NtkCheck( pNtkNew ) )
642 {
643 printf( "Abc_NtkBottommost: The network check has failed.\n" );
644 Abc_NtkDelete( pNtkNew );
645 return NULL;
646 }
647 return pNtkNew;
648}
Abc_Obj_t * Abc_NtkBottommost_rec(Abc_Ntk_t *pNtkNew, Abc_Obj_t *pNode, int LevelCut)
Definition abcStrash.c:594
ABC_DLL Abc_Ntk_t * Abc_NtkAlloc(Abc_NtkType_t Type, Abc_NtkFunc_t Func, int fUseMemMan)
DECLARATIONS ///.
Definition abcNtk.c:53
struct Abc_Ntk_t_ Abc_Ntk_t
Definition abc.h:115
@ ABC_NTK_STRASH
Definition abc.h:58
ABC_DLL void Abc_NtkAddDummyPoNames(Abc_Ntk_t *pNtk)
Definition abcNames.c:521
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition abcNtk.c:1421
@ ABC_FUNC_AIG
Definition abc.h:67
ABC_DLL void Abc_NtkAddDummyPiNames(Abc_Ntk_t *pNtk)
Definition abcNames.c:495
char * Extra_UtilStrsav(const char *s)
char * pName
Definition abc.h:158
Here is the call graph for this function:

◆ Abc_NtkBottommost_rec()

Abc_Obj_t * Abc_NtkBottommost_rec ( Abc_Ntk_t * pNtkNew,
Abc_Obj_t * pNode,
int LevelCut )

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

Synopsis [Copies the bottommost levels of the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 594 of file abcStrash.c.

595{
596 assert( !Abc_ObjIsComplement(pNode) );
597 if ( pNode->pCopy )
598 return pNode->pCopy;
599 Abc_NtkBottommost_rec( pNtkNew, Abc_ObjFanin0(pNode), LevelCut );
600 Abc_NtkBottommost_rec( pNtkNew, Abc_ObjFanin1(pNode), LevelCut );
601 if ( pNode->Level > (unsigned)LevelCut )
602 return NULL;
603 return pNode->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, Abc_ObjChild0Copy(pNode), Abc_ObjChild1Copy(pNode) );
604}
unsigned Level
Definition abc.h:142
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkPutOnTop()

Abc_Ntk_t * Abc_NtkPutOnTop ( Abc_Ntk_t * pNtk,
Abc_Ntk_t * pNtk2 )

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 861 of file abcStrash.c.

862{
863 Vec_Ptr_t * vNodes;
864 Abc_Ntk_t * pNtkNew;
865 Abc_Obj_t * pObj, * pFanin;
866 int i, k;
867 assert( Abc_NtkIsLogic(pNtk) );
868 assert( Abc_NtkIsLogic(pNtk2) );
869 assert( Abc_NtkPoNum(pNtk) == Abc_NtkPiNum(pNtk2) );
870 // clean the node copy fields
871 Abc_NtkCleanCopy( pNtk );
872 Abc_NtkCleanCopy( pNtk2 );
873 // duplicate the name and the spec
874 pNtkNew = Abc_NtkAlloc( pNtk->ntkType, pNtk->ntkFunc, 1 );
875 pNtkNew->pName = Extra_UtilStrsav(pNtk->pName);
876 pNtkNew->pSpec = Extra_UtilStrsav(pNtk->pSpec);
877 // clone CIs/CIs/boxes
878 Abc_NtkForEachPi( pNtk, pObj, i )
879 Abc_NtkDupObj( pNtkNew, pObj, 1 );
880 // add internal nodes
881 vNodes = Abc_NtkDfs( pNtk, 0 );
882 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
883 {
884 Abc_NtkDupObj( pNtkNew, pObj, 0 );
885 Abc_ObjForEachFanin( pObj, pFanin, k )
886 Abc_ObjAddFanin( pObj->pCopy, pFanin->pCopy );
887 }
888 Vec_PtrFree( vNodes );
889 // transfer to the POs
890 Abc_NtkForEachPi( pNtk2, pObj, i )
891 pObj->pCopy = Abc_ObjChild0Copy( Abc_NtkPo(pNtk, i) );
892 // add internal nodes
893 vNodes = Abc_NtkDfs( pNtk2, 0 );
894 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
895 {
896 Abc_NtkDupObj( pNtkNew, pObj, 0 );
897 Abc_ObjForEachFanin( pObj, pFanin, k )
898 Abc_ObjAddFanin( pObj->pCopy, pFanin->pCopy );
899 }
900 Vec_PtrFree( vNodes );
901 // clone CIs/CIs/boxes
902 Abc_NtkForEachPo( pNtk2, pObj, i )
903 {
904 Abc_NtkDupObj( pNtkNew, pObj, 1 );
905 Abc_ObjAddFanin( pObj->pCopy, Abc_ObjChild0Copy(pObj) );
906 }
907 if ( !Abc_NtkCheck( pNtkNew ) )
908 fprintf( stdout, "Abc_NtkPutOnTop(): Network check has failed.\n" );
909 return pNtkNew;
910}
ABC_DLL Vec_Ptr_t * Abc_NtkDfs(Abc_Ntk_t *pNtk, int fCollectAll)
Definition abcDfs.c:82
#define Abc_NtkForEachPi(pNtk, pPi, i)
Definition abc.h:516
Abc_NtkType_t ntkType
Definition abc.h:156
char * pSpec
Definition abc.h:159
Abc_NtkFunc_t ntkFunc
Definition abc.h:157
Here is the call graph for this function:

◆ Abc_NtkRestrash()

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)
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}
ABC_DLL int Abc_NtkGetChoiceNum(Abc_Ntk_t *pNtk)
Definition abcUtil.c:463
ABC_DLL void Abc_NtkFinalize(Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtkNew)
Definition abcNtk.c:355
ABC_DLL int Abc_AigCleanup(Abc_Aig_t *pMan)
Definition abcAig.c:194
ABC_DLL Abc_Ntk_t * Abc_NtkStartFrom(Abc_Ntk_t *pNtk, Abc_NtkType_t Type, Abc_NtkFunc_t Func)
Definition abcNtk.c:157
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
Definition abcNtk.c:472
Abc_Ntk_t * pExdc
Definition abc.h:201
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkRestrashRandom()

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}
void Abc_NtkRestrashRandom_rec(Abc_Ntk_t *pNtk, Abc_Obj_t *pObj)
Definition abcStrash.c:106
Here is the call graph for this function:

◆ Abc_NtkRestrashRandom_rec()

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 {
115 Abc_NtkRestrashRandom_rec( pNtk, Abc_ObjFanin0(pObj) );
116 Abc_NtkRestrashRandom_rec( pNtk, Abc_ObjFanin1(pObj) );
117 }
118 else
119 {
120 Abc_NtkRestrashRandom_rec( pNtk, Abc_ObjFanin1(pObj) );
121 Abc_NtkRestrashRandom_rec( pNtk, Abc_ObjFanin0(pObj) );
122 }
123 pObj->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtk->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
124}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkRestrashZero()

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 );
219 Abc_ObjAssignName( Abc_ObjFanout0(pObj), Abc_ObjName(Abc_ObjFanout0(pObj)), "_inv" );
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}
#define Abc_NtkForEachLatch(pNtk, pObj, i)
Definition abc.h:500
ABC_DLL void Abc_NtkUpdateNameIds(Abc_Ntk_t *p)
Definition abcNames.c:793
ABC_DLL void Abc_NtkTransferNameIds(Abc_Ntk_t *p, Abc_Ntk_t *pNew)
Definition abcNames.c:761
ABC_DLL Abc_Obj_t * Abc_NodeFindCoFanout(Abc_Obj_t *pNode)
Definition abcUtil.c:812
void Nm_ManDeleteIdName(Nm_Man_t *p, int ObjId)
Definition nmApi.c:149
Vec_Int_t * vNameIds
Definition abc.h:215
Here is the call graph for this function:

◆ Abc_NtkStrash()

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}
Abc_Ntk_t * Abc_NtkRestrash(Abc_Ntk_t *pNtk, int fCleanup)
FUNCTION DEFINITIONS ///.
Definition abcStrash.c:49
Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition abcStrash.c:265
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkTopAnd()

Abc_Ntk_t * Abc_NtkTopAnd ( Abc_Ntk_t * pNtk)

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

Synopsis [Copies the topmost levels of the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 730 of file abcStrash.c.

731{
732 Vec_Ptr_t * vNodes, * vOrder;
733 Abc_Ntk_t * pNtkAig;
734 Abc_Obj_t * pObj, * pDriver, * pObjPo;
735 int i, nNodes;
736 assert( Abc_NtkIsStrash(pNtk) );
737 // get the first PO
738 pObjPo = Abc_NtkPo(pNtk, 0);
739 vNodes = Abc_NodeGetSuper( Abc_ObjChild0(pObjPo) );
740 assert( Vec_PtrSize(vNodes) >= 2 );
741 // start the new network (constants and CIs of the old network will point to the their counterparts in the new network)
742 Abc_NtkCleanCopy( pNtk );
744 pNtkAig->pName = Extra_UtilStrsav(pNtk->pName);
745 pNtkAig->pSpec = Extra_UtilStrsav(pNtk->pSpec);
746 Abc_AigConst1(pNtk)->pCopy = Abc_AigConst1(pNtkAig);
747 Abc_NtkForEachPi( pNtk, pObj, i )
748 Abc_NtkDupObj( pNtkAig, pObj, 1 );
749 // restrash the nodes reachable from the roots
750 vOrder = Abc_NtkDfsIterNodes( pNtk, vNodes );
751 Vec_PtrForEachEntry( Abc_Obj_t *, vOrder, pObj, i )
752 pObj->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkAig->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
753 Vec_PtrFree( vOrder );
754 // finalize the network
755 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
756 {
757 pObjPo = Abc_NtkCreatePo(pNtkAig);
758 pDriver = Abc_ObjNotCond(Abc_ObjRegular(pObj)->pCopy, Abc_ObjIsComplement(pObj));
759 Abc_ObjAddFanin( pObjPo, pDriver );
760 Abc_ObjAssignName( pObjPo, Abc_ObjName(pObjPo), NULL );
761 }
762 Vec_PtrFree( vNodes );
763 // perform cleanup if requested
764 if ( (nNodes = Abc_AigCleanup((Abc_Aig_t *)pNtkAig->pManFunc)) )
765 printf( "Abc_NtkTopAnd(): AIG cleanup removed %d nodes (this is a bug).\n", nNodes );
766 // make sure everything is okay
767 if ( !Abc_NtkCheck( pNtkAig ) )
768 {
769 printf( "Abc_NtkStrash: The network check has failed.\n" );
770 Abc_NtkDelete( pNtkAig );
771 return NULL;
772 }
773 return pNtkAig;
774}
Vec_Ptr_t * Abc_NodeGetSuper(Abc_Obj_t *pNode)
Definition abcStrash.c:683
ABC_DLL Vec_Ptr_t * Abc_NtkDfsIterNodes(Abc_Ntk_t *pNtk, Vec_Ptr_t *vRoots)
Definition abcDfs.c:611
Here is the call graph for this function:

◆ Abc_NtkTopmost()

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, * pObj;
552 int LevelCut, i;
553 assert( Abc_NtkIsStrash(pNtk) );
554 // get the cutoff level
555 LevelCut = Abc_MaxInt( 0, Abc_AigLevel(pNtk) - nLevels );
556 // start the network
558 pNtkNew->pName = Extra_UtilStrsav(pNtk->pName);
559 // create PIs below the cut and nodes above the cut
560 Abc_NtkCleanCopy( pNtk );
561 Abc_AigConst1(pNtk)->pCopy = Abc_AigConst1(pNtkNew);
562 Abc_NtkForEachCo( pNtk, pObj, i )
563 {
564 pObjNew = Abc_NtkTopmost_rec( pNtkNew, Abc_ObjFanin0(pObj), LevelCut );
565 pObjNew = Abc_ObjNotCond( pObjNew, Abc_ObjFaninC0(pObj) );
566 Abc_ObjAddFanin( (pObj->pCopy = Abc_NtkCreatePo(pNtkNew)), pObjNew );
567 }
568 // add the PO node and name
569 Abc_NtkAddDummyPiNames( pNtkNew );
570 Abc_NtkForEachCo( pNtk, pObj, i )
571 Abc_ObjAssignName( pObj->pCopy, Abc_ObjName(pObj), NULL );
572 // make sure everything is okay
573 if ( !Abc_NtkCheck( pNtkNew ) )
574 {
575 printf( "Abc_NtkTopmost: The network check has failed.\n" );
576 Abc_NtkDelete( pNtkNew );
577 return NULL;
578 }
579 return pNtkNew;
580}
Abc_Obj_t * Abc_NtkTopmost_rec(Abc_Ntk_t *pNtkNew, Abc_Obj_t *pNode, int LevelCut)
Definition abcStrash.c:525
ABC_DLL int Abc_AigLevel(Abc_Ntk_t *pNtk)
Definition abcAig.c:292
Here is the call graph for this function:

◆ Abc_NtkTopmost_rec()

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}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkWriteAig()

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 787 of file abcStrash.c.

788{
789 FILE * pFile;
790 Vec_Int_t * vId2Num;
791 Abc_Obj_t * pObj;
792 int i, iLit;
793 assert( Abc_NtkIsStrash(pNtk) );
794 assert( Abc_NtkLatchNum(pNtk) == 0 );
795 if ( pFileName == NULL )
796 pFile = stdout;
797 else
798 pFile = fopen( pFileName, "w" );
799 if ( pFile == NULL )
800 {
801 printf( "Cannot open output file.\n" );
802 return;
803 }
804 vId2Num = Vec_IntAlloc( 2*Abc_NtkObjNumMax(pNtk) );
805 Vec_IntFill( vId2Num, 2*Abc_NtkObjNumMax(pNtk), -1 );
806
807 iLit = 0;
808 Vec_IntWriteEntry( vId2Num, 2*Abc_ObjId(Abc_AigConst1(pNtk))+1, iLit++ );
809 Vec_IntWriteEntry( vId2Num, 2*Abc_ObjId(Abc_AigConst1(pNtk))+0, iLit++ );
810 Abc_NtkForEachPi( pNtk, pObj, i )
811 {
812 Vec_IntWriteEntry( vId2Num, 2*Abc_ObjId(pObj)+0, iLit++ );
813 Vec_IntWriteEntry( vId2Num, 2*Abc_ObjId(pObj)+1, iLit++ );
814 }
815 Abc_AigForEachAnd( pNtk, pObj, i )
816 {
817 Vec_IntWriteEntry( vId2Num, 2*Abc_ObjId(pObj)+0, iLit++ );
818 Vec_IntWriteEntry( vId2Num, 2*Abc_ObjId(pObj)+1, iLit++ );
819 }
820 fprintf( pFile, "{\n" );
821 fprintf( pFile, " \"%s\", ", Abc_NtkName(pNtk) );
822 fprintf( pFile, "// pi=%d po=%d and=%d", Abc_NtkPiNum(pNtk), Abc_NtkPoNum(pNtk), Abc_NtkNodeNum(pNtk) );
823 fprintf( pFile, "\n" );
824 fprintf( pFile, " { " );
825 Abc_NtkForEachPi( pNtk, pObj, i )
826 fprintf( pFile, "\"%s\",", Abc_ObjName(pObj) );
827 fprintf( pFile, "NULL },\n" );
828 fprintf( pFile, " { " );
829 Abc_NtkForEachPo( pNtk, pObj, i )
830 fprintf( pFile, "\"%s\",", Abc_ObjName(pObj) );
831 fprintf( pFile, "NULL },\n" );
832 fprintf( pFile, " { " );
833 Abc_AigForEachAnd( pNtk, pObj, i )
834 fprintf( pFile, "%d,", Vec_IntEntry(vId2Num, 2*Abc_ObjFaninId0(pObj) + Abc_ObjFaninC0(pObj)) );
835 fprintf( pFile, "0 },\n" );
836 fprintf( pFile, " { " );
837 Abc_AigForEachAnd( pNtk, pObj, i )
838 fprintf( pFile, "%d,", Vec_IntEntry(vId2Num, 2*Abc_ObjFaninId1(pObj) + Abc_ObjFaninC1(pObj)) );
839 fprintf( pFile, "0 },\n" );
840 fprintf( pFile, " { " );
841 Abc_NtkForEachPo( pNtk, pObj, i )
842 fprintf( pFile, "%d,", Vec_IntEntry(vId2Num, 2*Abc_ObjFaninId0(pObj) + Abc_ObjFaninC0(pObj)) );
843 fprintf( pFile, "0 },\n" );
844 fprintf( pFile, "},\n" );
845 if ( pFile != stdout )
846 fclose( pFile );
847 Vec_IntFree( vId2Num );
848}
#define Abc_AigForEachAnd(pNtk, pNode, i)
Definition abc.h:488
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
Here is the call graph for this function: