ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
abcSweep.c File Reference
#include "base/abc/abc.h"
#include "base/main/main.h"
#include "proof/fraig/fraig.h"
Include dependency graph for abcSweep.c:

Go to the source code of this file.

Functions

int Abc_NtkFraigSweep (Abc_Ntk_t *pNtk, int fUseInv, int fExdc, int fVerbose, int fVeryVerbose)
 FUNCTION DEFINITIONS ///.
 
int Abc_NtkCleanup (Abc_Ntk_t *pNtk, int fVerbose)
 
int Abc_NtkCleanupNodes (Abc_Ntk_t *pNtk, Vec_Ptr_t *vRoots, int fVerbose)
 
int Abc_NtkSweep (Abc_Ntk_t *pNtk, int fVerbose)
 
int Abc_NodeRemoveNonCurrentObjects (Abc_Ntk_t *pNtk)
 
void Abc_NtkSetTravId_rec (Abc_Obj_t *pObj)
 
int Abc_NtkCheckConstant_rec (Abc_Obj_t *pObj)
 
int Abc_NtkLatchSweep (Abc_Ntk_t *pNtk)
 
int Abc_NtkReplaceAutonomousLogic (Abc_Ntk_t *pNtk)
 
int Abc_NtkCleanupSeq (Abc_Ntk_t *pNtk, int fLatchSweep, int fAutoSweep, int fVerbose)
 
int Abc_NtkSweepBufsInvs (Abc_Ntk_t *pNtk, int fVerbose)
 

Function Documentation

◆ Abc_NodeRemoveNonCurrentObjects()

int Abc_NodeRemoveNonCurrentObjects ( Abc_Ntk_t * pNtk)

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

Synopsis [Removes all objects whose trav ID is not current.]

Description []

SideEffects []

SeeAlso []

Definition at line 708 of file abcSweep.c.

709{
710 Abc_Obj_t * pObj;
711 int Counter, i;
712 int fVerbose = 0;
713
714 // report on the nodes to be deleted
715 if ( fVerbose )
716 {
717 printf( "These nodes will be deleted: \n" );
718 Abc_NtkForEachObj( pNtk, pObj, i )
719 if ( !Abc_NodeIsTravIdCurrent( pObj ) )
720 {
721 printf( " " );
722 Abc_ObjPrint( stdout, pObj );
723 }
724 }
725
726 // delete the nodes
727 Counter = 0;
728 Abc_NtkForEachObj( pNtk, pObj, i )
729 if ( !Abc_NodeIsTravIdCurrent( pObj ) )
730 {
731 Abc_NtkDeleteObj( pObj );
732 Counter++;
733 }
734 return Counter;
735}
struct Abc_Obj_t_ Abc_Obj_t
Definition abc.h:116
ABC_DLL void Abc_NtkDeleteObj(Abc_Obj_t *pObj)
Definition abcObj.c:170
#define Abc_NtkForEachObj(pNtk, pObj, i)
ITERATORS ///.
Definition abc.h:449
ABC_DLL void Abc_ObjPrint(FILE *pFile, Abc_Obj_t *pObj)
Definition abcPrint.c:1674
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkCheckConstant_rec()

int Abc_NtkCheckConstant_rec ( Abc_Obj_t * pObj)

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

Synopsis [Check if the fanin of this latch is a constant.]

Description [Returns 0/1 if constant; -1 if not a constant.]

SideEffects []

SeeAlso []

Definition at line 768 of file abcSweep.c.

769{
770 if ( Abc_ObjFaninNum(pObj) == 0 )
771 {
772 if ( !Abc_ObjIsNode(pObj) )
773 return -1;
774 if ( Abc_NodeIsConst0(pObj) )
775 return 0;
776 if ( Abc_NodeIsConst1(pObj) )
777 return 1;
778 assert( 0 );
779 return -1;
780 }
781 if ( Abc_ObjIsLatch(pObj) || Abc_ObjFaninNum(pObj) > 1 )
782 return -1;
783 if ( !Abc_ObjIsNode(pObj) || Abc_NodeIsBuf(pObj) )
784 return Abc_NtkCheckConstant_rec( Abc_ObjFanin0(pObj) );
785 if ( Abc_NodeIsInv(pObj) )
786 {
787 int RetValue = Abc_NtkCheckConstant_rec( Abc_ObjFanin0(pObj) );
788 if ( RetValue == 0 )
789 return 1;
790 if ( RetValue == 1 )
791 return 0;
792 return RetValue;
793 }
794 assert( 0 );
795 return -1;
796}
int Abc_NtkCheckConstant_rec(Abc_Obj_t *pObj)
Definition abcSweep.c:768
ABC_DLL int Abc_NodeIsBuf(Abc_Obj_t *pNode)
Definition abcObj.c:948
ABC_DLL int Abc_NodeIsInv(Abc_Obj_t *pNode)
Definition abcObj.c:980
ABC_DLL int Abc_NodeIsConst0(Abc_Obj_t *pNode)
Definition abcObj.c:884
ABC_DLL int Abc_NodeIsConst1(Abc_Obj_t *pNode)
Definition abcObj.c:916
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkCleanup()

int Abc_NtkCleanup ( Abc_Ntk_t * pNtk,
int fVerbose )

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

Synopsis [Removes dangling nodes.]

Description [Returns the number of nodes removed.]

SideEffects []

SeeAlso []

Definition at line 478 of file abcSweep.c.

479{
480 Vec_Ptr_t * vNodes;
481 int Counter;
482 assert( Abc_NtkIsLogic(pNtk) );
483 // mark the nodes reachable from the POs
484 vNodes = Abc_NtkDfs( pNtk, 0 );
485 Counter = Abc_NtkReduceNodes( pNtk, vNodes );
486 if ( fVerbose )
487 printf( "Cleanup removed %d dangling nodes.\n", Counter );
488 Vec_PtrFree( vNodes );
489 return Counter;
490}
ABC_DLL Vec_Ptr_t * Abc_NtkDfs(Abc_Ntk_t *pNtk, int fCollectAll)
Definition abcDfs.c:82
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkCleanupNodes()

int Abc_NtkCleanupNodes ( Abc_Ntk_t * pNtk,
Vec_Ptr_t * vRoots,
int fVerbose )

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

Synopsis [Removes dangling nodes.]

Description [Returns the number of nodes removed.]

SideEffects []

SeeAlso []

Definition at line 503 of file abcSweep.c.

504{
505 Vec_Ptr_t * vNodes, * vStarts;
506 Abc_Obj_t * pObj;
507 int i, Counter;
508 assert( Abc_NtkIsLogic(pNtk) );
509 // collect starting nodes into one array
510 vStarts = Vec_PtrAlloc( 1000 );
511 Abc_NtkForEachCo( pNtk, pObj, i )
512 Vec_PtrPush( vStarts, pObj );
513 Vec_PtrForEachEntry( Abc_Obj_t *, vRoots, pObj, i )
514 if ( pObj )
515 Vec_PtrPush( vStarts, pObj );
516 // mark the nodes reachable from the POs
517 vNodes = Abc_NtkDfsNodes( pNtk, (Abc_Obj_t **)Vec_PtrArray(vStarts), Vec_PtrSize(vStarts) );
518 Vec_PtrFree( vStarts );
519 Counter = Abc_NtkReduceNodes( pNtk, vNodes );
520 if ( fVerbose )
521 printf( "Cleanup removed %d dangling nodes.\n", Counter );
522 Vec_PtrFree( vNodes );
523 return Counter;
524}
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition abc.h:522
ABC_DLL Vec_Ptr_t * Abc_NtkDfsNodes(Abc_Ntk_t *pNtk, Abc_Obj_t **ppNodes, int nNodes)
Definition abcDfs.c:151
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55
Here is the call graph for this function:

◆ Abc_NtkCleanupSeq()

int Abc_NtkCleanupSeq ( Abc_Ntk_t * pNtk,
int fLatchSweep,
int fAutoSweep,
int fVerbose )

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

Synopsis [Sequential cleanup.]

Description [Performs three tasks:

  • Removes logic that does not feed into POs.
  • Removes latches driven by constant values equal to the initial state.
  • Replaces the autonomous components by additional PI variables.]

SideEffects []

SeeAlso []

Definition at line 919 of file abcSweep.c.

920{
921 Vec_Ptr_t * vNodes;
922 int Counter;
923 assert( Abc_NtkIsLogic(pNtk) );
924 // mark the nodes reachable from the POs
925 vNodes = Abc_NtkDfsSeq( pNtk );
926 Vec_PtrFree( vNodes );
927 // remove the non-marked nodes
928 Counter = Abc_NodeRemoveNonCurrentObjects( pNtk );
929 if ( fVerbose )
930 printf( "Cleanup removed %4d dangling objects.\n", Counter );
931 // check if some of the latches can be removed
932 if ( fLatchSweep )
933 {
934 Counter = Abc_NtkLatchSweep( pNtk );
935 if ( fVerbose )
936 printf( "Cleanup removed %4d redundant latches.\n", Counter );
937 }
938 // detect the autonomous components
939 if ( fAutoSweep )
940 {
941 vNodes = Abc_NtkDfsSeqReverse( pNtk );
942 Vec_PtrFree( vNodes );
943 // replace them by PIs
944 Counter = Abc_NtkReplaceAutonomousLogic( pNtk );
945 if ( fVerbose )
946 printf( "Cleanup added %4d additional PIs.\n", Counter );
947 // remove the non-marked nodes
948 Counter = Abc_NodeRemoveNonCurrentObjects( pNtk );
949 if ( fVerbose )
950 printf( "Cleanup removed %4d autonomous objects.\n", Counter );
951 }
952 // check
953 if ( !Abc_NtkCheck( pNtk ) )
954 printf( "Abc_NtkCleanupSeq: The network check has failed.\n" );
955 return 1;
956}
int Abc_NodeRemoveNonCurrentObjects(Abc_Ntk_t *pNtk)
Definition abcSweep.c:708
int Abc_NtkReplaceAutonomousLogic(Abc_Ntk_t *pNtk)
Definition abcSweep.c:862
int Abc_NtkLatchSweep(Abc_Ntk_t *pNtk)
Definition abcSweep.c:812
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition abcCheck.c:64
ABC_DLL Vec_Ptr_t * Abc_NtkDfsSeq(Abc_Ntk_t *pNtk)
Definition abcDfs.c:428
ABC_DLL Vec_Ptr_t * Abc_NtkDfsSeqReverse(Abc_Ntk_t *pNtk)
Definition abcDfs.c:485
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkFraigSweep()

int Abc_NtkFraigSweep ( Abc_Ntk_t * pNtk,
int fUseInv,
int fExdc,
int fVerbose,
int fVeryVerbose )

FUNCTION DEFINITIONS ///.

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

Synopsis [Sweping functionally equivalence nodes.]

Description [Removes gates with equivalent functionality. Works for both technology-independent and mapped networks. If the flag is set, allows adding inverters at the gate outputs.]

SideEffects []

SeeAlso []

Definition at line 62 of file abcSweep.c.

63{
64 Fraig_Params_t Params;
65 Abc_Ntk_t * pNtkAig;
66 Fraig_Man_t * pMan;
67 stmm_table * tEquiv;
68 Abc_Obj_t * pObj;
69 int i, fUseTrick;
70
71 assert( !Abc_NtkIsStrash(pNtk) );
72
73 // save gate assignments
74 fUseTrick = 0;
75 if ( Abc_NtkIsMappedLogic(pNtk) )
76 {
77 fUseTrick = 1;
78 Abc_NtkForEachNode( pNtk, pObj, i )
79 pObj->pNext = (Abc_Obj_t *)pObj->pData;
80 }
81 // derive the AIG
82 pNtkAig = Abc_NtkStrash( pNtk, 0, 1, 0 );
83 // reconstruct gate assignments
84 if ( fUseTrick )
85 {
86// extern void * Abc_FrameReadLibGen();
87 Hop_ManStop( (Hop_Man_t *)pNtk->pManFunc );
89 pNtk->ntkFunc = ABC_FUNC_MAP;
90 Abc_NtkForEachNode( pNtk, pObj, i )
91 pObj->pData = pObj->pNext, pObj->pNext = NULL;
92 }
93
94 // perform fraiging of the AIG
95 Fraig_ParamsSetDefault( &Params );
96 Params.fInternal = 1;
97 pMan = (Fraig_Man_t *)Abc_NtkToFraig( pNtkAig, &Params, 0, 0 );
98 // cannot use EXDC with FRAIG because it can create classes of equivalent FRAIG nodes
99 // with representative nodes that do not correspond to the nodes with the current network
100
101 // update FRAIG using EXDC
102 if ( fExdc )
103 {
104 if ( pNtk->pExdc == NULL )
105 printf( "Warning: Networks has no EXDC.\n" );
106 else
107 Abc_NtkFraigSweepUsingExdc( pMan, pNtk );
108 }
109 // assign levels to the nodes of the network
110 Abc_NtkLevel( pNtk );
111
112 // collect the classes of equivalent nets
113 tEquiv = Abc_NtkFraigEquiv( pNtk, fUseInv, fVerbose, fVeryVerbose );
114
115 // transform the network into the equivalent one
116 Abc_NtkFraigTransform( pNtk, tEquiv, fUseInv, fVerbose );
117 stmm_free_table( tEquiv );
118
119 // free the manager
120 Fraig_ManFree( pMan );
121 Abc_NtkDelete( pNtkAig );
122
123 // cleanup the dangling nodes
124 if ( Abc_NtkHasMapping(pNtk) )
125 Abc_NtkCleanup( pNtk, fVerbose );
126 else
127 Abc_NtkSweep( pNtk, fVerbose );
128
129 // check
130 if ( !Abc_NtkCheck( pNtk ) )
131 {
132 printf( "Abc_NtkFraigSweep: The network check has failed.\n" );
133 return 0;
134 }
135 return 1;
136}
int Abc_NtkCleanup(Abc_Ntk_t *pNtk, int fVerbose)
Definition abcSweep.c:478
int Abc_NtkSweep(Abc_Ntk_t *pNtk, int fVerbose)
Definition abcSweep.c:692
struct Abc_Ntk_t_ Abc_Ntk_t
Definition abc.h:115
ABC_DLL int Abc_NtkLevel(Abc_Ntk_t *pNtk)
Definition abcDfs.c:1449
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition abcStrash.c:265
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition abcNtk.c:1421
@ ABC_FUNC_MAP
Definition abc.h:68
ABC_DLL void * Abc_NtkToFraig(Abc_Ntk_t *pNtk, void *pParams, int fAllNodes, int fExdc)
Definition abcFraig.c:103
#define Abc_NtkForEachNode(pNtk, pNode, i)
Definition abc.h:464
ABC_DLL void * Abc_FrameReadLibGen()
Definition mainFrame.c:59
void Fraig_ManFree(Fraig_Man_t *pMan)
Definition fraigMan.c:262
void Fraig_ParamsSetDefault(Fraig_Params_t *pParams)
Definition fraigMan.c:122
typedefABC_NAMESPACE_HEADER_START struct Fraig_ManStruct_t_ Fraig_Man_t
INCLUDES ///.
Definition fraig.h:40
struct Fraig_ParamsStruct_t_ Fraig_Params_t
Definition fraig.h:44
typedefABC_NAMESPACE_HEADER_START struct Hop_Man_t_ Hop_Man_t
INCLUDES ///.
Definition hop.h:49
void Hop_ManStop(Hop_Man_t *p)
Definition hopMan.c:84
void stmm_free_table(stmm_table *table)
Definition stmm.c:79
Abc_Ntk_t * pExdc
Definition abc.h:201
void * pManFunc
Definition abc.h:191
Abc_NtkFunc_t ntkFunc
Definition abc.h:157
void * pData
Definition abc.h:145
Abc_Obj_t * pNext
Definition abc.h:131
Here is the call graph for this function:

◆ Abc_NtkLatchSweep()

int Abc_NtkLatchSweep ( Abc_Ntk_t * pNtk)

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

Synopsis [Removes redundant latches.]

Description [The redundant latches are of two types:

  • Latches fed by a constant which matches the init value of the latch.
  • Latches fed by a constant which does not match the init value of the latch can be all replaced by one latch.]

SideEffects []

SeeAlso []

Definition at line 812 of file abcSweep.c.

813{
814 Abc_Obj_t * pFanin, * pLatch, * pLatchPivot = NULL;
815 int Counter, RetValue, i;
816 Counter = 0;
817 // go through the latches
818 Abc_NtkForEachLatch( pNtk, pLatch, i )
819 {
820 // check if the latch has constant input
821 RetValue = Abc_NtkCheckConstant_rec( Abc_ObjFanin0(pLatch) );
822 if ( RetValue == -1 )
823 continue;
824 // found a latch with constant fanin
825 if ( (RetValue == 1 && Abc_LatchIsInit0(pLatch)) ||
826 (RetValue == 0 && Abc_LatchIsInit1(pLatch)) )
827 {
828 // fanin constant differs from the latch init value
829 if ( pLatchPivot == NULL )
830 {
831 pLatchPivot = pLatch;
832 continue;
833 }
834 if ( Abc_LatchInit(pLatch) != Abc_LatchInit(pLatchPivot) ) // add inverter
835 pFanin = Abc_NtkCreateNodeInv( pNtk, Abc_ObjFanout0(pLatchPivot) );
836 else
837 pFanin = Abc_ObjFanout0(pLatchPivot);
838 }
839 else
840 pFanin = Abc_ObjFanin0(Abc_ObjFanin0(pLatch));
841 // replace latch
842 Abc_ObjTransferFanout( Abc_ObjFanout0(pLatch), pFanin );
843 // delete the extra nodes
844 Abc_NtkDeleteObj_rec( Abc_ObjFanout0(pLatch), 0 );
845 Counter++;
846 }
847 return Counter;
848}
#define Abc_NtkForEachLatch(pNtk, pObj, i)
Definition abc.h:500
ABC_DLL void Abc_NtkDeleteObj_rec(Abc_Obj_t *pObj, int fOnlyNodes)
Definition abcObj.c:278
ABC_DLL void Abc_ObjTransferFanout(Abc_Obj_t *pObjOld, Abc_Obj_t *pObjNew)
Definition abcFanio.c:292
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeInv(Abc_Ntk_t *pNtk, Abc_Obj_t *pFanin)
Definition abcObj.c:674
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkReplaceAutonomousLogic()

int Abc_NtkReplaceAutonomousLogic ( Abc_Ntk_t * pNtk)

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

Synopsis [Replaces autonumnous logic by free inputs.]

Description [Assumes that non-autonomous logic is marked with the current ID.]

SideEffects []

SeeAlso []

Definition at line 862 of file abcSweep.c.

863{
864 Abc_Obj_t * pNode, * pFanin;
865 Vec_Ptr_t * vNodes;
866 int i, k, Counter;
867 // collect the nodes that feed into the reachable logic
868 vNodes = Vec_PtrAlloc( 100 );
869 Abc_NtkForEachObj( pNtk, pNode, i )
870 {
871 // skip non-visited fanins
872 if ( !Abc_NodeIsTravIdCurrent(pNode) )
873 continue;
874 // look for non-visited fanins
875 Abc_ObjForEachFanin( pNode, pFanin, k )
876 {
877 // skip visited fanins
878 if ( Abc_NodeIsTravIdCurrent(pFanin) )
879 continue;
880 // skip constants and latches fed by constants
881 if ( Abc_NtkCheckConstant_rec(pFanin) != -1 ||
882 (Abc_ObjIsBo(pFanin) && Abc_NtkCheckConstant_rec(Abc_ObjFanin0(Abc_ObjFanin0(pFanin))) != -1) )
883 {
884 Abc_NtkSetTravId_rec( pFanin );
885 continue;
886 }
887 assert( !Abc_ObjIsLatch(pFanin) );
888 Vec_PtrPush( vNodes, pFanin );
889 }
890 }
891 Vec_PtrUniqify( vNodes, (int (*)(const void *, const void *))Abc_ObjPointerCompare );
892 // replace these nodes by the PIs
893 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
894 {
895 pFanin = Abc_NtkCreatePi(pNtk);
896 Abc_ObjAssignName( pFanin, Abc_ObjName(pFanin), NULL );
897 Abc_NodeSetTravIdCurrent( pFanin );
898 Abc_ObjTransferFanout( pNode, pFanin );
899 }
900 Counter = Vec_PtrSize(vNodes);
901 Vec_PtrFree( vNodes );
902 return Counter;
903}
void Abc_NtkSetTravId_rec(Abc_Obj_t *pObj)
Definition abcSweep.c:748
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition abc.h:527
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_ObjPointerCompare(void **pp1, void **pp2)
Definition abcUtil.c:1939
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkSetTravId_rec()

void Abc_NtkSetTravId_rec ( Abc_Obj_t * pObj)

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

Synopsis [Check if the fanin of this latch is a constant.]

Description [Returns 0/1 if constant; -1 if not a constant.]

SideEffects []

SeeAlso []

Definition at line 748 of file abcSweep.c.

749{
750 Abc_NodeSetTravIdCurrent(pObj);
751 if ( Abc_ObjFaninNum(pObj) == 0 )
752 return;
753 assert( Abc_ObjFaninNum(pObj) == 1 );
754 Abc_NtkSetTravId_rec( Abc_ObjFanin0(pObj) );
755}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkSweep()

int Abc_NtkSweep ( Abc_Ntk_t * pNtk,
int fVerbose )

Definition at line 692 of file abcSweep.c.

692{ return 1; }
Here is the caller graph for this function:

◆ Abc_NtkSweepBufsInvs()

int Abc_NtkSweepBufsInvs ( Abc_Ntk_t * pNtk,
int fVerbose )

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

Synopsis [Sweep to remove buffers and inverters.]

Description []

SideEffects []

SeeAlso []

Definition at line 969 of file abcSweep.c.

970{
971 Hop_Man_t * pMan;
972 Abc_Obj_t * pObj, * pFanin;
973 int i, k, fChanges = 1, Counter = 0;
974 assert( Abc_NtkIsLogic(pNtk) );
975 // convert network to BDD representation
976 if ( !Abc_NtkToAig(pNtk) )
977 {
978 fprintf( stdout, "Converting to SOP has failed.\n" );
979 return 1;
980 }
981 // get AIG manager
982 pMan = (Hop_Man_t *)pNtk->pManFunc;
983 // label selected nodes
984 Abc_NtkIncrementTravId( pNtk );
985 // iterate till no improvement
986 while ( fChanges )
987 {
988 fChanges = 0;
989 Abc_NtkForEachObj( pNtk, pObj, i )
990 {
991 Abc_ObjForEachFanin( pObj, pFanin, k )
992 {
993 // do not eliminate marked fanins
994 if ( Abc_NodeIsTravIdCurrent(pFanin) )
995 continue;
996 // do not eliminate constant nodes
997 if ( !Abc_ObjIsNode(pFanin) || Abc_ObjFaninNum(pFanin) != 1 )
998 continue;
999 // do not eliminate inverters into COs
1000 if ( Abc_ObjIsCo(pObj) && Abc_NodeIsInv(pFanin) )
1001 continue;
1002 // do not eliminate buffers connecting PIs and POs
1003// if ( Abc_ObjIsCo(pObj) && Abc_ObjIsCi(Abc_ObjFanin0(pFanin)) )
1004// continue;
1005 fChanges = 1;
1006 Counter++;
1007 // update function of the node
1008 if ( Abc_NodeIsInv(pFanin) )
1009 pObj->pData = Hop_Compose( pMan, (Hop_Obj_t *)pObj->pData, Hop_Not(Hop_IthVar(pMan, k)), k );
1010 // update the fanin
1011 Abc_ObjPatchFanin( pObj, pFanin, Abc_ObjFanin0(pFanin) );
1012 if ( Abc_ObjFanoutNum(pFanin) == 0 )
1013 Abc_NtkDeleteObj(pFanin);
1014 }
1015 }
1016 }
1017 if ( fVerbose )
1018 printf( "Removed %d single input nodes.\n", Counter );
1019 return Counter;
1020}
ABC_DLL int Abc_NtkToAig(Abc_Ntk_t *pNtk)
Definition abcFunc.c:1333
ABC_DLL void Abc_ObjPatchFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFaninOld, Abc_Obj_t *pFaninNew)
Definition abcFanio.c:172
Hop_Obj_t * Hop_Compose(Hop_Man_t *p, Hop_Obj_t *pRoot, Hop_Obj_t *pFunc, int iVar)
Definition hopDfs.c:415
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
Here is the call graph for this function: