ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
abc.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "misc/vec/vec.h"
#include "aig/hop/hop.h"
#include "aig/gia/gia.h"
#include "misc/st/st.h"
#include "misc/st/stmm.h"
#include "misc/nm/nm.h"
#include "misc/mem/mem.h"
#include "misc/util/utilCex.h"
#include "misc/extra/extra.h"
Include dependency graph for abc.h:

Go to the source code of this file.

Classes

struct  Abc_Time_t_
 
struct  Abc_Obj_t_
 
struct  Abc_Ntk_t_
 
struct  Abc_Des_t_
 

Macros

#define Abc_NtkForEachObj(pNtk, pObj, i)
 ITERATORS ///.
 
#define Abc_NtkForEachObjReverse(pNtk, pNode, i)
 
#define Abc_NtkForEachObjVec(vIds, pNtk, pObj, i)
 
#define Abc_NtkForEachObjVecStart(vIds, pNtk, pObj, i, Start)
 
#define Abc_NtkForEachNet(pNtk, pNet, i)
 
#define Abc_NtkForEachNode(pNtk, pNode, i)
 
#define Abc_NtkForEachNodeNotBarBuf(pNtk, pNode, i)
 
#define Abc_NtkForEachNode1(pNtk, pNode, i)
 
#define Abc_NtkForEachNodeNotBarBuf1(pNtk, pNode, i)
 
#define Abc_NtkForEachNodeReverse(pNtk, pNode, i)
 
#define Abc_NtkForEachNodeReverse1(pNtk, pNode, i)
 
#define Abc_NtkForEachBarBuf(pNtk, pNode, i)
 
#define Abc_NtkForEachGate(pNtk, pNode, i)
 
#define Abc_AigForEachAnd(pNtk, pNode, i)
 
#define Abc_NtkForEachNodeCi(pNtk, pNode, i)
 
#define Abc_NtkForEachNodeCo(pNtk, pNode, i)
 
#define Abc_NtkForEachBox(pNtk, pObj, i)
 
#define Abc_NtkForEachLatch(pNtk, pObj, i)
 
#define Abc_NtkForEachLatchInput(pNtk, pObj, i)
 
#define Abc_NtkForEachLatchOutput(pNtk, pObj, i)
 
#define Abc_NtkForEachWhitebox(pNtk, pObj, i)
 
#define Abc_NtkForEachBlackbox(pNtk, pObj, i)
 
#define Abc_NtkForEachPi(pNtk, pPi, i)
 
#define Abc_NtkForEachCi(pNtk, pCi, i)
 
#define Abc_NtkForEachPo(pNtk, pPo, i)
 
#define Abc_NtkForEachCo(pNtk, pCo, i)
 
#define Abc_NtkForEachLiPo(pNtk, pCo, i)
 
#define Abc_ObjForEachFanin(pObj, pFanin, i)
 
#define Abc_ObjForEachFanout(pObj, pFanout, i)
 
#define Abc_ObjForEachFaninId(pObj, iFanin, i)
 
#define Abc_ObjForEachFanoutId(pObj, iFanout, i)
 
#define Abc_CubeForEachVar(pCube, Value, i)
 
#define Abc_SopForEachCube(pSop, nFanins, pCube)
 
#define Abc_SopForEachCubePair(pSop, nFanins, pCube, pCube2)
 

Typedefs

typedef struct Abc_Des_t_ Abc_Des_t
 BASIC TYPES ///.
 
typedef struct Abc_Ntk_t_ Abc_Ntk_t
 
typedef struct Abc_Obj_t_ Abc_Obj_t
 
typedef struct Abc_Aig_t_ Abc_Aig_t
 
typedef struct Abc_ManTime_t_ Abc_ManTime_t
 
typedef struct Abc_ManCut_t_ Abc_ManCut_t
 
typedef struct Abc_Time_t_ Abc_Time_t
 
typedef struct Odc_Man_t_ Odc_Man_t
 

Enumerations

enum  Abc_NtkType_t {
  ABC_NTK_NONE = 0 , ABC_NTK_NETLIST , ABC_NTK_LOGIC , ABC_NTK_STRASH ,
  ABC_NTK_OTHER
}
 INCLUDES ///. More...
 
enum  Abc_NtkFunc_t {
  ABC_FUNC_NONE = 0 , ABC_FUNC_SOP , ABC_FUNC_BDD , ABC_FUNC_AIG ,
  ABC_FUNC_MAP , ABC_FUNC_BLIFMV , ABC_FUNC_BLACKBOX , ABC_FUNC_OTHER
}
 
enum  Abc_ObjType_t {
  ABC_OBJ_NONE = 0 , ABC_OBJ_CONST1 , ABC_OBJ_PI , ABC_OBJ_PO ,
  ABC_OBJ_BI , ABC_OBJ_BO , ABC_OBJ_NET , ABC_OBJ_NODE ,
  ABC_OBJ_LATCH , ABC_OBJ_WHITEBOX , ABC_OBJ_BLACKBOX , ABC_OBJ_NUMBER
}
 
enum  Abc_InitType_t {
  ABC_INIT_NONE = 0 , ABC_INIT_ZERO , ABC_INIT_ONE , ABC_INIT_DC ,
  ABC_INIT_OTHER
}
 

Functions

ABC_DLL Abc_Obj_tAbc_NtkCreateObj (Abc_Ntk_t *pNtk, Abc_ObjType_t Type)
 
ABC_DLL Abc_Aig_tAbc_AigAlloc (Abc_Ntk_t *pNtk)
 FUNCTION DECLARATIONS ///.
 
ABC_DLL void Abc_AigFree (Abc_Aig_t *pMan)
 
ABC_DLL int Abc_AigCleanup (Abc_Aig_t *pMan)
 
ABC_DLL int Abc_AigCheck (Abc_Aig_t *pMan)
 
ABC_DLL int Abc_AigLevel (Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Obj_tAbc_AigConst1 (Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Obj_tAbc_AigAnd (Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
 
ABC_DLL Abc_Obj_tAbc_AigAndLookup (Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
 
ABC_DLL Abc_Obj_tAbc_AigXorLookup (Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1, int *pType)
 
ABC_DLL Abc_Obj_tAbc_AigMuxLookup (Abc_Aig_t *pMan, Abc_Obj_t *pC, Abc_Obj_t *pT, Abc_Obj_t *pE, int *pType)
 
ABC_DLL Abc_Obj_tAbc_AigOr (Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
 
ABC_DLL Abc_Obj_tAbc_AigXor (Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
 
ABC_DLL Abc_Obj_tAbc_AigMux (Abc_Aig_t *pMan, Abc_Obj_t *pC, Abc_Obj_t *p1, Abc_Obj_t *p0)
 
ABC_DLL Abc_Obj_tAbc_AigMiter (Abc_Aig_t *pMan, Vec_Ptr_t *vPairs, int fImplic)
 
ABC_DLL int Abc_AigReplace (Abc_Aig_t *pMan, Abc_Obj_t *pOld, Abc_Obj_t *pNew, int fUpdateLevel)
 
ABC_DLL void Abc_AigDeleteNode (Abc_Aig_t *pMan, Abc_Obj_t *pOld)
 
ABC_DLL void Abc_AigRehash (Abc_Aig_t *pMan)
 
ABC_DLL int Abc_AigNodeHasComplFanoutEdge (Abc_Obj_t *pNode)
 
ABC_DLL int Abc_AigNodeHasComplFanoutEdgeTrav (Abc_Obj_t *pNode)
 
ABC_DLL void Abc_AigPrintNode (Abc_Obj_t *pNode)
 
ABC_DLL int Abc_AigNodeIsAcyclic (Abc_Obj_t *pNode, Abc_Obj_t *pRoot)
 
ABC_DLL void Abc_AigCheckFaninOrder (Abc_Aig_t *pMan)
 
ABC_DLL void Abc_AigSetNodePhases (Abc_Ntk_t *pNtk)
 
ABC_DLL Vec_Ptr_tAbc_AigUpdateStart (Abc_Aig_t *pMan, Vec_Ptr_t **pvUpdatedNets)
 
ABC_DLL void Abc_AigUpdateStop (Abc_Aig_t *pMan)
 
ABC_DLL void Abc_AigUpdateReset (Abc_Aig_t *pMan)
 
ABC_DLL int Abc_NtkAttach (Abc_Ntk_t *pNtk)
 FUNCTION DEFINITIONS ///.
 
ABC_DLL Abc_Ntk_tAbc_NtkToBarBufs (Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Ntk_tAbc_NtkFromBarBufs (Abc_Ntk_t *pNtkBase, Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Ntk_tAbc_NtkBarBufsToBuffers (Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Ntk_tAbc_NtkBarBufsFromBuffers (Abc_Ntk_t *pNtkBase, Abc_Ntk_t *pNtk)
 
ABC_DLL void Abc_NtkStartMvVars (Abc_Ntk_t *pNtk)
 DECLARATIONS ///.
 
ABC_DLL void Abc_NtkFreeMvVars (Abc_Ntk_t *pNtk)
 
ABC_DLL void Abc_NtkSetMvVarValues (Abc_Obj_t *pObj, int nValues)
 
ABC_DLL Abc_Ntk_tAbc_NtkStrashBlifMv (Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Ntk_tAbc_NtkInsertBlifMv (Abc_Ntk_t *pNtkBase, Abc_Ntk_t *pNtkLogic)
 
ABC_DLL int Abc_NtkConvertToBlifMv (Abc_Ntk_t *pNtk)
 
ABC_DLL char * Abc_NodeConvertSopToMvSop (int nVars, Vec_Int_t *vSop0, Vec_Int_t *vSop1)
 
ABC_DLL int Abc_NodeEvalMvCost (int nVars, Vec_Int_t *vSop0, Vec_Int_t *vSop1)
 
ABC_DLL Abc_Ntk_tAbc_NtkBalance (Abc_Ntk_t *pNtk, int fDuplicate, int fSelective, int fUpdateLevel)
 FUNCTION DEFINITIONS ///.
 
ABC_DLL int Abc_NtkCheck (Abc_Ntk_t *pNtk)
 FUNCTION DEFINITIONS ///.
 
ABC_DLL int Abc_NtkCheckRead (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkDoCheck (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkCheckObj (Abc_Ntk_t *pNtk, Abc_Obj_t *pObj)
 
ABC_DLL int Abc_NtkCompareSignals (Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int fOnlyPis, int fComb)
 
ABC_DLL int Abc_NtkIsAcyclicHierarchy (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkCheckUniqueCiNames (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkCheckUniqueCoNames (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkCheckUniqueCioNames (Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Ntk_tAbc_NtkCollapse (Abc_Ntk_t *pNtk, int fBddSizeMax, int fDualRail, int fReorder, int fReverse, int fDumpOrder, int fVerbose)
 DECLARATIONS ///.
 
ABC_DLL Abc_Ntk_tAbc_NtkCollapseSat (Abc_Ntk_t *pNtk, int nCubeLim, int nBTLimit, int nCostMax, int fCanon, int fReverse, int fCnfShared, int fVerbose)
 
ABC_DLL Gia_Man_tAbc_NtkClpGia (Abc_Ntk_t *pNtk)
 
ABC_DLL void * Abc_NodeGetCutsRecursive (void *p, Abc_Obj_t *pObj, int fDag, int fTree)
 
ABC_DLL void * Abc_NodeGetCuts (void *p, Abc_Obj_t *pObj, int fDag, int fTree)
 
ABC_DLL void Abc_NodeGetCutsSeq (void *p, Abc_Obj_t *pObj, int fFirst)
 
ABC_DLL void * Abc_NodeReadCuts (void *p, Abc_Obj_t *pObj)
 
ABC_DLL void Abc_NodeFreeCuts (void *p, Abc_Obj_t *pObj)
 
ABC_DLL int Abc_NtkPhaseFrameNum (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkDarPrintCone (Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Ntk_tAbc_NtkBalanceExor (Abc_Ntk_t *pNtk, int fUpdateLevel, int fVerbose)
 
ABC_DLL Abc_Ntk_tAbc_NtkDarLatchSweep (Abc_Ntk_t *pNtk, int fLatchConst, int fLatchEqual, int fSaveNames, int fUseMvSweep, int nFramesSymb, int nFramesSatur, int fVerbose, int fVeryVerbose)
 
ABC_DLL float Abc_NtkDelayTraceLut (Abc_Ntk_t *pNtk, int fUseLutLib)
 
ABC_DLL Vec_Ptr_tAbc_NtkDfs (Abc_Ntk_t *pNtk, int fCollectAll)
 
ABC_DLL Vec_Ptr_tAbc_NtkDfs2 (Abc_Ntk_t *pNtk)
 
ABC_DLL Vec_Ptr_tAbc_NtkDfsNodes (Abc_Ntk_t *pNtk, Abc_Obj_t **ppNodes, int nNodes)
 
ABC_DLL Vec_Ptr_tAbc_NtkDfsReverse (Abc_Ntk_t *pNtk)
 
ABC_DLL Vec_Ptr_tAbc_NtkDfsReverseNodes (Abc_Ntk_t *pNtk, Abc_Obj_t **ppNodes, int nNodes)
 
ABC_DLL Vec_Ptr_tAbc_NtkDfsReverseNodesContained (Abc_Ntk_t *pNtk, Abc_Obj_t **ppNodes, int nNodes)
 
ABC_DLL Vec_Ptr_tAbc_NtkDfsSeq (Abc_Ntk_t *pNtk)
 
ABC_DLL Vec_Ptr_tAbc_NtkDfsSeqReverse (Abc_Ntk_t *pNtk)
 
ABC_DLL Vec_Ptr_tAbc_NtkDfsIter (Abc_Ntk_t *pNtk, int fCollectAll)
 
ABC_DLL Vec_Ptr_tAbc_NtkDfsIterNodes (Abc_Ntk_t *pNtk, Vec_Ptr_t *vRoots)
 
ABC_DLL Vec_Ptr_tAbc_NtkDfsHie (Abc_Ntk_t *pNtk, int fCollectAll)
 
ABC_DLL int Abc_NtkIsDfsOrdered (Abc_Ntk_t *pNtk)
 
ABC_DLL Vec_Ptr_tAbc_NtkDfsWithBoxes (Abc_Ntk_t *pNtk)
 
ABC_DLL Vec_Ptr_tAbc_NtkSupport (Abc_Ntk_t *pNtk)
 
ABC_DLL Vec_Ptr_tAbc_NtkNodeSupport (Abc_Ntk_t *pNtk, Abc_Obj_t **ppNodes, int nNodes)
 
ABC_DLL Vec_Int_tAbc_NtkNodeSupportInt (Abc_Ntk_t *pNtk, int iCo)
 
ABC_DLL int Abc_NtkFunctionalIso (Abc_Ntk_t *pNtk, int iCo1, int iCo2, int fCommon)
 
ABC_DLL Vec_Ptr_tAbc_AigDfs (Abc_Ntk_t *pNtk, int fCollectAll, int fCollectCos)
 
ABC_DLL Vec_Ptr_tAbc_AigDfsMap (Abc_Ntk_t *pNtk)
 
ABC_DLL Vec_Vec_tAbc_DfsLevelized (Abc_Obj_t *pNode, int fTfi)
 
ABC_DLL Vec_Vec_tAbc_NtkLevelize (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkLevel (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkLevelR (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkLevelReverse (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkIsAcyclic (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkIsAcyclicWithBoxes (Abc_Ntk_t *pNtk)
 
ABC_DLL Vec_Ptr_tAbc_AigGetLevelizedOrder (Abc_Ntk_t *pNtk, int fCollectCis)
 
ABC_DLL int Abc_ExactInputNum ()
 
ABC_DLL int Abc_ExactIsRunning ()
 
ABC_DLL Abc_Obj_tAbc_ExactBuildNode (word *pTruth, int nVars, int *pArrTimeProfile, Abc_Obj_t **pFanins, Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Ntk_tAbc_NtkFindExact (word *pTruth, int nVars, int nFunc, int nMaxDepth, int *pArrivalTimes, int nBTLimit, int nStartGates, int fVerbose)
 
ABC_DLL void Abc_ObjAddFanin (Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
 
ABC_DLL void Abc_ObjDeleteFanin (Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
 
ABC_DLL void Abc_ObjRemoveFanins (Abc_Obj_t *pObj)
 
ABC_DLL void Abc_ObjPatchFanin (Abc_Obj_t *pObj, Abc_Obj_t *pFaninOld, Abc_Obj_t *pFaninNew)
 
ABC_DLL void Abc_ObjPatchFanoutFanin (Abc_Obj_t *pObj, int iObjNew)
 
ABC_DLL Abc_Obj_tAbc_ObjInsertBetween (Abc_Obj_t *pNodeIn, Abc_Obj_t *pNodeOut, Abc_ObjType_t Type)
 
ABC_DLL void Abc_ObjTransferFanout (Abc_Obj_t *pObjOld, Abc_Obj_t *pObjNew)
 
ABC_DLL void Abc_ObjReplace (Abc_Obj_t *pObjOld, Abc_Obj_t *pObjNew)
 
ABC_DLL void Abc_ObjReplaceByConstant (Abc_Obj_t *pNode, int fConst1)
 
ABC_DLL int Abc_ObjFanoutFaninNum (Abc_Obj_t *pFanout, Abc_Obj_t *pFanin)
 
ABC_DLL int Abc_NtkMakeLegit (Abc_Ntk_t *pNtk)
 
ABC_DLL void Abc_NtkSortSops (Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Ntk_tAbc_NtkFraig (Abc_Ntk_t *pNtk, void *pParams, int fAllNodes, int fExdc)
 FUNCTION DEFINITIONS ///.
 
ABC_DLL void * Abc_NtkToFraig (Abc_Ntk_t *pNtk, void *pParams, int fAllNodes, int fExdc)
 
ABC_DLL Abc_Ntk_tAbc_NtkFraigTrust (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkFraigStore (Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Ntk_tAbc_NtkFraigRestore (int nPatsRand, int nPatsDyna, int nBTLimit)
 
ABC_DLL void Abc_NtkFraigStoreClean ()
 
ABC_DLL int Abc_NtkSopToBdd (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkBddToSop (Abc_Ntk_t *pNtk, int fMode, int nCubeLimit, int fCubeSort)
 
ABC_DLL void Abc_NodeBddToCnf (Abc_Obj_t *pNode, Mem_Flex_t *pMmMan, Vec_Str_t *vCube, int fAllPrimes, char **ppSop0, char **ppSop1)
 
ABC_DLL void Abc_NtkLogicMakeDirectSops (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkSopToAig (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkAigToBdd (Abc_Ntk_t *pNtk)
 
ABC_DLL Gia_Man_tAbc_NtkAigToGia (Abc_Ntk_t *p, int fGiaSimple)
 
ABC_DLL int Abc_NtkMapToSopUsingLibrary (Abc_Ntk_t *pNtk, void *library)
 
ABC_DLL int Abc_NtkMapToSop (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkToSop (Abc_Ntk_t *pNtk, int fMode, int nCubeLimit)
 
ABC_DLL int Abc_NtkToBdd (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkToAig (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkHaigStart (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkHaigStop (Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Ntk_tAbc_NtkHaigUse (Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Ntk_tAbc_NtkFlattenLogicHierarchy (Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Ntk_tAbc_NtkConvertBlackboxes (Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Ntk_tAbc_NtkInsertNewLogic (Abc_Ntk_t *pNtkH, Abc_Ntk_t *pNtkL)
 
ABC_DLL void Abc_NtkPrintBoxInfo (Abc_Ntk_t *pNtk)
 
ABC_DLL Gia_Man_tAbc_NtkFlattenHierarchyGia (Abc_Ntk_t *pNtk, Vec_Ptr_t **pvBuffers, int fVerbose)
 
ABC_DLL void Abc_NtkInsertHierarchyGia (Abc_Ntk_t *pNtk, Abc_Ntk_t *pNew, int fVerbose)
 
ABC_DLL int Abc_NtkLatchIsSelfFeed (Abc_Obj_t *pLatch)
 
ABC_DLL int Abc_NtkCountSelfFeedLatches (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkRemoveSelfFeedLatches (Abc_Ntk_t *pNtk)
 
ABC_DLL Vec_Int_tAbc_NtkCollectLatchValues (Abc_Ntk_t *pNtk)
 
ABC_DLL char * Abc_NtkCollectLatchValuesStr (Abc_Ntk_t *pNtk)
 
ABC_DLL void Abc_NtkInsertLatchValues (Abc_Ntk_t *pNtk, Vec_Int_t *vValues)
 
ABC_DLL Abc_Obj_tAbc_NtkAddLatch (Abc_Ntk_t *pNtk, Abc_Obj_t *pDriver, Abc_InitType_t Init)
 
ABC_DLL void Abc_NtkConvertDcLatches (Abc_Ntk_t *pNtk)
 
ABC_DLL Vec_Ptr_tAbc_NtkConverLatchNamesIntoNumbers (Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Des_tAbc_DesCreate (char *pName)
 DECLARATIONS ///.
 
ABC_DLL void Abc_DesCleanManPointer (Abc_Des_t *p, void *pMan)
 
ABC_DLL void Abc_DesFree (Abc_Des_t *p, Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Des_tAbc_DesDup (Abc_Des_t *p)
 
ABC_DLL void Abc_DesPrint (Abc_Des_t *p)
 
ABC_DLL int Abc_DesAddModel (Abc_Des_t *p, Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Ntk_tAbc_DesFindModelByName (Abc_Des_t *p, char *pName)
 
ABC_DLL int Abc_DesFindTopLevelModels (Abc_Des_t *p)
 
ABC_DLL Abc_Ntk_tAbc_DesDeriveRoot (Abc_Des_t *p)
 
ABC_DLL void Abc_NtkWriteLogFile (char *pFileName, Abc_Cex_t *pSeqCex, int Status, int nFrames, char *pCommand)
 DECLARATIONS ///.
 
ABC_DLL Abc_Obj_tAbc_NtkFetchTwinNode (Abc_Obj_t *pNode)
 
ABC_DLL int Abc_NtkMinimumBase (Abc_Ntk_t *pNtk)
 DECLARATIONS ///.
 
ABC_DLL int Abc_NodeMinimumBase (Abc_Obj_t *pNode)
 
ABC_DLL int Abc_NtkRemoveDupFanins (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NodeRemoveDupFanins (Abc_Obj_t *pNode)
 
ABC_DLL Abc_Ntk_tAbc_NtkMiter (Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int fComb, int nPartSize, int fImplic, int fMulti)
 FUNCTION DEFINITIONS ///.
 
ABC_DLL void Abc_NtkMiterAddCone (Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtkMiter, Abc_Obj_t *pNode)
 
ABC_DLL Abc_Ntk_tAbc_NtkMiterAnd (Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int fOr, int fCompl2)
 
ABC_DLL Abc_Ntk_tAbc_NtkMiterCofactor (Abc_Ntk_t *pNtk, Vec_Int_t *vPiValues)
 
ABC_DLL Abc_Ntk_tAbc_NtkMiterForCofactors (Abc_Ntk_t *pNtk, int Out, int In1, int In2)
 
ABC_DLL Abc_Ntk_tAbc_NtkMiterQuantify (Abc_Ntk_t *pNtk, int In, int fExist)
 
ABC_DLL Abc_Ntk_tAbc_NtkMiterQuantifyPis (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkMiterIsConstant (Abc_Ntk_t *pMiter)
 
ABC_DLL void Abc_NtkMiterReport (Abc_Ntk_t *pMiter)
 
ABC_DLL Abc_Ntk_tAbc_NtkFrames (Abc_Ntk_t *pNtk, int nFrames, int fInitial, int fVerbose)
 
ABC_DLL int Abc_NtkCombinePos (Abc_Ntk_t *pNtk, int fAnd, int fXor)
 
ABC_DLL char * Abc_ObjName (Abc_Obj_t *pNode)
 DECLARATIONS ///.
 
ABC_DLL char * Abc_ObjAssignName (Abc_Obj_t *pObj, char *pName, char *pSuffix)
 
ABC_DLL char * Abc_ObjNamePrefix (Abc_Obj_t *pObj, char *pPrefix)
 
ABC_DLL char * Abc_ObjNameSuffix (Abc_Obj_t *pObj, char *pSuffix)
 
ABC_DLL char * Abc_ObjNameDummy (char *pPrefix, int Num, int nDigits)
 
ABC_DLL void Abc_NtkTrasferNames (Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtkNew)
 
ABC_DLL void Abc_NtkTrasferNamesNoLatches (Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtkNew)
 
ABC_DLL Vec_Ptr_tAbc_NodeGetFaninNames (Abc_Obj_t *pNode)
 
ABC_DLL Vec_Ptr_tAbc_NodeGetFakeNames (int nNames)
 
ABC_DLL void Abc_NodeFreeNames (Vec_Ptr_t *vNames)
 
ABC_DLL char ** Abc_NtkCollectCioNames (Abc_Ntk_t *pNtk, int fCollectCos)
 
ABC_DLL int Abc_NodeCompareNames (Abc_Obj_t **pp1, Abc_Obj_t **pp2)
 
ABC_DLL void Abc_NtkOrderObjsByName (Abc_Ntk_t *pNtk, int fComb)
 
ABC_DLL void Abc_NtkAddDummyPiNames (Abc_Ntk_t *pNtk)
 
ABC_DLL void Abc_NtkAddDummyPoNames (Abc_Ntk_t *pNtk)
 
ABC_DLL void Abc_NtkAddDummyBoxNames (Abc_Ntk_t *pNtk)
 
ABC_DLL void Abc_NtkShortNames (Abc_Ntk_t *pNtk)
 
ABC_DLL void Abc_NtkCharNames (Abc_Ntk_t *pNtk)
 
ABC_DLL void Abc_NtkCleanNames (Abc_Ntk_t *pNtk)
 
ABC_DLL void Abc_NtkStartNameIds (Abc_Ntk_t *p)
 
ABC_DLL void Abc_NtkTransferNameIds (Abc_Ntk_t *p, Abc_Ntk_t *pNew)
 
ABC_DLL void Abc_NtkUpdateNameIds (Abc_Ntk_t *p)
 
ABC_DLL Abc_Ntk_tAbc_NtkToLogic (Abc_Ntk_t *pNtk)
 FUNCTION DEFINITIONS ///.
 
ABC_DLL Abc_Ntk_tAbc_NtkToNetlist (Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Ntk_tAbc_NtkToNetlistBench (Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Ntk_tAbc_NtkDeriveFromBdd (void *dd, void *bFunc, char *pNamePo, Vec_Ptr_t *vNamesPi)
 
ABC_DLL Abc_Ntk_tAbc_NtkBddToMuxes (Abc_Ntk_t *pNtk, int fGlobal, int Limit, int fUseAdd)
 
ABC_DLL void * Abc_NtkBuildGlobalBdds (Abc_Ntk_t *pNtk, int fBddSizeMax, int fDropInternal, int fReorder, int fReverse, int fVerbose)
 
ABC_DLL void * Abc_NtkFreeGlobalBdds (Abc_Ntk_t *pNtk, int fFreeMan)
 
ABC_DLL int Abc_NtkSizeOfGlobalBdds (Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Ntk_tAbc_NtkAlloc (Abc_NtkType_t Type, Abc_NtkFunc_t Func, int fUseMemMan)
 DECLARATIONS ///.
 
ABC_DLL Abc_Ntk_tAbc_NtkStartFrom (Abc_Ntk_t *pNtk, Abc_NtkType_t Type, Abc_NtkFunc_t Func)
 
ABC_DLL Abc_Ntk_tAbc_NtkStartFromNoLatches (Abc_Ntk_t *pNtk, Abc_NtkType_t Type, Abc_NtkFunc_t Func)
 
ABC_DLL void Abc_NtkFinalize (Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtkNew)
 
ABC_DLL Abc_Ntk_tAbc_NtkStartRead (char *pName)
 
ABC_DLL void Abc_NtkFinalizeRead (Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Ntk_tAbc_NtkDup (Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Ntk_tAbc_NtkDupDfs (Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Ntk_tAbc_NtkDupDfsNoBarBufs (Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Ntk_tAbc_NtkDupTransformMiter (Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Ntk_tAbc_NtkCreateCone (Abc_Ntk_t *pNtk, Abc_Obj_t *pNode, char *pNodeName, int fUseAllCis)
 
ABC_DLL Abc_Ntk_tAbc_NtkCreateConeArray (Abc_Ntk_t *pNtk, Vec_Ptr_t *vRoots, int fUseAllCis)
 
ABC_DLL void Abc_NtkAppendToCone (Abc_Ntk_t *pNtkNew, Abc_Ntk_t *pNtk, Vec_Ptr_t *vRoots)
 
ABC_DLL Abc_Ntk_tAbc_NtkCreateMffc (Abc_Ntk_t *pNtk, Abc_Obj_t *pNode, char *pNodeName)
 
ABC_DLL Abc_Ntk_tAbc_NtkCreateTarget (Abc_Ntk_t *pNtk, Vec_Ptr_t *vRoots, Vec_Int_t *vValues)
 
ABC_DLL Abc_Ntk_tAbc_NtkCreateFromNode (Abc_Ntk_t *pNtk, Abc_Obj_t *pNode)
 
ABC_DLL Abc_Ntk_tAbc_NtkCreateFromRange (Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Ntk_tAbc_NtkCreateWithNode (char *pSop)
 
ABC_DLL Abc_Ntk_tAbc_NtkCreateWithNodes (Vec_Ptr_t *vSops)
 
ABC_DLL void Abc_NtkDelete (Abc_Ntk_t *pNtk)
 
ABC_DLL void Abc_NtkFixNonDrivenNets (Abc_Ntk_t *pNtk)
 
ABC_DLL void Abc_NtkMakeComb (Abc_Ntk_t *pNtk, int fRemoveLatches)
 
ABC_DLL void Abc_NtkPermute (Abc_Ntk_t *pNtk, int fInputs, int fOutputs, int fFlops, char *pInPermFile, char *pOutPermFile, char *pFlopPermFile)
 
ABC_DLL void Abc_NtkUnpermute (Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Ntk_tAbc_NtkCreateFromSops (char *pName, Vec_Ptr_t *vSops)
 
ABC_DLL Abc_Ntk_tAbc_NtkCreateFromGias (char *pName, Vec_Ptr_t *vGias, Gia_Man_t *pMulti)
 
ABC_DLL Abc_Obj_tAbc_ObjAlloc (Abc_Ntk_t *pNtk, Abc_ObjType_t Type)
 DECLARATIONS ///.
 
ABC_DLL void Abc_ObjRecycle (Abc_Obj_t *pObj)
 
ABC_DLL void Abc_NtkDeleteObj (Abc_Obj_t *pObj)
 
ABC_DLL void Abc_NtkDeleteObjPo (Abc_Obj_t *pObj)
 
ABC_DLL void Abc_NtkDeleteObj_rec (Abc_Obj_t *pObj, int fOnlyNodes)
 
ABC_DLL void Abc_NtkDeleteAll_rec (Abc_Obj_t *pObj)
 
ABC_DLL Abc_Obj_tAbc_NtkDupObj (Abc_Ntk_t *pNtkNew, Abc_Obj_t *pObj, int fCopyName)
 
ABC_DLL Abc_Obj_tAbc_NtkDupBox (Abc_Ntk_t *pNtkNew, Abc_Obj_t *pBox, int fCopyName)
 
ABC_DLL Abc_Obj_tAbc_NtkCloneObj (Abc_Obj_t *pNode)
 
ABC_DLL Abc_Obj_tAbc_NtkFindNode (Abc_Ntk_t *pNtk, char *pName)
 
ABC_DLL Abc_Obj_tAbc_NtkFindNet (Abc_Ntk_t *pNtk, char *pName)
 
ABC_DLL Abc_Obj_tAbc_NtkFindCi (Abc_Ntk_t *pNtk, char *pName)
 
ABC_DLL Abc_Obj_tAbc_NtkFindCo (Abc_Ntk_t *pNtk, char *pName)
 
ABC_DLL Abc_Obj_tAbc_NtkFindOrCreateNet (Abc_Ntk_t *pNtk, char *pName)
 
ABC_DLL Abc_Obj_tAbc_NtkCreateNodeConst0 (Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Obj_tAbc_NtkCreateNodeConst1 (Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Obj_tAbc_NtkCreateNodeInv (Abc_Ntk_t *pNtk, Abc_Obj_t *pFanin)
 
ABC_DLL Abc_Obj_tAbc_NtkCreateNodeBuf (Abc_Ntk_t *pNtk, Abc_Obj_t *pFanin)
 
ABC_DLL Abc_Obj_tAbc_NtkCreateNodeAnd (Abc_Ntk_t *pNtk, Vec_Ptr_t *vFanins)
 
ABC_DLL Abc_Obj_tAbc_NtkCreateNodeOr (Abc_Ntk_t *pNtk, Vec_Ptr_t *vFanins)
 
ABC_DLL Abc_Obj_tAbc_NtkCreateNodeExor (Abc_Ntk_t *pNtk, Vec_Ptr_t *vFanins)
 
ABC_DLL Abc_Obj_tAbc_NtkCreateNodeMux (Abc_Ntk_t *pNtk, Abc_Obj_t *pNodeC, Abc_Obj_t *pNode1, Abc_Obj_t *pNode0)
 
ABC_DLL int Abc_NodeIsConst (Abc_Obj_t *pNode)
 
ABC_DLL int Abc_NodeIsConst0 (Abc_Obj_t *pNode)
 
ABC_DLL int Abc_NodeIsConst1 (Abc_Obj_t *pNode)
 
ABC_DLL int Abc_NodeIsBuf (Abc_Obj_t *pNode)
 
ABC_DLL int Abc_NodeIsInv (Abc_Obj_t *pNode)
 
ABC_DLL void Abc_NodeComplement (Abc_Obj_t *pNode)
 
ABC_DLL void Abc_NodeComplementInput (Abc_Obj_t *pNode, Abc_Obj_t *pFanin)
 
ABC_DLL Odc_Man_tAbc_NtkDontCareAlloc (int nVarsMax, int nLevels, int fVerbose, int fVeryVerbose)
 FUNCTION DEFINITIONS ///.
 
ABC_DLL void Abc_NtkDontCareClear (Odc_Man_t *p)
 
ABC_DLL void Abc_NtkDontCareFree (Odc_Man_t *p)
 
ABC_DLL int Abc_NtkDontCareCompute (Odc_Man_t *p, Abc_Obj_t *pNode, Vec_Ptr_t *vLeaves, unsigned *puTruth)
 
ABC_DLL float Abc_NtkMfsTotalSwitching (Abc_Ntk_t *pNtk)
 
ABC_DLL float Abc_NtkMfsTotalGlitching (Abc_Ntk_t *pNtk, int nPats, int Prob, int fVerbose)
 
ABC_DLL void Abc_NtkPrintStats (Abc_Ntk_t *pNtk, int fFactored, int fSaveBest, int fDumpResult, int fUseLutLib, int fPrintMuxes, int fPower, int fGlitch, int fSkipBuf, int fSkipSmall, int fPrintMem)
 
ABC_DLL void Abc_NtkPrintIo (FILE *pFile, Abc_Ntk_t *pNtk, int fPrintFlops)
 
ABC_DLL void Abc_NtkPrintLatch (FILE *pFile, Abc_Ntk_t *pNtk)
 
ABC_DLL void Abc_NtkPrintFanio (FILE *pFile, Abc_Ntk_t *pNtk, int fUseFanio, int fUsePio, int fUseSupp, int fUseCone)
 
ABC_DLL void Abc_NtkPrintFanioNew (FILE *pFile, Abc_Ntk_t *pNtk, int fMffc)
 
ABC_DLL void Abc_NodePrintFanio (FILE *pFile, Abc_Obj_t *pNode)
 
ABC_DLL void Abc_NtkPrintFactor (FILE *pFile, Abc_Ntk_t *pNtk, int fUseRealNames)
 
ABC_DLL void Abc_NodePrintFactor (FILE *pFile, Abc_Obj_t *pNode, int fUseRealNames)
 
ABC_DLL void Abc_NtkPrintLevel (FILE *pFile, Abc_Ntk_t *pNtk, int fProfile, int fListNodes, int fOutputs, int fVerbose)
 
ABC_DLL void Abc_NodePrintLevel (FILE *pFile, Abc_Obj_t *pNode)
 
ABC_DLL void Abc_NtkPrintSkews (FILE *pFile, Abc_Ntk_t *pNtk, int fPrintAll)
 
ABC_DLL void Abc_ObjPrint (FILE *pFile, Abc_Obj_t *pObj)
 
ABC_DLL void Abc_NtkShow6VarFunc (char *pF0, char *pF1)
 
ABC_DLL int Abc_NtkMiterProve (Abc_Ntk_t **ppNtk, void *pParams)
 FUNCTION DEFINITIONS ///.
 
ABC_DLL int Abc_NtkIvyProve (Abc_Ntk_t **ppNtk, void *pPars)
 
ABC_DLL void Abc_NtkRecStart3 (Gia_Man_t *p, int nVars, int nCuts, int fFuncOnly, int fVerbose)
 
ABC_DLL void Abc_NtkRecStop3 ()
 
ABC_DLL void Abc_NtkRecAdd3 (Abc_Ntk_t *pNtk, int fUseSOPB)
 
ABC_DLL void Abc_NtkRecPs3 (int fPrintLib)
 
ABC_DLL Gia_Man_tAbc_NtkRecGetGia3 ()
 
ABC_DLL int Abc_NtkRecIsRunning3 ()
 
ABC_DLL void Abc_NtkRecLibMerge3 (Gia_Man_t *pGia)
 
ABC_DLL int Abc_NtkRecInputNum3 ()
 
ABC_DLL Abc_ManCut_tAbc_NtkManCutStart (int nNodeSizeMax, int nConeSizeMax, int nNodeFanStop, int nConeFanStop)
 
ABC_DLL void Abc_NtkManCutStop (Abc_ManCut_t *p)
 
ABC_DLL Vec_Ptr_tAbc_NtkManCutReadCutLarge (Abc_ManCut_t *p)
 
ABC_DLL Vec_Ptr_tAbc_NtkManCutReadCutSmall (Abc_ManCut_t *p)
 
ABC_DLL Vec_Ptr_tAbc_NtkManCutReadVisited (Abc_ManCut_t *p)
 
ABC_DLL Vec_Ptr_tAbc_NodeFindCut (Abc_ManCut_t *p, Abc_Obj_t *pRoot, int fContain)
 
ABC_DLL void Abc_NodeConeCollect (Abc_Obj_t **ppRoots, int nRoots, Vec_Ptr_t *vFanins, Vec_Ptr_t *vVisited, int fIncludeFanins)
 
ABC_DLL Vec_Ptr_tAbc_NodeCollectTfoCands (Abc_ManCut_t *p, Abc_Obj_t *pRoot, Vec_Ptr_t *vFanins, int LevelMax)
 
ABC_DLL int Abc_NodeMffcSize (Abc_Obj_t *pNode)
 FUNCTION DEFINITIONS ///.
 
ABC_DLL int Abc_NodeMffcSizeSupp (Abc_Obj_t *pNode)
 
ABC_DLL int Abc_NodeMffcSizeStop (Abc_Obj_t *pNode)
 
ABC_DLL int Abc_NodeMffcLabelAig (Abc_Obj_t *pNode)
 
ABC_DLL int Abc_NodeMffcLabel (Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
 
ABC_DLL void Abc_NodeMffcConeSupp (Abc_Obj_t *pNode, Vec_Ptr_t *vCone, Vec_Ptr_t *vSupp)
 
ABC_DLL int Abc_NodeDeref_rec (Abc_Obj_t *pNode)
 
ABC_DLL int Abc_NodeRef_rec (Abc_Obj_t *pNode)
 
ABC_DLL int Abc_NtkRefactor (Abc_Ntk_t *pNtk, int nNodeSizeMax, int nMinSaved, int nConeSizeMax, int fUpdateLevel, int fUseZeros, int fUseDcs, int fVerbose)
 
ABC_DLL int Abc_NtkRewrite (Abc_Ntk_t *pNtk, int fUpdateLevel, int fUseZeros, int fVerbose, int fVeryVerbose, int fPlaceEnable)
 FUNCTION DEFINITIONS ///.
 
ABC_DLL int Abc_NtkMiterSat (Abc_Ntk_t *pNtk, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, int fVerbose, ABC_INT64_T *pNumConfs, ABC_INT64_T *pNumInspects)
 FUNCTION DEFINITIONS ///.
 
ABC_DLL void * Abc_NtkMiterSatCreate (Abc_Ntk_t *pNtk, int fAllPrimes)
 
ABC_DLL char * Abc_SopRegister (Mem_Flex_t *pMan, const char *pName)
 DECLARATIONS ///.
 
ABC_DLL char * Abc_SopStart (Mem_Flex_t *pMan, int nCubes, int nVars)
 
ABC_DLL char * Abc_SopCreateConst0 (Mem_Flex_t *pMan)
 
ABC_DLL char * Abc_SopCreateConst1 (Mem_Flex_t *pMan)
 
ABC_DLL char * Abc_SopCreateAnd2 (Mem_Flex_t *pMan, int fCompl0, int fCompl1)
 
ABC_DLL char * Abc_SopCreateAnd (Mem_Flex_t *pMan, int nVars, int *pfCompl)
 
ABC_DLL char * Abc_SopCreateNand (Mem_Flex_t *pMan, int nVars)
 
ABC_DLL char * Abc_SopCreateOr (Mem_Flex_t *pMan, int nVars, int *pfCompl)
 
ABC_DLL char * Abc_SopCreateOrMultiCube (Mem_Flex_t *pMan, int nVars, int *pfCompl)
 
ABC_DLL char * Abc_SopCreateNor (Mem_Flex_t *pMan, int nVars)
 
ABC_DLL char * Abc_SopCreateXor (Mem_Flex_t *pMan, int nVars)
 
ABC_DLL char * Abc_SopCreateXorSpecial (Mem_Flex_t *pMan, int nVars)
 
ABC_DLL char * Abc_SopCreateNxor (Mem_Flex_t *pMan, int nVars)
 
ABC_DLL char * Abc_SopCreateMux (Mem_Flex_t *pMan)
 
ABC_DLL char * Abc_SopCreateInv (Mem_Flex_t *pMan)
 
ABC_DLL char * Abc_SopCreateBuf (Mem_Flex_t *pMan)
 
ABC_DLL char * Abc_SopCreateFromTruth (Mem_Flex_t *pMan, int nVars, unsigned *pTruth)
 
ABC_DLL char * Abc_SopCreateFromIsop (Mem_Flex_t *pMan, int nVars, Vec_Int_t *vCover)
 
ABC_DLL char * Abc_SopCreateFromTruthIsop (Mem_Flex_t *pMan, int nVars, word *pTruth, Vec_Int_t *vCover)
 
ABC_DLL int Abc_SopGetCubeNum (char *pSop)
 
ABC_DLL int Abc_SopGetLitNum (char *pSop)
 
ABC_DLL int Abc_SopGetVarNum (char *pSop)
 
ABC_DLL int Abc_SopGetPhase (char *pSop)
 
ABC_DLL int Abc_SopGetIthCareLit (char *pSop, int i)
 
ABC_DLL void Abc_SopComplement (char *pSop)
 
ABC_DLL void Abc_SopComplementVar (char *pSop, int iVar)
 
ABC_DLL int Abc_SopIsComplement (char *pSop)
 
ABC_DLL int Abc_SopIsConst0 (char *pSop)
 
ABC_DLL int Abc_SopIsConst1 (char *pSop)
 
ABC_DLL int Abc_SopIsBuf (char *pSop)
 
ABC_DLL int Abc_SopIsInv (char *pSop)
 
ABC_DLL int Abc_SopIsAndType (char *pSop)
 
ABC_DLL int Abc_SopIsOrType (char *pSop)
 
ABC_DLL int Abc_SopIsExorType (char *pSop)
 
ABC_DLL int Abc_SopCheck (char *pSop, int nFanins)
 
ABC_DLL char * Abc_SopFromTruthBin (char *pTruth)
 
ABC_DLL char * Abc_SopFromTruthHex (char *pTruth)
 
ABC_DLL Vec_Ptr_tAbc_SopFromTruthsBin (char *pTruth)
 
ABC_DLL Vec_Ptr_tAbc_SopFromTruthsHex (char *pTruth)
 
ABC_DLL char * Abc_SopEncoderPos (Mem_Flex_t *pMan, int iValue, int nValues)
 
ABC_DLL char * Abc_SopEncoderLog (Mem_Flex_t *pMan, int iBit, int nValues)
 
ABC_DLL char * Abc_SopDecoderPos (Mem_Flex_t *pMan, int nValues)
 
ABC_DLL char * Abc_SopDecoderLog (Mem_Flex_t *pMan, int nValues)
 
ABC_DLL word Abc_SopToTruth (char *pSop, int nInputs)
 
ABC_DLL void Abc_SopToTruth7 (char *pSop, int nInputs, word r[2])
 
ABC_DLL void Abc_SopToTruthBig (char *pSop, int nInputs, word **pVars, word *pCube, word *pRes)
 
ABC_DLL Abc_Ntk_tAbc_NtkRestrash (Abc_Ntk_t *pNtk, int fCleanup)
 FUNCTION DEFINITIONS ///.
 
ABC_DLL Abc_Ntk_tAbc_NtkRestrashZero (Abc_Ntk_t *pNtk, int fCleanup)
 
ABC_DLL Abc_Ntk_tAbc_NtkStrash (Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
 
ABC_DLL Abc_Obj_tAbc_NodeStrash (Abc_Ntk_t *pNtkNew, Abc_Obj_t *pNode, int fRecord)
 
ABC_DLL int Abc_NtkAppend (Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int fAddPos)
 
ABC_DLL Abc_Ntk_tAbc_NtkTopmost (Abc_Ntk_t *pNtk, int nLevels)
 
ABC_DLL int Abc_NtkSweep (Abc_Ntk_t *pNtk, int fVerbose)
 
ABC_DLL int Abc_NtkCleanup (Abc_Ntk_t *pNtk, int fVerbose)
 
ABC_DLL int Abc_NtkCleanupNodes (Abc_Ntk_t *pNtk, Vec_Ptr_t *vNodes, int fVerbose)
 
ABC_DLL int Abc_NtkCleanupSeq (Abc_Ntk_t *pNtk, int fLatchSweep, int fAutoSweep, int fVerbose)
 
ABC_DLL int Abc_NtkSweepBufsInvs (Abc_Ntk_t *pNtk, int fVerbose)
 
ABC_DLL Abc_Time_tAbc_NtkReadDefaultArrival (Abc_Ntk_t *pNtk)
 FUNCTION DEFINITIONS ///.
 
ABC_DLL Abc_Time_tAbc_NtkReadDefaultRequired (Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Time_tAbc_NodeReadArrival (Abc_Obj_t *pNode)
 
ABC_DLL Abc_Time_tAbc_NodeReadRequired (Abc_Obj_t *pNode)
 
ABC_DLL float Abc_NtkReadDefaultArrivalWorst (Abc_Ntk_t *pNtk)
 
ABC_DLL float Abc_NtkReadDefaultRequiredWorst (Abc_Ntk_t *pNtk)
 
ABC_DLL float Abc_NodeReadArrivalAve (Abc_Obj_t *pNode)
 
ABC_DLL float Abc_NodeReadRequiredAve (Abc_Obj_t *pNode)
 
ABC_DLL float Abc_NodeReadArrivalWorst (Abc_Obj_t *pNode)
 
ABC_DLL float Abc_NodeReadRequiredWorst (Abc_Obj_t *pNode)
 
ABC_DLL Abc_Time_tAbc_NtkReadDefaultInputDrive (Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Time_tAbc_NtkReadDefaultOutputLoad (Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Time_tAbc_NodeReadInputDrive (Abc_Ntk_t *pNtk, int iPi)
 
ABC_DLL Abc_Time_tAbc_NodeReadOutputLoad (Abc_Ntk_t *pNtk, int iPo)
 
ABC_DLL float Abc_NodeReadInputDriveWorst (Abc_Ntk_t *pNtk, int iPi)
 
ABC_DLL float Abc_NodeReadOutputLoadWorst (Abc_Ntk_t *pNtk, int iPo)
 
ABC_DLL void Abc_NtkTimeSetDefaultArrival (Abc_Ntk_t *pNtk, float Rise, float Fall)
 
ABC_DLL void Abc_NtkTimeSetDefaultRequired (Abc_Ntk_t *pNtk, float Rise, float Fall)
 
ABC_DLL void Abc_NtkTimeSetArrival (Abc_Ntk_t *pNtk, int ObjId, float Rise, float Fall)
 
ABC_DLL void Abc_NtkTimeSetRequired (Abc_Ntk_t *pNtk, int ObjId, float Rise, float Fall)
 
ABC_DLL void Abc_NtkTimeSetDefaultInputDrive (Abc_Ntk_t *pNtk, float Rise, float Fall)
 
ABC_DLL void Abc_NtkTimeSetDefaultOutputLoad (Abc_Ntk_t *pNtk, float Rise, float Fall)
 
ABC_DLL void Abc_NtkTimeSetInputDrive (Abc_Ntk_t *pNtk, int PiNum, float Rise, float Fall)
 
ABC_DLL void Abc_NtkTimeSetOutputLoad (Abc_Ntk_t *pNtk, int PoNum, float Rise, float Fall)
 
ABC_DLL void Abc_NtkTimeInitialize (Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtkOld)
 
ABC_DLL void Abc_ManTimeStop (Abc_ManTime_t *p)
 
ABC_DLL void Abc_ManTimeDup (Abc_Ntk_t *pNtkOld, Abc_Ntk_t *pNtkNew)
 
ABC_DLL void Abc_NtkSetNodeLevelsArrival (Abc_Ntk_t *pNtk)
 
ABC_DLL float * Abc_NtkGetCiArrivalFloats (Abc_Ntk_t *pNtk)
 
ABC_DLL float * Abc_NtkGetCoRequiredFloats (Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Time_tAbc_NtkGetCiArrivalTimes (Abc_Ntk_t *pNtk)
 
ABC_DLL Abc_Time_tAbc_NtkGetCoRequiredTimes (Abc_Ntk_t *pNtk)
 
ABC_DLL float Abc_NtkDelayTrace (Abc_Ntk_t *pNtk, Abc_Obj_t *pOut, Abc_Obj_t *pIn, int fPrint)
 
ABC_DLL int Abc_ObjLevelNew (Abc_Obj_t *pObj)
 
ABC_DLL int Abc_ObjReverseLevelNew (Abc_Obj_t *pObj)
 
ABC_DLL int Abc_ObjRequiredLevel (Abc_Obj_t *pObj)
 
ABC_DLL int Abc_ObjReverseLevel (Abc_Obj_t *pObj)
 
ABC_DLL void Abc_ObjSetReverseLevel (Abc_Obj_t *pObj, int LevelR)
 
ABC_DLL void Abc_NtkStartReverseLevels (Abc_Ntk_t *pNtk, int nMaxLevelIncrease)
 
ABC_DLL void Abc_NtkStopReverseLevels (Abc_Ntk_t *pNtk)
 
ABC_DLL void Abc_NtkUpdateLevel (Abc_Obj_t *pObjNew, Vec_Vec_t *vLevels)
 
ABC_DLL void Abc_NtkUpdateReverseLevel (Abc_Obj_t *pObjNew, Vec_Vec_t *vLevels)
 
ABC_DLL void Abc_NtkUpdate (Abc_Obj_t *pObj, Abc_Obj_t *pObjNew, Vec_Vec_t *vLevels)
 
ABC_DLL void * Abc_NtkAttrFree (Abc_Ntk_t *pNtk, int Attr, int fFreeMan)
 DECLARATIONS ///.
 
ABC_DLL void Abc_NtkOrderCisCos (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkGetCubeNum (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkGetCubePairNum (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkGetLitNum (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkGetLitFactNum (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkGetBddNodeNum (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkGetAigNodeNum (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkGetClauseNum (Abc_Ntk_t *pNtk)
 
ABC_DLL double Abc_NtkGetMappedArea (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkGetExorNum (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkGetMuxNum (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkGetBufNum (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkGetLargeNodeNum (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkGetChoiceNum (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkGetFaninMax (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkGetFanoutMax (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkGetTotalFanins (Abc_Ntk_t *pNtk)
 
ABC_DLL void Abc_NtkCleanCopy (Abc_Ntk_t *pNtk)
 
ABC_DLL void Abc_NtkCleanCopy_rec (Abc_Ntk_t *pNtk)
 
ABC_DLL void Abc_NtkCleanData (Abc_Ntk_t *pNtk)
 
ABC_DLL void Abc_NtkFillTemp (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkCountCopy (Abc_Ntk_t *pNtk)
 
ABC_DLL Vec_Ptr_tAbc_NtkSaveCopy (Abc_Ntk_t *pNtk)
 
ABC_DLL void Abc_NtkLoadCopy (Abc_Ntk_t *pNtk, Vec_Ptr_t *vCopies)
 
ABC_DLL void Abc_NtkCleanNext (Abc_Ntk_t *pNtk)
 
ABC_DLL void Abc_NtkCleanNext_rec (Abc_Ntk_t *pNtk)
 
ABC_DLL void Abc_NtkCleanMarkA (Abc_Ntk_t *pNtk)
 
ABC_DLL void Abc_NtkCleanMarkB (Abc_Ntk_t *pNtk)
 
ABC_DLL void Abc_NtkCleanMarkC (Abc_Ntk_t *pNtk)
 
ABC_DLL void Abc_NtkCleanMarkAB (Abc_Ntk_t *pNtk)
 
ABC_DLL void Abc_NtkCleanMarkABC (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NodeFindFanin (Abc_Obj_t *pNode, Abc_Obj_t *pFanin)
 
ABC_DLL Abc_Obj_tAbc_NodeFindCoFanout (Abc_Obj_t *pNode)
 
ABC_DLL Abc_Obj_tAbc_NodeFindNonCoFanout (Abc_Obj_t *pNode)
 
ABC_DLL Abc_Obj_tAbc_NodeHasUniqueCoFanout (Abc_Obj_t *pNode)
 
ABC_DLL int Abc_NtkLogicHasSimpleCos (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkLogicMakeSimpleCos (Abc_Ntk_t *pNtk, int fDuplicate)
 
ABC_DLL void Abc_VecObjPushUniqueOrderByLevel (Vec_Ptr_t *p, Abc_Obj_t *pNode)
 
ABC_DLL int Abc_NodeIsExorType (Abc_Obj_t *pNode)
 
ABC_DLL int Abc_NodeIsMuxType (Abc_Obj_t *pNode)
 
ABC_DLL int Abc_NodeIsMuxControlType (Abc_Obj_t *pNode)
 
ABC_DLL Abc_Obj_tAbc_NodeRecognizeMux (Abc_Obj_t *pNode, Abc_Obj_t **ppNodeT, Abc_Obj_t **ppNodeE)
 
ABC_DLL int Abc_NtkPrepareTwoNtks (FILE *pErr, Abc_Ntk_t *pNtk, char **argv, int argc, Abc_Ntk_t **ppNtk1, Abc_Ntk_t **ppNtk2, int *pfDelete1, int *pfDelete2, int fCheck)
 
ABC_DLL void Abc_NodeCollectFanins (Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
 
ABC_DLL void Abc_NodeCollectFanouts (Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
 
ABC_DLL Vec_Ptr_tAbc_NtkCollectLatches (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NodeCompareLevelsIncrease (Abc_Obj_t **pp1, Abc_Obj_t **pp2)
 
ABC_DLL int Abc_NodeCompareLevelsDecrease (Abc_Obj_t **pp1, Abc_Obj_t **pp2)
 
ABC_DLL Vec_Int_tAbc_NtkFanoutCounts (Abc_Ntk_t *pNtk)
 
ABC_DLL Vec_Ptr_tAbc_NtkCollectObjects (Abc_Ntk_t *pNtk)
 
ABC_DLL Vec_Int_tAbc_NtkGetCiIds (Abc_Ntk_t *pNtk)
 
ABC_DLL void Abc_NtkReassignIds (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_ObjPointerCompare (void **pp1, void **pp2)
 
ABC_DLL void Abc_NtkTransferCopy (Abc_Ntk_t *pNtk)
 
ABC_DLL void Abc_NtkInvertConstraints (Abc_Ntk_t *pNtk)
 
ABC_DLL void Abc_NtkPrintCiLevels (Abc_Ntk_t *pNtk)
 
ABC_DLL void Abc_NtkReverseTopoOrder (Abc_Ntk_t *pNtk)
 
ABC_DLL int Abc_NtkIsTopo (Abc_Ntk_t *pNtk)
 
ABC_DLL void Abc_NtkTransferPhases (Abc_Ntk_t *pNtkNew, Abc_Ntk_t *pNtk)
 
ABC_DLL Gia_Man_tAbc_SopSynthesizeOne (char *pSop, int fClp)
 
ABC_DLL int * Abc_NtkVerifyGetCleanModel (Abc_Ntk_t *pNtk, int nFrames)
 
ABC_DLL int * Abc_NtkVerifySimulatePattern (Abc_Ntk_t *pNtk, int *pModel)
 
ABC_DLL int Abc_NtkIsTrueCex (Abc_Ntk_t *pNtk, Abc_Cex_t *pCex)
 
ABC_DLL int Abc_NtkIsValidCex (Abc_Ntk_t *pNtk, Abc_Cex_t *pCex)
 

Macro Definition Documentation

◆ Abc_AigForEachAnd

#define Abc_AigForEachAnd ( pNtk,
pNode,
i )
Value:
for ( i = 0; (i < Vec_PtrSize((pNtk)->vObjs)) && (((pNode) = Abc_NtkObj(pNtk, i)), 1); i++ ) \
if ( (pNode) == NULL || !Abc_AigNodeIsAnd(pNode) ) {} else

Definition at line 488 of file abc.h.

488#define Abc_AigForEachAnd( pNtk, pNode, i ) \
489 for ( i = 0; (i < Vec_PtrSize((pNtk)->vObjs)) && (((pNode) = Abc_NtkObj(pNtk, i)), 1); i++ ) \
490 if ( (pNode) == NULL || !Abc_AigNodeIsAnd(pNode) ) {} else

◆ Abc_CubeForEachVar

#define Abc_CubeForEachVar ( pCube,
Value,
i )
Value:
for ( i = 0; (pCube[i] != ' ') && (Value = pCube[i]); i++ )

Definition at line 536 of file abc.h.

536#define Abc_CubeForEachVar( pCube, Value, i ) \
537 for ( i = 0; (pCube[i] != ' ') && (Value = pCube[i]); i++ )

◆ Abc_NtkForEachBarBuf

#define Abc_NtkForEachBarBuf ( pNtk,
pNode,
i )
Value:
for ( i = 0; (i < Vec_PtrSize((pNtk)->vObjs)) && (((pNode) = Abc_NtkObj(pNtk, i)), 1); i++ ) \
if ( (pNode) == NULL || !Abc_ObjIsBarBuf(pNode) ) {} else

Definition at line 482 of file abc.h.

482#define Abc_NtkForEachBarBuf( pNtk, pNode, i ) \
483 for ( i = 0; (i < Vec_PtrSize((pNtk)->vObjs)) && (((pNode) = Abc_NtkObj(pNtk, i)), 1); i++ ) \
484 if ( (pNode) == NULL || !Abc_ObjIsBarBuf(pNode) ) {} else

◆ Abc_NtkForEachBlackbox

#define Abc_NtkForEachBlackbox ( pNtk,
pObj,
i )
Value:
for ( i = 0; (i < Vec_PtrSize((pNtk)->vBoxes)) && (((pObj) = Abc_NtkBox(pNtk, i)), 1); i++ ) \
if ( !Abc_ObjIsBlackbox(pObj) ) {} else

Definition at line 512 of file abc.h.

512#define Abc_NtkForEachBlackbox( pNtk, pObj, i ) \
513 for ( i = 0; (i < Vec_PtrSize((pNtk)->vBoxes)) && (((pObj) = Abc_NtkBox(pNtk, i)), 1); i++ ) \
514 if ( !Abc_ObjIsBlackbox(pObj) ) {} else

◆ Abc_NtkForEachBox

#define Abc_NtkForEachBox ( pNtk,
pObj,
i )
Value:
for ( i = 0; (i < Vec_PtrSize((pNtk)->vBoxes)) && (((pObj) = Abc_NtkBox(pNtk, i)), 1); i++ )

Definition at line 498 of file abc.h.

498#define Abc_NtkForEachBox( pNtk, pObj, i ) \
499 for ( i = 0; (i < Vec_PtrSize((pNtk)->vBoxes)) && (((pObj) = Abc_NtkBox(pNtk, i)), 1); i++ )

◆ Abc_NtkForEachCi

#define Abc_NtkForEachCi ( pNtk,
pCi,
i )
Value:
for ( i = 0; (i < Abc_NtkCiNum(pNtk)) && (((pCi) = Abc_NtkCi(pNtk, i)), 1); i++ )

Definition at line 518 of file abc.h.

518#define Abc_NtkForEachCi( pNtk, pCi, i ) \
519 for ( i = 0; (i < Abc_NtkCiNum(pNtk)) && (((pCi) = Abc_NtkCi(pNtk, i)), 1); i++ )

◆ Abc_NtkForEachCo

#define Abc_NtkForEachCo ( pNtk,
pCo,
i )
Value:
for ( i = 0; (i < Abc_NtkCoNum(pNtk)) && (((pCo) = Abc_NtkCo(pNtk, i)), 1); i++ )

Definition at line 522 of file abc.h.

522#define Abc_NtkForEachCo( pNtk, pCo, i ) \
523 for ( i = 0; (i < Abc_NtkCoNum(pNtk)) && (((pCo) = Abc_NtkCo(pNtk, i)), 1); i++ )

◆ Abc_NtkForEachGate

#define Abc_NtkForEachGate ( pNtk,
pNode,
i )
Value:
for ( i = 0; (i < Vec_PtrSize((pNtk)->vObjs)) && (((pNode) = Abc_NtkObj(pNtk, i)), 1); i++ ) \
if ( (pNode) == NULL || !Abc_ObjIsGate(pNode) ) {} else

Definition at line 485 of file abc.h.

485#define Abc_NtkForEachGate( pNtk, pNode, i ) \
486 for ( i = 0; (i < Vec_PtrSize((pNtk)->vObjs)) && (((pNode) = Abc_NtkObj(pNtk, i)), 1); i++ ) \
487 if ( (pNode) == NULL || !Abc_ObjIsGate(pNode) ) {} else

◆ Abc_NtkForEachLatch

#define Abc_NtkForEachLatch ( pNtk,
pObj,
i )
Value:
for ( i = 0; (i < Vec_PtrSize((pNtk)->vBoxes)) && (((pObj) = Abc_NtkBox(pNtk, i)), 1); i++ ) \
if ( !Abc_ObjIsLatch(pObj) ) {} else

Definition at line 500 of file abc.h.

500#define Abc_NtkForEachLatch( pNtk, pObj, i ) \
501 for ( i = 0; (i < Vec_PtrSize((pNtk)->vBoxes)) && (((pObj) = Abc_NtkBox(pNtk, i)), 1); i++ ) \
502 if ( !Abc_ObjIsLatch(pObj) ) {} else

◆ Abc_NtkForEachLatchInput

#define Abc_NtkForEachLatchInput ( pNtk,
pObj,
i )
Value:
for ( i = 0; (i < Vec_PtrSize((pNtk)->vBoxes)); i++ ) \
if ( !(Abc_ObjIsLatch(Abc_NtkBox(pNtk, i)) && (((pObj) = Abc_ObjFanin0(Abc_NtkBox(pNtk, i))), 1)) ) {} else

Definition at line 503 of file abc.h.

503#define Abc_NtkForEachLatchInput( pNtk, pObj, i ) \
504 for ( i = 0; (i < Vec_PtrSize((pNtk)->vBoxes)); i++ ) \
505 if ( !(Abc_ObjIsLatch(Abc_NtkBox(pNtk, i)) && (((pObj) = Abc_ObjFanin0(Abc_NtkBox(pNtk, i))), 1)) ) {} else

◆ Abc_NtkForEachLatchOutput

#define Abc_NtkForEachLatchOutput ( pNtk,
pObj,
i )
Value:
for ( i = 0; (i < Vec_PtrSize((pNtk)->vBoxes)); i++ ) \
if ( !(Abc_ObjIsLatch(Abc_NtkBox(pNtk, i)) && (((pObj) = Abc_ObjFanout0(Abc_NtkBox(pNtk, i))), 1)) ) {} else

Definition at line 506 of file abc.h.

506#define Abc_NtkForEachLatchOutput( pNtk, pObj, i ) \
507 for ( i = 0; (i < Vec_PtrSize((pNtk)->vBoxes)); i++ ) \
508 if ( !(Abc_ObjIsLatch(Abc_NtkBox(pNtk, i)) && (((pObj) = Abc_ObjFanout0(Abc_NtkBox(pNtk, i))), 1)) ) {} else

◆ Abc_NtkForEachLiPo

#define Abc_NtkForEachLiPo ( pNtk,
pCo,
i )
Value:
for ( i = 0; (i < Abc_NtkCoNum(pNtk)) && (((pCo) = Abc_NtkCo(pNtk, i < pNtk->nBarBufs ? Abc_NtkCoNum(pNtk) - pNtk->nBarBufs + i : i - pNtk->nBarBufs)), 1); i++ )

Definition at line 524 of file abc.h.

524#define Abc_NtkForEachLiPo( pNtk, pCo, i ) \
525 for ( i = 0; (i < Abc_NtkCoNum(pNtk)) && (((pCo) = Abc_NtkCo(pNtk, i < pNtk->nBarBufs ? Abc_NtkCoNum(pNtk) - pNtk->nBarBufs + i : i - pNtk->nBarBufs)), 1); i++ )

◆ Abc_NtkForEachNet

#define Abc_NtkForEachNet ( pNtk,
pNet,
i )
Value:
for ( i = 0; (i < Vec_PtrSize((pNtk)->vObjs)) && (((pNet) = Abc_NtkObj(pNtk, i)), 1); i++ ) \
if ( (pNet) == NULL || !Abc_ObjIsNet(pNet) ) {} else

Definition at line 461 of file abc.h.

461#define Abc_NtkForEachNet( pNtk, pNet, i ) \
462 for ( i = 0; (i < Vec_PtrSize((pNtk)->vObjs)) && (((pNet) = Abc_NtkObj(pNtk, i)), 1); i++ ) \
463 if ( (pNet) == NULL || !Abc_ObjIsNet(pNet) ) {} else

◆ Abc_NtkForEachNode

#define Abc_NtkForEachNode ( pNtk,
pNode,
i )
Value:
for ( i = 0; (i < Vec_PtrSize((pNtk)->vObjs)) && (((pNode) = Abc_NtkObj(pNtk, i)), 1); i++ ) \
if ( (pNode) == NULL || !Abc_ObjIsNode(pNode) ) {} else

Definition at line 464 of file abc.h.

464#define Abc_NtkForEachNode( pNtk, pNode, i ) \
465 for ( i = 0; (i < Vec_PtrSize((pNtk)->vObjs)) && (((pNode) = Abc_NtkObj(pNtk, i)), 1); i++ ) \
466 if ( (pNode) == NULL || !Abc_ObjIsNode(pNode) ) {} else

◆ Abc_NtkForEachNode1

#define Abc_NtkForEachNode1 ( pNtk,
pNode,
i )
Value:
for ( i = 0; (i < Vec_PtrSize((pNtk)->vObjs)) && (((pNode) = Abc_NtkObj(pNtk, i)), 1); i++ ) \
if ( (pNode) == NULL || !Abc_ObjIsNode(pNode) || !Abc_ObjFaninNum(pNode) ) {} else

Definition at line 470 of file abc.h.

470#define Abc_NtkForEachNode1( pNtk, pNode, i ) \
471 for ( i = 0; (i < Vec_PtrSize((pNtk)->vObjs)) && (((pNode) = Abc_NtkObj(pNtk, i)), 1); i++ ) \
472 if ( (pNode) == NULL || !Abc_ObjIsNode(pNode) || !Abc_ObjFaninNum(pNode) ) {} else

◆ Abc_NtkForEachNodeCi

#define Abc_NtkForEachNodeCi ( pNtk,
pNode,
i )
Value:
for ( i = 0; (i < Vec_PtrSize((pNtk)->vObjs)) && (((pNode) = Abc_NtkObj(pNtk, i)), 1); i++ ) \
if ( (pNode) == NULL || (!Abc_ObjIsNode(pNode) && !Abc_ObjIsCi(pNode)) ) {} else

Definition at line 491 of file abc.h.

491#define Abc_NtkForEachNodeCi( pNtk, pNode, i ) \
492 for ( i = 0; (i < Vec_PtrSize((pNtk)->vObjs)) && (((pNode) = Abc_NtkObj(pNtk, i)), 1); i++ ) \
493 if ( (pNode) == NULL || (!Abc_ObjIsNode(pNode) && !Abc_ObjIsCi(pNode)) ) {} else

◆ Abc_NtkForEachNodeCo

#define Abc_NtkForEachNodeCo ( pNtk,
pNode,
i )
Value:
for ( i = 0; (i < Vec_PtrSize((pNtk)->vObjs)) && (((pNode) = Abc_NtkObj(pNtk, i)), 1); i++ ) \
if ( (pNode) == NULL || (!Abc_ObjIsNode(pNode) && !Abc_ObjIsCo(pNode)) ) {} else

Definition at line 494 of file abc.h.

494#define Abc_NtkForEachNodeCo( pNtk, pNode, i ) \
495 for ( i = 0; (i < Vec_PtrSize((pNtk)->vObjs)) && (((pNode) = Abc_NtkObj(pNtk, i)), 1); i++ ) \
496 if ( (pNode) == NULL || (!Abc_ObjIsNode(pNode) && !Abc_ObjIsCo(pNode)) ) {} else

◆ Abc_NtkForEachNodeNotBarBuf

#define Abc_NtkForEachNodeNotBarBuf ( pNtk,
pNode,
i )
Value:
for ( i = 0; (i < Vec_PtrSize((pNtk)->vObjs)) && (((pNode) = Abc_NtkObj(pNtk, i)), 1); i++ ) \
if ( (pNode) == NULL || !Abc_ObjIsNode(pNode) || Abc_ObjIsBarBuf(pNode) ) {} else

Definition at line 467 of file abc.h.

467#define Abc_NtkForEachNodeNotBarBuf( pNtk, pNode, i ) \
468 for ( i = 0; (i < Vec_PtrSize((pNtk)->vObjs)) && (((pNode) = Abc_NtkObj(pNtk, i)), 1); i++ ) \
469 if ( (pNode) == NULL || !Abc_ObjIsNode(pNode) || Abc_ObjIsBarBuf(pNode) ) {} else

◆ Abc_NtkForEachNodeNotBarBuf1

#define Abc_NtkForEachNodeNotBarBuf1 ( pNtk,
pNode,
i )
Value:
for ( i = 0; (i < Vec_PtrSize((pNtk)->vObjs)) && (((pNode) = Abc_NtkObj(pNtk, i)), 1); i++ ) \
if ( (pNode) == NULL || !Abc_ObjIsNode(pNode) || !Abc_ObjFaninNum(pNode) || Abc_ObjIsBarBuf(pNode) ) {} else

Definition at line 473 of file abc.h.

473#define Abc_NtkForEachNodeNotBarBuf1( pNtk, pNode, i ) \
474 for ( i = 0; (i < Vec_PtrSize((pNtk)->vObjs)) && (((pNode) = Abc_NtkObj(pNtk, i)), 1); i++ ) \
475 if ( (pNode) == NULL || !Abc_ObjIsNode(pNode) || !Abc_ObjFaninNum(pNode) || Abc_ObjIsBarBuf(pNode) ) {} else

◆ Abc_NtkForEachNodeReverse

#define Abc_NtkForEachNodeReverse ( pNtk,
pNode,
i )
Value:
for ( i = Vec_PtrSize((pNtk)->vObjs) - 1; (i >= 0) && (((pNode) = Abc_NtkObj(pNtk, i)), 1); i-- ) \
if ( (pNode) == NULL || !Abc_ObjIsNode(pNode) ) {} else

Definition at line 476 of file abc.h.

476#define Abc_NtkForEachNodeReverse( pNtk, pNode, i ) \
477 for ( i = Vec_PtrSize((pNtk)->vObjs) - 1; (i >= 0) && (((pNode) = Abc_NtkObj(pNtk, i)), 1); i-- ) \
478 if ( (pNode) == NULL || !Abc_ObjIsNode(pNode) ) {} else

◆ Abc_NtkForEachNodeReverse1

#define Abc_NtkForEachNodeReverse1 ( pNtk,
pNode,
i )
Value:
for ( i = Vec_PtrSize((pNtk)->vObjs) - 1; (i >= 0) && (((pNode) = Abc_NtkObj(pNtk, i)), 1); i-- ) \
if ( (pNode) == NULL || !Abc_ObjIsNode(pNode) || !Abc_ObjFaninNum(pNode) ) {} else

Definition at line 479 of file abc.h.

479#define Abc_NtkForEachNodeReverse1( pNtk, pNode, i ) \
480 for ( i = Vec_PtrSize((pNtk)->vObjs) - 1; (i >= 0) && (((pNode) = Abc_NtkObj(pNtk, i)), 1); i-- ) \
481 if ( (pNode) == NULL || !Abc_ObjIsNode(pNode) || !Abc_ObjFaninNum(pNode) ) {} else

◆ Abc_NtkForEachObj

#define Abc_NtkForEachObj ( pNtk,
pObj,
i )
Value:
for ( i = 0; (i < Vec_PtrSize((pNtk)->vObjs)) && (((pObj) = Abc_NtkObj(pNtk, i)), 1); i++ ) \
if ( (pObj) == NULL ) {} else

ITERATORS ///.

Definition at line 449 of file abc.h.

449#define Abc_NtkForEachObj( pNtk, pObj, i ) \
450 for ( i = 0; (i < Vec_PtrSize((pNtk)->vObjs)) && (((pObj) = Abc_NtkObj(pNtk, i)), 1); i++ ) \
451 if ( (pObj) == NULL ) {} else

◆ Abc_NtkForEachObjReverse

#define Abc_NtkForEachObjReverse ( pNtk,
pNode,
i )
Value:
for ( i = Vec_PtrSize((pNtk)->vObjs) - 1; (i >= 0) && (((pNode) = Abc_NtkObj(pNtk, i)), 1); i-- ) \
if ( (pNode) == NULL ) {} else

Definition at line 452 of file abc.h.

452#define Abc_NtkForEachObjReverse( pNtk, pNode, i ) \
453 for ( i = Vec_PtrSize((pNtk)->vObjs) - 1; (i >= 0) && (((pNode) = Abc_NtkObj(pNtk, i)), 1); i-- ) \
454 if ( (pNode) == NULL ) {} else

◆ Abc_NtkForEachObjVec

#define Abc_NtkForEachObjVec ( vIds,
pNtk,
pObj,
i )
Value:
for ( i = 0; i < Vec_IntSize(vIds) && (((pObj) = Abc_NtkObj(pNtk, Vec_IntEntry(vIds,i))), 1); i++ ) \
if ( (pObj) == NULL ) {} else

Definition at line 455 of file abc.h.

455#define Abc_NtkForEachObjVec( vIds, pNtk, pObj, i ) \
456 for ( i = 0; i < Vec_IntSize(vIds) && (((pObj) = Abc_NtkObj(pNtk, Vec_IntEntry(vIds,i))), 1); i++ ) \
457 if ( (pObj) == NULL ) {} else

◆ Abc_NtkForEachObjVecStart

#define Abc_NtkForEachObjVecStart ( vIds,
pNtk,
pObj,
i,
Start )
Value:
for ( i = Start; i < Vec_IntSize(vIds) && (((pObj) = Abc_NtkObj(pNtk, Vec_IntEntry(vIds,i))), 1); i++ ) \
if ( (pObj) == NULL ) {} else

Definition at line 458 of file abc.h.

458#define Abc_NtkForEachObjVecStart( vIds, pNtk, pObj, i, Start ) \
459 for ( i = Start; i < Vec_IntSize(vIds) && (((pObj) = Abc_NtkObj(pNtk, Vec_IntEntry(vIds,i))), 1); i++ ) \
460 if ( (pObj) == NULL ) {} else

◆ Abc_NtkForEachPi

#define Abc_NtkForEachPi ( pNtk,
pPi,
i )
Value:
for ( i = 0; (i < Abc_NtkPiNum(pNtk)) && (((pPi) = Abc_NtkPi(pNtk, i)), 1); i++ )

Definition at line 516 of file abc.h.

516#define Abc_NtkForEachPi( pNtk, pPi, i ) \
517 for ( i = 0; (i < Abc_NtkPiNum(pNtk)) && (((pPi) = Abc_NtkPi(pNtk, i)), 1); i++ )

◆ Abc_NtkForEachPo

#define Abc_NtkForEachPo ( pNtk,
pPo,
i )
Value:
for ( i = 0; (i < Abc_NtkPoNum(pNtk)) && (((pPo) = Abc_NtkPo(pNtk, i)), 1); i++ )

Definition at line 520 of file abc.h.

520#define Abc_NtkForEachPo( pNtk, pPo, i ) \
521 for ( i = 0; (i < Abc_NtkPoNum(pNtk)) && (((pPo) = Abc_NtkPo(pNtk, i)), 1); i++ )

◆ Abc_NtkForEachWhitebox

#define Abc_NtkForEachWhitebox ( pNtk,
pObj,
i )
Value:
for ( i = 0; (i < Vec_PtrSize((pNtk)->vBoxes)) && (((pObj) = Abc_NtkBox(pNtk, i)), 1); i++ ) \
if ( !Abc_ObjIsWhitebox(pObj) ) {} else

Definition at line 509 of file abc.h.

509#define Abc_NtkForEachWhitebox( pNtk, pObj, i ) \
510 for ( i = 0; (i < Vec_PtrSize((pNtk)->vBoxes)) && (((pObj) = Abc_NtkBox(pNtk, i)), 1); i++ ) \
511 if ( !Abc_ObjIsWhitebox(pObj) ) {} else

◆ Abc_ObjForEachFanin

#define Abc_ObjForEachFanin ( pObj,
pFanin,
i )
Value:
for ( i = 0; (i < Abc_ObjFaninNum(pObj)) && (((pFanin) = Abc_ObjFanin(pObj, i)), 1); i++ )

Definition at line 527 of file abc.h.

527#define Abc_ObjForEachFanin( pObj, pFanin, i ) \
528 for ( i = 0; (i < Abc_ObjFaninNum(pObj)) && (((pFanin) = Abc_ObjFanin(pObj, i)), 1); i++ )

◆ Abc_ObjForEachFaninId

#define Abc_ObjForEachFaninId ( pObj,
iFanin,
i )
Value:
for ( i = 0; (i < Abc_ObjFaninNum(pObj)) && (((iFanin) = Abc_ObjFaninId(pObj, i)), 1); i++ )

Definition at line 531 of file abc.h.

531#define Abc_ObjForEachFaninId( pObj, iFanin, i ) \
532 for ( i = 0; (i < Abc_ObjFaninNum(pObj)) && (((iFanin) = Abc_ObjFaninId(pObj, i)), 1); i++ )

◆ Abc_ObjForEachFanout

#define Abc_ObjForEachFanout ( pObj,
pFanout,
i )
Value:
for ( i = 0; (i < Abc_ObjFanoutNum(pObj)) && (((pFanout) = Abc_ObjFanout(pObj, i)), 1); i++ )

Definition at line 529 of file abc.h.

529#define Abc_ObjForEachFanout( pObj, pFanout, i ) \
530 for ( i = 0; (i < Abc_ObjFanoutNum(pObj)) && (((pFanout) = Abc_ObjFanout(pObj, i)), 1); i++ )

◆ Abc_ObjForEachFanoutId

#define Abc_ObjForEachFanoutId ( pObj,
iFanout,
i )
Value:
for ( i = 0; (i < Abc_ObjFanoutNum(pObj)) && (((iFanout) = Abc_ObjFanoutId(pObj, i)), 1); i++ )

Definition at line 533 of file abc.h.

533#define Abc_ObjForEachFanoutId( pObj, iFanout, i ) \
534 for ( i = 0; (i < Abc_ObjFanoutNum(pObj)) && (((iFanout) = Abc_ObjFanoutId(pObj, i)), 1); i++ )

◆ Abc_SopForEachCube

#define Abc_SopForEachCube ( pSop,
nFanins,
pCube )
Value:
for ( pCube = (pSop); *pCube; pCube += (nFanins) + 3 )

Definition at line 538 of file abc.h.

538#define Abc_SopForEachCube( pSop, nFanins, pCube ) \
539 for ( pCube = (pSop); *pCube; pCube += (nFanins) + 3 )

◆ Abc_SopForEachCubePair

#define Abc_SopForEachCubePair ( pSop,
nFanins,
pCube,
pCube2 )
Value:
Abc_SopForEachCube( pSop, nFanins, pCube ) \
Abc_SopForEachCube( pCube + (nFanins) + 3, nFanins, pCube2 )
#define Abc_SopForEachCube(pSop, nFanins, pCube)
Definition abc.h:538

Definition at line 540 of file abc.h.

540#define Abc_SopForEachCubePair( pSop, nFanins, pCube, pCube2 ) \
541 Abc_SopForEachCube( pSop, nFanins, pCube ) \
542 Abc_SopForEachCube( pCube + (nFanins) + 3, nFanins, pCube2 )

Typedef Documentation

◆ Abc_Aig_t

typedef struct Abc_Aig_t_ Abc_Aig_t

Definition at line 117 of file abc.h.

◆ Abc_Des_t

typedef struct Abc_Des_t_ Abc_Des_t

BASIC TYPES ///.

Definition at line 114 of file abc.h.

◆ Abc_ManCut_t

typedef struct Abc_ManCut_t_ Abc_ManCut_t

Definition at line 119 of file abc.h.

◆ Abc_ManTime_t

typedef struct Abc_ManTime_t_ Abc_ManTime_t

Definition at line 118 of file abc.h.

◆ Abc_Ntk_t

typedef struct Abc_Ntk_t_ Abc_Ntk_t

Definition at line 115 of file abc.h.

◆ Abc_Obj_t

typedef struct Abc_Obj_t_ Abc_Obj_t

Definition at line 116 of file abc.h.

◆ Abc_Time_t

typedef struct Abc_Time_t_ Abc_Time_t

Definition at line 120 of file abc.h.

◆ Odc_Man_t

typedef struct Odc_Man_t_ Odc_Man_t

Definition at line 832 of file abc.h.

Enumeration Type Documentation

◆ Abc_InitType_t

Enumerator
ABC_INIT_NONE 
ABC_INIT_ZERO 
ABC_INIT_ONE 
ABC_INIT_DC 
ABC_INIT_OTHER 

Definition at line 102 of file abc.h.

102 {
103 ABC_INIT_NONE = 0, // 0: unknown
104 ABC_INIT_ZERO, // 1: zero
105 ABC_INIT_ONE, // 2: one
106 ABC_INIT_DC, // 3: don't-care
107 ABC_INIT_OTHER // 4: unused
Abc_InitType_t
Definition abc.h:102
@ ABC_INIT_OTHER
Definition abc.h:107
@ ABC_INIT_ZERO
Definition abc.h:104
@ ABC_INIT_ONE
Definition abc.h:105
@ ABC_INIT_DC
Definition abc.h:106
@ ABC_INIT_NONE
Definition abc.h:103

◆ Abc_NtkFunc_t

Enumerator
ABC_FUNC_NONE 
ABC_FUNC_SOP 
ABC_FUNC_BDD 
ABC_FUNC_AIG 
ABC_FUNC_MAP 
ABC_FUNC_BLIFMV 
ABC_FUNC_BLACKBOX 
ABC_FUNC_OTHER 

Definition at line 63 of file abc.h.

63 {
64 ABC_FUNC_NONE = 0, // 0: unknown
65 ABC_FUNC_SOP, // 1: sum-of-products
66 ABC_FUNC_BDD, // 2: binary decision diagrams
67 ABC_FUNC_AIG, // 3: and-inverter graphs
68 ABC_FUNC_MAP, // 4: standard cell library
69 ABC_FUNC_BLIFMV, // 5: BLIF-MV node functions
70 ABC_FUNC_BLACKBOX, // 6: black box about which nothing is known
71 ABC_FUNC_OTHER // 7: unused
Abc_NtkFunc_t
Definition abc.h:63
@ ABC_FUNC_OTHER
Definition abc.h:71
@ ABC_FUNC_NONE
Definition abc.h:64
@ ABC_FUNC_BLIFMV
Definition abc.h:69
@ ABC_FUNC_BLACKBOX
Definition abc.h:70
@ ABC_FUNC_SOP
Definition abc.h:65
@ ABC_FUNC_BDD
Definition abc.h:66
@ ABC_FUNC_AIG
Definition abc.h:67
@ ABC_FUNC_MAP
Definition abc.h:68

◆ Abc_NtkType_t

INCLUDES ///.

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

FileName [abc.h]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Network and node package.]

Synopsis [External declarations.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

Id
abc.h,v 1.1 2008/05/14 22:13:11 wudenni Exp

] PARAMETERS ///

Enumerator
ABC_NTK_NONE 
ABC_NTK_NETLIST 
ABC_NTK_LOGIC 
ABC_NTK_STRASH 
ABC_NTK_OTHER 

Definition at line 54 of file abc.h.

54 {
55 ABC_NTK_NONE = 0, // 0: unknown
56 ABC_NTK_NETLIST, // 1: network with PIs/POs, latches, nodes, and nets
57 ABC_NTK_LOGIC, // 2: network with PIs/POs, latches, and nodes
58 ABC_NTK_STRASH, // 3: structurally hashed AIG (two input AND gates with c-attributes on edges)
59 ABC_NTK_OTHER // 4: unused
Abc_NtkType_t
INCLUDES ///.
Definition abc.h:54
@ ABC_NTK_NONE
Definition abc.h:55
@ ABC_NTK_LOGIC
Definition abc.h:57
@ ABC_NTK_STRASH
Definition abc.h:58
@ ABC_NTK_NETLIST
Definition abc.h:56
@ ABC_NTK_OTHER
Definition abc.h:59

◆ Abc_ObjType_t

Enumerator
ABC_OBJ_NONE 
ABC_OBJ_CONST1 
ABC_OBJ_PI 
ABC_OBJ_PO 
ABC_OBJ_BI 
ABC_OBJ_BO 
ABC_OBJ_NET 
ABC_OBJ_NODE 
ABC_OBJ_LATCH 
ABC_OBJ_WHITEBOX 
ABC_OBJ_BLACKBOX 
ABC_OBJ_NUMBER 

Definition at line 86 of file abc.h.

86 {
87 ABC_OBJ_NONE = 0, // 0: unknown
88 ABC_OBJ_CONST1, // 1: constant 1 node (AIG only)
89 ABC_OBJ_PI, // 2: primary input terminal
90 ABC_OBJ_PO, // 3: primary output terminal
91 ABC_OBJ_BI, // 4: box input terminal
92 ABC_OBJ_BO, // 5: box output terminal
93 ABC_OBJ_NET, // 6: net
94 ABC_OBJ_NODE, // 7: node
95 ABC_OBJ_LATCH, // 8: latch
96 ABC_OBJ_WHITEBOX, // 9: box with known contents
97 ABC_OBJ_BLACKBOX, // 10: box with unknown contents
98 ABC_OBJ_NUMBER // 11: unused
Abc_ObjType_t
Definition abc.h:86
@ ABC_OBJ_NET
Definition abc.h:93
@ ABC_OBJ_NONE
Definition abc.h:87
@ ABC_OBJ_NODE
Definition abc.h:94
@ ABC_OBJ_BLACKBOX
Definition abc.h:97
@ ABC_OBJ_BI
Definition abc.h:91
@ ABC_OBJ_NUMBER
Definition abc.h:98
@ ABC_OBJ_BO
Definition abc.h:92
@ ABC_OBJ_WHITEBOX
Definition abc.h:96
@ ABC_OBJ_PI
Definition abc.h:89
@ ABC_OBJ_LATCH
Definition abc.h:95
@ ABC_OBJ_PO
Definition abc.h:90
@ ABC_OBJ_CONST1
Definition abc.h:88

Function Documentation

◆ Abc_AigAlloc()

ABC_DLL Abc_Aig_t * Abc_AigAlloc ( Abc_Ntk_t * pNtkAig)
extern

FUNCTION DECLARATIONS ///.

FUNCTION DECLARATIONS ///.

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

Synopsis [Allocates the local AIG manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 128 of file abcAig.c.

129{
130 Abc_Aig_t * pMan;
131 // start the manager
132 pMan = ABC_ALLOC( Abc_Aig_t, 1 );
133 memset( pMan, 0, sizeof(Abc_Aig_t) );
134 // allocate the table
135 pMan->nBins = Abc_PrimeCudd( 10000 );
136 pMan->pBins = ABC_ALLOC( Abc_Obj_t *, pMan->nBins );
137 memset( pMan->pBins, 0, sizeof(Abc_Obj_t *) * pMan->nBins );
138 pMan->vNodes = Vec_PtrAlloc( 100 );
139 pMan->vLevels = Vec_VecAlloc( 100 );
140 pMan->vLevelsR = Vec_VecAlloc( 100 );
141 pMan->vStackReplaceOld = Vec_PtrAlloc( 100 );
142 pMan->vStackReplaceNew = Vec_PtrAlloc( 100 );
143 // create the constant node
144 assert( pNtkAig->vObjs->nSize == 0 );
145 pMan->pConst1 = Abc_NtkCreateObj( pNtkAig, ABC_OBJ_NODE );
146 pMan->pConst1->Type = ABC_OBJ_CONST1;
147 pMan->pConst1->fPhase = 1;
148 pNtkAig->nObjCounts[ABC_OBJ_NODE]--;
149 // save the current network
150 pMan->pNtkAig = pNtkAig;
151 return pMan;
152}
struct Abc_Obj_t_ Abc_Obj_t
Definition abc.h:116
struct Abc_Aig_t_ Abc_Aig_t
Definition abc.h:117
ABC_DLL Abc_Obj_t * Abc_NtkCreateObj(Abc_Ntk_t *pNtk, Abc_ObjType_t Type)
Definition abcObj.c:109
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
Vec_Vec_t * vLevels
Definition abcAig.c:62
Abc_Ntk_t * pNtkAig
Definition abcAig.c:54
Vec_Ptr_t * vStackReplaceOld
Definition abcAig.c:60
int nBins
Definition abcAig.c:57
Vec_Vec_t * vLevelsR
Definition abcAig.c:63
Vec_Ptr_t * vNodes
Definition abcAig.c:59
Abc_Obj_t ** pBins
Definition abcAig.c:56
Abc_Obj_t * pConst1
Definition abcAig.c:55
Vec_Ptr_t * vStackReplaceNew
Definition abcAig.c:61
int nObjCounts[ABC_OBJ_NUMBER]
Definition abc.h:171
Vec_Ptr_t * vObjs
Definition abc.h:162
unsigned Type
Definition abc.h:133
unsigned fPhase
Definition abc.h:137
#define assert(ex)
Definition util_old.h:213
char * memset()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_AigAnd()

ABC_DLL Abc_Obj_t * Abc_AigAnd ( Abc_Aig_t * pMan,
Abc_Obj_t * p0,
Abc_Obj_t * p1 )
extern

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

Synopsis [Performs canonicization step.]

Description [The argument nodes can be complemented.]

SideEffects []

SeeAlso []

Definition at line 700 of file abcAig.c.

701{
702 Abc_Obj_t * pAnd;
703 if ( (pAnd = Abc_AigAndLookup( pMan, p0, p1 )) )
704 return pAnd;
705 return Abc_AigAndCreate( pMan, p0, p1 );
706}
Abc_Obj_t * Abc_AigAndLookup(Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
Definition abcAig.c:403
Here is the call graph for this function:

◆ Abc_AigAndLookup()

ABC_DLL Abc_Obj_t * Abc_AigAndLookup ( Abc_Aig_t * pMan,
Abc_Obj_t * p0,
Abc_Obj_t * p1 )
extern

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

Synopsis [Performs canonicization step.]

Description [The argument nodes can be complemented.]

SideEffects []

SeeAlso []

Definition at line 403 of file abcAig.c.

404{
405 Abc_Obj_t * pAnd, * pConst1;
406 unsigned Key;
407 assert( Abc_ObjRegular(p0)->pNtk->pManFunc == pMan );
408 assert( Abc_ObjRegular(p1)->pNtk->pManFunc == pMan );
409 // check for trivial cases
410 pConst1 = Abc_AigConst1(pMan->pNtkAig);
411 if ( p0 == p1 )
412 return p0;
413 if ( p0 == Abc_ObjNot(p1) )
414 return Abc_ObjNot(pConst1);
415 if ( Abc_ObjRegular(p0) == pConst1 )
416 {
417 if ( p0 == pConst1 )
418 return p1;
419 return Abc_ObjNot(pConst1);
420 }
421 if ( Abc_ObjRegular(p1) == pConst1 )
422 {
423 if ( p1 == pConst1 )
424 return p0;
425 return Abc_ObjNot(pConst1);
426 }
427/*
428 {
429 int nFans0 = Abc_ObjFanoutNum( Abc_ObjRegular(p0) );
430 int nFans1 = Abc_ObjFanoutNum( Abc_ObjRegular(p1) );
431 if ( nFans0 == 0 || nFans1 == 0 )
432 pMan->nStrash0++;
433 else if ( nFans0 == 1 || nFans1 == 1 )
434 pMan->nStrash1++;
435 else if ( nFans0 <= 100 && nFans1 <= 100 )
436 pMan->nStrash5++;
437 else
438 pMan->nStrash2++;
439 }
440*/
441 {
442 int nFans0 = Abc_ObjFanoutNum( Abc_ObjRegular(p0) );
443 int nFans1 = Abc_ObjFanoutNum( Abc_ObjRegular(p1) );
444 if ( nFans0 == 0 || nFans1 == 0 )
445 return NULL;
446 }
447
448 // order the arguments
449 if ( Abc_ObjRegular(p0)->Id > Abc_ObjRegular(p1)->Id )
450 pAnd = p0, p0 = p1, p1 = pAnd;
451 // get the hash key for these two nodes
452 Key = Abc_HashKey2( p0, p1, pMan->nBins );
453 // find the matching node in the table
454 Abc_AigBinForEachEntry( pMan->pBins[Key], pAnd )
455 if ( p0 == Abc_ObjChild0(pAnd) && p1 == Abc_ObjChild1(pAnd) )
456 {
457// assert( Abc_ObjFanoutNum(Abc_ObjRegular(p0)) && Abc_ObjFanoutNum(p1) );
458 return pAnd;
459 }
460 return NULL;
461}
Abc_Obj_t * Abc_AigConst1(Abc_Ntk_t *pNtk)
Definition abcAig.c:683
#define Abc_AigBinForEachEntry(pBin, pEnt)
Definition abcAig.c:74
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_AigCheck()

ABC_DLL int Abc_AigCheck ( Abc_Aig_t * pMan)
extern

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

Synopsis [Makes sure that every node in the table is in the network and vice versa.]

Description []

SideEffects []

SeeAlso []

Definition at line 226 of file abcAig.c.

227{
228 Abc_Obj_t * pObj, * pAnd;
229 int i, nFanins, Counter;
230 Abc_NtkForEachNode( pMan->pNtkAig, pObj, i )
231 {
232 nFanins = Abc_ObjFaninNum(pObj);
233 if ( nFanins == 0 )
234 {
235 if ( !Abc_AigNodeIsConst(pObj) )
236 {
237 printf( "Abc_AigCheck: The AIG has non-standard constant nodes.\n" );
238 return 0;
239 }
240 continue;
241 }
242 if ( nFanins == 1 )
243 {
244 printf( "Abc_AigCheck: The AIG has single input nodes.\n" );
245 return 0;
246 }
247 if ( nFanins > 2 )
248 {
249 printf( "Abc_AigCheck: The AIG has non-standard nodes.\n" );
250 return 0;
251 }
252 if ( pObj->Level != 1 + (unsigned)Abc_MaxInt( Abc_ObjFanin0(pObj)->Level, Abc_ObjFanin1(pObj)->Level ) )
253 printf( "Abc_AigCheck: Node \"%s\" has level that does not agree with the fanin levels.\n", Abc_ObjName(pObj) );
254 pAnd = Abc_AigAndLookup( pMan, Abc_ObjChild0(pObj), Abc_ObjChild1(pObj) );
255 if ( pAnd != pObj )
256 printf( "Abc_AigCheck: Node \"%s\" is not in the structural hashing table.\n", Abc_ObjName(pObj) );
257 }
258 // count the number of nodes in the table
259 Counter = 0;
260 for ( i = 0; i < pMan->nBins; i++ )
261 Abc_AigBinForEachEntry( pMan->pBins[i], pAnd )
262 Counter++;
263 if ( Counter != Abc_NtkNodeNum(pMan->pNtkAig) )
264 {
265 printf( "Abc_AigCheck: The number of nodes in the structural hashing table is wrong.\n" );
266 return 0;
267 }
268 // if the node is a choice node, nodes in its class should not have fanouts
269 Abc_NtkForEachNode( pMan->pNtkAig, pObj, i )
270 if ( Abc_AigNodeIsChoice(pObj) )
271 for ( pAnd = (Abc_Obj_t *)pObj->pData; pAnd; pAnd = (Abc_Obj_t *)pAnd->pData )
272 if ( Abc_ObjFanoutNum(pAnd) > 0 )
273 {
274 printf( "Abc_AigCheck: Representative %s", Abc_ObjName(pAnd) );
275 printf( " of choice node %s has %d fanouts.\n", Abc_ObjName(pObj), Abc_ObjFanoutNum(pAnd) );
276 return 0;
277 }
278 return 1;
279}
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
Definition abcNames.c:49
#define Abc_NtkForEachNode(pNtk, pNode, i)
Definition abc.h:464
void * pData
Definition abc.h:145
unsigned Level
Definition abc.h:142
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_AigCheckFaninOrder()

ABC_DLL void Abc_AigCheckFaninOrder ( Abc_Aig_t * pMan)
extern

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

Synopsis [Resizes the hash table of AIG nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 1379 of file abcAig.c.

1380{
1381 Abc_Obj_t * pEnt;
1382 int i;
1383 for ( i = 0; i < pMan->nBins; i++ )
1384 Abc_AigBinForEachEntry( pMan->pBins[i], pEnt )
1385 {
1386 if ( Abc_ObjRegular(Abc_ObjChild0(pEnt))->Id > Abc_ObjRegular(Abc_ObjChild1(pEnt))->Id )
1387 {
1388// int i0 = Abc_ObjRegular(Abc_ObjChild0(pEnt))->Id;
1389// int i1 = Abc_ObjRegular(Abc_ObjChild1(pEnt))->Id;
1390 printf( "Node %d has incorrect ordering of fanins.\n", pEnt->Id );
1391 }
1392 }
1393}
int Id
Definition abc.h:132

◆ Abc_AigCleanup()

ABC_DLL int Abc_AigCleanup ( Abc_Aig_t * pMan)
extern

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

Synopsis [Returns the number of dangling nodes removed.]

Description []

SideEffects []

SeeAlso []

Definition at line 194 of file abcAig.c.

195{
196 Vec_Ptr_t * vDangles;
197 Abc_Obj_t * pAnd;
198 int i, nNodesOld;
199// printf( "Strash0 = %d. Strash1 = %d. Strash100 = %d. StrashM = %d.\n",
200// pMan->nStrash0, pMan->nStrash1, pMan->nStrash5, pMan->nStrash2 );
201 nNodesOld = pMan->nEntries;
202 // collect the AND nodes that do not fanout
203 vDangles = Vec_PtrAlloc( 100 );
204 for ( i = 0; i < pMan->nBins; i++ )
205 Abc_AigBinForEachEntry( pMan->pBins[i], pAnd )
206 if ( Abc_ObjFanoutNum(pAnd) == 0 )
207 Vec_PtrPush( vDangles, pAnd );
208 // process the dangling nodes and their MFFCs
209 Vec_PtrForEachEntry( Abc_Obj_t *, vDangles, pAnd, i )
210 Abc_AigDeleteNode( pMan, pAnd );
211 Vec_PtrFree( vDangles );
212 return nNodesOld - pMan->nEntries;
213}
void Abc_AigDeleteNode(Abc_Aig_t *pMan, Abc_Obj_t *pNode)
Definition abcAig.c:989
int nEntries
Definition abcAig.c:58
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 call graph for this function:
Here is the caller graph for this function:

◆ Abc_AigConst1()

ABC_DLL Abc_Obj_t * Abc_AigConst1 ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Performs canonicization step.]

Description [The argument nodes can be complemented.]

SideEffects []

SeeAlso []

Definition at line 683 of file abcAig.c.

684{
685 assert( Abc_NtkIsStrash(pNtk) );
686 return ((Abc_Aig_t *)pNtk->pManFunc)->pConst1;
687}
void * pManFunc
Definition abc.h:191

◆ Abc_AigDeleteNode()

ABC_DLL void Abc_AigDeleteNode ( Abc_Aig_t * pMan,
Abc_Obj_t * pNode )
extern

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

Synopsis [Performs internal deletion step.]

Description []

SideEffects []

SeeAlso []

Definition at line 989 of file abcAig.c.

990{
991 Abc_Obj_t * pNode0, * pNode1, * pTemp;
992 int i, k;
993
994 // make sure the node is regular and dangling
995 assert( !Abc_ObjIsComplement(pNode) );
996 assert( Abc_ObjIsNode(pNode) );
997 assert( Abc_ObjFaninNum(pNode) == 2 );
998 assert( Abc_ObjFanoutNum(pNode) == 0 );
999
1000 // when deleting an old node that is scheduled for replacement, remove it from the replacement queue
1001 Vec_PtrForEachEntry( Abc_Obj_t *, pMan->vStackReplaceOld, pTemp, i )
1002 if ( pNode == pTemp )
1003 {
1004 // remove the entry from the replacement array
1005 for ( k = i; k < pMan->vStackReplaceOld->nSize - 1; k++ )
1006 {
1007 pMan->vStackReplaceOld->pArray[k] = pMan->vStackReplaceOld->pArray[k+1];
1008 pMan->vStackReplaceNew->pArray[k] = pMan->vStackReplaceNew->pArray[k+1];
1009 }
1010 pMan->vStackReplaceOld->nSize--;
1011 pMan->vStackReplaceNew->nSize--;
1012 }
1013
1014 // when deleting a new node that should replace another node, do not delete
1015 Vec_PtrForEachEntry( Abc_Obj_t *, pMan->vStackReplaceNew, pTemp, i )
1016 if ( pNode == Abc_ObjRegular(pTemp) )
1017 return;
1018
1019 // remember the node's fanins
1020 pNode0 = Abc_ObjFanin0( pNode );
1021 pNode1 = Abc_ObjFanin1( pNode );
1022
1023 // add the node to the list of updated nodes
1024 if ( pMan->vUpdatedNets )
1025 {
1026 Vec_PtrPushUnique( pMan->vUpdatedNets, pNode0 );
1027 Vec_PtrPushUnique( pMan->vUpdatedNets, pNode1 );
1028 }
1029
1030 // remove the node from the table
1031 Abc_AigAndDelete( pMan, pNode );
1032 // if the node is in the level structure, remove it
1033 if ( pNode->fMarkA )
1034 Abc_AigRemoveFromLevelStructure( pMan->vLevels, pNode );
1035 if ( pNode->fMarkB )
1036 Abc_AigRemoveFromLevelStructureR( pMan->vLevelsR, pNode );
1037 // remove the node from the network
1038 Abc_NtkDeleteObj( pNode );
1039
1040 // call recursively for the fanins
1041 if ( Abc_ObjIsNode(pNode0) && pNode0->vFanouts.nSize == 0 )
1042 Abc_AigDeleteNode( pMan, pNode0 );
1043 if ( Abc_ObjIsNode(pNode1) && pNode1->vFanouts.nSize == 0 )
1044 Abc_AigDeleteNode( pMan, pNode1 );
1045}
ABC_DLL void Abc_NtkDeleteObj(Abc_Obj_t *pObj)
Definition abcObj.c:170
Vec_Ptr_t * vUpdatedNets
Definition abcAig.c:65
unsigned fMarkB
Definition abc.h:135
Vec_Int_t vFanouts
Definition abc.h:144
unsigned fMarkA
Definition abc.h:134
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_AigDfs()

ABC_DLL Vec_Ptr_t * Abc_AigDfs ( Abc_Ntk_t * pNtk,
int fCollectAll,
int fCollectCos )
extern

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

Synopsis [Returns the DFS ordered array of logic nodes.]

Description [Collects only the internal nodes, leaving out CIs/COs. However it marks both CIs and COs with the current TravId.]

SideEffects []

SeeAlso []

Definition at line 1198 of file abcDfs.c.

1199{
1200 Vec_Ptr_t * vNodes;
1201 Abc_Obj_t * pNode;
1202 int i;
1203 assert( Abc_NtkIsStrash(pNtk) );
1204 // set the traversal ID
1205 Abc_NtkIncrementTravId( pNtk );
1206 // start the array of nodes
1207 vNodes = Vec_PtrAlloc( 100 );
1208 // go through the PO nodes and call for each of them
1209 Abc_NtkForEachCo( pNtk, pNode, i )
1210 {
1211 Abc_AigDfs_rec( Abc_ObjFanin0(pNode), vNodes );
1212 Abc_NodeSetTravIdCurrent( pNode );
1213 if ( fCollectCos )
1214 Vec_PtrPush( vNodes, pNode );
1215 }
1216 // collect dangling nodes if asked to
1217 if ( fCollectAll )
1218 {
1219 Abc_NtkForEachNode( pNtk, pNode, i )
1220 if ( !Abc_NodeIsTravIdCurrent(pNode) )
1221 Abc_AigDfs_rec( pNode, vNodes );
1222 }
1223 return vNodes;
1224}
void Abc_AigDfs_rec(Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
Definition abcDfs.c:1162
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition abc.h:522
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_AigDfsMap()

ABC_DLL Vec_Ptr_t * Abc_AigDfsMap ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Returns the DFS ordered array of logic nodes.]

Description [Collects only the internal nodes, leaving out CIs/COs. However it marks both CIs and COs with the current TravId.]

SideEffects []

SeeAlso []

Definition at line 1238 of file abcDfs.c.

1239{
1240 Vec_Ptr_t * vNodes;
1241 Abc_Obj_t * pNode;
1242 int i;
1243 assert( Abc_NtkIsStrash(pNtk) );
1244 // set the traversal ID
1245 Abc_NtkIncrementTravId( pNtk );
1246 // start the array of nodes
1247 vNodes = Vec_PtrAlloc( 100 );
1248 // collect cones of barbufs
1249 Abc_NtkForEachCo( pNtk, pNode, i )
1250 {
1251 if ( i < Abc_NtkCoNum(pNtk) - pNtk->nBarBufs )
1252 continue;
1253 Abc_AigDfs_rec( Abc_ObjFanin0(pNode), vNodes );
1254 Abc_NodeSetTravIdCurrent( pNode );
1255 // collect latch as a placeholder
1256 assert( Abc_ObjIsLatch(Abc_ObjFanout0(pNode)) );
1257 Vec_PtrPush( vNodes, Abc_ObjFanout0(pNode) );
1258 }
1259 // collect nodes of real POs
1260 Abc_NtkForEachCo( pNtk, pNode, i )
1261 {
1262 if ( i >= Abc_NtkCoNum(pNtk) - pNtk->nBarBufs )
1263 break;
1264 Abc_AigDfs_rec( Abc_ObjFanin0(pNode), vNodes );
1265 assert( Abc_ObjIsCo(pNode) );
1266 Abc_NodeSetTravIdCurrent( pNode );
1267 }
1268 return vNodes;
1269}
int nBarBufs
Definition abc.h:174
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_AigFree()

ABC_DLL void Abc_AigFree ( Abc_Aig_t * pMan)
extern

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

Synopsis [Deallocates the local AIG manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 165 of file abcAig.c.

166{
167 assert( Vec_PtrSize( pMan->vStackReplaceOld ) == 0 );
168 assert( Vec_PtrSize( pMan->vStackReplaceNew ) == 0 );
169 // free the table
170 if ( pMan->vAddedCells )
171 Vec_PtrFree( pMan->vAddedCells );
172 if ( pMan->vUpdatedNets )
173 Vec_PtrFree( pMan->vUpdatedNets );
174 Vec_VecFree( pMan->vLevels );
175 Vec_VecFree( pMan->vLevelsR );
176 Vec_PtrFree( pMan->vStackReplaceOld );
177 Vec_PtrFree( pMan->vStackReplaceNew );
178 Vec_PtrFree( pMan->vNodes );
179 ABC_FREE( pMan->pBins );
180 ABC_FREE( pMan );
181}
#define ABC_FREE(obj)
Definition abc_global.h:267
Vec_Ptr_t * vAddedCells
Definition abcAig.c:64
Here is the caller graph for this function:

◆ Abc_AigGetLevelizedOrder()

ABC_DLL Vec_Ptr_t * Abc_AigGetLevelizedOrder ( Abc_Ntk_t * pNtk,
int fCollectCis )
extern

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

Synopsis [Returns nodes by level from the smallest to the largest.]

Description [Correctly handles the case of choice nodes, by first spreading them out across several levels and then collecting.]

SideEffects [What happens with dangling nodes???]

SeeAlso []

Definition at line 1841 of file abcDfs.c.

1842{
1843 Vec_Ptr_t * vNodes, * vLevels;
1844 Abc_Obj_t * pNode, ** ppHead;
1845 int LevelMax, i;
1846 assert( Abc_NtkIsStrash(pNtk) );
1847 // set the correct levels
1848 Abc_NtkCleanCopy( pNtk );
1849 LevelMax = Abc_AigSetChoiceLevels( pNtk );
1850 // relink nodes by level
1851 vLevels = Vec_PtrStart( LevelMax + 1 );
1852 Abc_NtkForEachNode( pNtk, pNode, i )
1853 {
1854 ppHead = ((Abc_Obj_t **)vLevels->pArray) + (int)(ABC_PTRINT_T)pNode->pCopy;
1855 pNode->pCopy = *ppHead;
1856 *ppHead = pNode;
1857 }
1858 // recollect nodes
1859 vNodes = Vec_PtrStart( Abc_NtkNodeNum(pNtk) );
1860 Vec_PtrForEachEntryStart( Abc_Obj_t *, vLevels, pNode, i, !fCollectCis )
1861 for ( ; pNode; pNode = pNode->pCopy )
1862 Vec_PtrPush( vNodes, pNode );
1863 Vec_PtrFree( vLevels );
1864 return vNodes;
1865}
int Abc_AigSetChoiceLevels(Abc_Ntk_t *pNtk)
Definition abcDfs.c:1803
ABC_DLL void Abc_NtkCleanCopy(Abc_Ntk_t *pNtk)
Definition abcUtil.c:540
Abc_Obj_t * pCopy
Definition abc.h:148
#define Vec_PtrForEachEntryStart(Type, vVec, pEntry, i, Start)
Definition vecPtr.h:57
Here is the call graph for this function:

◆ Abc_AigLevel()

ABC_DLL int Abc_AigLevel ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Computes the number of logic levels not counting PIs/POs.]

Description []

SideEffects []

SeeAlso []

Definition at line 292 of file abcAig.c.

293{
294 Abc_Obj_t * pNode;
295 int i, LevelsMax;
296 assert( Abc_NtkIsStrash(pNtk) );
297 if ( pNtk->nBarBufs )
298 return Abc_NtkLevel( pNtk );
299 // perform the traversal
300 LevelsMax = 0;
301 Abc_NtkForEachCo( pNtk, pNode, i )
302 if ( LevelsMax < (int)Abc_ObjFanin0(pNode)->Level )
303 LevelsMax = (int)Abc_ObjFanin0(pNode)->Level;
304 return LevelsMax;
305}
ABC_DLL int Abc_NtkLevel(Abc_Ntk_t *pNtk)
Definition abcDfs.c:1449
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_AigMiter()

ABC_DLL Abc_Obj_t * Abc_AigMiter ( Abc_Aig_t * pMan,
Vec_Ptr_t * vPairs,
int fImplic )
extern

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

Synopsis [Implements the miter.]

Description []

SideEffects []

SeeAlso []

Definition at line 789 of file abcAig.c.

790{
791 int i;
792 if ( vPairs->nSize == 0 )
793 return Abc_ObjNot( Abc_AigConst1(pMan->pNtkAig) );
794 assert( vPairs->nSize % 2 == 0 );
795 // go through the cubes of the node's SOP
796 if ( fImplic )
797 {
798 for ( i = 0; i < vPairs->nSize; i += 2 )
799 vPairs->pArray[i/2] = Abc_AigAnd( pMan, (Abc_Obj_t *)vPairs->pArray[i], Abc_ObjNot((Abc_Obj_t *)vPairs->pArray[i+1]) );
800 }
801 else
802 {
803 for ( i = 0; i < vPairs->nSize; i += 2 )
804 vPairs->pArray[i/2] = Abc_AigXor( pMan, (Abc_Obj_t *)vPairs->pArray[i], (Abc_Obj_t *)vPairs->pArray[i+1] );
805 }
806 vPairs->nSize = vPairs->nSize/2;
807 return Abc_AigMiter_rec( pMan, (Abc_Obj_t **)vPairs->pArray, vPairs->nSize );
808}
Abc_Obj_t * Abc_AigMiter_rec(Abc_Aig_t *pMan, Abc_Obj_t **ppObjs, int nObjs)
Definition abcAig.c:768
ABC_DLL Abc_Obj_t * Abc_AigXor(Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
Definition abcAig.c:735
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_AigMux()

ABC_DLL Abc_Obj_t * Abc_AigMux ( Abc_Aig_t * pMan,
Abc_Obj_t * pC,
Abc_Obj_t * p1,
Abc_Obj_t * p0 )
extern

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

Synopsis [Implements Boolean XOR.]

Description []

SideEffects []

SeeAlso []

Definition at line 752 of file abcAig.c.

753{
754 return Abc_AigOr( pMan, Abc_AigAnd(pMan, pC, p1), Abc_AigAnd(pMan, Abc_ObjNot(pC), p0) );
755}
Abc_Obj_t * Abc_AigOr(Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
Definition abcAig.c:719
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_AigMuxLookup()

ABC_DLL Abc_Obj_t * Abc_AigMuxLookup ( Abc_Aig_t * pMan,
Abc_Obj_t * pC,
Abc_Obj_t * pT,
Abc_Obj_t * pE,
int * pType )
extern

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

Synopsis [Returns the gate implementing EXOR of the two arguments if it exists.]

Description [The argument nodes can be complemented.]

SideEffects []

SeeAlso []

Definition at line 508 of file abcAig.c.

509{
510 Abc_Obj_t * pNode1, * pNode2, * pNode;
511 // set the flag to zero
512 if ( pType ) *pType = 0;
513 // check the case of MUX(c,t,e) = OR(ct', c'e')'
514 if ( (pNode1 = Abc_AigAndLookup(pMan, pC, Abc_ObjNot(pT))) &&
515 (pNode2 = Abc_AigAndLookup(pMan, Abc_ObjNot(pC), Abc_ObjNot(pE))) )
516 {
517 pNode = Abc_AigAndLookup( pMan, Abc_ObjNot(pNode1), Abc_ObjNot(pNode2) );
518 if ( pNode && pType ) *pType = 1;
519 return pNode;
520 }
521 // check the case of MUX(c,t,e) = OR(ct, c'e)
522 if ( (pNode1 = Abc_AigAndLookup(pMan, pC, pT)) &&
523 (pNode2 = Abc_AigAndLookup(pMan, Abc_ObjNot(pC), pE)) )
524 {
525 pNode = Abc_AigAndLookup( pMan, Abc_ObjNot(pNode1), Abc_ObjNot(pNode2) );
526 return pNode? Abc_ObjNot(pNode) : NULL;
527 }
528 return NULL;
529}
Here is the call graph for this function:

◆ Abc_AigNodeHasComplFanoutEdge()

ABC_DLL int Abc_AigNodeHasComplFanoutEdge ( Abc_Obj_t * pNode)
extern

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

Synopsis [Returns 1 if the node has at least one complemented fanout.]

Description [A fanout is complemented if the fanout's fanin edge pointing to the given node is complemented.]

SideEffects []

SeeAlso []

Definition at line 1241 of file abcAig.c.

1242{
1243 Abc_Obj_t * pFanout;
1244 int i, iFanin;
1245 Abc_ObjForEachFanout( pNode, pFanout, i )
1246 {
1247 iFanin = Vec_IntFind( &pFanout->vFanins, pNode->Id );
1248 assert( iFanin >= 0 );
1249 if ( Abc_ObjFaninC( pFanout, iFanin ) )
1250 return 1;
1251 }
1252 return 0;
1253}
#define Abc_ObjForEachFanout(pObj, pFanout, i)
Definition abc.h:529
Vec_Int_t vFanins
Definition abc.h:143

◆ Abc_AigNodeHasComplFanoutEdgeTrav()

ABC_DLL int Abc_AigNodeHasComplFanoutEdgeTrav ( Abc_Obj_t * pNode)
extern

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

Synopsis [Returns 1 if the node has at least one complemented fanout.]

Description [A fanout is complemented if the fanout's fanin edge pointing to the given node is complemented. Only the fanouts with current TravId are counted.]

SideEffects []

SeeAlso []

Definition at line 1268 of file abcAig.c.

1269{
1270 Abc_Obj_t * pFanout;
1271 int i, iFanin;
1272 Abc_ObjForEachFanout( pNode, pFanout, i )
1273 {
1274 if ( !Abc_NodeIsTravIdCurrent(pFanout) )
1275 continue;
1276 iFanin = Vec_IntFind( &pFanout->vFanins, pNode->Id );
1277 assert( iFanin >= 0 );
1278 if ( Abc_ObjFaninC( pFanout, iFanin ) )
1279 return 1;
1280 }
1281 return 0;
1282}
Here is the caller graph for this function:

◆ Abc_AigNodeIsAcyclic()

ABC_DLL int Abc_AigNodeIsAcyclic ( Abc_Obj_t * pNode,
Abc_Obj_t * pRoot )
extern

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

Synopsis [Check if the node has a combination loop of depth 1 or 2.]

Description []

SideEffects []

SeeAlso []

Definition at line 1330 of file abcAig.c.

1331{
1332 Abc_Obj_t * pFanin0, * pFanin1;
1333 Abc_Obj_t * pChild00, * pChild01;
1334 Abc_Obj_t * pChild10, * pChild11;
1335 if ( !Abc_AigNodeIsAnd(pNode) )
1336 return 1;
1337 pFanin0 = Abc_ObjFanin0(pNode);
1338 pFanin1 = Abc_ObjFanin1(pNode);
1339 if ( pRoot == pFanin0 || pRoot == pFanin1 )
1340 return 0;
1341 if ( Abc_ObjIsCi(pFanin0) )
1342 {
1343 pChild00 = NULL;
1344 pChild01 = NULL;
1345 }
1346 else
1347 {
1348 pChild00 = Abc_ObjFanin0(pFanin0);
1349 pChild01 = Abc_ObjFanin1(pFanin0);
1350 if ( pRoot == pChild00 || pRoot == pChild01 )
1351 return 0;
1352 }
1353 if ( Abc_ObjIsCi(pFanin1) )
1354 {
1355 pChild10 = NULL;
1356 pChild11 = NULL;
1357 }
1358 else
1359 {
1360 pChild10 = Abc_ObjFanin0(pFanin1);
1361 pChild11 = Abc_ObjFanin1(pFanin1);
1362 if ( pRoot == pChild10 || pRoot == pChild11 )
1363 return 0;
1364 }
1365 return 1;
1366}

◆ Abc_AigOr()

ABC_DLL Abc_Obj_t * Abc_AigOr ( Abc_Aig_t * pMan,
Abc_Obj_t * p0,
Abc_Obj_t * p1 )
extern

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

Synopsis [Implements Boolean OR.]

Description []

SideEffects []

SeeAlso []

Definition at line 719 of file abcAig.c.

720{
721 return Abc_ObjNot( Abc_AigAnd( pMan, Abc_ObjNot(p0), Abc_ObjNot(p1) ) );
722}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_AigPrintNode()

ABC_DLL void Abc_AigPrintNode ( Abc_Obj_t * pNode)
extern

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

Synopsis [Prints the AIG node for debugging purposes.]

Description []

SideEffects []

SeeAlso []

Definition at line 1296 of file abcAig.c.

1297{
1298 Abc_Obj_t * pNodeR = Abc_ObjRegular(pNode);
1299 if ( Abc_ObjIsCi(pNodeR) )
1300 {
1301 printf( "CI %4s%s.\n", Abc_ObjName(pNodeR), Abc_ObjIsComplement(pNode)? "\'" : "" );
1302 return;
1303 }
1304 if ( Abc_AigNodeIsConst(pNodeR) )
1305 {
1306 printf( "Constant 1 %s.\n", Abc_ObjIsComplement(pNode)? "(complemented)" : "" );
1307 return;
1308 }
1309 // print the node's function
1310 printf( "%7s%s", Abc_ObjName(pNodeR), Abc_ObjIsComplement(pNode)? "\'" : "" );
1311 printf( " = " );
1312 printf( "%7s%s", Abc_ObjName(Abc_ObjFanin0(pNodeR)), Abc_ObjFaninC0(pNodeR)? "\'" : "" );
1313 printf( " * " );
1314 printf( "%7s%s", Abc_ObjName(Abc_ObjFanin1(pNodeR)), Abc_ObjFaninC1(pNodeR)? "\'" : "" );
1315 printf( "\n" );
1316}
Here is the call graph for this function:

◆ Abc_AigRehash()

ABC_DLL void Abc_AigRehash ( Abc_Aig_t * pMan)
extern

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

Synopsis [Resizes the hash table of AIG nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 628 of file abcAig.c.

629{
630 Abc_Obj_t ** pBinsNew;
631 Abc_Obj_t * pEnt, * pEnt2;
632 int * pArray;
633 unsigned Key;
634 int Counter, Temp, i;
635
636 // allocate a new array
637 pBinsNew = ABC_ALLOC( Abc_Obj_t *, pMan->nBins );
638 memset( pBinsNew, 0, sizeof(Abc_Obj_t *) * pMan->nBins );
639 // rehash the entries from the old table
640 Counter = 0;
641 for ( i = 0; i < pMan->nBins; i++ )
642 Abc_AigBinForEachEntrySafe( pMan->pBins[i], pEnt, pEnt2 )
643 {
644 // swap the fanins if needed
645 pArray = pEnt->vFanins.pArray;
646 if ( pArray[0] > pArray[1] )
647 {
648 Temp = pArray[0];
649 pArray[0] = pArray[1];
650 pArray[1] = Temp;
651 Temp = pEnt->fCompl0;
652 pEnt->fCompl0 = pEnt->fCompl1;
653 pEnt->fCompl1 = Temp;
654 }
655 // rehash the node
656 Key = Abc_HashKey2( Abc_ObjChild0(pEnt), Abc_ObjChild1(pEnt), pMan->nBins );
657 pEnt->pNext = pBinsNew[Key];
658 pBinsNew[Key] = pEnt;
659 Counter++;
660 }
661 assert( Counter == pMan->nEntries );
662 // replace the table and the parameters
663 ABC_FREE( pMan->pBins );
664 pMan->pBins = pBinsNew;
665}
#define Abc_AigBinForEachEntrySafe(pBin, pEnt, pEnt2)
Definition abcAig.c:78
unsigned fCompl1
Definition abc.h:141
Abc_Obj_t * pNext
Definition abc.h:131
unsigned fCompl0
Definition abc.h:140
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_AigReplace()

ABC_DLL int Abc_AigReplace ( Abc_Aig_t * pMan,
Abc_Obj_t * pOld,
Abc_Obj_t * pNew,
int fUpdateLevel )
extern

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

Synopsis [Replaces one AIG node by the other.]

Description []

SideEffects []

SeeAlso []

Definition at line 850 of file abcAig.c.

851{
852 assert( Vec_PtrSize(pMan->vStackReplaceOld) == 0 );
853 assert( Vec_PtrSize(pMan->vStackReplaceNew) == 0 );
854 Vec_PtrPush( pMan->vStackReplaceOld, pOld );
855 Vec_PtrPush( pMan->vStackReplaceNew, pNew );
856 assert( !Abc_ObjIsComplement(pOld) );
857 // process the replacements
858 while ( Vec_PtrSize(pMan->vStackReplaceOld) )
859 {
860 pOld = (Abc_Obj_t *)Vec_PtrPop( pMan->vStackReplaceOld );
861 pNew = (Abc_Obj_t *)Vec_PtrPop( pMan->vStackReplaceNew );
862 if ( Abc_ObjFanoutNum(pOld) == 0 )
863 //return 0;
864 continue;
865 Abc_AigReplace_int( pMan, pOld, pNew, fUpdateLevel );
866 }
867 if ( fUpdateLevel )
868 {
869 Abc_AigUpdateLevel_int( pMan );
870 if ( pMan->pNtkAig->vLevelsR )
871 Abc_AigUpdateLevelR_int( pMan );
872 }
873 return 1;
874}
Vec_Int_t * vLevelsR
Definition abc.h:196
Here is the caller graph for this function:

◆ Abc_AigSetNodePhases()

ABC_DLL void Abc_AigSetNodePhases ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Sets the correct phase of the nodes.]

Description [The AIG nodes should be in the DFS order.]

SideEffects []

SeeAlso []

Definition at line 1406 of file abcAig.c.

1407{
1408 Abc_Obj_t * pObj;
1409 int i;
1410 assert( Abc_NtkIsDfsOrdered(pNtk) );
1411 Abc_AigConst1(pNtk)->fPhase = 1;
1412 Abc_NtkForEachPi( pNtk, pObj, i )
1413 pObj->fPhase = 0;
1414 Abc_NtkForEachLatchOutput( pNtk, pObj, i )
1415 pObj->fPhase = Abc_LatchIsInit1(pObj);
1416 Abc_AigForEachAnd( pNtk, pObj, i )
1417 pObj->fPhase = (Abc_ObjFanin0(pObj)->fPhase ^ Abc_ObjFaninC0(pObj)) & (Abc_ObjFanin1(pObj)->fPhase ^ Abc_ObjFaninC1(pObj));
1418 Abc_NtkForEachPo( pNtk, pObj, i )
1419 pObj->fPhase = (Abc_ObjFanin0(pObj)->fPhase ^ Abc_ObjFaninC0(pObj));
1420 Abc_NtkForEachLatchInput( pNtk, pObj, i )
1421 pObj->fPhase = (Abc_ObjFanin0(pObj)->fPhase ^ Abc_ObjFaninC0(pObj));
1422}
ABC_DLL int Abc_NtkIsDfsOrdered(Abc_Ntk_t *pNtk)
Definition abcDfs.c:698
#define Abc_AigForEachAnd(pNtk, pNode, i)
Definition abc.h:488
#define Abc_NtkForEachPo(pNtk, pPo, i)
Definition abc.h:520
#define Abc_NtkForEachLatchOutput(pNtk, pObj, i)
Definition abc.h:506
#define Abc_NtkForEachLatchInput(pNtk, pObj, i)
Definition abc.h:503
#define Abc_NtkForEachPi(pNtk, pPi, i)
Definition abc.h:516
Here is the call graph for this function:

◆ Abc_AigUpdateReset()

ABC_DLL void Abc_AigUpdateReset ( Abc_Aig_t * pMan)
extern

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

Synopsis [Start the update list.]

Description []

SideEffects []

SeeAlso []

Definition at line 1477 of file abcAig.c.

1478{
1479 assert( pMan->vAddedCells != NULL );
1480 Vec_PtrClear( pMan->vAddedCells );
1481 Vec_PtrClear( pMan->vUpdatedNets );
1482}
Here is the caller graph for this function:

◆ Abc_AigUpdateStart()

ABC_DLL Vec_Ptr_t * Abc_AigUpdateStart ( Abc_Aig_t * pMan,
Vec_Ptr_t ** pvUpdatedNets )
extern

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

Synopsis [Start the update list.]

Description []

SideEffects []

SeeAlso []

Definition at line 1437 of file abcAig.c.

1438{
1439 assert( pMan->vAddedCells == NULL );
1440 pMan->vAddedCells = Vec_PtrAlloc( 1000 );
1441 pMan->vUpdatedNets = Vec_PtrAlloc( 1000 );
1442 *pvUpdatedNets = pMan->vUpdatedNets;
1443 return pMan->vAddedCells;
1444}

◆ Abc_AigUpdateStop()

ABC_DLL void Abc_AigUpdateStop ( Abc_Aig_t * pMan)
extern

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

Synopsis [Start the update list.]

Description []

SideEffects []

SeeAlso []

Definition at line 1457 of file abcAig.c.

1458{
1459 assert( pMan->vAddedCells != NULL );
1460 Vec_PtrFree( pMan->vAddedCells );
1461 Vec_PtrFree( pMan->vUpdatedNets );
1462 pMan->vAddedCells = NULL;
1463 pMan->vUpdatedNets = NULL;
1464}

◆ Abc_AigXor()

ABC_DLL Abc_Obj_t * Abc_AigXor ( Abc_Aig_t * pMan,
Abc_Obj_t * p0,
Abc_Obj_t * p1 )
extern

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

Synopsis [Implements Boolean XOR.]

Description []

SideEffects []

SeeAlso []

Definition at line 735 of file abcAig.c.

736{
737 return Abc_AigOr( pMan, Abc_AigAnd(pMan, p0, Abc_ObjNot(p1)),
738 Abc_AigAnd(pMan, p1, Abc_ObjNot(p0)) );
739}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_AigXorLookup()

ABC_DLL Abc_Obj_t * Abc_AigXorLookup ( Abc_Aig_t * pMan,
Abc_Obj_t * p0,
Abc_Obj_t * p1,
int * pType )
extern

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

Synopsis [Returns the gate implementing EXOR of the two arguments if it exists.]

Description [The argument nodes can be complemented.]

SideEffects []

SeeAlso []

Definition at line 474 of file abcAig.c.

475{
476 Abc_Obj_t * pNode1, * pNode2, * pNode;
477 // set the flag to zero
478 if ( pType ) *pType = 0;
479 // check the case of XOR(a,b) = OR(ab, a'b')'
480 if ( (pNode1 = Abc_AigAndLookup(pMan, Abc_ObjNot(p0), Abc_ObjNot(p1))) &&
481 (pNode2 = Abc_AigAndLookup(pMan, p0, p1)) )
482 {
483 pNode = Abc_AigAndLookup( pMan, Abc_ObjNot(pNode1), Abc_ObjNot(pNode2) );
484 if ( pNode && pType ) *pType = 1;
485 return pNode;
486 }
487 // check the case of XOR(a,b) = OR(a'b, ab')
488 if ( (pNode1 = Abc_AigAndLookup(pMan, p0, Abc_ObjNot(p1))) &&
489 (pNode2 = Abc_AigAndLookup(pMan, Abc_ObjNot(p0), p1)) )
490 {
491 pNode = Abc_AigAndLookup( pMan, Abc_ObjNot(pNode1), Abc_ObjNot(pNode2) );
492 return pNode? Abc_ObjNot(pNode) : NULL;
493 }
494 return NULL;
495}
Here is the call graph for this function:

◆ Abc_DesAddModel()

ABC_DLL int Abc_DesAddModel ( Abc_Des_t * p,
Abc_Ntk_t * pNtk )
extern

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

Synopsis [Create the library.]

Description []

SideEffects []

SeeAlso []

Definition at line 226 of file abcLib.c.

227{
228 if ( st__is_member( p->tModules, (char *)pNtk->pName ) )
229 return 0;
230 st__insert( p->tModules, (char *)pNtk->pName, (char *)pNtk );
231 assert( pNtk->Id == 0 );
232 pNtk->Id = Vec_PtrSize(p->vModules);
233 Vec_PtrPush( p->vModules, pNtk );
234 pNtk->pDesign = p;
235 return 1;
236}
Cube * p
Definition exorList.c:222
int st__insert(st__table *table, const char *key, char *value)
Definition st.c:171
#define st__is_member(table, key)
Definition st.h:70
char * pName
Definition abc.h:158
Abc_Des_t * pDesign
Definition abc.h:180
int Id
Definition abc.h:184
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_DesCleanManPointer()

ABC_DLL void Abc_DesCleanManPointer ( Abc_Des_t * p,
void * pMan )
extern

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

Synopsis [Removes all pointers to the manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 70 of file abcLib.c.

71{
72 Abc_Ntk_t * pTemp;
73 int i;
74 if ( p == NULL )
75 return;
76 if ( p->pManFunc == pMan )
77 p->pManFunc = NULL;
78 Vec_PtrForEachEntry( Abc_Ntk_t *, p->vModules, pTemp, i )
79 if ( pTemp->pManFunc == pMan )
80 pTemp->pManFunc = NULL;
81}
struct Abc_Ntk_t_ Abc_Ntk_t
Definition abc.h:115

◆ Abc_DesCreate()

ABC_DLL Abc_Des_t * Abc_DesCreate ( char * pName)
extern

DECLARATIONS ///.

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

FileName [abcLib.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Network and node package.]

Synopsis [Functions to manipulate verilog libraries.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

] FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis [Create the library.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file abcLib.c.

46{
47 Abc_Des_t * p;
48 p = ABC_ALLOC( Abc_Des_t, 1 );
49 memset( p, 0, sizeof(Abc_Des_t) );
50 p->pName = Abc_UtilStrsav( pName );
51 p->tModules = st__init_table( strcmp, st__strhash );
52 p->vTops = Vec_PtrAlloc( 100 );
53 p->vModules = Vec_PtrAlloc( 100 );
54 p->pManFunc = Hop_ManStart();
55 p->pLibrary = NULL;
56 return p;
57}
struct Abc_Des_t_ Abc_Des_t
BASIC TYPES ///.
Definition abc.h:114
Hop_Man_t * Hop_ManStart()
DECLARATIONS ///.
Definition hopMan.c:45
int st__strhash(const char *string, int modulus)
Definition st.c:449
st__table * st__init_table(st__compare_func_type compare, st__hash_func_type hash)
Definition st.c:72
int strcmp()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_DesDeriveRoot()

ABC_DLL Abc_Ntk_t * Abc_DesDeriveRoot ( Abc_Des_t * p)
extern

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

Synopsis [Frees the library.]

Description []

SideEffects []

SeeAlso []

Definition at line 269 of file abcLib.c.

270{
271 Abc_Ntk_t * pNtk;
272 if ( Vec_PtrSize(p->vModules) > 1 )
273 {
274 printf( "The design includes more than one module and is currently not used.\n" );
275 return NULL;
276 }
277 pNtk = (Abc_Ntk_t *)Vec_PtrEntry( p->vModules, 0 ); Vec_PtrClear( p->vModules );
278 pNtk->pManFunc = p->pManFunc; p->pManFunc = NULL;
279 return pNtk;
280}

◆ Abc_DesDup()

ABC_DLL Abc_Des_t * Abc_DesDup ( Abc_Des_t * p)
extern

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

Synopsis [Duplicated the library.]

Description []

SideEffects []

SeeAlso []

Definition at line 133 of file abcLib.c.

134{
135 Abc_Des_t * pNew;
136 Abc_Ntk_t * pTemp;
137 Abc_Obj_t * pObj;
138 int i, k;
139 pNew = Abc_DesCreate( p->pName );
140 Vec_PtrForEachEntry( Abc_Ntk_t *, p->vModules, pTemp, i )
141 Abc_DesAddModel( pNew, Abc_NtkDup(pTemp) );
142 Vec_PtrForEachEntry( Abc_Ntk_t *, p->vTops, pTemp, i )
143 Vec_PtrPush( pNew->vTops, pTemp->pCopy );
144 Vec_PtrForEachEntry( Abc_Ntk_t *, p->vModules, pTemp, i )
145 pTemp->pCopy->pAltView = pTemp->pAltView ? pTemp->pAltView->pCopy : NULL;
146 // update box models
147 Vec_PtrForEachEntry( Abc_Ntk_t *, p->vModules, pTemp, i )
148 Abc_NtkForEachBox( pTemp, pObj, k )
149 if ( Abc_ObjIsWhitebox(pObj) || Abc_ObjIsBlackbox(pObj) )
150 pObj->pCopy->pData = Abc_ObjModel(pObj)->pCopy;
151 return pNew;
152}
int Abc_DesAddModel(Abc_Des_t *p, Abc_Ntk_t *pNtk)
Definition abcLib.c:226
ABC_NAMESPACE_IMPL_START Abc_Des_t * Abc_DesCreate(char *pName)
DECLARATIONS ///.
Definition abcLib.c:45
#define Abc_NtkForEachBox(pNtk, pObj, i)
Definition abc.h:498
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
Definition abcNtk.c:472
Vec_Ptr_t * vTops
Definition abc.h:224
Abc_Ntk_t * pCopy
Definition abc.h:204
Abc_Ntk_t * pAltView
Definition abc.h:181
Here is the call graph for this function:

◆ Abc_DesFindModelByName()

ABC_DLL Abc_Ntk_t * Abc_DesFindModelByName ( Abc_Des_t * p,
char * pName )
extern

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

Synopsis [Create the library.]

Description []

SideEffects []

SeeAlso []

Definition at line 249 of file abcLib.c.

250{
251 Abc_Ntk_t * pNtk;
252 if ( ! st__is_member( p->tModules, (char *)pName ) )
253 return NULL;
254 st__lookup( p->tModules, (char *)pName, (char **)&pNtk );
255 return pNtk;
256}
int st__lookup(st__table *table, const char *key, char **value)
Definition st.c:114
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_DesFindTopLevelModels()

ABC_DLL int Abc_DesFindTopLevelModels ( Abc_Des_t * p)
extern

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

Synopsis [Detects the top-level models.]

Description []

SideEffects []

SeeAlso []

Definition at line 293 of file abcLib.c.

294{
295 Abc_Ntk_t * pNtk, * pNtkBox;
296 Abc_Obj_t * pObj;
297 int i, k;
298 assert( Vec_PtrSize( p->vModules ) > 0 );
299 // clear the models
300 Vec_PtrForEachEntry( Abc_Ntk_t *, p->vModules, pNtk, i )
301 pNtk->fHieVisited = 0;
302 // mark all the models reachable from other models
303 Vec_PtrForEachEntry( Abc_Ntk_t *, p->vModules, pNtk, i )
304 {
305 Abc_NtkForEachBox( pNtk, pObj, k )
306 {
307 if ( Abc_ObjIsLatch(pObj) )
308 continue;
309 if ( pObj->pData == NULL )
310 continue;
311 pNtkBox = (Abc_Ntk_t *)pObj->pData;
312 pNtkBox->fHieVisited = 1;
313 }
314 }
315 // collect the models that are not marked
316 Vec_PtrClear( p->vTops );
317 Vec_PtrForEachEntry( Abc_Ntk_t *, p->vModules, pNtk, i )
318 {
319 if ( pNtk->fHieVisited == 0 )
320 Vec_PtrPush( p->vTops, pNtk );
321 else
322 pNtk->fHieVisited = 0;
323 }
324 return Vec_PtrSize( p->vTops );
325}
int fHieVisited
Definition abc.h:182
Here is the caller graph for this function:

◆ Abc_DesFree()

ABC_DLL void Abc_DesFree ( Abc_Des_t * p,
Abc_Ntk_t * pNtkSave )
extern

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

Synopsis [Frees the library.]

Description []

SideEffects []

SeeAlso []

Definition at line 94 of file abcLib.c.

95{
96 Abc_Ntk_t * pNtk;
97 int i;
98 if ( p->pName )
99 ABC_FREE( p->pName );
100 if ( p->pManFunc )
101 Hop_ManStop( (Hop_Man_t *)p->pManFunc );
102 if ( p->tModules )
103 st__free_table( p->tModules );
104 if ( p->vModules )
105 {
106 Vec_PtrForEachEntry( Abc_Ntk_t *, p->vModules, pNtk, i )
107 {
108 if ( pNtk == pNtkSave )
109 continue;
110 pNtk->pDesign = NULL;
111 if ( (pNtkSave && pNtk->pManFunc == pNtkSave->pManFunc) || (pNtk->pManFunc == p->pManFunc) )
112 pNtk->pManFunc = NULL;
113 Abc_NtkDelete( pNtk );
114 }
115 Vec_PtrFree( p->vModules );
116 }
117 if ( p->vTops )
118 Vec_PtrFree( p->vTops );
119 ABC_FREE( p );
120}
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition abcNtk.c:1421
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 st__free_table(st__table *table)
Definition st.c:81
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_DesPrint()

ABC_DLL void Abc_DesPrint ( Abc_Des_t * p)
extern

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

Synopsis [Prints the library.]

Description []

SideEffects []

SeeAlso []

Definition at line 194 of file abcLib.c.

195{
196 Abc_Ntk_t * pNtk;
197 Abc_Obj_t * pObj;
198 int i, k;
199 printf( "Models of design %s:\n", p->pName );
200 Vec_PtrForEachEntry( Abc_Ntk_t *, p->vModules, pNtk, i )
201 {
202 printf( "%2d : %20s ", i+1, pNtk->pName );
203 printf( "nd = %6d lat = %6d whitebox = %3d blackbox = %3d\n",
204 Abc_NtkNodeNum(pNtk), Abc_NtkLatchNum(pNtk),
205 Abc_NtkWhiteboxNum(pNtk), Abc_NtkBlackboxNum(pNtk) );
206 if ( Abc_NtkBlackboxNum(pNtk) == 0 )
207 continue;
208 Abc_NtkForEachWhitebox( pNtk, pObj, k )
209 printf( " %20s (whitebox)\n", Abc_NtkName((Abc_Ntk_t *)pObj->pData) );
210 Abc_NtkForEachBlackbox( pNtk, pObj, k )
211 printf( " %20s (blackbox)\n", Abc_NtkName((Abc_Ntk_t *)pObj->pData) );
212 }
213}
#define Abc_NtkForEachBlackbox(pNtk, pObj, i)
Definition abc.h:512
#define Abc_NtkForEachWhitebox(pNtk, pObj, i)
Definition abc.h:509

◆ Abc_DfsLevelized()

ABC_DLL Vec_Vec_t * Abc_DfsLevelized ( Abc_Obj_t * pNode,
int fTfi )
extern

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

Synopsis [Collects nodes in the DFS manner by level.]

Description [The number of levels should be set!!!]

SideEffects []

SeeAlso []

Definition at line 1313 of file abcDfs.c.

1314{
1315 Vec_Vec_t * vLevels;
1316 Abc_Obj_t * pFanout;
1317 int i;
1318 assert( fTfi == 0 );
1319 assert( !Abc_NtkIsNetlist(pNode->pNtk) );
1320 // set the traversal ID
1321 Abc_NtkIncrementTravId( pNode->pNtk );
1322 vLevels = Vec_VecAlloc( 100 );
1323 if ( Abc_ObjIsNode(pNode) )
1324 Abc_DfsLevelizedTfo_rec( pNode, vLevels );
1325 else
1326 {
1327 assert( Abc_ObjIsCi(pNode) );
1328 Abc_NodeSetTravIdCurrent( pNode );
1329 Abc_ObjForEachFanout( pNode, pFanout, i )
1330 Abc_DfsLevelizedTfo_rec( pFanout, vLevels );
1331 }
1332 return vLevels;
1333}
void Abc_DfsLevelizedTfo_rec(Abc_Obj_t *pNode, Vec_Vec_t *vLevels)
Definition abcDfs.c:1282
Abc_Ntk_t * pNtk
Definition abc.h:130
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Definition vecVec.h:42
Here is the call graph for this function:

◆ Abc_ExactBuildNode()

ABC_DLL Abc_Obj_t * Abc_ExactBuildNode ( word * pTruth,
int nVars,
int * pArrTimeProfile,
Abc_Obj_t ** pFanins,
Abc_Ntk_t * pNtk )
extern

Definition at line 2894 of file abcExact.c.

2895{
2896 char * pSol = NULL;
2897 int i, j, nMaxArrival;
2898 int pNormalArrTime[8];
2899 char const * p;
2900 Abc_Obj_t * pObj;
2901 Vec_Ptr_t * pGates;
2902 char pGateTruth[5];
2903 char * pSopCover;
2904 abctime timeStart = Abc_Clock();
2905
2906 if ( nVars == 0 )
2907 {
2908 s_pSesStore->timeTotal += ( Abc_Clock() - timeStart );
2909 return (pTruth[0] & 1) ? Abc_NtkCreateNodeConst1(pNtk) : Abc_NtkCreateNodeConst0(pNtk);
2910 }
2911 if ( nVars == 1 )
2912 {
2913 s_pSesStore->timeTotal += ( Abc_Clock() - timeStart );
2914 return (pTruth[0] & 1) ? Abc_NtkCreateNodeInv(pNtk, pFanins[0]) : Abc_NtkCreateNodeBuf(pNtk, pFanins[0]);
2915 }
2916
2917 for ( i = 0; i < nVars; ++i )
2918 pNormalArrTime[i] = pArrTimeProfile[i];
2919 Abc_NormalizeArrivalTimes( pNormalArrTime, nVars, &nMaxArrival );
2920 assert( Ses_StoreGetEntry( s_pSesStore, pTruth, nVars, pNormalArrTime, &pSol ) );
2921 if ( !pSol )
2922 {
2923 s_pSesStore->timeTotal += ( Abc_Clock() - timeStart );
2924 return NULL;
2925 }
2926
2927 assert( pSol[ABC_EXACT_SOL_NVARS] == nVars );
2928 assert( pSol[ABC_EXACT_SOL_NFUNC] == 1 );
2929
2930 pGates = Vec_PtrAlloc( nVars + pSol[ABC_EXACT_SOL_NGATES] );
2931 pGateTruth[3] = '0';
2932 pGateTruth[4] = '\0';
2933
2934 /* primary inputs */
2935 for ( i = 0; i < nVars; ++i )
2936 {
2937 assert( pFanins[i] );
2938 Vec_PtrPush( pGates, pFanins[i] );
2939 }
2940
2941 /* gates */
2942 p = pSol + 3;
2943 for ( i = 0; i < pSol[ABC_EXACT_SOL_NGATES]; ++i )
2944 {
2945 pGateTruth[2] = '0' + ( *p & 1 );
2946 pGateTruth[1] = '0' + ( ( *p >> 1 ) & 1 );
2947 pGateTruth[0] = '0' + ( ( *p >> 2 ) & 1 );
2948 ++p;
2949
2950 assert( *p == 2 ); /* binary gate */
2951 ++p;
2952
2953 /* invert truth table if we are last gate and inverted */
2954 if ( i + 1 == pSol[ABC_EXACT_SOL_NGATES] && Abc_LitIsCompl( *( p + 2 ) ) )
2955 for ( j = 0; j < 4; ++j )
2956 pGateTruth[j] = ( pGateTruth[j] == '0' ) ? '1' : '0';
2957
2958 pSopCover = Abc_SopFromTruthBin( pGateTruth );
2959 pObj = Abc_NtkCreateNode( pNtk );
2960 assert( pObj );
2961 pObj->pData = Abc_SopRegister( (Mem_Flex_t*)pNtk->pManFunc, pSopCover );
2962 Vec_PtrPush( pGates, pObj );
2963 ABC_FREE( pSopCover );
2964
2965 Abc_ObjAddFanin( pObj, (Abc_Obj_t *)Vec_PtrEntry( pGates, *p++ ) );
2966 Abc_ObjAddFanin( pObj, (Abc_Obj_t *)Vec_PtrEntry( pGates, *p++ ) );
2967 }
2968
2969 /* output */
2970 pObj = (Abc_Obj_t *)Vec_PtrEntry( pGates, nVars + Abc_Lit2Var( *p ) );
2971
2972 Vec_PtrFree( pGates );
2973
2974 s_pSesStore->timeTotal += ( Abc_Clock() - timeStart );
2975 return pObj;
2976}
#define ABC_EXACT_SOL_NGATES
Definition abcExact.c:205
int Ses_StoreGetEntry(Ses_Store_t *pStore, word *pTruth, int nVars, int *pArrTimeProfile, char **pSol)
Definition abcExact.c:768
#define ABC_EXACT_SOL_NVARS
Definition abcExact.c:203
#define ABC_EXACT_SOL_NFUNC
Definition abcExact.c:204
ABC_DLL void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
Definition abcFanio.c:84
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeConst1(Abc_Ntk_t *pNtk)
Definition abcObj.c:643
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeBuf(Abc_Ntk_t *pNtk, Abc_Obj_t *pFanin)
Definition abcObj.c:706
ABC_DLL char * Abc_SopFromTruthBin(char *pTruth)
Definition abcSop.c:964
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeConst0(Abc_Ntk_t *pNtk)
Definition abcObj.c:612
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeInv(Abc_Ntk_t *pNtk, Abc_Obj_t *pFanin)
Definition abcObj.c:674
ABC_DLL char * Abc_SopRegister(Mem_Flex_t *pMan, const char *pName)
DECLARATIONS ///.
Definition abcSop.c:62
ABC_INT64_T abctime
Definition abc_global.h:332
struct Mem_Flex_t_ Mem_Flex_t
Definition mem.h:34
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_ExactInputNum()

ABC_DLL int Abc_ExactInputNum ( )
extern

Definition at line 2611 of file abcExact.c.

2612{
2613 return 8;
2614}

◆ Abc_ExactIsRunning()

ABC_DLL int Abc_ExactIsRunning ( )
extern

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

Synopsis [APIs for integraging with the mapper.]

Definition at line 2605 of file abcExact.c.

2606{
2607 return s_pSesStore != NULL;
2608}

◆ Abc_ManTimeDup()

ABC_DLL void Abc_ManTimeDup ( Abc_Ntk_t * pNtkOld,
Abc_Ntk_t * pNtkNew )
extern

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

Synopsis [Duplicates the timing manager with the PI/PO timing info.]

Description [The PIs/POs of the new network should be allocated.]

SideEffects []

SeeAlso []

Definition at line 573 of file abcTiming.c.

574{
575 extern void Abc_NtkTimePrint( Abc_Ntk_t * pNtk );
576
577 Abc_Obj_t * pObj;
578 Abc_Time_t ** ppTimesOld, ** ppTimesNew;
579 int i;
580 if ( pNtkOld->pManTime == NULL )
581 return;
582 assert( Abc_NtkCiNum(pNtkOld) == Abc_NtkCiNum(pNtkNew) );
583 assert( Abc_NtkCoNum(pNtkOld) == Abc_NtkCoNum(pNtkNew) );
584 assert( Abc_NtkLatchNum(pNtkOld) == Abc_NtkLatchNum(pNtkNew) );
585 // create the new timing manager
586 pNtkNew->pManTime = Abc_ManTimeStart(pNtkNew);
587 Abc_ManTimeExpand( pNtkNew->pManTime, Abc_NtkObjNumMax(pNtkNew), 0 );
588 // set the default timing
589 pNtkNew->pManTime->tArrDef = pNtkOld->pManTime->tArrDef;
590 pNtkNew->pManTime->tReqDef = pNtkOld->pManTime->tReqDef;
591 // set the CI timing
592 ppTimesOld = (Abc_Time_t **)pNtkOld->pManTime->vArrs->pArray;
593 ppTimesNew = (Abc_Time_t **)pNtkNew->pManTime->vArrs->pArray;
594 Abc_NtkForEachCi( pNtkOld, pObj, i )
595 *ppTimesNew[ Abc_NtkCi(pNtkNew,i)->Id ] = *ppTimesOld[ pObj->Id ];
596 // set the CO timing
597 ppTimesOld = (Abc_Time_t **)pNtkOld->pManTime->vReqs->pArray;
598 ppTimesNew = (Abc_Time_t **)pNtkNew->pManTime->vReqs->pArray;
599 Abc_NtkForEachCo( pNtkOld, pObj, i )
600 *ppTimesNew[ Abc_NtkCo(pNtkNew,i)->Id ] = *ppTimesOld[ pObj->Id ];
601 // duplicate input drive
602 pNtkNew->pManTime->tInDriveDef = pNtkOld->pManTime->tInDriveDef;
603 pNtkNew->pManTime->tOutLoadDef = pNtkOld->pManTime->tOutLoadDef;
604 if ( pNtkOld->pManTime->tInDrive )
605 {
606 pNtkNew->pManTime->tInDrive = ABC_ALLOC( Abc_Time_t, Abc_NtkCiNum(pNtkOld) );
607 memcpy( pNtkNew->pManTime->tInDrive, pNtkOld->pManTime->tInDrive, sizeof(Abc_Time_t) * Abc_NtkCiNum(pNtkOld) );
608 }
609 if ( pNtkOld->pManTime->tOutLoad )
610 {
611 pNtkNew->pManTime->tOutLoad = ABC_ALLOC( Abc_Time_t, Abc_NtkCoNum(pNtkOld) );
612 memcpy( pNtkNew->pManTime->tOutLoad, pNtkOld->pManTime->tOutLoad, sizeof(Abc_Time_t) * Abc_NtkCoNum(pNtkOld) );
613 }
614
615
616}
void Abc_NtkTimePrint(Abc_Ntk_t *pNtk)
Definition abcTiming.c:629
struct Abc_Time_t_ Abc_Time_t
Definition abc.h:120
#define Abc_NtkForEachCi(pNtk, pCi, i)
Definition abc.h:518
Vec_Ptr_t * vArrs
Definition abcTiming.c:40
Abc_Time_t * tOutLoad
Definition abcTiming.c:45
Abc_Time_t * tInDrive
Definition abcTiming.c:44
Abc_Time_t tReqDef
Definition abcTiming.c:39
Abc_Time_t tArrDef
Definition abcTiming.c:38
Abc_Time_t tInDriveDef
Definition abcTiming.c:42
Abc_Time_t tOutLoadDef
Definition abcTiming.c:43
Vec_Ptr_t * vReqs
Definition abcTiming.c:41
Abc_ManTime_t * pManTime
Definition abc.h:192
char * memcpy()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_ManTimeStop()

ABC_DLL void Abc_ManTimeStop ( Abc_ManTime_t * p)
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 547 of file abcTiming.c.

548{
549 if ( p->tInDrive )
550 ABC_FREE( p->tInDrive );
551 if ( p->tOutLoad )
552 ABC_FREE( p->tOutLoad );
553 if ( Vec_PtrSize(p->vArrs) > 0 )
554 ABC_FREE( p->vArrs->pArray[0] );
555 Vec_PtrFree( p->vArrs );
556 if ( Vec_PtrSize(p->vReqs) > 0 )
557 ABC_FREE( p->vReqs->pArray[0] );
558 Vec_PtrFree( p->vReqs );
559 ABC_FREE( p );
560}
Here is the caller graph for this function:

◆ Abc_NodeBddToCnf()

ABC_DLL void Abc_NodeBddToCnf ( Abc_Obj_t * pNode,
Mem_Flex_t * pMmMan,
Vec_Str_t * vCube,
int fAllPrimes,
char ** ppSop0,
char ** ppSop1 )
extern

Definition at line 867 of file abcFunc.c.

867{}
Here is the caller graph for this function:

◆ Abc_NodeCollectFanins()

ABC_DLL void Abc_NodeCollectFanins ( Abc_Obj_t * pNode,
Vec_Ptr_t * vNodes )
extern

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

Synopsis [Returns 1 if it is an AIG with choice nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 1627 of file abcUtil.c.

1628{
1629 Abc_Obj_t * pFanin;
1630 int i;
1631 Vec_PtrClear(vNodes);
1632 Abc_ObjForEachFanin( pNode, pFanin, i )
1633 Vec_PtrPush( vNodes, pFanin );
1634}
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition abc.h:527
Here is the caller graph for this function:

◆ Abc_NodeCollectFanouts()

ABC_DLL void Abc_NodeCollectFanouts ( Abc_Obj_t * pNode,
Vec_Ptr_t * vNodes )
extern

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

Synopsis [Returns 1 if it is an AIG with choice nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 1647 of file abcUtil.c.

1648{
1649 Abc_Obj_t * pFanout;
1650 int i;
1651 Vec_PtrClear(vNodes);
1652 Abc_ObjForEachFanout( pNode, pFanout, i )
1653 Vec_PtrPush( vNodes, pFanout );
1654}
Here is the caller graph for this function:

◆ Abc_NodeCollectTfoCands()

ABC_DLL Vec_Ptr_t * Abc_NodeCollectTfoCands ( Abc_ManCut_t * p,
Abc_Obj_t * pRoot,
Vec_Ptr_t * vLeaves,
int LevelMax )
extern

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

Synopsis [Collects the TFO of the cut in the topological order.]

Description [TFO of the cut is defined as a set of nodes, for which the cut is a cut, that is, every path from the collected nodes to the CIs goes through a node in the cut. The nodes are collected if their level does not exceed the given number (LevelMax). The nodes are returned in the topological order. If the root node is given, its MFFC is marked, so that the collected nodes do not contain any nodes in the MFFC.]

SideEffects []

SeeAlso []

Definition at line 699 of file abcReconv.c.

700{
701 Abc_Ntk_t * pNtk = pRoot->pNtk;
702 Vec_Ptr_t * vVec;
703 Abc_Obj_t * pNode, * pFanout;
704 int i, k, v, LevelMin;
705 assert( Abc_NtkIsStrash(pNtk) );
706
707 // assuming that the structure is clean
708 Vec_VecForEachLevel( p->vLevels, vVec, i )
709 assert( vVec->nSize == 0 );
710
711 // put fanins into the structure while labeling them
712 Abc_NtkIncrementTravId( pNtk );
713 LevelMin = -1;
714 Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pNode, i )
715 {
716 if ( pNode->Level > (unsigned)LevelMax )
717 continue;
718 Abc_NodeSetTravIdCurrent( pNode );
719 Vec_VecPush( p->vLevels, pNode->Level, pNode );
720 if ( LevelMin < (int)pNode->Level )
721 LevelMin = pNode->Level;
722 }
723 assert( LevelMin >= 0 );
724
725 // mark MFFC
726 if ( pRoot )
727 Abc_NodeMffcLabelAig( pRoot );
728
729 // go through the levels up
730 Vec_PtrClear( p->vNodesTfo );
731 Vec_VecForEachEntryStart( Abc_Obj_t *, p->vLevels, pNode, i, k, LevelMin )
732 {
733 if ( i > LevelMax )
734 break;
735 // if the node is not marked, it is not a fanin
736 if ( !Abc_NodeIsTravIdCurrent(pNode) )
737 {
738 // check if it belongs to the TFO
739 if ( !Abc_NodeIsTravIdCurrent(Abc_ObjFanin0(pNode)) ||
740 !Abc_NodeIsTravIdCurrent(Abc_ObjFanin1(pNode)) )
741 continue;
742 // save the node in the TFO and label it
743 Vec_PtrPush( p->vNodesTfo, pNode );
744 Abc_NodeSetTravIdCurrent( pNode );
745 }
746 // go through the fanouts and add them to the structure if they meet the conditions
747 Abc_ObjForEachFanout( pNode, pFanout, v )
748 {
749 // skip if fanout is a CO or its level exceeds
750 if ( Abc_ObjIsCo(pFanout) || pFanout->Level > (unsigned)LevelMax )
751 continue;
752 // skip if it is already added or if it is in MFFC
753 if ( Abc_NodeIsTravIdCurrent(pFanout) )
754 continue;
755 // add it to the structure but do not mark it (until tested later)
756 Vec_VecPushUnique( p->vLevels, pFanout->Level, pFanout );
757 }
758 }
759
760 // clear the levelized structure
761 Vec_VecForEachLevelStart( p->vLevels, vVec, i, LevelMin )
762 {
763 if ( i > LevelMax )
764 break;
765 Vec_PtrClear( vVec );
766 }
767 return p->vNodesTfo;
768}
ABC_DLL int Abc_NodeMffcLabelAig(Abc_Obj_t *pNode)
Definition abcRefs.c:100
#define Vec_VecForEachEntryStart(Type, vGlob, pEntry, i, k, LevelStart)
Definition vecVec.h:92
#define Vec_VecForEachLevelStart(vGlob, vVec, i, LevelStart)
Definition vecVec.h:57
#define Vec_VecForEachLevel(vGlob, vVec, i)
MACRO DEFINITIONS ///.
Definition vecVec.h:55
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeCompareLevelsDecrease()

ABC_DLL int Abc_NodeCompareLevelsDecrease ( Abc_Obj_t ** pp1,
Abc_Obj_t ** pp2 )
extern

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

Synopsis [Procedure used for sorting the nodes in decreasing order of levels.]

Description []

SideEffects []

SeeAlso []

Definition at line 1715 of file abcUtil.c.

1716{
1717 int Diff = Abc_ObjRegular(*pp1)->Level - Abc_ObjRegular(*pp2)->Level;
1718 if ( Diff > 0 )
1719 return -1;
1720 if ( Diff < 0 )
1721 return 1;
1722 Diff = Abc_ObjRegular(*pp1)->Id - Abc_ObjRegular(*pp2)->Id;
1723 if ( Diff > 0 )
1724 return -1;
1725 if ( Diff < 0 )
1726 return 1;
1727 return 0;
1728}

◆ Abc_NodeCompareLevelsIncrease()

ABC_DLL int Abc_NodeCompareLevelsIncrease ( Abc_Obj_t ** pp1,
Abc_Obj_t ** pp2 )
extern

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

Synopsis [Procedure used for sorting the nodes in increasing order of levels.]

Description []

SideEffects []

SeeAlso []

Definition at line 1689 of file abcUtil.c.

1690{
1691 int Diff = Abc_ObjRegular(*pp1)->Level - Abc_ObjRegular(*pp2)->Level;
1692 if ( Diff < 0 )
1693 return -1;
1694 if ( Diff > 0 )
1695 return 1;
1696 Diff = Abc_ObjRegular(*pp1)->Id - Abc_ObjRegular(*pp2)->Id;
1697 if ( Diff < 0 )
1698 return -1;
1699 if ( Diff > 0 )
1700 return 1;
1701 return 0;
1702}
Here is the caller graph for this function:

◆ Abc_NodeCompareNames()

ABC_DLL int Abc_NodeCompareNames ( Abc_Obj_t ** pp1,
Abc_Obj_t ** pp2 )
extern

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

Synopsis [Orders PIs/POs/latches alphabetically.]

Description []

SideEffects []

SeeAlso []

Definition at line 316 of file abcNames.c.

317{
318 int Diff = strcmp( (char *)(*pp1)->pCopy, (char *)(*pp2)->pCopy );
319 if ( Diff < 0 )
320 return -1;
321 if ( Diff > 0 )
322 return 1;
323 Diff = (*pp1)->Id - (*pp2)->Id;
324 if ( Diff < 0 )
325 return -1;
326 if ( Diff > 0 )
327 return 1;
328 return 0;
329}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeComplement()

ABC_DLL void Abc_NodeComplement ( Abc_Obj_t * pNode)
extern

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

Synopsis [Complements the local functions of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 1012 of file abcObj.c.

1013{
1014 assert( Abc_NtkIsLogic(pNode->pNtk) || Abc_NtkIsNetlist(pNode->pNtk) );
1015 assert( Abc_ObjIsNode(pNode) );
1016 if ( Abc_NtkHasSop(pNode->pNtk) )
1017 Abc_SopComplement( (char *)pNode->pData );
1018 else if ( Abc_NtkHasAig(pNode->pNtk) )
1019 pNode->pData = Hop_Not( (Hop_Obj_t *)pNode->pData );
1020#ifdef ABC_USE_CUDD
1021 else if ( Abc_NtkHasBdd(pNode->pNtk) )
1022 pNode->pData = Cudd_Not( pNode->pData );
1023#endif
1024 else
1025 assert( 0 );
1026}
ABC_DLL void Abc_SopComplement(char *pSop)
Definition abcSop.c:648
struct Hop_Obj_t_ Hop_Obj_t
Definition hop.h:50
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeComplementInput()

ABC_DLL void Abc_NodeComplementInput ( Abc_Obj_t * pNode,
Abc_Obj_t * pFanin )
extern

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

Synopsis [Changes the polarity of one fanin.]

Description []

SideEffects []

SeeAlso []

Definition at line 1039 of file abcObj.c.

1040{
1041 int iFanin;
1042 if ( (iFanin = Vec_IntFind( &pNode->vFanins, pFanin->Id )) == -1 )
1043 {
1044 printf( "Node %s should be among", Abc_ObjName(pFanin) );
1045 printf( " the fanins of node %s...\n", Abc_ObjName(pNode) );
1046 return;
1047 }
1048 if ( Abc_NtkHasSop(pNode->pNtk) )
1049 Abc_SopComplementVar( (char *)pNode->pData, iFanin );
1050 else if ( Abc_NtkHasAig(pNode->pNtk) )
1051 pNode->pData = Hop_Complement( (Hop_Man_t *)pNode->pNtk->pManFunc, (Hop_Obj_t *)pNode->pData, iFanin );
1052#ifdef ABC_USE_CUDD
1053 else if ( Abc_NtkHasBdd(pNode->pNtk) )
1054 {
1055 DdManager * dd = (DdManager *)pNode->pNtk->pManFunc;
1056 DdNode * bVar, * bCof0, * bCof1;
1057 bVar = Cudd_bddIthVar( dd, iFanin );
1058 bCof0 = Cudd_Cofactor( dd, (DdNode *)pNode->pData, Cudd_Not(bVar) ); Cudd_Ref( bCof0 );
1059 bCof1 = Cudd_Cofactor( dd, (DdNode *)pNode->pData, bVar ); Cudd_Ref( bCof1 );
1060 Cudd_RecursiveDeref( dd, (DdNode *)pNode->pData );
1061 pNode->pData = Cudd_bddIte( dd, bVar, bCof0, bCof1 ); Cudd_Ref( (DdNode *)pNode->pData );
1062 Cudd_RecursiveDeref( dd, bCof0 );
1063 Cudd_RecursiveDeref( dd, bCof1 );
1064 }
1065#endif
1066 else
1067 assert( 0 );
1068}
ABC_DLL void Abc_SopComplementVar(char *pSop, int iVar)
Definition abcSop.c:678
Hop_Obj_t * Hop_Complement(Hop_Man_t *p, Hop_Obj_t *pRoot, int iVar)
Definition hopDfs.c:469
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeConeCollect()

ABC_DLL void Abc_NodeConeCollect ( Abc_Obj_t ** ppRoots,
int nRoots,
Vec_Ptr_t * vLeaves,
Vec_Ptr_t * vVisited,
int fIncludeFanins )
extern

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

Synopsis [Get the nodes contained in the cut.]

Description []

SideEffects []

SeeAlso []

Definition at line 444 of file abcReconv.c.

445{
446 Abc_Obj_t * pTemp;
447 int i;
448 // mark the fanins of the cone
449 Abc_NodesMark( vLeaves );
450 // collect the nodes in the DFS order
451 Vec_PtrClear( vVisited );
452 // add the fanins
453 if ( fIncludeFanins )
454 Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pTemp, i )
455 Vec_PtrPush( vVisited, pTemp );
456 // add other nodes
457 for ( i = 0; i < nRoots; i++ )
458 Abc_NodeConeMarkCollect_rec( ppRoots[i], vVisited );
459 // unmark both sets
460 Abc_NodesUnmark( vLeaves );
461 Abc_NodesUnmark( vVisited );
462}
Here is the caller graph for this function:

◆ Abc_NodeConvertSopToMvSop()

ABC_DLL char * Abc_NodeConvertSopToMvSop ( int nVars,
Vec_Int_t * vSop0,
Vec_Int_t * vSop1 )
extern

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

Synopsis [Converts SOP into MV-SOP.]

Description []

SideEffects []

SeeAlso []

Definition at line 1033 of file abcBlifMv.c.

1034{
1035 char * pMvSop, * pCur;
1036 unsigned uCube;
1037 int nCubes, nSize, Value, i, k;
1038 // consider the case of the constant node
1039 if ( Vec_IntSize(vSop0) == 0 || Vec_IntSize(vSop1) == 0 )
1040 {
1041 // (temporary) create a tautology cube
1042 pMvSop = ABC_ALLOC( char, nVars + 3 );
1043 for ( k = 0; k < nVars; k++ )
1044 pMvSop[k] = '-';
1045 pMvSop[nVars] = '0' + (int)(Vec_IntSize(vSop1) > 0);
1046 pMvSop[nVars+1] = '\n';
1047 pMvSop[nVars+2] = 0;
1048 return pMvSop;
1049 }
1050 // find the total number of cubes
1051 nCubes = Vec_IntSize(vSop0) + Vec_IntSize(vSop1);
1052 // find the size of the MVSOP represented as a C-string
1053 // (each cube has nVars variables + one output literal + end-of-line,
1054 // and the string is zero-terminated)
1055 nSize = nCubes * (nVars + 2) + 1;
1056 // allocate memory
1057 pMvSop = pCur = ABC_ALLOC( char, nSize );
1058 // fill in the negative polarity cubes
1059 Vec_IntForEachEntry( vSop0, uCube, i )
1060 {
1061 for ( k = 0; k < nVars; k++ )
1062 {
1063 Value = (uCube >> (2*k)) & 3;
1064 if ( Value == 1 )
1065 *pCur++ = '0';
1066 else if ( Value == 2 )
1067 *pCur++ = '1';
1068 else if ( Value == 0 )
1069 *pCur++ = '-';
1070 else
1071 assert( 0 );
1072 }
1073 *pCur++ = '0';
1074 *pCur++ = '\n';
1075 }
1076 // fill in the positive polarity cubes
1077 Vec_IntForEachEntry( vSop1, uCube, i )
1078 {
1079 for ( k = 0; k < nVars; k++ )
1080 {
1081 Value = (uCube >> (2*k)) & 3;
1082 if ( Value == 1 )
1083 *pCur++ = '0';
1084 else if ( Value == 2 )
1085 *pCur++ = '1';
1086 else if ( Value == 0 )
1087 *pCur++ = '-';
1088 else
1089 assert( 0 );
1090 }
1091 *pCur++ = '1';
1092 *pCur++ = '\n';
1093 }
1094 *pCur++ = 0;
1095 assert( pCur - pMvSop == nSize );
1096 return pMvSop;
1097}
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition vecInt.h:54
Here is the caller graph for this function:

◆ Abc_NodeDeref_rec()

ABC_DLL int Abc_NodeDeref_rec ( Abc_Obj_t * pNode)
extern

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

Synopsis [Dereferences the node's MFFC.]

Description []

SideEffects []

SeeAlso []

Definition at line 215 of file abcRefs.c.

216{
217 Abc_Obj_t * pFanin;
218 int i, Counter = 1;
219 if ( Abc_ObjIsCi(pNode) )
220 return 0;
221 Abc_ObjForEachFanin( pNode, pFanin, i )
222 {
223 assert( pFanin->vFanouts.nSize > 0 );
224 if ( --pFanin->vFanouts.nSize == 0 )
225 Counter += Abc_NodeDeref_rec( pFanin );
226 }
227 return Counter;
228}
int Abc_NodeDeref_rec(Abc_Obj_t *pNode)
Definition abcRefs.c:215
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeEvalMvCost()

ABC_DLL int Abc_NodeEvalMvCost ( int nVars,
Vec_Int_t * vSop0,
Vec_Int_t * vSop1 )
extern

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

Synopsis [Evaluates the cost of the cut.]

Description [The Boolean function of the cut is specified by two SOPs, which represent the negative/positive polarities of the cut function. Converts these two SOPs into a mutually-agreed-upon representation to be passed to the internal cost-evaluation procedure (see the above prototype Abc_NodeEvalMvCostInternal).]

SideEffects []

SeeAlso []

Definition at line 1140 of file abcBlifMv.c.

1141{
1142 char * pMvSop;
1143 int * pVarValues;
1144 int i, RetValue;
1145 // collect the input and output values (currently, they are binary)
1146 pVarValues = ABC_ALLOC( int, nVars + 1 );
1147 for ( i = 0; i <= nVars; i++ )
1148 pVarValues[i] = 2;
1149 // prepare MV-SOP for evaluation
1150 pMvSop = Abc_NodeConvertSopToMvSop( nVars, vSop0, vSop1 );
1151 // have a look at the MV-SOP:
1152// printf( "%s\n", pMvSop );
1153 // get the result of internal cost evaluation
1154 RetValue = Abc_NodeEvalMvCostInternal( nVars, pVarValues, pMvSop );
1155 // cleanup
1156 ABC_FREE( pVarValues );
1157 ABC_FREE( pMvSop );
1158 return RetValue;
1159}
int Abc_NodeEvalMvCostInternal(int nVars, int *pVarValues, char *pMvSop)
Definition abcBlifMv.c:1116
char * Abc_NodeConvertSopToMvSop(int nVars, Vec_Int_t *vSop0, Vec_Int_t *vSop1)
Definition abcBlifMv.c:1033
Here is the call graph for this function:

◆ Abc_NodeFindCoFanout()

ABC_DLL Abc_Obj_t * Abc_NodeFindCoFanout ( Abc_Obj_t * pNode)
extern

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

Synopsis [Checks if the internal node has CO fanout.]

Description []

SideEffects []

SeeAlso []

Definition at line 812 of file abcUtil.c.

813{
814 Abc_Obj_t * pFanout;
815 int i;
816 Abc_ObjForEachFanout( pNode, pFanout, i )
817 if ( Abc_ObjIsCo(pFanout) )
818 return pFanout;
819 return NULL;
820}
Here is the caller graph for this function:

◆ Abc_NodeFindCut()

ABC_DLL Vec_Ptr_t * Abc_NodeFindCut ( Abc_ManCut_t * p,
Abc_Obj_t * pRoot,
int fContain )
extern

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

Synopsis [Finds a fanin-limited, reconvergence-driven cut for the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 256 of file abcReconv.c.

257{
258 Abc_Obj_t * pNode;
259 int i;
260
261 assert( !Abc_ObjIsComplement(pRoot) );
262 assert( Abc_ObjIsNode(pRoot) );
263
264 // start the visited nodes and mark them
265 Vec_PtrClear( p->vVisited );
266 Vec_PtrPush( p->vVisited, pRoot );
267 Vec_PtrPush( p->vVisited, Abc_ObjFanin0(pRoot) );
268 Vec_PtrPush( p->vVisited, Abc_ObjFanin1(pRoot) );
269 pRoot->fMarkB = 1;
270 Abc_ObjFanin0(pRoot)->fMarkB = 1;
271 Abc_ObjFanin1(pRoot)->fMarkB = 1;
272
273 // start the cut
274 Vec_PtrClear( p->vNodeLeaves );
275 Vec_PtrPush( p->vNodeLeaves, Abc_ObjFanin0(pRoot) );
276 Vec_PtrPush( p->vNodeLeaves, Abc_ObjFanin1(pRoot) );
277
278 // compute the cut
279 while ( Abc_NodeBuildCutLevelOne_int( p->vVisited, p->vNodeLeaves, p->nNodeSizeMax, p->nNodeFanStop ) );
280 assert( Vec_PtrSize(p->vNodeLeaves) <= p->nNodeSizeMax );
281
282 // return if containing cut is not requested
283 if ( !fContain )
284 {
285 // unmark both fMarkA and fMarkB in tbe TFI
286 Abc_NodesUnmarkB( p->vVisited );
287 return p->vNodeLeaves;
288 }
289
290//printf( "\n\n\n" );
291 // compute the containing cut
292 assert( p->nNodeSizeMax < p->nConeSizeMax );
293 // copy the current boundary
294 Vec_PtrClear( p->vConeLeaves );
295 Vec_PtrForEachEntry( Abc_Obj_t *, p->vNodeLeaves, pNode, i )
296 Vec_PtrPush( p->vConeLeaves, pNode );
297 // compute the containing cut
298 while ( Abc_NodeBuildCutLevelOne_int( p->vVisited, p->vConeLeaves, p->nConeSizeMax, p->nConeFanStop ) );
299 assert( Vec_PtrSize(p->vConeLeaves) <= p->nConeSizeMax );
300 // unmark TFI using fMarkA and fMarkB
301 Abc_NodesUnmarkB( p->vVisited );
302 return p->vNodeLeaves;
303}
Here is the caller graph for this function:

◆ Abc_NodeFindFanin()

ABC_DLL int Abc_NodeFindFanin ( Abc_Obj_t * pNode,
Abc_Obj_t * pFanin )
extern

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

Synopsis [Returns the index of the given fanin.]

Description []

SideEffects []

SeeAlso []

Definition at line 791 of file abcUtil.c.

792{
793 Abc_Obj_t * pThis;
794 int i;
795 Abc_ObjForEachFanin( pNode, pThis, i )
796 if ( pThis == pFanin )
797 return i;
798 return -1;
799}
Here is the caller graph for this function:

◆ Abc_NodeFindNonCoFanout()

ABC_DLL Abc_Obj_t * Abc_NodeFindNonCoFanout ( Abc_Obj_t * pNode)
extern

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

Synopsis [Checks if the internal node has CO fanout.]

Description []

SideEffects []

SeeAlso []

Definition at line 833 of file abcUtil.c.

834{
835 Abc_Obj_t * pFanout;
836 int i;
837 Abc_ObjForEachFanout( pNode, pFanout, i )
838 if ( !Abc_ObjIsCo(pFanout) )
839 return pFanout;
840 return NULL;
841}

◆ Abc_NodeFreeCuts()

ABC_DLL void Abc_NodeFreeCuts ( void * p,
Abc_Obj_t * pObj )
extern

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

Synopsis [Computes the cuts for the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 527 of file abcCut.c.

528{
529 Cut_NodeFreeCuts( (Cut_Man_t *)p, pObj->Id );
530}
struct Cut_ManStruct_t_ Cut_Man_t
BASIC TYPES ///.
Definition cut.h:48
void Cut_NodeFreeCuts(Cut_Man_t *p, int Node)
Definition cutApi.c:184
Here is the call graph for this function:

◆ Abc_NodeFreeNames()

ABC_DLL void Abc_NodeFreeNames ( Vec_Ptr_t * vNames)
extern

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

Synopsis [Gets fanin node names.]

Description []

SideEffects []

SeeAlso []

Definition at line 264 of file abcNames.c.

265{
266 int i;
267 if ( vNames == NULL )
268 return;
269 for ( i = 0; i < vNames->nSize; i++ )
270 ABC_FREE( vNames->pArray[i] );
271 Vec_PtrFree( vNames );
272}
Here is the caller graph for this function:

◆ Abc_NodeGetCuts()

ABC_DLL void * Abc_NodeGetCuts ( void * p,
Abc_Obj_t * pObj,
int fDag,
int fTree )
extern

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

Synopsis [Computes the cuts for the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 433 of file abcCut.c.

434{
435 Abc_Obj_t * pFanin;
436 int fDagNode, fTriv, TreeCode = 0;
437// assert( Abc_NtkIsStrash(pObj->pNtk) );
438 assert( Abc_ObjFaninNum(pObj) == 2 );
439
440 // check if the node is a DAG node
441 fDagNode = (Abc_ObjFanoutNum(pObj) > 1 && !Abc_NodeIsMuxControlType(pObj));
442 // increment the counter of DAG nodes
443 if ( fDagNode ) Cut_ManIncrementDagNodes( (Cut_Man_t *)p );
444 // add the trivial cut if the node is a DAG node, or if we compute all cuts
445 fTriv = fDagNode || !fDag;
446 // check if fanins are DAG nodes
447 if ( fTree )
448 {
449 pFanin = Abc_ObjFanin0(pObj);
450 TreeCode |= (Abc_ObjFanoutNum(pFanin) > 1 && !Abc_NodeIsMuxControlType(pFanin));
451 pFanin = Abc_ObjFanin1(pObj);
452 TreeCode |= ((Abc_ObjFanoutNum(pFanin) > 1 && !Abc_NodeIsMuxControlType(pFanin)) << 1);
453 }
454
455 // changes due to the global/local cut computation
456 {
458 if ( pParams->fLocal )
459 {
460 Vec_Int_t * vNodeAttrs = Cut_ManReadNodeAttrs((Cut_Man_t *)p);
461 fDagNode = Vec_IntEntry( vNodeAttrs, pObj->Id );
462 if ( fDagNode ) Cut_ManIncrementDagNodes( (Cut_Man_t *)p );
463// fTriv = fDagNode || !pParams->fGlobal;
464 fTriv = !Vec_IntEntry( vNodeAttrs, pObj->Id );
465 TreeCode = 0;
466 pFanin = Abc_ObjFanin0(pObj);
467 TreeCode |= Vec_IntEntry( vNodeAttrs, pFanin->Id );
468 pFanin = Abc_ObjFanin1(pObj);
469 TreeCode |= (Vec_IntEntry( vNodeAttrs, pFanin->Id ) << 1);
470 }
471 }
472 return Cut_NodeComputeCuts( (Cut_Man_t *)p, pObj->Id, Abc_ObjFaninId0(pObj), Abc_ObjFaninId1(pObj),
473 Abc_ObjFaninC0(pObj), Abc_ObjFaninC1(pObj), fTriv, TreeCode );
474}
ABC_DLL int Abc_NodeIsMuxControlType(Abc_Obj_t *pNode)
Definition abcUtil.c:1398
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
void Cut_ManIncrementDagNodes(Cut_Man_t *p)
Definition cutMan.c:309
Cut_Cut_t * Cut_NodeComputeCuts(Cut_Man_t *p, int Node, int Node0, int Node1, int fCompl0, int fCompl1, int fTriv, int TreeCode)
Definition cutNode.c:369
struct Cut_ParamsStruct_t_ Cut_Params_t
Definition cut.h:51
Vec_Int_t * Cut_ManReadNodeAttrs(Cut_Man_t *p)
Definition cutMan.c:293
Cut_Params_t * Cut_ManReadParams(Cut_Man_t *p)
Definition cutMan.c:277
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeGetCutsRecursive()

ABC_DLL void * Abc_NodeGetCutsRecursive ( void * p,
Abc_Obj_t * pObj,
int fDag,
int fTree )
extern

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

Synopsis [Computes the cuts for the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 412 of file abcCut.c.

413{
414 void * pList;
415 if ( (pList = Abc_NodeReadCuts( p, pObj )) )
416 return pList;
417 Abc_NodeGetCutsRecursive( p, Abc_ObjFanin0(pObj), fDag, fTree );
418 Abc_NodeGetCutsRecursive( p, Abc_ObjFanin1(pObj), fDag, fTree );
419 return Abc_NodeGetCuts( p, pObj, fDag, fTree );
420}
void * Abc_NodeGetCutsRecursive(void *p, Abc_Obj_t *pObj, int fDag, int fTree)
Definition abcCut.c:412
void * Abc_NodeReadCuts(void *p, Abc_Obj_t *pObj)
Definition abcCut.c:511
void * Abc_NodeGetCuts(void *p, Abc_Obj_t *pObj, int fDag, int fTree)
Definition abcCut.c:433
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeGetCutsSeq()

ABC_DLL void Abc_NodeGetCutsSeq ( void * p,
Abc_Obj_t * pObj,
int fTriv )
extern

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

Synopsis [Computes the cuts for the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 487 of file abcCut.c.

488{
489/*
490 int CutSetNum;
491 assert( Abc_NtkIsSeq(pObj->pNtk) );
492 assert( Abc_ObjFaninNum(pObj) == 2 );
493 fTriv = pObj->fMarkC ? 0 : fTriv;
494 CutSetNum = pObj->fMarkC ? (int)pObj->pCopy : -1;
495 Cut_NodeComputeCutsSeq( p, pObj->Id, Abc_ObjFaninId0(pObj), Abc_ObjFaninId1(pObj),
496 Abc_ObjFaninC0(pObj), Abc_ObjFaninC1(pObj), Seq_ObjFaninL0(pObj), Seq_ObjFaninL1(pObj), fTriv, CutSetNum );
497*/
498}
Here is the call graph for this function:

◆ Abc_NodeGetFakeNames()

ABC_DLL Vec_Ptr_t * Abc_NodeGetFakeNames ( int nNames)
extern

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

Synopsis [Gets fanin node names.]

Description []

SideEffects []

SeeAlso []

Definition at line 228 of file abcNames.c.

229{
230 Vec_Ptr_t * vNames;
231 char Buffer[5];
232 int i;
233
234 vNames = Vec_PtrAlloc( nNames );
235 for ( i = 0; i < nNames; i++ )
236 {
237 if ( nNames < 26 )
238 {
239 Buffer[0] = 'a' + i;
240 Buffer[1] = 0;
241 }
242 else
243 {
244 Buffer[0] = 'a' + i%26;
245 Buffer[1] = '0' + i/26;
246 Buffer[2] = 0;
247 }
248 Vec_PtrPush( vNames, Extra_UtilStrsav(Buffer) );
249 }
250 return vNames;
251}
char * Extra_UtilStrsav(const char *s)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeGetFaninNames()

ABC_DLL Vec_Ptr_t * Abc_NodeGetFaninNames ( Abc_Obj_t * pNode)
extern

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

Synopsis [Gets fanin node names.]

Description []

SideEffects []

SeeAlso []

Definition at line 206 of file abcNames.c.

207{
208 Vec_Ptr_t * vNodes;
209 Abc_Obj_t * pFanin;
210 int i;
211 vNodes = Vec_PtrAlloc( 100 );
212 Abc_ObjForEachFanin( pNode, pFanin, i )
213 Vec_PtrPush( vNodes, Abc_UtilStrsav(Abc_ObjName(pFanin)) );
214 return vNodes;
215}
ABC_NAMESPACE_IMPL_START char * Abc_ObjName(Abc_Obj_t *pObj)
DECLARATIONS ///.
Definition abcNames.c:49
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeHasUniqueCoFanout()

ABC_DLL Abc_Obj_t * Abc_NodeHasUniqueCoFanout ( Abc_Obj_t * pNode)
extern

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

Synopsis [Checks if the internal node has CO drivers with the same name.]

Description [Checks if the internal node can borrow its name from CO fanouts. This is possible if all COs with non-complemented fanin edge pointing to this node have the same name.]

SideEffects []

SeeAlso []

Definition at line 856 of file abcUtil.c.

857{
858 Abc_Obj_t * pFanout, * pFanoutCo;
859 int i;
860 pFanoutCo = NULL;
861 Abc_ObjForEachFanout( pNode, pFanout, i )
862 {
863 if ( !Abc_ObjIsCo(pFanout) )
864 continue;
865 if ( Abc_ObjFaninC0(pFanout) )
866 continue;
867 if ( pFanoutCo == NULL )
868 {
869 assert( Abc_ObjFaninNum(pFanout) == 1 );
870 assert( Abc_ObjFanin0(pFanout) == pNode );
871 pFanoutCo = pFanout;
872 continue;
873 }
874 if ( strcmp( Abc_ObjName(pFanoutCo), Abc_ObjName(pFanout) ) ) // they have diff names
875 return NULL;
876 }
877 return pFanoutCo;
878}
Here is the call graph for this function:

◆ Abc_NodeIsBuf()

ABC_DLL int Abc_NodeIsBuf ( Abc_Obj_t * pNode)
extern

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

Synopsis [Returns 1 if the node is a buffer.]

Description []

SideEffects []

SeeAlso []

Definition at line 948 of file abcObj.c.

949{
950 Abc_Ntk_t * pNtk = pNode->pNtk;
951 assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsNetlist(pNtk) );
952 assert( Abc_ObjIsNode(pNode) );
953 if ( Abc_ObjFaninNum(pNode) != 1 )
954 return 0;
955 if ( Abc_NtkHasSop(pNtk) )
956 return Abc_SopIsBuf((char *)pNode->pData);
957#ifdef ABC_USE_CUDD
958 if ( Abc_NtkHasBdd(pNtk) )
959 return !Cudd_IsComplement(pNode->pData);
960#endif
961 if ( Abc_NtkHasAig(pNtk) )
962 return !Hop_IsComplement((Hop_Obj_t *)pNode->pData);
963 if ( Abc_NtkHasMapping(pNtk) )
965 assert( 0 );
966 return 0;
967}
ABC_DLL int Abc_SopIsBuf(char *pSop)
Definition abcSop.c:756
ABC_DLL void * Abc_FrameReadLibGen()
Definition mainFrame.c:59
struct Mio_LibraryStruct_t_ Mio_Library_t
Definition mio.h:42
Mio_Gate_t * Mio_LibraryReadBuf(Mio_Library_t *pLib)
Definition mioApi.c:49
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeIsConst()

ABC_DLL int Abc_NodeIsConst ( Abc_Obj_t * pNode)
extern

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

Synopsis [Returns 1 if the node is a constant 0 node.]

Description []

SideEffects []

SeeAlso []

Definition at line 867 of file abcObj.c.

868{
869 assert( Abc_NtkIsLogic(pNode->pNtk) || Abc_NtkIsNetlist(pNode->pNtk) );
870 return Abc_ObjIsNode(pNode) && Abc_ObjFaninNum(pNode) == 0;
871}
Here is the caller graph for this function:

◆ Abc_NodeIsConst0()

ABC_DLL int Abc_NodeIsConst0 ( Abc_Obj_t * pNode)
extern

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

Synopsis [Returns 1 if the node is a constant 0 node.]

Description []

SideEffects []

SeeAlso []

Definition at line 884 of file abcObj.c.

885{
886 Abc_Ntk_t * pNtk = pNode->pNtk;
887 assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsNetlist(pNtk) );
888 assert( Abc_ObjIsNode(pNode) );
889 if ( !Abc_NodeIsConst(pNode) )
890 return 0;
891 if ( Abc_NtkHasSop(pNtk) )
892 return Abc_SopIsConst0((char *)pNode->pData);
893#ifdef ABC_USE_CUDD
894 if ( Abc_NtkHasBdd(pNtk) )
895 return Cudd_IsComplement(pNode->pData);
896#endif
897 if ( Abc_NtkHasAig(pNtk) )
898 return Hop_IsComplement((Hop_Obj_t *)pNode->pData)? 1:0;
899 if ( Abc_NtkHasMapping(pNtk) )
901 assert( 0 );
902 return 0;
903}
int Abc_NodeIsConst(Abc_Obj_t *pNode)
Definition abcObj.c:867
ABC_DLL int Abc_SopIsConst0(char *pSop)
Definition abcSop.c:724
Mio_Gate_t * Mio_LibraryReadConst0(Mio_Library_t *pLib)
Definition mioApi.c:51
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeIsConst1()

ABC_DLL int Abc_NodeIsConst1 ( Abc_Obj_t * pNode)
extern

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

Synopsis [Returns 1 if the node is a constant 1 node.]

Description []

SideEffects []

SeeAlso []

Definition at line 916 of file abcObj.c.

917{
918 Abc_Ntk_t * pNtk = pNode->pNtk;
919 assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsNetlist(pNtk) );
920 assert( Abc_ObjIsNode(pNode) );
921 if ( !Abc_NodeIsConst(pNode) )
922 return 0;
923 if ( Abc_NtkHasSop(pNtk) )
924 return Abc_SopIsConst1((char *)pNode->pData);
925#ifdef ABC_USE_CUDD
926 if ( Abc_NtkHasBdd(pNtk) )
927 return !Cudd_IsComplement(pNode->pData);
928#endif
929 if ( Abc_NtkHasAig(pNtk) )
930 return !Hop_IsComplement((Hop_Obj_t *)pNode->pData);
931 if ( Abc_NtkHasMapping(pNtk) )
933 assert( 0 );
934 return 0;
935}
ABC_DLL int Abc_SopIsConst1(char *pSop)
Definition abcSop.c:740
Mio_Gate_t * Mio_LibraryReadConst1(Mio_Library_t *pLib)
Definition mioApi.c:52
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeIsExorType()

ABC_DLL int Abc_NodeIsExorType ( Abc_Obj_t * pNode)
extern

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

Synopsis [Returns 1 if the node is the root of EXOR/NEXOR.]

Description []

SideEffects []

SeeAlso []

Definition at line 1300 of file abcUtil.c.

1301{
1302 Abc_Obj_t * pNode0, * pNode1;
1303 // check that the node is regular
1304 assert( !Abc_ObjIsComplement(pNode) );
1305 // if the node is not AND, this is not EXOR
1306 if ( !Abc_AigNodeIsAnd(pNode) )
1307 return 0;
1308 // if the children are not complemented, this is not EXOR
1309 if ( !Abc_ObjFaninC0(pNode) || !Abc_ObjFaninC1(pNode) )
1310 return 0;
1311 // get children
1312 pNode0 = Abc_ObjFanin0(pNode);
1313 pNode1 = Abc_ObjFanin1(pNode);
1314 // if the children are not ANDs, this is not EXOR
1315 if ( Abc_ObjFaninNum(pNode0) != 2 || Abc_ObjFaninNum(pNode1) != 2 )
1316 return 0;
1317 // this is AIG, which means the fanins should be ordered
1318 assert( Abc_ObjFaninId0(pNode0) != Abc_ObjFaninId1(pNode1) ||
1319 Abc_ObjFaninId0(pNode1) != Abc_ObjFaninId1(pNode0) );
1320 // if grand children are not the same, this is not EXOR
1321 if ( Abc_ObjFaninId0(pNode0) != Abc_ObjFaninId0(pNode1) ||
1322 Abc_ObjFaninId1(pNode0) != Abc_ObjFaninId1(pNode1) )
1323 return 0;
1324 // finally, if the complemented edges are matched, this is not EXOR
1325 if ( Abc_ObjFaninC0(pNode0) == Abc_ObjFaninC0(pNode1) ||
1326 Abc_ObjFaninC1(pNode0) == Abc_ObjFaninC1(pNode1) )
1327 return 0;
1328 return 1;
1329}
Here is the caller graph for this function:

◆ Abc_NodeIsInv()

ABC_DLL int Abc_NodeIsInv ( Abc_Obj_t * pNode)
extern

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

Synopsis [Returns 1 if the node is an inverter.]

Description []

SideEffects []

SeeAlso []

Definition at line 980 of file abcObj.c.

981{
982 Abc_Ntk_t * pNtk = pNode->pNtk;
983 assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsNetlist(pNtk) );
984 assert( Abc_ObjIsNode(pNode) );
985 if ( Abc_ObjFaninNum(pNode) != 1 )
986 return 0;
987 if ( Abc_NtkHasSop(pNtk) )
988 return Abc_SopIsInv((char *)pNode->pData);
989#ifdef ABC_USE_CUDD
990 if ( Abc_NtkHasBdd(pNtk) )
991 return Cudd_IsComplement(pNode->pData);
992#endif
993 if ( Abc_NtkHasAig(pNtk) )
994 return Hop_IsComplement((Hop_Obj_t *)pNode->pData)? 1:0;
995 if ( Abc_NtkHasMapping(pNtk) )
997 assert( 0 );
998 return 0;
999}
ABC_DLL int Abc_SopIsInv(char *pSop)
Definition abcSop.c:776
Mio_Gate_t * Mio_LibraryReadInv(Mio_Library_t *pLib)
Definition mioApi.c:50
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeIsMuxControlType()

ABC_DLL int Abc_NodeIsMuxControlType ( Abc_Obj_t * pNode)
extern

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

Synopsis [Returns 1 if the node is the control type of the MUX.]

Description []

SideEffects []

SeeAlso []

Definition at line 1398 of file abcUtil.c.

1399{
1400 Abc_Obj_t * pNode0, * pNode1;
1401 // check that the node is regular
1402 assert( !Abc_ObjIsComplement(pNode) );
1403 // skip the node that do not have two fanouts
1404 if ( Abc_ObjFanoutNum(pNode) != 2 )
1405 return 0;
1406 // get the fanouts
1407 pNode0 = Abc_ObjFanout( pNode, 0 );
1408 pNode1 = Abc_ObjFanout( pNode, 1 );
1409 // if they have more than one fanout, we are not interested
1410 if ( Abc_ObjFanoutNum(pNode0) != 1 || Abc_ObjFanoutNum(pNode1) != 1 )
1411 return 0;
1412 // if the fanouts have the same fanout, this is MUX or EXOR (or a redundant gate (CA)(CB))
1413 return Abc_ObjFanout0(pNode0) == Abc_ObjFanout0(pNode1);
1414}
Here is the caller graph for this function:

◆ Abc_NodeIsMuxType()

ABC_DLL int Abc_NodeIsMuxType ( Abc_Obj_t * pNode)
extern

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

Synopsis [Returns 1 if the node is the root of MUX or EXOR/NEXOR.]

Description []

SideEffects []

SeeAlso []

Definition at line 1342 of file abcUtil.c.

1343{
1344 Abc_Obj_t * pNode0, * pNode1;
1345 // check that the node is regular
1346 assert( !Abc_ObjIsComplement(pNode) );
1347 // if the node is not AND, this is not MUX
1348 if ( !Abc_AigNodeIsAnd(pNode) )
1349 return 0;
1350 // if the children are not complemented, this is not MUX
1351 if ( !Abc_ObjFaninC0(pNode) || !Abc_ObjFaninC1(pNode) )
1352 return 0;
1353 // get children
1354 pNode0 = Abc_ObjFanin0(pNode);
1355 pNode1 = Abc_ObjFanin1(pNode);
1356 // if the children are not ANDs, this is not MUX
1357 if ( !Abc_AigNodeIsAnd(pNode0) || !Abc_AigNodeIsAnd(pNode1) )
1358 return 0;
1359 // otherwise the node is MUX iff it has a pair of equal grandchildren with opposite polarity
1360 return (Abc_ObjFaninId0(pNode0) == Abc_ObjFaninId0(pNode1) && (Abc_ObjFaninC0(pNode0) ^ Abc_ObjFaninC0(pNode1))) ||
1361 (Abc_ObjFaninId0(pNode0) == Abc_ObjFaninId1(pNode1) && (Abc_ObjFaninC0(pNode0) ^ Abc_ObjFaninC1(pNode1))) ||
1362 (Abc_ObjFaninId1(pNode0) == Abc_ObjFaninId0(pNode1) && (Abc_ObjFaninC1(pNode0) ^ Abc_ObjFaninC0(pNode1))) ||
1363 (Abc_ObjFaninId1(pNode0) == Abc_ObjFaninId1(pNode1) && (Abc_ObjFaninC1(pNode0) ^ Abc_ObjFaninC1(pNode1)));
1364}
Here is the caller graph for this function:

◆ Abc_NodeMffcConeSupp()

ABC_DLL void Abc_NodeMffcConeSupp ( Abc_Obj_t * pNode,
Vec_Ptr_t * vCone,
Vec_Ptr_t * vSupp )
extern

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

Synopsis [Collects the support of the derefed MFFC.]

Description []

SideEffects []

SeeAlso []

Definition at line 299 of file abcRefs.c.

300{
301 assert( Abc_ObjIsNode(pNode) );
302 assert( !Abc_ObjIsComplement(pNode) );
303 if ( vCone ) Vec_PtrClear( vCone );
304 if ( vSupp ) Vec_PtrClear( vSupp );
305 Abc_NtkIncrementTravId( pNode->pNtk );
306 Abc_NodeMffcConeSupp_rec( pNode, vCone, vSupp, 1 );
307// printf( "\n" );
308}
void Abc_NodeMffcConeSupp_rec(Abc_Obj_t *pNode, Vec_Ptr_t *vCone, Vec_Ptr_t *vSupp, int fTopmost)
Definition abcRefs.c:266
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeMffcLabel()

ABC_DLL int Abc_NodeMffcLabel ( Abc_Obj_t * pNode,
Vec_Ptr_t * vNodes )
extern

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

Synopsis [Collects the internal nodes of the MFFC limited by cut.]

Description []

SideEffects [Increments the trav ID and marks visited nodes.]

SeeAlso []

Definition at line 439 of file abcRefs.c.

440{
441 int Count1, Count2;
442 // dereference the node
443 Count1 = Abc_NodeDeref_rec( pNode );
444 // collect the nodes inside the MFFC
445 Abc_NtkIncrementTravId( pNode->pNtk );
446 Abc_NodeMffcLabel_rec( pNode, 1, vNodes );
447 // reference it back
448 Count2 = Abc_NodeRef_rec( pNode );
449 assert( Count1 == Count2 );
450 return Count1;
451}
int Abc_NodeRef_rec(Abc_Obj_t *pNode)
Definition abcRefs.c:241
void Abc_NodeMffcLabel_rec(Abc_Obj_t *pNode, int fTopmost, Vec_Ptr_t *vNodes)
Definition abcRefs.c:408
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeMffcLabelAig()

ABC_DLL int Abc_NodeMffcLabelAig ( Abc_Obj_t * pNode)
extern

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

Synopsis [Labels MFFC with the current traversal ID.]

Description []

SideEffects []

SeeAlso []

Definition at line 100 of file abcRefs.c.

101{
102 int nConeSize1, nConeSize2;
103 assert( Abc_NtkIsStrash(pNode->pNtk) );
104 assert( !Abc_ObjIsComplement( pNode ) );
105 assert( Abc_ObjIsNode( pNode ) );
106 if ( Abc_ObjFaninNum(pNode) == 0 )
107 return 0;
108 nConeSize1 = Abc_NodeRefDeref( pNode, 0, 1 ); // dereference
109 nConeSize2 = Abc_NodeRefDeref( pNode, 1, 0 ); // reference
110 assert( nConeSize1 == nConeSize2 );
111 assert( nConeSize1 > 0 );
112 return nConeSize1;
113}
Here is the caller graph for this function:

◆ Abc_NodeMffcSize()

ABC_DLL int Abc_NodeMffcSize ( Abc_Obj_t * pNode)
extern

FUNCTION DEFINITIONS ///.

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

Synopsis [Returns the MFFC size.]

Description []

SideEffects []

SeeAlso []

Definition at line 48 of file abcRefs.c.

49{
50 int nConeSize1, nConeSize2;
51// assert( Abc_NtkIsStrash(pNode->pNtk) );
52// assert( !Abc_ObjIsComplement( pNode ) );
53 assert( Abc_ObjIsNode( pNode ) );
54 if ( Abc_ObjFaninNum(pNode) == 0 )
55 return 0;
56 nConeSize1 = Abc_NodeRefDeref( pNode, 0, 0 ); // dereference
57 nConeSize2 = Abc_NodeRefDeref( pNode, 1, 0 ); // reference
58 assert( nConeSize1 == nConeSize2 );
59 assert( nConeSize1 > 0 );
60 return nConeSize1;
61}
Here is the caller graph for this function:

◆ Abc_NodeMffcSizeStop()

ABC_DLL int Abc_NodeMffcSizeStop ( Abc_Obj_t * pNode)
extern

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

Synopsis [Returns the MFFC size while stopping at the complemented edges.]

Description []

SideEffects []

SeeAlso []

Definition at line 74 of file abcRefs.c.

75{
76 int nConeSize1, nConeSize2;
77 assert( Abc_NtkIsStrash(pNode->pNtk) );
78 assert( !Abc_ObjIsComplement( pNode ) );
79 assert( Abc_ObjIsNode( pNode ) );
80 if ( Abc_ObjFaninNum(pNode) == 0 )
81 return 0;
82 nConeSize1 = Abc_NodeRefDerefStop( pNode, 0 ); // dereference
83 nConeSize2 = Abc_NodeRefDerefStop( pNode, 1 ); // reference
84 assert( nConeSize1 == nConeSize2 );
85 assert( nConeSize1 > 0 );
86 return nConeSize1;
87}

◆ Abc_NodeMffcSizeSupp()

ABC_DLL int Abc_NodeMffcSizeSupp ( Abc_Obj_t * pNode)
extern

◆ Abc_NodeMinimumBase()

ABC_DLL int Abc_NodeMinimumBase ( Abc_Obj_t * pNode)
extern

Definition at line 893 of file abcMinBase.c.

893{ return 0; }

◆ Abc_NodePrintFactor()

ABC_DLL void Abc_NodePrintFactor ( FILE * pFile,
Abc_Obj_t * pNode,
int fUseRealNames )
extern

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

Synopsis [Prints the factored form of one node.]

Description []

SideEffects []

SeeAlso []

Definition at line 1101 of file abcPrint.c.

1102{
1103 Dec_Graph_t * pGraph;
1104 Vec_Ptr_t * vNamesIn;
1105 if ( Abc_ObjIsCo(pNode) )
1106 pNode = Abc_ObjFanin0(pNode);
1107 if ( Abc_ObjIsPi(pNode) )
1108 {
1109 fprintf( pFile, "Skipping the PI node.\n" );
1110 return;
1111 }
1112 if ( Abc_ObjIsLatch(pNode) )
1113 {
1114 fprintf( pFile, "Skipping the latch.\n" );
1115 return;
1116 }
1117 assert( Abc_ObjIsNode(pNode) );
1118 pGraph = Dec_Factor( (char *)pNode->pData );
1119 if ( fUseRealNames )
1120 {
1121 vNamesIn = Abc_NodeGetFaninNames(pNode);
1122 Dec_GraphPrint( stdout, pGraph, (char **)vNamesIn->pArray, Abc_ObjName(pNode) );
1123 Abc_NodeFreeNames( vNamesIn );
1124 }
1125 else
1126 Dec_GraphPrint( stdout, pGraph, (char **)NULL, Abc_ObjName(pNode) );
1127 Dec_GraphFree( pGraph );
1128}
ABC_DLL Vec_Ptr_t * Abc_NodeGetFaninNames(Abc_Obj_t *pNode)
Definition abcNames.c:206
ABC_DLL void Abc_NodeFreeNames(Vec_Ptr_t *vNames)
Definition abcNames.c:264
void Dec_GraphPrint(FILE *pFile, Dec_Graph_t *pGraph, char *pNamesIn[], char *pNameOut)
FUNCTION DEFINITIONS ///.
Definition decPrint.c:49
Dec_Graph_t * Dec_Factor(char *pSop)
FUNCTION DECLARATIONS ///.
Definition decFactor.c:58
struct Dec_Graph_t_ Dec_Graph_t
Definition dec.h:68
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodePrintFanio()

ABC_DLL void Abc_NodePrintFanio ( FILE * pFile,
Abc_Obj_t * pNode )
extern

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

Synopsis [Prints the fanins/fanouts of a node.]

Description []

SideEffects []

SeeAlso []

Definition at line 1048 of file abcPrint.c.

1049{
1050 Abc_Obj_t * pNode2;
1051 int i;
1052 if ( Abc_ObjIsPo(pNode) )
1053 pNode = Abc_ObjFanin0(pNode);
1054
1055 fprintf( pFile, "Node %s", Abc_ObjName(pNode) );
1056 fprintf( pFile, "\n" );
1057
1058 fprintf( pFile, "Fanins (%d): ", Abc_ObjFaninNum(pNode) );
1059 Abc_ObjForEachFanin( pNode, pNode2, i )
1060 fprintf( pFile, " %s", Abc_ObjName(pNode2) );
1061 fprintf( pFile, "\n" );
1062
1063 fprintf( pFile, "Fanouts (%d): ", Abc_ObjFaninNum(pNode) );
1064 Abc_ObjForEachFanout( pNode, pNode2, i )
1065 fprintf( pFile, " %s", Abc_ObjName(pNode2) );
1066 fprintf( pFile, "\n" );
1067}
Here is the call graph for this function:

◆ Abc_NodePrintLevel()

ABC_DLL void Abc_NodePrintLevel ( FILE * pFile,
Abc_Obj_t * pNode )
extern

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

Synopsis [Prints the factored form of one node.]

Description []

SideEffects []

SeeAlso []

Definition at line 1358 of file abcPrint.c.

1359{
1360 Abc_Obj_t * pDriver;
1361 Vec_Ptr_t * vNodes;
1362
1363 pDriver = Abc_ObjIsCo(pNode)? Abc_ObjFanin0(pNode) : pNode;
1364 if ( Abc_ObjIsPi(pDriver) )
1365 {
1366 fprintf( pFile, "Primary input.\n" );
1367 return;
1368 }
1369 if ( Abc_ObjIsLatch(pDriver) )
1370 {
1371 fprintf( pFile, "Latch.\n" );
1372 return;
1373 }
1374 if ( Abc_NodeIsConst(pDriver) )
1375 {
1376 fprintf( pFile, "Constant %d.\n", !Abc_ObjFaninC0(pNode) );
1377 return;
1378 }
1379 // print the level
1380 fprintf( pFile, "Level = %3d. ", pDriver->Level );
1381 // print the size of MFFC
1382 fprintf( pFile, "Mffc = %5d. ", Abc_NodeMffcSize(pDriver) );
1383 // print the size of the shole cone
1384 vNodes = Abc_NtkDfsNodes( pNode->pNtk, &pDriver, 1 );
1385 fprintf( pFile, "Cone = %5d. ", Vec_PtrSize(vNodes) );
1386 Vec_PtrFree( vNodes );
1387 fprintf( pFile, "\n" );
1388}
ABC_DLL int Abc_NodeMffcSize(Abc_Obj_t *pNode)
FUNCTION DEFINITIONS ///.
Definition abcRefs.c:48
ABC_DLL int Abc_NodeIsConst(Abc_Obj_t *pNode)
Definition abcObj.c:867
ABC_DLL Vec_Ptr_t * Abc_NtkDfsNodes(Abc_Ntk_t *pNtk, Abc_Obj_t **ppNodes, int nNodes)
Definition abcDfs.c:151
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeReadArrival()

ABC_DLL Abc_Time_t * Abc_NodeReadArrival ( Abc_Obj_t * pNode)
extern

Definition at line 85 of file abcTiming.c.

86{
87 assert( pNode->pNtk->pManTime );
88 return Abc_NodeArrival(pNode);
89}
Here is the caller graph for this function:

◆ Abc_NodeReadArrivalAve()

ABC_DLL float Abc_NodeReadArrivalAve ( Abc_Obj_t * pNode)
extern

Definition at line 103 of file abcTiming.c.

104{
105 return 0.5 * Abc_NodeArrival(pNode)->Rise + 0.5 * Abc_NodeArrival(pNode)->Fall;
106}

◆ Abc_NodeReadArrivalWorst()

ABC_DLL float Abc_NodeReadArrivalWorst ( Abc_Obj_t * pNode)
extern

Definition at line 111 of file abcTiming.c.

112{
113 return Abc_MaxFloat( Abc_NodeArrival(pNode)->Rise, Abc_NodeArrival(pNode)->Fall );
114}
Here is the caller graph for this function:

◆ Abc_NodeReadCuts()

ABC_DLL void * Abc_NodeReadCuts ( void * p,
Abc_Obj_t * pObj )
extern

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

Synopsis [Computes the cuts for the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 511 of file abcCut.c.

512{
513 return Cut_NodeReadCutsNew( (Cut_Man_t *)p, pObj->Id );
514}
Cut_Cut_t * Cut_NodeReadCutsNew(Cut_Man_t *p, int Node)
MACRO DEFINITIONS ///.
Definition cutApi.c:45
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeReadInputDrive()

ABC_DLL Abc_Time_t * Abc_NodeReadInputDrive ( Abc_Ntk_t * pNtk,
int iPi )
extern

Definition at line 141 of file abcTiming.c.

142{
143 assert( pNtk->pManTime );
144 return pNtk->pManTime->tInDrive ? pNtk->pManTime->tInDrive + iPi : NULL;
145}
Here is the caller graph for this function:

◆ Abc_NodeReadInputDriveWorst()

ABC_DLL float Abc_NodeReadInputDriveWorst ( Abc_Ntk_t * pNtk,
int iPi )
extern

Definition at line 151 of file abcTiming.c.

152{
153 return Abc_MaxFloat( Abc_NodeReadInputDrive(pNtk, iPi)->Rise, Abc_NodeReadInputDrive(pNtk, iPi)->Fall );
154}
Abc_Time_t * Abc_NodeReadInputDrive(Abc_Ntk_t *pNtk, int iPi)
Definition abcTiming.c:141
Here is the call graph for this function:

◆ Abc_NodeReadOutputLoad()

ABC_DLL Abc_Time_t * Abc_NodeReadOutputLoad ( Abc_Ntk_t * pNtk,
int iPo )
extern

Definition at line 146 of file abcTiming.c.

147{
148 assert( pNtk->pManTime );
149 return pNtk->pManTime->tOutLoad ? pNtk->pManTime->tOutLoad + iPo : NULL;
150}
Here is the caller graph for this function:

◆ Abc_NodeReadOutputLoadWorst()

ABC_DLL float Abc_NodeReadOutputLoadWorst ( Abc_Ntk_t * pNtk,
int iPo )
extern

Definition at line 155 of file abcTiming.c.

156{
157 return Abc_MaxFloat( Abc_NodeReadOutputLoad(pNtk, iPo)->Rise, Abc_NodeReadOutputLoad(pNtk, iPo)->Fall );
158}
Abc_Time_t * Abc_NodeReadOutputLoad(Abc_Ntk_t *pNtk, int iPo)
Definition abcTiming.c:146
Here is the call graph for this function:

◆ Abc_NodeReadRequired()

ABC_DLL Abc_Time_t * Abc_NodeReadRequired ( Abc_Obj_t * pNode)
extern

Definition at line 90 of file abcTiming.c.

91{
92 assert( pNode->pNtk->pManTime );
93 return Abc_NodeRequired(pNode);
94}
Here is the caller graph for this function:

◆ Abc_NodeReadRequiredAve()

ABC_DLL float Abc_NodeReadRequiredAve ( Abc_Obj_t * pNode)
extern

Definition at line 107 of file abcTiming.c.

108{
109 return 0.5 * Abc_NodeReadRequired(pNode)->Rise + 0.5 * Abc_NodeReadRequired(pNode)->Fall;
110}
Abc_Time_t * Abc_NodeReadRequired(Abc_Obj_t *pNode)
Definition abcTiming.c:90
float Rise
Definition abc.h:124
float Fall
Definition abc.h:125
Here is the call graph for this function:

◆ Abc_NodeReadRequiredWorst()

ABC_DLL float Abc_NodeReadRequiredWorst ( Abc_Obj_t * pNode)
extern

Definition at line 115 of file abcTiming.c.

116{
117 return Abc_MinFloat( Abc_NodeReadRequired(pNode)->Rise, Abc_NodeReadRequired(pNode)->Fall );
118}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeRecognizeMux()

ABC_DLL Abc_Obj_t * Abc_NodeRecognizeMux ( Abc_Obj_t * pNode,
Abc_Obj_t ** ppNodeT,
Abc_Obj_t ** ppNodeE )
extern

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

Synopsis [Recognizes what nodes are control and data inputs of a MUX.]

Description [If the node is a MUX, returns the control variable C. Assigns nodes T and E to be the then and else variables of the MUX. Node C is never complemented. Nodes T and E can be complemented. This function also recognizes EXOR/NEXOR gates as MUXes.]

SideEffects []

SeeAlso []

Definition at line 1430 of file abcUtil.c.

1431{
1432 Abc_Obj_t * pNode0, * pNode1;
1433 assert( !Abc_ObjIsComplement(pNode) );
1434 assert( Abc_NodeIsMuxType(pNode) );
1435 // get children
1436 pNode0 = Abc_ObjFanin0(pNode);
1437 pNode1 = Abc_ObjFanin1(pNode);
1438 // find the control variable
1439// if ( pNode1->p1 == Fraig_Not(pNode2->p1) )
1440 if ( Abc_ObjFaninId0(pNode0) == Abc_ObjFaninId0(pNode1) && (Abc_ObjFaninC0(pNode0) ^ Abc_ObjFaninC0(pNode1)) )
1441 {
1442// if ( Fraig_IsComplement(pNode1->p1) )
1443 if ( Abc_ObjFaninC0(pNode0) )
1444 { // pNode2->p1 is positive phase of C
1445 *ppNodeT = Abc_ObjNot(Abc_ObjChild1(pNode1));//pNode2->p2);
1446 *ppNodeE = Abc_ObjNot(Abc_ObjChild1(pNode0));//pNode1->p2);
1447 return Abc_ObjChild0(pNode1);//pNode2->p1;
1448 }
1449 else
1450 { // pNode1->p1 is positive phase of C
1451 *ppNodeT = Abc_ObjNot(Abc_ObjChild1(pNode0));//pNode1->p2);
1452 *ppNodeE = Abc_ObjNot(Abc_ObjChild1(pNode1));//pNode2->p2);
1453 return Abc_ObjChild0(pNode0);//pNode1->p1;
1454 }
1455 }
1456// else if ( pNode1->p1 == Fraig_Not(pNode2->p2) )
1457 else if ( Abc_ObjFaninId0(pNode0) == Abc_ObjFaninId1(pNode1) && (Abc_ObjFaninC0(pNode0) ^ Abc_ObjFaninC1(pNode1)) )
1458 {
1459// if ( Fraig_IsComplement(pNode1->p1) )
1460 if ( Abc_ObjFaninC0(pNode0) )
1461 { // pNode2->p2 is positive phase of C
1462 *ppNodeT = Abc_ObjNot(Abc_ObjChild0(pNode1));//pNode2->p1);
1463 *ppNodeE = Abc_ObjNot(Abc_ObjChild1(pNode0));//pNode1->p2);
1464 return Abc_ObjChild1(pNode1);//pNode2->p2;
1465 }
1466 else
1467 { // pNode1->p1 is positive phase of C
1468 *ppNodeT = Abc_ObjNot(Abc_ObjChild1(pNode0));//pNode1->p2);
1469 *ppNodeE = Abc_ObjNot(Abc_ObjChild0(pNode1));//pNode2->p1);
1470 return Abc_ObjChild0(pNode0);//pNode1->p1;
1471 }
1472 }
1473// else if ( pNode1->p2 == Fraig_Not(pNode2->p1) )
1474 else if ( Abc_ObjFaninId1(pNode0) == Abc_ObjFaninId0(pNode1) && (Abc_ObjFaninC1(pNode0) ^ Abc_ObjFaninC0(pNode1)) )
1475 {
1476// if ( Fraig_IsComplement(pNode1->p2) )
1477 if ( Abc_ObjFaninC1(pNode0) )
1478 { // pNode2->p1 is positive phase of C
1479 *ppNodeT = Abc_ObjNot(Abc_ObjChild1(pNode1));//pNode2->p2);
1480 *ppNodeE = Abc_ObjNot(Abc_ObjChild0(pNode0));//pNode1->p1);
1481 return Abc_ObjChild0(pNode1);//pNode2->p1;
1482 }
1483 else
1484 { // pNode1->p2 is positive phase of C
1485 *ppNodeT = Abc_ObjNot(Abc_ObjChild0(pNode0));//pNode1->p1);
1486 *ppNodeE = Abc_ObjNot(Abc_ObjChild1(pNode1));//pNode2->p2);
1487 return Abc_ObjChild1(pNode0);//pNode1->p2;
1488 }
1489 }
1490// else if ( pNode1->p2 == Fraig_Not(pNode2->p2) )
1491 else if ( Abc_ObjFaninId1(pNode0) == Abc_ObjFaninId1(pNode1) && (Abc_ObjFaninC1(pNode0) ^ Abc_ObjFaninC1(pNode1)) )
1492 {
1493// if ( Fraig_IsComplement(pNode1->p2) )
1494 if ( Abc_ObjFaninC1(pNode0) )
1495 { // pNode2->p2 is positive phase of C
1496 *ppNodeT = Abc_ObjNot(Abc_ObjChild0(pNode1));//pNode2->p1);
1497 *ppNodeE = Abc_ObjNot(Abc_ObjChild0(pNode0));//pNode1->p1);
1498 return Abc_ObjChild1(pNode1);//pNode2->p2;
1499 }
1500 else
1501 { // pNode1->p2 is positive phase of C
1502 *ppNodeT = Abc_ObjNot(Abc_ObjChild0(pNode0));//pNode1->p1);
1503 *ppNodeE = Abc_ObjNot(Abc_ObjChild0(pNode1));//pNode2->p1);
1504 return Abc_ObjChild1(pNode0);//pNode1->p2;
1505 }
1506 }
1507 assert( 0 ); // this is not MUX
1508 return NULL;
1509}
int Abc_NodeIsMuxType(Abc_Obj_t *pNode)
Definition abcUtil.c:1342
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeRef_rec()

ABC_DLL int Abc_NodeRef_rec ( Abc_Obj_t * pNode)
extern

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

Synopsis [References the node's MFFC.]

Description []

SideEffects []

SeeAlso []

Definition at line 241 of file abcRefs.c.

242{
243 Abc_Obj_t * pFanin;
244 int i, Counter = 1;
245 if ( Abc_ObjIsCi(pNode) )
246 return 0;
247 Abc_ObjForEachFanin( pNode, pFanin, i )
248 {
249 if ( pFanin->vFanouts.nSize++ == 0 )
250 Counter += Abc_NodeRef_rec( pFanin );
251 }
252 return Counter;
253}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeRemoveDupFanins()

ABC_DLL int Abc_NodeRemoveDupFanins ( Abc_Obj_t * pNode)
extern

◆ Abc_NodeStrash()

ABC_DLL Abc_Obj_t * Abc_NodeStrash ( Abc_Ntk_t * pNtkNew,
Abc_Obj_t * pNodeOld,
int fRecord )
extern

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
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
Hop_Obj_t * Hop_IthVar(Hop_Man_t *p, int i)
FUNCTION DEFINITIONS ///.
Definition hopOper.c:63
void * pData
Definition hop.h:68
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkAddDummyBoxNames()

ABC_DLL void Abc_NtkAddDummyBoxNames ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Adds dummy names.]

Description []

SideEffects []

SeeAlso []

Definition at line 547 of file abcNames.c.

548{
549 char * pName, PrefLi[100], PrefLo[100];
550 Abc_Obj_t * pObj;
551 int nDigits, i, k, CountCur, CountMax = 0;
552 // if PIs/POs already have nodes with what looks like latch names
553 // we need to add different prefix for the new latches
554 Abc_NtkForEachPi( pNtk, pObj, i )
555 {
556 CountCur = 0;
557 pName = Abc_ObjName(pObj);
558 for ( k = 0; pName[k]; k++ )
559 if ( pName[k] == 'l' )
560 CountCur++;
561 else
562 break;
563 CountMax = Abc_MaxInt( CountMax, CountCur );
564 }
565 Abc_NtkForEachPo( pNtk, pObj, i )
566 {
567 CountCur = 0;
568 pName = Abc_ObjName(pObj);
569 for ( k = 0; pName[k]; k++ )
570 if ( pName[k] == 'l' )
571 CountCur++;
572 else
573 break;
574 CountMax = Abc_MaxInt( CountMax, CountCur );
575 }
576//printf( "CountMax = %d\n", CountMax );
577 assert( CountMax < 100-2 );
578 for ( i = 0; i <= CountMax; i++ )
579 PrefLi[i] = PrefLo[i] = 'l';
580 PrefLi[i] = 'i';
581 PrefLo[i] = 'o';
582 PrefLi[i+1] = 0;
583 PrefLo[i+1] = 0;
584 // create latch names
585 assert( !Abc_NtkIsNetlist(pNtk) );
586 nDigits = Abc_Base10Log( Abc_NtkLatchNum(pNtk) );
587 Abc_NtkForEachLatch( pNtk, pObj, i )
588 {
589 Abc_ObjAssignName( pObj, Abc_ObjNameDummy("l", i, nDigits), NULL );
590 Abc_ObjAssignName( Abc_ObjFanin0(pObj), Abc_ObjNameDummy(PrefLi, i, nDigits), NULL );
591 Abc_ObjAssignName( Abc_ObjFanout0(pObj), Abc_ObjNameDummy(PrefLo, i, nDigits), NULL );
592 }
593/*
594 nDigits = Abc_Base10Log( Abc_NtkBlackboxNum(pNtk) );
595 Abc_NtkForEachBlackbox( pNtk, pObj, i )
596 {
597 pName = Abc_ObjAssignName( pObj, Abc_ObjNameDummy("B", i, nDigits), NULL );
598 nDigitsF = Abc_Base10Log( Abc_ObjFaninNum(pObj) );
599 Abc_ObjForEachFanin( pObj, pTerm, k )
600 Abc_ObjAssignName( Abc_ObjFanin0(pObj), pName, Abc_ObjNameDummy("i", k, nDigitsF) );
601 nDigitsF = Abc_Base10Log( Abc_ObjFanoutNum(pObj) );
602 Abc_ObjForEachFanout( pObj, pTerm, k )
603 Abc_ObjAssignName( Abc_ObjFanin0(pObj), pName, Abc_ObjNameDummy("o", k, nDigitsF) );
604 }
605*/
606}
char * Abc_ObjNameDummy(char *pPrefix, int Num, int nDigits)
Definition abcNames.c:122
char * Abc_ObjAssignName(Abc_Obj_t *pObj, char *pName, char *pSuffix)
Definition abcNames.c:69
#define Abc_NtkForEachLatch(pNtk, pObj, i)
Definition abc.h:500
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkAddDummyPiNames()

ABC_DLL void Abc_NtkAddDummyPiNames ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Adds dummy names.]

Description []

SideEffects []

SeeAlso []

Definition at line 495 of file abcNames.c.

496{
497 Abc_Obj_t * pObj;
498 int nDigits, i;
499 nDigits = Abc_Base10Log( Abc_NtkPiNum(pNtk) );
500 Abc_NtkForEachPi( pNtk, pObj, i )
501 Abc_ObjAssignName( pObj, Abc_ObjNameDummy("pi", i, nDigits), NULL );
502}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkAddDummyPoNames()

ABC_DLL void Abc_NtkAddDummyPoNames ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Adds dummy names.]

Description []

SideEffects []

SeeAlso []

Definition at line 521 of file abcNames.c.

522{
523 Abc_Obj_t * pObj;
524 int nDigits, i;
525 nDigits = Abc_Base10Log( Abc_NtkPoNum(pNtk) );
526 Abc_NtkForEachPo( pNtk, pObj, i )
527 Abc_ObjAssignName( pObj, Abc_ObjNameDummy("po", i, nDigits), NULL );
528}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkAddLatch()

ABC_DLL Abc_Obj_t * Abc_NtkAddLatch ( Abc_Ntk_t * pNtk,
Abc_Obj_t * pDriver,
Abc_InitType_t Init )
extern

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

Synopsis [Creates latch with the given initial value.]

Description []

SideEffects []

SeeAlso []

Definition at line 254 of file abcLatch.c.

255{
256 Abc_Obj_t * pLatchOut, * pLatch, * pLatchIn;
257 pLatchOut = Abc_NtkCreateBo(pNtk);
258 pLatch = Abc_NtkCreateLatch(pNtk);
259 pLatchIn = Abc_NtkCreateBi(pNtk);
260 Abc_ObjAssignName( pLatchOut, Abc_ObjName(pLatch), "_lo" );
261 Abc_ObjAssignName( pLatchIn, Abc_ObjName(pLatch), "_li" );
262 Abc_ObjAddFanin( pLatchOut, pLatch );
263 Abc_ObjAddFanin( pLatch, pLatchIn );
264 if ( pDriver )
265 Abc_ObjAddFanin( pLatchIn, pDriver );
266 pLatch->pData = (void *)Init;
267 return pLatchOut;
268}
ABC_DLL char * Abc_ObjAssignName(Abc_Obj_t *pObj, char *pName, char *pSuffix)
Definition abcNames.c:69
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkAigToBdd()

ABC_DLL int Abc_NtkAigToBdd ( Abc_Ntk_t * pNtk)
extern

Definition at line 869 of file abcFunc.c.

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

◆ Abc_NtkAigToGia()

ABC_DLL Gia_Man_t * Abc_NtkAigToGia ( Abc_Ntk_t * p,
int fGiaSimple )
extern

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

Synopsis [Converts the network from AIG to BDD representation.]

Description []

SideEffects []

SeeAlso []

Definition at line 1050 of file abcFunc.c.

1051{
1052 Gia_Man_t * pNew;
1053 Hop_Man_t * pHopMan;
1054 Hop_Obj_t * pHopObj;
1055 Vec_Int_t * vMapping = NULL;
1056 Vec_Ptr_t * vNodes;
1057 Abc_Obj_t * pNode, * pFanin;
1058 int i, k, nObjs, iGiaObj;
1059 assert( Abc_NtkIsAigLogic(p) );
1060 pHopMan = (Hop_Man_t *)p->pManFunc;
1061 // create new manager
1062 pNew = Gia_ManStart( 10000 );
1063 pNew->pName = Abc_UtilStrsav( Abc_NtkName(p) );
1064 pNew->pSpec = Abc_UtilStrsav( Abc_NtkSpec(p) );
1065 pNew->fGiaSimple = fGiaSimple;
1067 Hop_ManConst1(pHopMan)->iData = 1;
1068 // create primary inputs
1069 Abc_NtkForEachCi( p, pNode, i )
1070 pNode->iTemp = Gia_ManAppendCi(pNew);
1071 // find the number of objects
1072 nObjs = 1 + Abc_NtkCiNum(p) + Abc_NtkCoNum(p);
1073 Abc_NtkForEachNode( p, pNode, i )
1074 nObjs += Abc_ObjIsBarBuf(pNode) ? 1 : Hop_DagSize( (Hop_Obj_t *)pNode->pData );
1075 if ( !fGiaSimple )
1076 vMapping = Vec_IntStart( nObjs );
1077 // iterate through nodes used in the mapping
1078 vNodes = Abc_NtkDfs( p, 0 );
1079 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
1080 {
1081 if ( Abc_ObjIsBarBuf(pNode) )
1082 {
1083 assert( !Abc_ObjFaninC0(pNode) );
1084 pNode->iTemp = Gia_ManAppendBuf( pNew, Abc_ObjFanin0(pNode)->iTemp );
1085 continue;
1086 }
1087 Abc_ObjForEachFanin( pNode, pFanin, k )
1088 Hop_ManPi(pHopMan, k)->iData = pFanin->iTemp;
1089 pHopObj = Hop_Regular( (Hop_Obj_t *)pNode->pData );
1090 if ( Hop_DagSize(pHopObj) > 0 )
1091 {
1092 assert( Abc_ObjFaninNum(pNode) <= Hop_ManPiNum(pHopMan) );
1093 Abc_ConvertAigToGia( pNew, pHopObj );
1094 iGiaObj = Abc_Lit2Var( pHopObj->iData );
1095 if ( vMapping && Gia_ObjIsAnd(Gia_ManObj(pNew, iGiaObj)) && !Vec_IntEntry(vMapping, iGiaObj) )
1096 {
1097 Vec_IntWriteEntry( vMapping, iGiaObj, Vec_IntSize(vMapping) );
1098 Vec_IntPush( vMapping, Abc_ObjFaninNum(pNode) );
1099 Abc_ObjForEachFanin( pNode, pFanin, k )
1100 Vec_IntPush( vMapping, Abc_Lit2Var(pFanin->iTemp) );
1101 Vec_IntPush( vMapping, iGiaObj );
1102 }
1103 }
1104 pNode->iTemp = Abc_LitNotCond( pHopObj->iData, Hop_IsComplement( (Hop_Obj_t *)pNode->pData ) );
1105 }
1106 // create primary outputs
1107 Abc_NtkForEachCo( p, pNode, i )
1108 Gia_ManAppendCo( pNew, Abc_ObjFanin0(pNode)->iTemp );
1109 Gia_ManSetRegNum( pNew, Abc_NtkLatchNum(p) );
1110 // copy original IDs
1111 pNew->vIdsOrig = Vec_IntStart( Gia_ManObjNum(pNew) );
1112 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
1113 Vec_IntWriteEntry( pNew->vIdsOrig, Abc_Lit2Var(pNode->iTemp), Abc_ObjId(pNode) );
1114 Vec_PtrFree( vNodes );
1115 // finish mapping
1116 assert( Gia_ManObjNum(pNew) <= nObjs );
1117 assert( pNew->vMapping == NULL );
1118 pNew->vMapping = vMapping;
1119 return pNew;
1120}
int Abc_ConvertAigToGia(Gia_Man_t *p, Hop_Obj_t *pRoot)
Definition abcFunc.c:1029
ABC_DLL Vec_Ptr_t * Abc_NtkDfs(Abc_Ntk_t *pNtk, int fCollectAll)
Definition abcDfs.c:82
void Gia_ManSetRegNum(Gia_Man_t *p, int nRegs)
Definition giaMan.c:764
Gia_Man_t * Gia_ManStart(int nObjsMax)
FUNCTION DEFINITIONS ///.
Definition giaMan.c:57
struct Gia_Man_t_ Gia_Man_t
Definition gia.h:96
int Hop_DagSize(Hop_Obj_t *pObj)
Definition hopDfs.c:279
int iTemp
Definition abc.h:149
char * pSpec
Definition gia.h:100
Vec_Int_t * vIdsOrig
Definition gia.h:189
int fGiaSimple
Definition gia.h:116
Vec_Int_t * vMapping
Definition gia.h:136
char * pName
Definition gia.h:99
int iData
Definition hop.h:69
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkAlloc()

ABC_DLL Abc_Ntk_t * Abc_NtkAlloc ( Abc_NtkType_t Type,
Abc_NtkFunc_t Func,
int fUseMemMan )
extern

DECLARATIONS ///.

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

FileName [abcNtk.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Network and node package.]

Synopsis [Network creation/duplication/deletion procedures.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

] FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis [Creates a new Ntk.]

Description []

SideEffects []

SeeAlso []

Definition at line 53 of file abcNtk.c.

54{
55 Abc_Ntk_t * pNtk;
56 pNtk = ABC_ALLOC( Abc_Ntk_t, 1 );
57 memset( pNtk, 0, sizeof(Abc_Ntk_t) );
58 pNtk->ntkType = Type;
59 pNtk->ntkFunc = Func;
60 // start the object storage
61 pNtk->vObjs = Vec_PtrAlloc( 100 );
62 pNtk->vPios = Vec_PtrAlloc( 100 );
63 pNtk->vPis = Vec_PtrAlloc( 100 );
64 pNtk->vPos = Vec_PtrAlloc( 100 );
65 pNtk->vCis = Vec_PtrAlloc( 100 );
66 pNtk->vCos = Vec_PtrAlloc( 100 );
67 pNtk->vBoxes = Vec_PtrAlloc( 100 );
68 pNtk->vLtlProperties = Vec_PtrAlloc( 100 );
69 // start the memory managers
70 pNtk->pMmObj = fUseMemMan? Mem_FixedStart( sizeof(Abc_Obj_t) ) : NULL;
71 pNtk->pMmStep = fUseMemMan? Mem_StepStart( ABC_NUM_STEPS ) : NULL;
72 // get ready to assign the first Obj ID
73 pNtk->nTravIds = 1;
74 // start the functionality manager
75 if ( !Abc_NtkIsStrash(pNtk) )
76 Vec_PtrPush( pNtk->vObjs, NULL );
77 if ( Abc_NtkIsStrash(pNtk) )
78 pNtk->pManFunc = Abc_AigAlloc( pNtk );
79 else if ( Abc_NtkHasSop(pNtk) || Abc_NtkHasBlifMv(pNtk) )
80 pNtk->pManFunc = Mem_FlexStart();
81#ifdef ABC_USE_CUDD
82 else if ( Abc_NtkHasBdd(pNtk) )
83 pNtk->pManFunc = Cudd_Init( 20, 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0 );
84#endif
85 else if ( Abc_NtkHasAig(pNtk) )
86 pNtk->pManFunc = Hop_ManStart();
87 else if ( Abc_NtkHasMapping(pNtk) )
89 else if ( !Abc_NtkHasBlackbox(pNtk) )
90 assert( 0 );
91 // name manager
92 pNtk->pManName = Nm_ManCreate( 200 );
93 // attribute manager
94 pNtk->vAttrs = Vec_PtrStart( VEC_ATTR_TOTAL_NUM );
95 // estimated AndGateDelay
96 pNtk->AndGateDelay = 0.0;
97 return pNtk;
98}
#define ABC_NUM_STEPS
INCLUDES ///.
Definition abcInt.h:36
ABC_DLL Abc_Aig_t * Abc_AigAlloc(Abc_Ntk_t *pNtk)
FUNCTION DECLARATIONS ///.
Definition abcAig.c:128
Mem_Flex_t * Mem_FlexStart()
Definition mem.c:327
Mem_Step_t * Mem_StepStart(int nSteps)
Definition mem.c:490
Mem_Fixed_t * Mem_FixedStart(int nEntrySize)
FUNCTION DEFINITIONS ///.
Definition mem.c:100
Nm_Man_t * Nm_ManCreate(int nSize)
MACRO DEFINITIONS ///.
Definition nmApi.c:45
Abc_NtkType_t ntkType
Definition abc.h:156
Vec_Ptr_t * vAttrs
Definition abc.h:214
Vec_Ptr_t * vCis
Definition abc.h:165
Vec_Ptr_t * vCos
Definition abc.h:166
int nTravIds
Definition abc.h:187
float AndGateDelay
Definition abc.h:194
Vec_Ptr_t * vPos
Definition abc.h:164
Vec_Ptr_t * vBoxes
Definition abc.h:168
Mem_Step_t * pMmStep
Definition abc.h:190
Vec_Ptr_t * vPios
Definition abc.h:167
Mem_Fixed_t * pMmObj
Definition abc.h:189
Nm_Man_t * pManName
Definition abc.h:160
Vec_Ptr_t * vPis
Definition abc.h:163
Vec_Ptr_t * vLtlProperties
Definition abc.h:169
Abc_NtkFunc_t ntkFunc
Definition abc.h:157
@ VEC_ATTR_TOTAL_NUM
Definition vecAtt.h:55
Here is the call graph for this function:

◆ Abc_NtkAppend()

ABC_DLL int Abc_NtkAppend ( Abc_Ntk_t * pNtk1,
Abc_Ntk_t * pNtk2,
int fAddPos )
extern

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}
ABC_DLL Abc_Obj_t * Abc_NtkFindCi(Abc_Ntk_t *pNtk, char *pName)
Definition abcObj.c:538
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_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
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
int Nm_ManFindIdByNameTwoTypes(Nm_Man_t *p, char *pName, int Type1, int Type2)
Definition nmApi.c:239
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkAppendToCone()

ABC_DLL void Abc_NtkAppendToCone ( Abc_Ntk_t * pNtkNew,
Abc_Ntk_t * pNtk,
Vec_Ptr_t * vRoots )
extern

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

Synopsis [Adds new nodes to the cone.]

Description []

SideEffects []

SeeAlso []

Definition at line 1075 of file abcNtk.c.

1076{
1077 Vec_Ptr_t * vNodes;
1078 Abc_Obj_t * pObj;
1079 int i, iNodeId;
1080
1081 assert( Abc_NtkIsStrash(pNtkNew) );
1082 assert( Abc_NtkIsStrash(pNtk) );
1083
1084 // collect the nodes in the TFI of the output (mark the TFI)
1085 vNodes = Abc_NtkDfsNodes( pNtk, (Abc_Obj_t **)Vec_PtrArray(vRoots), Vec_PtrSize(vRoots) );
1086
1087 // establish connection between the constant nodes
1088 Abc_AigConst1(pNtk)->pCopy = Abc_AigConst1(pNtkNew);
1089
1090 // create the PIs
1091 Abc_NtkForEachCi( pNtk, pObj, i )
1092 {
1093 // skip CIs that are not used
1094 if ( !Abc_NodeIsTravIdCurrent(pObj) )
1095 continue;
1096 // find the corresponding CI in the new network
1098 if ( iNodeId == -1 )
1099 {
1100 pObj->pCopy = Abc_NtkCreatePi(pNtkNew);
1101 Abc_ObjAssignName( pObj->pCopy, Abc_ObjName(pObj), NULL );
1102 }
1103 else
1104 pObj->pCopy = Abc_NtkObj( pNtkNew, iNodeId );
1105 }
1106
1107 // copy the nodes
1108 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
1109 pObj->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
1110 Vec_PtrFree( vNodes );
1111
1112 // do not add the COs
1113 if ( !Abc_NtkCheck( pNtkNew ) )
1114 fprintf( stdout, "Abc_NtkAppendToCone(): Network check has failed.\n" );
1115}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkAttach()

ABC_DLL int Abc_NtkAttach ( Abc_Ntk_t * pNtk)
extern

FUNCTION DEFINITIONS ///.

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

Synopsis [Attaches gates from the current library to the internal nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 60 of file abcAttach.c.

61{
62 Mio_Library_t * pGenlib;
63 unsigned ** puTruthGates;
64 unsigned uTruths[6][2];
65 Abc_Obj_t * pNode;
66 Mio_Gate_t ** ppGates;
67 int nGates, nFanins, i;
68
69 assert( Abc_NtkIsSopLogic(pNtk) );
70
71 // check that the library is available
73 if ( pGenlib == NULL )
74 {
75 printf( "The current library is not available.\n" );
76 return 0;
77 }
78
79 // start the truth tables
80 Abc_AttachSetupTruthTables( uTruths );
81
82 // collect all the gates
83 ppGates = Mio_CollectRoots( pGenlib, 6, (float)1.0e+20, 1, &nGates, 0 );
84
85 // derive the gate truth tables
86 puTruthGates = ABC_ALLOC( unsigned *, nGates );
87 puTruthGates[0] = ABC_ALLOC( unsigned, 2 * nGates );
88 for ( i = 1; i < nGates; i++ )
89 puTruthGates[i] = puTruthGates[i-1] + 2;
90 for ( i = 0; i < nGates; i++ )
91 Mio_DeriveTruthTable( ppGates[i], uTruths, Mio_GateReadPinNum(ppGates[i]), 6, puTruthGates[i] );
92
93 // assign the gates to pNode->pCopy
94 Abc_NtkCleanCopy( pNtk );
95 Abc_NtkForEachNode( pNtk, pNode, i )
96 {
97 nFanins = Abc_ObjFaninNum(pNode);
98 if ( nFanins == 0 )
99 {
100 if ( Abc_SopIsConst1((char *)pNode->pData) )
101 pNode->pCopy = (Abc_Obj_t *)Mio_LibraryReadConst1(pGenlib);
102 else
103 pNode->pCopy = (Abc_Obj_t *)Mio_LibraryReadConst0(pGenlib);
104 }
105 else if ( nFanins == 1 )
106 {
107 if ( Abc_SopIsBuf((char *)pNode->pData) )
108 pNode->pCopy = (Abc_Obj_t *)Mio_LibraryReadBuf(pGenlib);
109 else
110 pNode->pCopy = (Abc_Obj_t *)Mio_LibraryReadInv(pGenlib);
111 }
112 else if ( nFanins > 6 )
113 {
114 printf( "Cannot attach gate with more than 6 inputs to node %s.\n", Abc_ObjName(pNode) );
115 ABC_FREE( puTruthGates[0] );
116 ABC_FREE( puTruthGates );
117 ABC_FREE( ppGates );
118 return 0;
119 }
120 else if ( !Abc_NodeAttach( pNode, ppGates, puTruthGates, nGates, uTruths ) )
121 {
122 printf( "Could not attach the library gate to node %s.\n", Abc_ObjName(pNode) );
123 ABC_FREE( puTruthGates[0] );
124 ABC_FREE( puTruthGates );
125 ABC_FREE( ppGates );
126 return 0;
127 }
128 }
129 ABC_FREE( puTruthGates[0] );
130 ABC_FREE( puTruthGates );
131 ABC_FREE( ppGates );
132 ABC_FREE( s_pPerms );
133
134 // perform the final transformation
135 Abc_NtkForEachNode( pNtk, pNode, i )
136 {
137 if ( pNode->pCopy == NULL )
138 {
139 printf( "Some elementary gates (constant, buffer, or inverter) are missing in the library.\n" );
140 return 0;
141 }
142 }
143
144 // replace SOP representation by the gate representation
145 Abc_NtkForEachNode( pNtk, pNode, i )
146 pNode->pData = pNode->pCopy, pNode->pCopy = NULL;
147 pNtk->ntkFunc = ABC_FUNC_MAP;
149 pNtk->pManFunc = pGenlib;
150
151 printf( "Library gates are successfully attached to the nodes.\n" );
152
153 // make sure that everything is okay
154 if ( !Abc_NtkCheck( pNtk ) )
155 {
156 printf( "Abc_NtkAttach: The network check has failed.\n" );
157 return 0;
158 }
159 return 1;
160}
void Extra_MmFlexStop(Extra_MmFlex_t *p)
struct Extra_MmFlex_t_ Extra_MmFlex_t
Definition extra.h:148
int Mio_GateReadPinNum(Mio_Gate_t *pGate)
Definition mioApi.c:177
Mio_Gate_t ** Mio_CollectRoots(Mio_Library_t *pLib, int nInputs, float tDelay, int fSkipInv, int *pnGates, int fVerbose)
Definition mioUtils.c:515
void Mio_DeriveTruthTable(Mio_Gate_t *pGate, unsigned uTruthsIn[][2], int nSigns, int nInputs, unsigned uTruthRes[])
Definition mioUtils.c:1036
struct Mio_GateStruct_t_ Mio_Gate_t
Definition mio.h:43
Here is the call graph for this function:

◆ Abc_NtkAttrFree()

ABC_DLL void * Abc_NtkAttrFree ( Abc_Ntk_t * pNtk,
int Attr,
int fFreeMan )
extern

DECLARATIONS ///.

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

FileName [abcUtil.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Network and node package.]

Synopsis [Various utilities.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

] FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis [Frees one attribute manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 55 of file abcUtil.c.

56{
57 void * pUserMan;
58 Vec_Att_t * pAttrMan;
59 pAttrMan = (Vec_Att_t *)Vec_PtrEntry( pNtk->vAttrs, Attr );
60 Vec_PtrWriteEntry( pNtk->vAttrs, Attr, NULL );
61 pUserMan = Vec_AttFree( pAttrMan, fFreeMan );
62 return pUserMan;
63}
struct Vec_Att_t_ Vec_Att_t
BASIC TYPES ///.
Definition vecAtt.h:62
Here is the caller graph for this function:

◆ Abc_NtkBalance()

ABC_DLL Abc_Ntk_t * Abc_NtkBalance ( Abc_Ntk_t * pNtk,
int fDuplicate,
int fSelective,
int fUpdateLevel )
extern

FUNCTION DEFINITIONS ///.

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

Synopsis [Balances the AIG network.]

Description []

SideEffects []

SeeAlso []

Definition at line 53 of file abcBalance.c.

54{
55// extern void Abc_NtkHaigTranfer( Abc_Ntk_t * pNtkOld, Abc_Ntk_t * pNtkNew );
56 Abc_Ntk_t * pNtkAig;
57 assert( Abc_NtkIsStrash(pNtk) );
58 // compute the required times
59 if ( fSelective )
60 {
62 Abc_NtkMarkCriticalNodes( pNtk );
63 }
64 // perform balancing
66 // transfer HAIG
67// Abc_NtkHaigTranfer( pNtk, pNtkAig );
68 // perform balancing
69 Abc_NtkBalancePerform( pNtk, pNtkAig, fDuplicate, fSelective, fUpdateLevel );
70 Abc_NtkFinalize( pNtk, pNtkAig );
71 Abc_AigCleanup( (Abc_Aig_t *)pNtkAig->pManFunc );
72 // undo the required times
73 if ( fSelective )
74 {
76 Abc_NtkCleanMarkA( pNtk );
77 }
78 if ( pNtk->pExdc )
79 pNtkAig->pExdc = Abc_NtkDup( pNtk->pExdc );
80 // make sure everything is okay
81 if ( !Abc_NtkCheck( pNtkAig ) )
82 {
83 printf( "Abc_NtkBalance: The network check has failed.\n" );
84 Abc_NtkDelete( pNtkAig );
85 return NULL;
86 }
87//Abc_NtkPrintCiLevels( pNtkAig );
88 return pNtkAig;
89}
ABC_DLL void Abc_NtkCleanMarkA(Abc_Ntk_t *pNtk)
Definition abcUtil.c:696
ABC_DLL void Abc_NtkFinalize(Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtkNew)
Definition abcNtk.c:355
ABC_DLL void Abc_NtkStopReverseLevels(Abc_Ntk_t *pNtk)
Definition abcTiming.c:1302
ABC_DLL int Abc_AigCleanup(Abc_Aig_t *pMan)
Definition abcAig.c:194
ABC_DLL void Abc_NtkStartReverseLevels(Abc_Ntk_t *pNtk, int nMaxLevelIncrease)
Definition abcTiming.c:1274
ABC_DLL Abc_Ntk_t * Abc_NtkStartFrom(Abc_Ntk_t *pNtk, Abc_NtkType_t Type, Abc_NtkFunc_t Func)
Definition abcNtk.c:157
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_NtkBalanceExor()

ABC_DLL Abc_Ntk_t * Abc_NtkBalanceExor ( Abc_Ntk_t * pNtk,
int fUpdateLevel,
int fVerbose )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 4078 of file abcDar.c.

4079{
4080 extern void Dar_BalancePrintStats( Aig_Man_t * p );
4081 Abc_Ntk_t * pNtkAig;
4082 Aig_Man_t * pMan, * pTemp;//, * pTemp2;
4083 assert( Abc_NtkIsStrash(pNtk) );
4084 // derive AIG with EXORs
4085 pMan = Abc_NtkToDar( pNtk, 1, 0 );
4086 if ( pMan == NULL )
4087 return NULL;
4088// Aig_ManPrintStats( pMan );
4089 if ( fVerbose )
4090 Dar_BalancePrintStats( pMan );
4091 // perform balancing
4092 pTemp = Dar_ManBalance( pMan, fUpdateLevel );
4093// Aig_ManPrintStats( pTemp );
4094 // create logic network
4095 pNtkAig = Abc_NtkFromDar( pNtk, pTemp );
4096 Aig_ManStop( pTemp );
4097 Aig_ManStop( pMan );
4098 return pNtkAig;
4099}
Abc_Ntk_t * Abc_NtkFromDar(Abc_Ntk_t *pNtkOld, Aig_Man_t *pMan)
Definition abcDar.c:419
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
DECLARATIONS ///.
Definition abcDar.c:237
void Aig_ManStop(Aig_Man_t *p)
Definition aigMan.c:187
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition aig.h:50
Aig_Man_t * Dar_ManBalance(Aig_Man_t *p, int fUpdateLevel)
Definition darBalance.c:554
void Dar_BalancePrintStats(Aig_Man_t *p)
Definition darBalance.c:716
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkBarBufsFromBuffers()

ABC_DLL Abc_Ntk_t * Abc_NtkBarBufsFromBuffers ( Abc_Ntk_t * pNtkBase,
Abc_Ntk_t * pNtk )
extern

Definition at line 462 of file abcBarBuf.c.

463{
464 Abc_Ntk_t * pNtkNew;
465 Abc_Obj_t * pObj, * pFanin, * pLatch;
466 int i, k, nBarBufs;
467 assert( Abc_NtkIsLogic(pNtkBase) );
468 assert( Abc_NtkIsLogic(pNtk) );
469 assert( pNtkBase->nBarBufs == Abc_NtkLatchNum(pNtkBase) );
470 // start the network
471 pNtkNew = Abc_NtkStartFrom( pNtkBase, pNtk->ntkType, pNtk->ntkFunc );
472 // transfer PI pointers
473 Abc_NtkForEachPi( pNtk, pObj, i )
474 pObj->pCopy = Abc_NtkPi(pNtkNew, i);
475 // assuming that the order/number of barbufs remains the same
476 nBarBufs = 0;
477 Abc_NtkForEachNode( pNtk, pObj, i )
478 {
479 if ( Abc_ObjIsBarBuf(pObj) )
480 {
481 pLatch = Abc_NtkBox(pNtkNew, nBarBufs++);
482 Abc_ObjAddFanin( Abc_ObjFanin0(pLatch), Abc_ObjFanin0(pObj)->pCopy );
483 pObj->pCopy = Abc_ObjFanout0(pLatch);
484 }
485 else
486 {
487 Abc_NtkDupObj( pNtkNew, pObj, 1 );
488 Abc_ObjForEachFanin( pObj, pFanin, k )
489 Abc_ObjAddFanin( pObj->pCopy, pFanin->pCopy );
490 }
491 }
492 assert( nBarBufs == pNtkBase->nBarBufs );
493 // connect POs
494 Abc_NtkForEachPo( pNtk, pObj, i )
495 Abc_ObjAddFanin( Abc_NtkPo(pNtkNew, i), Abc_ObjFanin0(pObj)->pCopy );
496 return pNtkNew;
497}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkBarBufsToBuffers()

ABC_DLL Abc_Ntk_t * Abc_NtkBarBufsToBuffers ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Converts the network to dedicated barbufs and back.]

Description []

SideEffects []

SeeAlso []

Definition at line 424 of file abcBarBuf.c.

425{
426 Vec_Ptr_t * vNodes;
427 Abc_Ntk_t * pNtkNew;
428 Abc_Obj_t * pObj, * pFanin;
429 int i, k;
430 assert( Abc_NtkIsLogic(pNtk) );
431 assert( pNtk->pDesign == NULL );
432 assert( pNtk->nBarBufs > 0 );
433 assert( pNtk->nBarBufs == Abc_NtkLatchNum(pNtk) );
434 vNodes = Abc_NtkToBarBufsCollect( pNtk );
435 // start the network
436 pNtkNew = Abc_NtkAlloc( ABC_NTK_LOGIC, pNtk->ntkFunc, 1 );
437 pNtkNew->pName = Extra_UtilStrsav(pNtk->pName);
438 pNtkNew->pSpec = Extra_UtilStrsav(pNtk->pSpec);
439 // create objects
440 Abc_NtkCleanCopy( pNtk );
441 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
442 {
443 if ( Abc_ObjIsPi(pObj) )
444 Abc_NtkDupObj( pNtkNew, pObj, 1 );
445 else if ( Abc_ObjIsPo( pObj) )
446 Abc_ObjAddFanin( Abc_NtkDupObj(pNtkNew, pObj, 1), Abc_ObjFanin0(pObj)->pCopy );
447 else if ( Abc_ObjIsBi(pObj) || Abc_ObjIsBo(pObj) )
448 pObj->pCopy = Abc_ObjFanin0(pObj)->pCopy;
449 else if ( Abc_ObjIsLatch(pObj) )
450 Abc_ObjAddFanin( (pObj->pCopy = Abc_NtkCreateNode(pNtkNew)), Abc_ObjFanin0(pObj)->pCopy );
451 else if ( Abc_ObjIsNode(pObj) )
452 {
453 Abc_NtkDupObj( pNtkNew, pObj, 1 );
454 Abc_ObjForEachFanin( pObj, pFanin, k )
455 Abc_ObjAddFanin( pObj->pCopy, pFanin->pCopy );
456 }
457 else assert( 0 );
458 }
459 Vec_PtrFree( vNodes );
460 return pNtkNew;
461}
Vec_Ptr_t * Abc_NtkToBarBufsCollect(Abc_Ntk_t *pNtk)
Definition abcBarBuf.c:352
ABC_DLL Abc_Ntk_t * Abc_NtkAlloc(Abc_NtkType_t Type, Abc_NtkFunc_t Func, int fUseMemMan)
DECLARATIONS ///.
Definition abcNtk.c:53
char * pSpec
Definition abc.h:159
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkBddToMuxes()

ABC_DLL Abc_Ntk_t * Abc_NtkBddToMuxes ( Abc_Ntk_t * pNtk,
int fGlobal,
int Limit,
int fUseAdd )
extern

Definition at line 687 of file abcNtbdd.c.

687{ return NULL; }
Here is the caller graph for this function:

◆ Abc_NtkBddToSop()

ABC_DLL int Abc_NtkBddToSop ( Abc_Ntk_t * pNtk,
int fMode,
int nCubeLimit,
int fCubeSort )
extern

Definition at line 866 of file abcFunc.c.

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

◆ Abc_NtkBuildGlobalBdds()

ABC_DLL void * Abc_NtkBuildGlobalBdds ( Abc_Ntk_t * pNtk,
int fBddSizeMax,
int fDropInternal,
int fReorder,
int fReverse,
int fVerbose )
extern

◆ Abc_NtkCharNames()

ABC_DLL void Abc_NtkCharNames ( Abc_Ntk_t * pNtk)
extern

Definition at line 627 of file abcNames.c.

628{
629 Nm_ManFree( pNtk->pManName );
630 pNtk->pManName = Nm_ManCreate( Abc_NtkCiNum(pNtk) + Abc_NtkCoNum(pNtk) + Abc_NtkBoxNum(pNtk) );
631 Abc_NtkAddCharPiNames( pNtk );
632 Abc_NtkAddCharPoNames( pNtk );
634}
void Abc_NtkAddCharPiNames(Abc_Ntk_t *pNtk)
Definition abcNames.c:503
void Abc_NtkAddCharPoNames(Abc_Ntk_t *pNtk)
Definition abcNames.c:529
void Abc_NtkAddDummyBoxNames(Abc_Ntk_t *pNtk)
Definition abcNames.c:547
void Nm_ManFree(Nm_Man_t *p)
Definition nmApi.c:76
Here is the call graph for this function:

◆ Abc_NtkCheck()

ABC_DLL int Abc_NtkCheck ( Abc_Ntk_t * pNtk)
extern

FUNCTION DEFINITIONS ///.

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

Synopsis [Checks the integrity of the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 64 of file abcCheck.c.

65{
66 return !Abc_FrameIsFlagEnabled( "check" ) || Abc_NtkDoCheck( pNtk );
67}
int Abc_NtkDoCheck(Abc_Ntk_t *pNtk)
Definition abcCheck.c:96
ABC_DLL int Abc_FrameIsFlagEnabled(char *pFlag)
Definition mainFrame.c:138
Here is the call graph for this function:

◆ Abc_NtkCheckObj()

ABC_DLL int Abc_NtkCheckObj ( Abc_Ntk_t * pNtk,
Abc_Obj_t * pObj )
extern

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

Synopsis [Checks the connectivity of the object.]

Description []

SideEffects []

SeeAlso []

Definition at line 420 of file abcCheck.c.

421{
422 Abc_Obj_t * pFanin, * pFanout;
423 int Value = 1;
424 int i, k;
425
426 // check the network
427 if ( pObj->pNtk != pNtk )
428 {
429 fprintf( stdout, "NetworkCheck: Object \"%s\" does not belong to the network.\n", Abc_ObjName(pObj) );
430 return 0;
431 }
432 // check the object ID
433 if ( pObj->Id < 0 || (int)pObj->Id >= Abc_NtkObjNumMax(pNtk) )
434 {
435 fprintf( stdout, "NetworkCheck: Object \"%s\" has incorrect ID.\n", Abc_ObjName(pObj) );
436 return 0;
437 }
438
439 if ( !Abc_FrameIsFlagEnabled("checkfio") )
440 return Value;
441
442 // go through the fanins of the object and make sure fanins have this object as a fanout
443 Abc_ObjForEachFanin( pObj, pFanin, i )
444 {
445 if ( Vec_IntFind( &pFanin->vFanouts, pObj->Id ) == -1 )
446 {
447 fprintf( stdout, "NodeCheck: Object \"%s\" has fanin ", Abc_ObjName(pObj) );
448 fprintf( stdout, "\"%s\" but the fanin does not have it as a fanout.\n", Abc_ObjName(pFanin) );
449 Value = 0;
450 }
451 }
452 // go through the fanouts of the object and make sure fanouts have this object as a fanin
453 Abc_ObjForEachFanout( pObj, pFanout, i )
454 {
455 if ( Vec_IntFind( &pFanout->vFanins, pObj->Id ) == -1 )
456 {
457 fprintf( stdout, "NodeCheck: Object \"%s\" has fanout ", Abc_ObjName(pObj) );
458 fprintf( stdout, "\"%s\" but the fanout does not have it as a fanin.\n", Abc_ObjName(pFanout) );
459 Value = 0;
460 }
461 }
462
463 // make sure fanins are not duplicated
464 for ( i = 0; i < pObj->vFanins.nSize; i++ )
465 for ( k = i + 1; k < pObj->vFanins.nSize; k++ )
466 if ( pObj->vFanins.pArray[k] == pObj->vFanins.pArray[i] )
467 {
468 printf( "Warning: Node %s has", Abc_ObjName(pObj) );
469 printf( " duplicated fanin %s.\n", Abc_ObjName(Abc_ObjFanin(pObj,k)) );
470 }
471
472 // save time: do not check large fanout lists
473 if ( pObj->vFanouts.nSize > 100 )
474 return Value;
475
476 // make sure fanouts are not duplicated
477 for ( i = 0; i < pObj->vFanouts.nSize; i++ )
478 for ( k = i + 1; k < pObj->vFanouts.nSize; k++ )
479 if ( pObj->vFanouts.pArray[k] == pObj->vFanouts.pArray[i] )
480 {
481 printf( "Warning: Node %s has", Abc_ObjName(pObj) );
482 printf( " duplicated fanout %s.\n", Abc_ObjName(Abc_ObjFanout(pObj,k)) );
483 }
484
485 return Value;
486}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkCheckRead()

ABC_DLL int Abc_NtkCheckRead ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Checks the integrity of the network after reading.]

Description []

SideEffects []

SeeAlso []

Definition at line 80 of file abcCheck.c.

81{
82 return !Abc_FrameIsFlagEnabled( "checkread" ) || Abc_NtkDoCheck( pNtk );
83}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkCheckUniqueCiNames()

ABC_DLL int Abc_NtkCheckUniqueCiNames ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Returns 0 if CI names are repeated.]

Description []

SideEffects []

SeeAlso []

Definition at line 862 of file abcCheck.c.

863{
864 Vec_Ptr_t * vNames;
865 Abc_Obj_t * pObj;
866 int i, fRetValue = 1;
867 assert( !Abc_NtkIsNetlist(pNtk) );
868 vNames = Vec_PtrAlloc( Abc_NtkCiNum(pNtk) );
869 Abc_NtkForEachCi( pNtk, pObj, i )
870 Vec_PtrPush( vNames, Abc_ObjName(pObj) );
871 Vec_PtrSort( vNames, (int (*)(const void *, const void *))Abc_NtkNamesCompare );
872 for ( i = 1; i < Abc_NtkCiNum(pNtk); i++ )
873 if ( !strcmp( (const char *)Vec_PtrEntry(vNames,i-1), (const char *)Vec_PtrEntry(vNames,i) ) )
874 {
875 printf( "Abc_NtkCheck: Repeated CI names: %s and %s.\n", (char*)Vec_PtrEntry(vNames,i-1), (char*)Vec_PtrEntry(vNames,i) );
876 fRetValue = 0;
877 }
878 Vec_PtrFree( vNames );
879 return fRetValue;
880}
int Abc_NtkNamesCompare(char **pName1, char **pName2)
Definition abcCheck.c:846
Here is the call graph for this function:

◆ Abc_NtkCheckUniqueCioNames()

ABC_DLL int Abc_NtkCheckUniqueCioNames ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Returns 0 if there is a pair of CI/CO with the same name and logic in between.]

Description []

SideEffects []

SeeAlso []

Definition at line 927 of file abcCheck.c.

928{
929 Abc_Obj_t * pObj, * pObjCi, * pFanin;
930 int i, nCiId, fRetValue = 1;
931 assert( !Abc_NtkIsNetlist(pNtk) );
932 Abc_NtkForEachCo( pNtk, pObj, i )
933 {
935 if ( nCiId == -1 )
936 continue;
937 pObjCi = Abc_NtkObj( pNtk, nCiId );
938 assert( !strcmp( Abc_ObjName(pObj), Abc_ObjName(pObjCi) ) );
939 pFanin = Abc_ObjFanin0(pObj);
940 if ( pFanin != pObjCi )
941 {
942 printf( "Abc_NtkCheck: A CI/CO pair share the name (%s) but do not link directly. The name of the CO fanin is %s.\n",
943 Abc_ObjName(pObj), Abc_ObjName(Abc_ObjFanin0(pObj)) );
944 fRetValue = 0;
945 }
946 }
947 return fRetValue;
948}
Here is the call graph for this function:

◆ Abc_NtkCheckUniqueCoNames()

ABC_DLL int Abc_NtkCheckUniqueCoNames ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Returns 0 if CO names are repeated.]

Description []

SideEffects []

SeeAlso []

Definition at line 893 of file abcCheck.c.

894{
895 Vec_Ptr_t * vNames;
896 Abc_Obj_t * pObj;
897 int i, fRetValue = 1;
898 assert( !Abc_NtkIsNetlist(pNtk) );
899 vNames = Vec_PtrAlloc( Abc_NtkCoNum(pNtk) );
900 Abc_NtkForEachCo( pNtk, pObj, i )
901 Vec_PtrPush( vNames, Abc_ObjName(pObj) );
902 Vec_PtrSort( vNames, (int (*)(const void *, const void *))Abc_NtkNamesCompare );
903 for ( i = 1; i < Abc_NtkCoNum(pNtk); i++ )
904 {
905// printf( "%s\n", Vec_PtrEntry(vNames,i) );
906 if ( !strcmp( (const char *)Vec_PtrEntry(vNames,i-1), (const char *)Vec_PtrEntry(vNames,i) ) )
907 {
908 printf( "Abc_NtkCheck: Repeated CO names: %s and %s.\n", (char*)Vec_PtrEntry(vNames,i-1), (char*)Vec_PtrEntry(vNames,i) );
909 fRetValue = 0;
910 }
911 }
912 Vec_PtrFree( vNames );
913 return fRetValue;
914}
Here is the call graph for this function:

◆ Abc_NtkCleanCopy()

ABC_DLL void Abc_NtkCleanCopy ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Cleans the copy field of all objects.]

Description []

SideEffects []

SeeAlso []

Definition at line 540 of file abcUtil.c.

541{
542 Abc_Obj_t * pObj;
543 int i;
544 Abc_NtkForEachObj( pNtk, pObj, i )
545 pObj->pCopy = NULL;
546}
#define Abc_NtkForEachObj(pNtk, pObj, i)
ITERATORS ///.
Definition abc.h:449

◆ Abc_NtkCleanCopy_rec()

ABC_DLL void Abc_NtkCleanCopy_rec ( Abc_Ntk_t * pNtk)
extern

Definition at line 547 of file abcUtil.c.

548{
549 Abc_Obj_t * pObj;
550 int i;
551 Abc_NtkCleanCopy( pNtk );
552 Abc_NtkForEachBox( pNtk, pObj, i )
553 Abc_NtkCleanCopy_rec( Abc_ObjModel(pObj) );
554}
void Abc_NtkCleanCopy(Abc_Ntk_t *pNtk)
Definition abcUtil.c:540
void Abc_NtkCleanCopy_rec(Abc_Ntk_t *pNtk)
Definition abcUtil.c:547
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkCleanData()

ABC_DLL void Abc_NtkCleanData ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Cleans the copy field of all objects.]

Description []

SideEffects []

SeeAlso []

Definition at line 567 of file abcUtil.c.

568{
569 Abc_Obj_t * pObj;
570 int i;
571 Abc_NtkForEachObj( pNtk, pObj, i )
572 pObj->pData = NULL;
573}
Here is the caller graph for this function:

◆ Abc_NtkCleanMarkA()

ABC_DLL void Abc_NtkCleanMarkA ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Cleans the copy field of all objects.]

Description []

SideEffects []

SeeAlso []

Definition at line 696 of file abcUtil.c.

697{
698 Abc_Obj_t * pObj;
699 int i;
700 Abc_NtkForEachObj( pNtk, pObj, i )
701 pObj->fMarkA = 0;
702}
Here is the caller graph for this function:

◆ Abc_NtkCleanMarkAB()

ABC_DLL void Abc_NtkCleanMarkAB ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Cleans the copy field of all objects.]

Description []

SideEffects []

SeeAlso []

Definition at line 753 of file abcUtil.c.

754{
755 Abc_Obj_t * pObj;
756 int i;
757 Abc_NtkForEachObj( pNtk, pObj, i )
758 pObj->fMarkA = pObj->fMarkB = 0;
759}
Here is the caller graph for this function:

◆ Abc_NtkCleanMarkABC()

ABC_DLL void Abc_NtkCleanMarkABC ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Cleans the copy field of all objects.]

Description []

SideEffects []

SeeAlso []

Definition at line 772 of file abcUtil.c.

773{
774 Abc_Obj_t * pObj;
775 int i;
776 Abc_NtkForEachObj( pNtk, pObj, i )
777 pObj->fMarkA = pObj->fMarkB = pObj->fMarkC = 0;
778}
unsigned fMarkC
Definition abc.h:136
Here is the caller graph for this function:

◆ Abc_NtkCleanMarkB()

ABC_DLL void Abc_NtkCleanMarkB ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Cleans the copy field of all objects.]

Description []

SideEffects []

SeeAlso []

Definition at line 715 of file abcUtil.c.

716{
717 Abc_Obj_t * pObj;
718 int i;
719 Abc_NtkForEachObj( pNtk, pObj, i )
720 pObj->fMarkB = 0;
721}

◆ Abc_NtkCleanMarkC()

ABC_DLL void Abc_NtkCleanMarkC ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Cleans the copy field of all objects.]

Description []

SideEffects []

SeeAlso []

Definition at line 734 of file abcUtil.c.

735{
736 Abc_Obj_t * pObj;
737 int i;
738 Abc_NtkForEachObj( pNtk, pObj, i )
739 pObj->fMarkC = 0;
740}
Here is the caller graph for this function:

◆ Abc_NtkCleanNames()

ABC_DLL void Abc_NtkCleanNames ( Abc_Ntk_t * pNtk)
extern

Definition at line 635 of file abcNames.c.

636{
637 Abc_Obj_t * pObj; int i;
638 Nm_Man_t * pManName = Nm_ManCreate( Abc_NtkCiNum(pNtk) + Abc_NtkCoNum(pNtk) + Abc_NtkBoxNum(pNtk) );
639 Abc_NtkForEachCi( pNtk, pObj, i )
640 Nm_ManStoreIdName( pManName, pObj->Id, pObj->Type, Abc_ObjName(pObj), NULL );
641 Abc_NtkForEachCo( pNtk, pObj, i )
642 Nm_ManStoreIdName( pManName, pObj->Id, pObj->Type, Abc_ObjName(pObj), NULL );
643 Nm_ManFree( pNtk->pManName );
644 pNtk->pManName = pManName;
645}
typedefABC_NAMESPACE_HEADER_START struct Nm_Man_t_ Nm_Man_t
INCLUDES ///.
Definition nm.h:63
char * Nm_ManStoreIdName(Nm_Man_t *p, int ObjId, int Type, char *pName, char *pSuffix)
Definition nmApi.c:112
Here is the call graph for this function:

◆ Abc_NtkCleanNext()

ABC_DLL void Abc_NtkCleanNext ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Cleans the copy field of all objects.]

Description []

SideEffects []

SeeAlso []

Definition at line 669 of file abcUtil.c.

670{
671 Abc_Obj_t * pObj;
672 int i;
673 Abc_NtkForEachObj( pNtk, pObj, i )
674 pObj->pNext = NULL;
675}
Here is the caller graph for this function:

◆ Abc_NtkCleanNext_rec()

ABC_DLL void Abc_NtkCleanNext_rec ( Abc_Ntk_t * pNtk)
extern

Definition at line 676 of file abcUtil.c.

677{
678 Abc_Obj_t * pObj;
679 int i;
680 Abc_NtkCleanNext( pNtk );
681 Abc_NtkForEachBox( pNtk, pObj, i )
682 Abc_NtkCleanNext_rec( Abc_ObjModel(pObj) );
683}
void Abc_NtkCleanNext_rec(Abc_Ntk_t *pNtk)
Definition abcUtil.c:676
void Abc_NtkCleanNext(Abc_Ntk_t *pNtk)
Definition abcUtil.c:669
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkCleanup()

ABC_DLL int Abc_NtkCleanup ( Abc_Ntk_t * pNtk,
int fVerbose )
extern

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

◆ Abc_NtkCleanupNodes()

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

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

◆ Abc_NtkCleanupSeq()

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

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 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_NtkCloneObj()

ABC_DLL Abc_Obj_t * Abc_NtkCloneObj ( Abc_Obj_t * pObj)
extern

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

Synopsis [Clones the objects in the same network but does not assign its function.]

Description []

SideEffects []

SeeAlso []

Definition at line 442 of file abcObj.c.

443{
444 Abc_Obj_t * pClone, * pFanin;
445 int i;
446 pClone = Abc_NtkCreateObj( pObj->pNtk, (Abc_ObjType_t)pObj->Type );
447 Abc_ObjForEachFanin( pObj, pFanin, i )
448 Abc_ObjAddFanin( pClone, pFanin );
449 return pClone;
450}
Abc_Obj_t * Abc_NtkCreateObj(Abc_Ntk_t *pNtk, Abc_ObjType_t Type)
Definition abcObj.c:109
Here is the call graph for this function:

◆ Abc_NtkClpGia()

ABC_DLL Gia_Man_t * Abc_NtkClpGia ( Abc_Ntk_t * pNtk)
extern

Definition at line 574 of file abcCollapse.c.

575{
576 int i, iLit;
577 Gia_Man_t * pNew;
578 Abc_Obj_t * pNode;
579 assert( Abc_NtkIsStrash(pNtk) );
580 pNew = Gia_ManStart( 1000 );
581 pNew->pName = Abc_UtilStrsav( pNtk->pName );
582 pNew->pSpec = Abc_UtilStrsav( pNtk->pSpec );
583 Abc_NtkForEachObj( pNtk, pNode, i )
584 pNode->iTemp = -1;
585 Abc_AigConst1(pNtk)->iTemp = 1;
586 Abc_NtkForEachCi( pNtk, pNode, i )
587 pNode->iTemp = Gia_ManAppendCi(pNew);
588 Abc_NtkForEachCo( pNtk, pNode, i )
589 {
590 iLit = Abc_NtkClpGia_rec( pNew, Abc_ObjFanin0(pNode) );
591 iLit = Abc_LitNotCond( iLit, Abc_ObjFaninC0(pNode) );
592 Gia_ManAppendCo( pNew, iLit );
593 }
594 return pNew;
595}
int Abc_NtkClpGia_rec(Gia_Man_t *pNew, Abc_Obj_t *pNode)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkCollapse()

ABC_DLL Abc_Ntk_t * Abc_NtkCollapse ( Abc_Ntk_t * pNtk,
int fBddSizeMax,
int fDualRail,
int fReorder,
int fReverse,
int fDumpOrder,
int fVerbose )
extern

DECLARATIONS ///.

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

FileName [abcCollapse.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Network and node package.]

Synopsis [Collapsing the network into two-levels.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

]

Definition at line 250 of file abcCollapse.c.

251{
252 return NULL;
253}
Here is the caller graph for this function:

◆ Abc_NtkCollapseSat()

ABC_DLL Abc_Ntk_t * Abc_NtkCollapseSat ( Abc_Ntk_t * pNtk,
int nCubeLim,
int nBTLimit,
int nCostMax,
int fCanon,
int fReverse,
int fCnfShared,
int fVerbose )
extern

Definition at line 943 of file abcCollapse.c.

944{
945 Abc_Ntk_t * pNtkNew;
946 assert( Abc_NtkIsStrash(pNtk) );
947 pNtkNew = Abc_NtkFromSopsInt( pNtk, nCubeLim, nBTLimit, nCostMax, fCanon, fReverse, fCnfShared, fVerbose );
948 if ( pNtkNew == NULL )
949 return NULL;
950 if ( pNtk->pExdc )
951 pNtkNew->pExdc = Abc_NtkDup( pNtk->pExdc );
952 if ( !Abc_NtkCheck( pNtkNew ) )
953 {
954 printf( "Abc_NtkCollapseSat: The network check has failed.\n" );
955 Abc_NtkDelete( pNtkNew );
956 return NULL;
957 }
958 return pNtkNew;
959}
Abc_Ntk_t * Abc_NtkFromSopsInt(Abc_Ntk_t *pNtk, int nCubeLim, int nBTLimit, int nCostMax, int fCanon, int fReverse, int fCnfShared, int fVerbose)
Here is the call graph for this function:

◆ Abc_NtkCollectCioNames()

ABC_DLL char ** Abc_NtkCollectCioNames ( Abc_Ntk_t * pNtk,
int fCollectCos )
extern

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

Synopsis [Collects the CI or CO names.]

Description []

SideEffects []

SeeAlso []

Definition at line 285 of file abcNames.c.

286{
287 Abc_Obj_t * pObj;
288 char ** ppNames;
289 int i;
290 if ( fCollectCos )
291 {
292 ppNames = ABC_ALLOC( char *, Abc_NtkCoNum(pNtk) );
293 Abc_NtkForEachCo( pNtk, pObj, i )
294 ppNames[i] = Abc_ObjName(pObj);
295 }
296 else
297 {
298 ppNames = ABC_ALLOC( char *, Abc_NtkCiNum(pNtk) );
299 Abc_NtkForEachCi( pNtk, pObj, i )
300 ppNames[i] = Abc_ObjName(pObj);
301 }
302 return ppNames;
303}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkCollectLatches()

ABC_DLL Vec_Ptr_t * Abc_NtkCollectLatches ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Collects all latches in the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 1667 of file abcUtil.c.

1668{
1669 Vec_Ptr_t * vLatches;
1670 Abc_Obj_t * pObj;
1671 int i;
1672 vLatches = Vec_PtrAlloc( 10 );
1673 Abc_NtkForEachObj( pNtk, pObj, i )
1674 Vec_PtrPush( vLatches, pObj );
1675 return vLatches;
1676}

◆ Abc_NtkCollectLatchValues()

ABC_DLL Vec_Int_t * Abc_NtkCollectLatchValues ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Strashes one logic node using its SOP.]

Description []

SideEffects []

SeeAlso []

Definition at line 181 of file abcLatch.c.

182{
183 Vec_Int_t * vValues;
184 Abc_Obj_t * pLatch;
185 int i;
186 vValues = Vec_IntAlloc( Abc_NtkLatchNum(pNtk) );
187 Abc_NtkForEachLatch( pNtk, pLatch, i )
188 Vec_IntPush( vValues, Abc_LatchIsInit1(pLatch) );
189 return vValues;
190}
Here is the caller graph for this function:

◆ Abc_NtkCollectLatchValuesStr()

ABC_DLL char * Abc_NtkCollectLatchValuesStr ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Derives latch init string.]

Description []

SideEffects []

SeeAlso []

Definition at line 203 of file abcLatch.c.

204{
205 char * pInits;
206 Abc_Obj_t * pLatch;
207 int i;
208 pInits = ABC_ALLOC( char, Abc_NtkLatchNum(pNtk) + 1 );
209 Abc_NtkForEachLatch( pNtk, pLatch, i )
210 {
211 if ( Abc_LatchIsInit0(pLatch) )
212 pInits[i] = '0';
213 else if ( Abc_LatchIsInit1(pLatch) )
214 pInits[i] = '1';
215 else if ( Abc_LatchIsInitDc(pLatch) )
216 pInits[i] = 'x';
217 else
218 assert( 0 );
219 }
220 pInits[i] = 0;
221 return pInits;
222}

◆ Abc_NtkCollectObjects()

ABC_DLL Vec_Ptr_t * Abc_NtkCollectObjects ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Collects all objects into one array.]

Description []

SideEffects []

SeeAlso []

Definition at line 1765 of file abcUtil.c.

1766{
1767 Vec_Ptr_t * vNodes;
1768 Abc_Obj_t * pNode;
1769 int i;
1770 vNodes = Vec_PtrAlloc( 100 );
1771 Abc_NtkForEachObj( pNtk, pNode, i )
1772 Vec_PtrPush( vNodes, pNode );
1773 return vNodes;
1774}
Here is the caller graph for this function:

◆ Abc_NtkCombinePos()

ABC_DLL int Abc_NtkCombinePos ( Abc_Ntk_t * pNtk,
int fAnd,
int fXor )
extern

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

Synopsis [Computes OR or AND of the POs.]

Description []

SideEffects []

SeeAlso []

Definition at line 1155 of file abcMiter.c.

1156{
1157 Abc_Obj_t * pNode, * pMiter;
1158 int i;
1159 assert( Abc_NtkIsStrash(pNtk) );
1160// assert( Abc_NtkLatchNum(pNtk) == 0 );
1161 if ( Abc_NtkPoNum(pNtk) == 1 )
1162 return 1;
1163 // start the result
1164 if ( fAnd )
1165 pMiter = Abc_AigConst1(pNtk);
1166 else
1167 pMiter = Abc_ObjNot( Abc_AigConst1(pNtk) );
1168 // perform operations on the POs
1169 Abc_NtkForEachPo( pNtk, pNode, i )
1170 if ( fAnd )
1171 pMiter = Abc_AigAnd( (Abc_Aig_t *)pNtk->pManFunc, pMiter, Abc_ObjChild0(pNode) );
1172 else if ( fXor )
1173 pMiter = Abc_AigXor( (Abc_Aig_t *)pNtk->pManFunc, pMiter, Abc_ObjChild0(pNode) );
1174 else
1175 pMiter = Abc_AigOr( (Abc_Aig_t *)pNtk->pManFunc, pMiter, Abc_ObjChild0(pNode) );
1176 // remove the POs and their names
1177 for ( i = Abc_NtkPoNum(pNtk) - 1; i >= 0; i-- )
1178 Abc_NtkDeleteObj( Abc_NtkPo(pNtk, i) );
1179 assert( Abc_NtkPoNum(pNtk) == 0 );
1180 // create the new PO
1181 pNode = Abc_NtkCreatePo( pNtk );
1182 Abc_ObjAddFanin( pNode, pMiter );
1183 Abc_ObjAssignName( pNode, "miter", NULL );
1184 Abc_NtkOrderCisCos( pNtk );
1185 // make sure that everything is okay
1186 if ( !Abc_NtkCheck( pNtk ) )
1187 {
1188 printf( "Abc_NtkOrPos: The network check has failed.\n" );
1189 return 0;
1190 }
1191 return 1;
1192}
ABC_DLL void Abc_NtkOrderCisCos(Abc_Ntk_t *pNtk)
Definition abcUtil.c:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkCompareSignals()

ABC_DLL int Abc_NtkCompareSignals ( Abc_Ntk_t * pNtk1,
Abc_Ntk_t * pNtk2,
int fOnlyPis,
int fComb )
extern

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

Synopsis [Compares the signals of the networks.]

Description []

SideEffects [Ordering POs by name is a very bad idea! It destroys the natural order of the logic in the circuit.]

SeeAlso []

Definition at line 749 of file abcCheck.c.

750{
751 Abc_NtkOrderObjsByName( pNtk1, fComb );
752 Abc_NtkOrderObjsByName( pNtk2, fComb );
753 if ( !Abc_NtkComparePis( pNtk1, pNtk2, fComb ) )
754 return 0;
755 if ( !fOnlyPis )
756 {
757 if ( !Abc_NtkCompareBoxes( pNtk1, pNtk2, fComb ) )
758 return 0;
759 if ( !Abc_NtkComparePos( pNtk1, pNtk2, fComb ) )
760 return 0;
761 }
762 return 1;
763}
int Abc_NtkCompareBoxes(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int fComb)
Definition abcCheck.c:711
ABC_DLL void Abc_NtkOrderObjsByName(Abc_Ntk_t *pNtk, int fComb)
Definition abcNames.c:330
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkConverLatchNamesIntoNumbers()

ABC_DLL Vec_Ptr_t * Abc_NtkConverLatchNamesIntoNumbers ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Transfors the array of latch names into that of latch numbers.]

Description []

SideEffects []

SeeAlso []

Definition at line 364 of file abcLatch.c.

365{
366 Vec_Ptr_t * vResult, * vNames;
367 Vec_Int_t * vNumbers;
368 Abc_Obj_t * pObj;
369 char * pName;
370 int i, k, Num;
371 if ( pNtk->vOnehots == NULL )
372 return NULL;
373 // set register numbers
374 Abc_NtkForEachLatch( pNtk, pObj, i )
375 pObj->pNext = (Abc_Obj_t *)(ABC_PTRINT_T)i;
376 // add the numbers
377 vResult = Vec_PtrAlloc( Vec_PtrSize(pNtk->vOnehots) );
378 Vec_PtrForEachEntry( Vec_Ptr_t *, pNtk->vOnehots, vNames, i )
379 {
380 vNumbers = Vec_IntAlloc( Vec_PtrSize(vNames) );
381 Vec_PtrForEachEntry( char *, vNames, pName, k )
382 {
383 Num = Nm_ManFindIdByName( pNtk->pManName, pName, ABC_OBJ_BO );
384 if ( Num < 0 )
385 continue;
386 pObj = Abc_NtkObj( pNtk, Num );
387 if ( Abc_ObjFaninNum(pObj) != 1 || !Abc_ObjIsLatch(Abc_ObjFanin0(pObj)) )
388 continue;
389 Vec_IntPush( vNumbers, (int)(ABC_PTRINT_T)pObj->pNext );
390 }
391 if ( Vec_IntSize( vNumbers ) > 1 )
392 {
393 Vec_PtrPush( vResult, vNumbers );
394printf( "Converted %d one-hot registers.\n", Vec_IntSize(vNumbers) );
395 }
396 else
397 Vec_IntFree( vNumbers );
398 }
399 // clean the numbers
400 Abc_NtkForEachLatch( pNtk, pObj, i )
401 pObj->pNext = NULL;
402 return vResult;
403}
int Nm_ManFindIdByName(Nm_Man_t *p, char *pName, int Type)
Definition nmApi.c:219
Vec_Ptr_t * vOnehots
Definition abc.h:211
Here is the call graph for this function:

◆ Abc_NtkConvertBlackboxes()

ABC_DLL Abc_Ntk_t * Abc_NtkConvertBlackboxes ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Extracts blackboxes by making them into additional PIs/POs.]

Description [The input netlist has not logic hierarchy. The resulting netlist has additional PIs/POs for each blackbox input/output.]

SideEffects []

SeeAlso []

Definition at line 598 of file abcHie.c.

599{
600 Abc_Ntk_t * pNtkNew;
601 Abc_Obj_t * pObj, * pNet, * pFanin, * pTerm;
602 int i, k;
603
604 assert( Abc_NtkIsNetlist(pNtk) );
605 assert( Abc_NtkWhiteboxNum(pNtk) == 0 );
606
607 // start the network
608 pNtkNew = Abc_NtkAlloc( pNtk->ntkType, pNtk->ntkFunc, 1 );
609 // duplicate the name and the spec
610 pNtkNew->pName = Extra_UtilStrsav( pNtk->pName );
611 pNtkNew->pSpec = Extra_UtilStrsav( pNtk->pSpec );
612
613 // clean the node copy fields
614 Abc_NtkCleanCopy( pNtk );
615
616 // mark the nodes that should not be connected
617 Abc_NtkIncrementTravId( pNtk );
618 Abc_NtkForEachBlackbox( pNtk, pObj, i )
619 Abc_NodeSetTravIdCurrent( pObj );
620 Abc_NtkForEachCi( pNtk, pTerm, i )
621 Abc_NodeSetTravIdCurrent( pTerm );
622 Abc_NtkForEachCo( pNtk, pTerm, i )
623 Abc_NodeSetTravIdCurrent( pTerm );
624 // unmark PIs and LIs/LOs
625 Abc_NtkForEachPi( pNtk, pTerm, i )
626 Abc_NodeSetTravIdPrevious( pTerm );
627 Abc_NtkForEachLatchInput( pNtk, pTerm, i )
628 Abc_NodeSetTravIdPrevious( pTerm );
629 Abc_NtkForEachLatchOutput( pNtk, pTerm, i )
630 Abc_NodeSetTravIdPrevious( pTerm );
631 // copy the box outputs
632 Abc_NtkForEachBlackbox( pNtk, pObj, i )
633 Abc_ObjForEachFanout( pObj, pTerm, k )
634 pTerm->pCopy = Abc_NtkCreatePi( pNtkNew );
635
636 // duplicate other objects
637 Abc_NtkForEachObj( pNtk, pObj, i )
638 if ( !Abc_NodeIsTravIdCurrent(pObj) )
639 Abc_NtkDupObj( pNtkNew, pObj, Abc_ObjIsNet(pObj) );
640
641 // connect all objects
642 Abc_NtkForEachObj( pNtk, pObj, i )
643 if ( !Abc_NodeIsTravIdCurrent(pObj) )
644 Abc_ObjForEachFanin( pObj, pFanin, k )
645 Abc_ObjAddFanin( pObj->pCopy, pFanin->pCopy );
646
647 // create unique PO for each net feeding into blackboxes or POs
648 Abc_NtkIncrementTravId( pNtk );
649 Abc_NtkForEachCo( pNtk, pTerm, i )
650 {
651 // skip latch inputs
652 assert( Abc_ObjFanoutNum(pTerm) <= 1 );
653 if ( Abc_ObjFanoutNum(pTerm) > 0 && Abc_ObjIsLatch(Abc_ObjFanout0(pTerm)) )
654 continue;
655 // check if the net is visited
656 pNet = Abc_ObjFanin0(pTerm);
657 if ( Abc_NodeIsTravIdCurrent(pNet) )
658 continue;
659 // create PO
660 Abc_NodeSetTravIdCurrent( pNet );
661 Abc_ObjAddFanin( Abc_NtkCreatePo(pNtkNew), pNet->pCopy );
662 }
663
664 // check integrity
665 if ( !Abc_NtkCheck( pNtkNew ) )
666 {
667 fprintf( stdout, "Abc_NtkConvertBlackboxes(): Network check has failed.\n" );
668 Abc_NtkDelete( pNtkNew );
669 return NULL;
670 }
671 return pNtkNew;
672}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkConvertDcLatches()

ABC_DLL void Abc_NtkConvertDcLatches ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Converts registers with DC values into additional PIs.]

Description []

SideEffects []

SeeAlso []

Definition at line 310 of file abcLatch.c.

311{
312 Abc_Obj_t * pCtrl, * pLatch, * pMux, * pPi;
314 int i, fFound = 0, Counter;
315 // check if there are latches with DC values
316 Abc_NtkForEachLatch( pNtk, pLatch, i )
317 if ( Abc_LatchIsInitDc(pLatch) )
318 {
319 fFound = 1;
320 break;
321 }
322 if ( !fFound )
323 return;
324 // add control latch
325 pCtrl = Abc_NtkAddLatch( pNtk, Abc_NtkCreateNodeConst1(pNtk), Init );
326 // add fanouts for each latch with DC values
327 Counter = 0;
328 Abc_NtkForEachLatch( pNtk, pLatch, i )
329 {
330 if ( !Abc_LatchIsInitDc(pLatch) )
331 continue;
332 // change latch value
333 pLatch->pData = (void *)Init;
334 // if the latch output has the same name as a PO, rename it
335 if ( Abc_NodeFindCoFanout( Abc_ObjFanout0(pLatch) ) )
336 {
337 Nm_ManDeleteIdName( pLatch->pNtk->pManName, Abc_ObjFanout0(pLatch)->Id );
338 Abc_ObjAssignName( Abc_ObjFanout0(pLatch), Abc_ObjName(pLatch), "_lo" );
339 }
340 // create new PIs
341 pPi = Abc_NtkCreatePi( pNtk );
342 Abc_ObjAssignName( pPi, Abc_ObjName(pLatch), "_pi" );
343 // create a new node and transfer fanout from latch output to the new node
344 pMux = Abc_NtkCreateNode( pNtk );
345 Abc_ObjTransferFanout( Abc_ObjFanout0(pLatch), pMux );
346 // convert the node into a mux
347 Abc_NtkNodeConvertToMux( pNtk, pCtrl, Abc_ObjFanout0(pLatch), pPi, pMux );
348 Counter++;
349 }
350 printf( "The number of converted latches with DC values = %d.\n", Counter );
351}
Abc_Obj_t * Abc_NtkAddLatch(Abc_Ntk_t *pNtk, Abc_Obj_t *pDriver, Abc_InitType_t Init)
Definition abcLatch.c:254
void Abc_NtkNodeConvertToMux(Abc_Ntk_t *pNtk, Abc_Obj_t *pNodeC, Abc_Obj_t *pNode1, Abc_Obj_t *pNode0, Abc_Obj_t *pMux)
Definition abcLatch.c:281
ABC_DLL void Abc_ObjTransferFanout(Abc_Obj_t *pObjOld, Abc_Obj_t *pObjNew)
Definition abcFanio.c:292
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
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkConvertToBlifMv()

ABC_DLL int Abc_NtkConvertToBlifMv ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Converts SOP netlist into BLIF-MV netlist.]

Description []

SideEffects []

SeeAlso []

Definition at line 957 of file abcBlifMv.c.

958{
959#ifdef ABC_USE_CUDD
960 Mem_Flex_t * pMmFlex;
961 Abc_Obj_t * pNode;
962 Vec_Str_t * vCube;
963 char * pSop0, * pSop1, * pBlifMv, * pCube, * pCur;
964 int Value, nCubes, nSize, i, k;
965
966 assert( Abc_NtkIsNetlist(pNtk) );
967 if ( !Abc_NtkToBdd(pNtk) )
968 {
969 printf( "Converting logic functions to BDDs has failed.\n" );
970 return 0;
971 }
972
973 pMmFlex = Mem_FlexStart();
974 vCube = Vec_StrAlloc( 100 );
975 Abc_NtkForEachNode( pNtk, pNode, i )
976 {
977 // convert BDD into cubes for on-set and off-set
978 Abc_NodeBddToCnf( pNode, pMmFlex, vCube, 0, &pSop0, &pSop1 );
979 // allocate room for the MV-SOP
980 nCubes = Abc_SopGetCubeNum(pSop0) + Abc_SopGetCubeNum(pSop1);
981 nSize = nCubes*(2*Abc_ObjFaninNum(pNode) + 2)+1;
982 pBlifMv = Mem_FlexEntryFetch( pMmFlex, nSize );
983 // add the cubes
984 pCur = pBlifMv;
985 Abc_SopForEachCube( pSop0, Abc_ObjFaninNum(pNode), pCube )
986 {
987 Abc_CubeForEachVar( pCube, Value, k )
988 {
989 *pCur++ = Value;
990 *pCur++ = ' ';
991 }
992 *pCur++ = '0';
993 *pCur++ = '\n';
994 }
995 Abc_SopForEachCube( pSop1, Abc_ObjFaninNum(pNode), pCube )
996 {
997 Abc_CubeForEachVar( pCube, Value, k )
998 {
999 *pCur++ = Value;
1000 *pCur++ = ' ';
1001 }
1002 *pCur++ = '1';
1003 *pCur++ = '\n';
1004 }
1005 *pCur++ = 0;
1006 assert( pCur - pBlifMv == nSize );
1007 // update the node representation
1008 Cudd_RecursiveDeref( (DdManager *)pNtk->pManFunc, (DdNode *)pNode->pData );
1009 pNode->pData = pBlifMv;
1010 }
1011
1012 // update the functionality type
1013 pNtk->ntkFunc = ABC_FUNC_BLIFMV;
1014 Cudd_Quit( (DdManager *)pNtk->pManFunc );
1015 pNtk->pManFunc = pMmFlex;
1016
1017 Vec_StrFree( vCube );
1018#endif
1019 return 1;
1020}
ABC_DLL int Abc_NtkToBdd(Abc_Ntk_t *pNtk)
Definition abcFunc.c:1299
#define Abc_CubeForEachVar(pCube, Value, i)
Definition abc.h:536
ABC_DLL void Abc_NodeBddToCnf(Abc_Obj_t *pNode, Mem_Flex_t *pMmMan, Vec_Str_t *vCube, int fAllPrimes, char **ppSop0, char **ppSop1)
Definition abcFunc.c:867
ABC_DLL int Abc_SopGetCubeNum(char *pSop)
Definition abcSop.c:537
struct Vec_Str_t_ Vec_Str_t
Definition bblif.c:46
char * Mem_FlexEntryFetch(Mem_Flex_t *p, int nBytes)
Definition mem.c:388
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkCountCopy()

ABC_DLL int Abc_NtkCountCopy ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Counts the number of nodes having non-trivial copies.]

Description []

SideEffects []

SeeAlso []

Definition at line 605 of file abcUtil.c.

606{
607 Abc_Obj_t * pObj;
608 int i, Counter = 0;
609 Abc_NtkForEachObj( pNtk, pObj, i )
610 {
611 if ( Abc_ObjIsNode(pObj) )
612 Counter += (pObj->pCopy != NULL);
613 }
614 return Counter;
615}
Here is the caller graph for this function:

◆ Abc_NtkCountSelfFeedLatches()

ABC_DLL int Abc_NtkCountSelfFeedLatches ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Checks if latches form self-loop.]

Description []

SideEffects []

SeeAlso []

Definition at line 92 of file abcLatch.c.

93{
94 Abc_Obj_t * pLatch;
95 int i, Counter;
96 Counter = 0;
97 Abc_NtkForEachLatch( pNtk, pLatch, i )
98 {
99// if ( Abc_NtkLatchIsSelfFeed(pLatch) && Abc_ObjFanoutNum(pLatch) > 1 )
100// printf( "Fanouts = %d.\n", Abc_ObjFanoutNum(pLatch) );
101 Counter += Abc_NtkLatchIsSelfFeed( pLatch );
102 }
103 return Counter;
104}
int Abc_NtkLatchIsSelfFeed(Abc_Obj_t *pLatch)
Definition abcLatch.c:71
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkCreateCone()

ABC_DLL Abc_Ntk_t * Abc_NtkCreateCone ( Abc_Ntk_t * pNtk,
Abc_Obj_t * pNode,
char * pNodeName,
int fUseAllCis )
extern

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

Synopsis [Creates the network composed of one logic cone.]

Description []

SideEffects []

SeeAlso []

Definition at line 925 of file abcNtk.c.

926{
927 Abc_Ntk_t * pNtkNew;
928 Vec_Ptr_t * vNodes;
929 Abc_Obj_t * pObj, * pFanin, * pNodeCoNew;
930 char Buffer[1000];
931 int i, k;
932
933 assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsStrash(pNtk) );
934 assert( Abc_ObjIsNode(pNode) || (Abc_NtkIsStrash(pNtk) && (Abc_AigNodeIsConst(pNode) || Abc_ObjIsCi(pNode))) );
935
936 // start the network
937 pNtkNew = Abc_NtkAlloc( pNtk->ntkType, pNtk->ntkFunc, 1 );
938 // set the name
939 sprintf( Buffer, "%s_%s", pNtk->pName, pNodeName );
940 pNtkNew->pName = Extra_UtilStrsav(Buffer);
941
942 // establish connection between the constant nodes
943 if ( Abc_NtkIsStrash(pNtk) )
944 Abc_AigConst1(pNtk)->pCopy = Abc_AigConst1(pNtkNew);
945
946 // collect the nodes in the TFI of the output (mark the TFI)
947 vNodes = Abc_NtkDfsNodes( pNtk, &pNode, 1 );
948 // create the PIs
949 Abc_NtkForEachCi( pNtk, pObj, i )
950 {
951 if ( fUseAllCis || Abc_NodeIsTravIdCurrent(pObj) ) // TravId is set by DFS
952 {
953 pObj->pCopy = Abc_NtkCreatePi(pNtkNew);
954 Abc_ObjAssignName( pObj->pCopy, Abc_ObjName(pObj), NULL );
955 }
956 }
957 // add the PO corresponding to this output
958 pNodeCoNew = Abc_NtkCreatePo( pNtkNew );
959 Abc_ObjAssignName( pNodeCoNew, pNodeName, NULL );
960 // copy the nodes
961 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
962 {
963 // if it is an AIG, add to the hash table
964 if ( Abc_NtkIsStrash(pNtk) )
965 {
966 pObj->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
967 }
968 else
969 {
970 Abc_NtkDupObj( pNtkNew, pObj, 0 );
971 Abc_ObjForEachFanin( pObj, pFanin, k )
972 Abc_ObjAddFanin( pObj->pCopy, pFanin->pCopy );
973 }
974 }
975 // connect the internal nodes to the new CO
976 Abc_ObjAddFanin( pNodeCoNew, pNode->pCopy );
977 Vec_PtrFree( vNodes );
978
979 if ( !Abc_NtkCheck( pNtkNew ) )
980 fprintf( stdout, "Abc_NtkCreateCone(): Network check has failed.\n" );
981 return pNtkNew;
982}
ABC_NAMESPACE_IMPL_START Abc_Ntk_t * Abc_NtkAlloc(Abc_NtkType_t Type, Abc_NtkFunc_t Func, int fUseMemMan)
DECLARATIONS ///.
Definition abcNtk.c:53
char * sprintf()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkCreateConeArray()

ABC_DLL Abc_Ntk_t * Abc_NtkCreateConeArray ( Abc_Ntk_t * pNtk,
Vec_Ptr_t * vRoots,
int fUseAllCis )
extern

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

Synopsis [Creates the network composed of several logic cones.]

Description []

SideEffects []

SeeAlso []

Definition at line 995 of file abcNtk.c.

996{
997 Abc_Ntk_t * pNtkNew;
998 Vec_Ptr_t * vNodes;
999 Abc_Obj_t * pObj, * pFanin, * pNodeCoNew;
1000 char Buffer[1000];
1001 int i, k;
1002
1003 assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsStrash(pNtk) );
1004
1005 // start the network
1006 pNtkNew = Abc_NtkAlloc( pNtk->ntkType, pNtk->ntkFunc, 1 );
1007 // set the name
1008 sprintf( Buffer, "%s_part", pNtk->pName );
1009 pNtkNew->pName = Extra_UtilStrsav(Buffer);
1010
1011 // establish connection between the constant nodes
1012 if ( Abc_NtkIsStrash(pNtk) )
1013 Abc_AigConst1(pNtk)->pCopy = Abc_AigConst1(pNtkNew);
1014
1015 // collect the nodes in the TFI of the output (mark the TFI)
1016 vNodes = Abc_NtkDfsNodes( pNtk, (Abc_Obj_t **)Vec_PtrArray(vRoots), Vec_PtrSize(vRoots) );
1017
1018 // create the PIs
1019 Abc_NtkForEachCi( pNtk, pObj, i )
1020 {
1021 if ( fUseAllCis || Abc_NodeIsTravIdCurrent(pObj) ) // TravId is set by DFS
1022 {
1023 pObj->pCopy = Abc_NtkCreatePi(pNtkNew);
1024 Abc_ObjAssignName( pObj->pCopy, Abc_ObjName(pObj), NULL );
1025 }
1026 }
1027
1028 // copy the nodes
1029 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
1030 {
1031 // if it is an AIG, add to the hash table
1032 if ( Abc_NtkIsStrash(pNtk) )
1033 {
1034 pObj->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
1035 }
1036 else
1037 {
1038 Abc_NtkDupObj( pNtkNew, pObj, 0 );
1039 Abc_ObjForEachFanin( pObj, pFanin, k )
1040 Abc_ObjAddFanin( pObj->pCopy, pFanin->pCopy );
1041 }
1042 }
1043 Vec_PtrFree( vNodes );
1044
1045 // add the POs corresponding to the root nodes
1046 Vec_PtrForEachEntry( Abc_Obj_t *, vRoots, pObj, i )
1047 {
1048 // create the PO node
1049 pNodeCoNew = Abc_NtkCreatePo( pNtkNew );
1050 // connect the internal nodes to the new CO
1051 if ( Abc_ObjIsCo(pObj) )
1052 Abc_ObjAddFanin( pNodeCoNew, Abc_ObjChild0Copy(pObj) );
1053 else
1054 Abc_ObjAddFanin( pNodeCoNew, pObj->pCopy );
1055 // assign the name
1056 Abc_ObjAssignName( pNodeCoNew, Abc_ObjName(pObj), NULL );
1057 }
1058
1059 if ( !Abc_NtkCheck( pNtkNew ) )
1060 fprintf( stdout, "Abc_NtkCreateConeArray(): Network check has failed.\n" );
1061 return pNtkNew;
1062}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkCreateFromGias()

ABC_DLL Abc_Ntk_t * Abc_NtkCreateFromGias ( char * pName,
Vec_Ptr_t * vGias,
Gia_Man_t * pMulti )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 2550 of file abcNtk.c.

2551{
2552 Gia_Man_t * pGia = pMulti ? pMulti : (Gia_Man_t *)Vec_PtrEntry(vGias, 0);
2554 Abc_Obj_t * pAbcObj, * pAbcObjPo;
2555 Gia_Obj_t * pObj; int i, k;
2556 pNtk->pName = Extra_UtilStrsav( pName );
2557 for ( k = 0; k < Gia_ManCiNum(pGia); k++ )
2558 Abc_NtkCreatePi( pNtk );
2559 if ( pMulti )
2560 {
2561 Gia_ManCleanValue(pGia);
2562 Gia_ManForEachCi( pGia, pObj, k )
2563 pObj->Value = Abc_ObjId( Abc_NtkCi(pNtk, k) );
2564 Gia_ManForEachAnd( pGia, pObj, k )
2565 {
2566 Abc_Obj_t * pAbcObj0 = Abc_NtkObj( pNtk, Gia_ObjFanin0(pObj)->Value );
2567 Abc_Obj_t * pAbcObj1 = Abc_NtkObj( pNtk, Gia_ObjFanin1(pObj)->Value );
2568 pAbcObj0 = Abc_ObjNotCond( pAbcObj0, Gia_ObjFaninC0(pObj) );
2569 pAbcObj1 = Abc_ObjNotCond( pAbcObj1, Gia_ObjFaninC1(pObj) );
2570 pAbcObj = Abc_AigAnd( (Abc_Aig_t *)pNtk->pManFunc, pAbcObj0, pAbcObj1 );
2571 pObj->Value = Abc_ObjId( pAbcObj );
2572 }
2573 Gia_ManForEachCo( pGia, pObj, k )
2574 {
2575 //pObj = Gia_ManCo(pGia, 0);
2576 if ( Gia_ObjFaninId0p(pGia, pObj) == 0 )
2577 pAbcObj = Abc_ObjNot( Abc_AigConst1(pNtk) );
2578 else
2579 pAbcObj = Abc_NtkObj( pNtk, Gia_ObjFanin0(pObj)->Value );
2580 pAbcObj = Abc_ObjNotCond( pAbcObj, Gia_ObjFaninC0(pObj) );
2581 pAbcObjPo = Abc_NtkCreatePo( pNtk );
2582 Abc_ObjAddFanin( pAbcObjPo, pAbcObj );
2583 }
2584 }
2585 else
2586 {
2587 Vec_PtrForEachEntry( Gia_Man_t *, vGias, pGia, i )
2588 {
2589 assert( Gia_ManCoNum(pGia) == 1 );
2590 Gia_ManCleanValue(pGia);
2591 Gia_ManForEachCi( pGia, pObj, k )
2592 pObj->Value = Abc_ObjId( Abc_NtkCi(pNtk, k) );
2593 Gia_ManForEachAnd( pGia, pObj, k )
2594 {
2595 Abc_Obj_t * pAbcObj0 = Abc_NtkObj( pNtk, Gia_ObjFanin0(pObj)->Value );
2596 Abc_Obj_t * pAbcObj1 = Abc_NtkObj( pNtk, Gia_ObjFanin1(pObj)->Value );
2597 pAbcObj0 = Abc_ObjNotCond( pAbcObj0, Gia_ObjFaninC0(pObj) );
2598 pAbcObj1 = Abc_ObjNotCond( pAbcObj1, Gia_ObjFaninC1(pObj) );
2599 pAbcObj = Abc_AigAnd( (Abc_Aig_t *)pNtk->pManFunc, pAbcObj0, pAbcObj1 );
2600 pObj->Value = Abc_ObjId( pAbcObj );
2601 }
2602 pObj = Gia_ManCo(pGia, 0);
2603 if ( Gia_ObjFaninId0p(pGia, pObj) == 0 )
2604 pAbcObj = Abc_ObjNot( Abc_AigConst1(pNtk) );
2605 else
2606 pAbcObj = Abc_NtkObj( pNtk, Gia_ObjFanin0(pObj)->Value );
2607 pAbcObj = Abc_ObjNotCond( pAbcObj, Gia_ObjFaninC0(pObj) );
2608 pAbcObjPo = Abc_NtkCreatePo( pNtk );
2609 Abc_ObjAddFanin( pAbcObjPo, pAbcObj );
2610 }
2611 }
2612 Abc_NtkAddDummyPiNames( pNtk );
2613 Abc_NtkAddDummyPoNames( pNtk );
2614 return pNtk;
2615}
ABC_DLL void Abc_NtkAddDummyPoNames(Abc_Ntk_t *pNtk)
Definition abcNames.c:521
ABC_DLL void Abc_NtkAddDummyPiNames(Abc_Ntk_t *pNtk)
Definition abcNames.c:495
#define Gia_ManForEachAnd(p, pObj, i)
Definition gia.h:1214
struct Gia_Obj_t_ Gia_Obj_t
Definition gia.h:76
void Gia_ManCleanValue(Gia_Man_t *p)
Definition giaUtil.c:351
#define Gia_ManForEachCo(p, pObj, i)
Definition gia.h:1236
#define Gia_ManForEachCi(p, pObj, i)
Definition gia.h:1228
unsigned Value
Definition gia.h:89
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkCreateFromNode()

ABC_DLL Abc_Ntk_t * Abc_NtkCreateFromNode ( Abc_Ntk_t * pNtk,
Abc_Obj_t * pNode )
extern

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

Synopsis [Creates the network composed of one node.]

Description []

SideEffects []

SeeAlso []

Definition at line 1260 of file abcNtk.c.

1261{
1262 Abc_Ntk_t * pNtkNew;
1263 Abc_Obj_t * pFanin, * pNodePo;
1264 int i;
1265 // start the network
1266 pNtkNew = Abc_NtkAlloc( pNtk->ntkType, pNtk->ntkFunc, 1 );
1267 pNtkNew->pName = Extra_UtilStrsav(Abc_ObjName(pNode));
1268 // add the PIs corresponding to the fanins of the node
1269 Abc_ObjForEachFanin( pNode, pFanin, i )
1270 {
1271 pFanin->pCopy = Abc_NtkCreatePi( pNtkNew );
1272 Abc_ObjAssignName( pFanin->pCopy, Abc_ObjName(pFanin), NULL );
1273 }
1274 // duplicate and connect the node
1275 pNode->pCopy = Abc_NtkDupObj( pNtkNew, pNode, 0 );
1276 Abc_ObjForEachFanin( pNode, pFanin, i )
1277 Abc_ObjAddFanin( pNode->pCopy, pFanin->pCopy );
1278 // create the only PO
1279 pNodePo = Abc_NtkCreatePo( pNtkNew );
1280 Abc_ObjAddFanin( pNodePo, pNode->pCopy );
1281 Abc_ObjAssignName( pNodePo, Abc_ObjName(pNode), NULL );
1282 if ( !Abc_NtkCheck( pNtkNew ) )
1283 fprintf( stdout, "Abc_NtkCreateFromNode(): Network check has failed.\n" );
1284 return pNtkNew;
1285}
Here is the call graph for this function:

◆ Abc_NtkCreateFromRange()

ABC_DLL Abc_Ntk_t * Abc_NtkCreateFromRange ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Creates the network composed of one node.]

Description []

SideEffects []

SeeAlso []

Definition at line 1298 of file abcNtk.c.

1299{
1300 Abc_Ntk_t * pNtkNew;
1301 Abc_Obj_t * pObj, * pNodeNew, * pNodePo;
1302 Gia_Man_t * p = Abc_NtkClpGia( pNtk ); int i;
1303 Vec_Str_t * vStr = Gia_ManComputeRange( p );
1304 Gia_ManStop( p );
1305 pNtkNew = Abc_NtkAlloc( ABC_NTK_LOGIC, ABC_FUNC_SOP, 1 );
1306 pNtkNew->pName = Extra_UtilStrsav("range");
1307 Abc_NtkForEachCo( pNtk, pObj, i )
1308 Abc_ObjAssignName( Abc_NtkCreatePi(pNtkNew), Abc_ObjName(pObj), NULL );
1309 pNodeNew = Abc_NtkCreateObj( pNtkNew, ABC_OBJ_NODE );
1310 pNodeNew->pData = Abc_SopRegister( (Mem_Flex_t *)pNtkNew->pManFunc, Vec_StrArray(vStr) );
1311 Vec_StrFree( vStr );
1312 Abc_NtkForEachCi( pNtkNew, pObj, i )
1313 Abc_ObjAddFanin( pNodeNew, pObj );
1314 pNodePo = Abc_NtkCreatePo( pNtkNew );
1315 Abc_ObjAddFanin( pNodePo, pNodeNew );
1316 Abc_ObjAssignName( pNodePo, "range", NULL );
1317 if ( !Abc_NtkCheck( pNtkNew ) )
1318 fprintf( stdout, "Abc_NtkCreateFromNode(): Network check has failed.\n" );
1319 return pNtkNew;
1320}
ABC_DLL Gia_Man_t * Abc_NtkClpGia(Abc_Ntk_t *pNtk)
void Gia_ManStop(Gia_Man_t *p)
Definition giaMan.c:82
Vec_Str_t * Gia_ManComputeRange(Gia_Man_t *p)
Here is the call graph for this function:

◆ Abc_NtkCreateFromSops()

ABC_DLL Abc_Ntk_t * Abc_NtkCreateFromSops ( char * pName,
Vec_Ptr_t * vSops )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 2512 of file abcNtk.c.

2513{
2514 int i, k, nObjBeg;
2515 char * pSop = (char *)Vec_PtrEntry(vSops, 0);
2517 pNtk->pName = Extra_UtilStrsav( pName );
2518 for ( k = 0; pSop[k] != ' '; k++ )
2519 Abc_NtkCreatePi( pNtk );
2520 nObjBeg = Abc_NtkObjNumMax(pNtk);
2521 Vec_PtrForEachEntry( char *, vSops, pSop, i )
2522 {
2523 Abc_Obj_t * pObj = Abc_NtkCreateNode( pNtk );
2524 pObj->pData = Abc_SopRegister( (Mem_Flex_t*)pNtk->pManFunc, pSop );
2525 for ( k = 0; pSop[k] != ' '; k++ )
2526 Abc_ObjAddFanin( pObj, Abc_NtkCi(pNtk, k) );
2527 }
2528 for ( i = 0; i < Vec_PtrSize(vSops); i++ )
2529 {
2530 Abc_Obj_t * pObj = Abc_NtkObj( pNtk, nObjBeg + i );
2531 Abc_Obj_t * pObjPo = Abc_NtkCreatePo( pNtk );
2532 Abc_ObjAddFanin( pObjPo, pObj );
2533 }
2534 Abc_NtkAddDummyPiNames( pNtk );
2535 Abc_NtkAddDummyPoNames( pNtk );
2536 return pNtk;
2537}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkCreateMffc()

ABC_DLL Abc_Ntk_t * Abc_NtkCreateMffc ( Abc_Ntk_t * pNtk,
Abc_Obj_t * pNode,
char * pNodeName )
extern

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

Synopsis [Creates the network composed of MFFC of one node.]

Description []

SideEffects []

SeeAlso []

Definition at line 1128 of file abcNtk.c.

1129{
1130 Abc_Ntk_t * pNtkNew;
1131 Abc_Obj_t * pObj, * pFanin, * pNodeCoNew;
1132 Vec_Ptr_t * vCone, * vSupp;
1133 char Buffer[1000];
1134 int i, k;
1135
1136 assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsStrash(pNtk) );
1137 assert( Abc_ObjIsNode(pNode) );
1138
1139 // start the network
1140 pNtkNew = Abc_NtkAlloc( pNtk->ntkType, pNtk->ntkFunc, 1 );
1141 // set the name
1142 sprintf( Buffer, "%s_%s", pNtk->pName, pNodeName );
1143 pNtkNew->pName = Extra_UtilStrsav(Buffer);
1144
1145 // establish connection between the constant nodes
1146 if ( Abc_NtkIsStrash(pNtk) )
1147 Abc_AigConst1(pNtk)->pCopy = Abc_AigConst1(pNtkNew);
1148
1149 // collect the nodes in MFFC
1150 vCone = Vec_PtrAlloc( 100 );
1151 vSupp = Vec_PtrAlloc( 100 );
1152 Abc_NodeDeref_rec( pNode );
1153 Abc_NodeMffcConeSupp( pNode, vCone, vSupp );
1154 Abc_NodeRef_rec( pNode );
1155 // create the PIs
1156 Vec_PtrForEachEntry( Abc_Obj_t *, vSupp, pObj, i )
1157 {
1158 pObj->pCopy = Abc_NtkCreatePi(pNtkNew);
1159 Abc_ObjAssignName( pObj->pCopy, Abc_ObjName(pObj), NULL );
1160 }
1161 // create the PO
1162 pNodeCoNew = Abc_NtkCreatePo( pNtkNew );
1163 Abc_ObjAssignName( pNodeCoNew, pNodeName, NULL );
1164 // copy the nodes
1165 Vec_PtrForEachEntry( Abc_Obj_t *, vCone, pObj, i )
1166 {
1167 // if it is an AIG, add to the hash table
1168 if ( Abc_NtkIsStrash(pNtk) )
1169 {
1170 pObj->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
1171 }
1172 else
1173 {
1174 Abc_NtkDupObj( pNtkNew, pObj, 0 );
1175 Abc_ObjForEachFanin( pObj, pFanin, k )
1176 Abc_ObjAddFanin( pObj->pCopy, pFanin->pCopy );
1177 }
1178 }
1179 // connect the topmost node
1180 Abc_ObjAddFanin( pNodeCoNew, pNode->pCopy );
1181 Vec_PtrFree( vCone );
1182 Vec_PtrFree( vSupp );
1183
1184 if ( !Abc_NtkCheck( pNtkNew ) )
1185 fprintf( stdout, "Abc_NtkCreateMffc(): Network check has failed.\n" );
1186 return pNtkNew;
1187}
ABC_DLL int Abc_NodeRef_rec(Abc_Obj_t *pNode)
Definition abcRefs.c:241
ABC_DLL int Abc_NodeDeref_rec(Abc_Obj_t *pNode)
Definition abcRefs.c:215
ABC_DLL void Abc_NodeMffcConeSupp(Abc_Obj_t *pNode, Vec_Ptr_t *vCone, Vec_Ptr_t *vSupp)
Definition abcRefs.c:299
Here is the call graph for this function:

◆ Abc_NtkCreateNodeAnd()

ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeAnd ( Abc_Ntk_t * pNtk,
Vec_Ptr_t * vFanins )
extern

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

Synopsis [Creates AND.]

Description []

SideEffects []

SeeAlso []

Definition at line 738 of file abcObj.c.

739{
740 Abc_Obj_t * pNode;
741 int i;
742 assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsNetlist(pNtk) );
743 pNode = Abc_NtkCreateNode( pNtk );
744 for ( i = 0; i < vFanins->nSize; i++ )
745 Abc_ObjAddFanin( pNode, (Abc_Obj_t *)vFanins->pArray[i] );
746 if ( Abc_NtkHasSop(pNtk) )
747 pNode->pData = Abc_SopCreateAnd( (Mem_Flex_t *)pNtk->pManFunc, Vec_PtrSize(vFanins), NULL );
748#ifdef ABC_USE_CUDD
749 else if ( Abc_NtkHasBdd(pNtk) )
750 pNode->pData = Extra_bddCreateAnd( (DdManager *)pNtk->pManFunc, Vec_PtrSize(vFanins) ), Cudd_Ref((DdNode *)pNode->pData);
751#endif
752 else if ( Abc_NtkHasAig(pNtk) )
753 pNode->pData = Hop_CreateAnd( (Hop_Man_t *)pNtk->pManFunc, Vec_PtrSize(vFanins) );
754 else
755 assert( 0 );
756 return pNode;
757}
ABC_DLL char * Abc_SopCreateAnd(Mem_Flex_t *pMan, int nVars, int *pfCompl)
Definition abcSop.c:168
DdNode * Extra_bddCreateAnd(DdManager *dd, int nVars)
Hop_Obj_t * Hop_CreateAnd(Hop_Man_t *p, int nVars)
Definition hopOper.c:320
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkCreateNodeBuf()

ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeBuf ( Abc_Ntk_t * pNtk,
Abc_Obj_t * pFanin )
extern

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

Synopsis [Creates buffer.]

Description []

SideEffects []

SeeAlso []

Definition at line 706 of file abcObj.c.

707{
708 Abc_Obj_t * pNode;
709 assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsNetlist(pNtk) );
710 pNode = Abc_NtkCreateNode( pNtk );
711 if ( pFanin ) Abc_ObjAddFanin( pNode, pFanin );
712 if ( Abc_NtkHasSop(pNtk) )
713 pNode->pData = Abc_SopRegister( (Mem_Flex_t *)pNtk->pManFunc, "1 1\n" );
714#ifdef ABC_USE_CUDD
715 else if ( Abc_NtkHasBdd(pNtk) )
716 pNode->pData = Cudd_bddIthVar((DdManager *)pNtk->pManFunc,0), Cudd_Ref( (DdNode *)pNode->pData );
717#endif
718 else if ( Abc_NtkHasAig(pNtk) )
719 pNode->pData = Hop_IthVar((Hop_Man_t *)pNtk->pManFunc,0);
720 else if ( Abc_NtkHasMapping(pNtk) )
722 else
723 assert( 0 );
724 return pNode;
725}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkCreateNodeConst0()

ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeConst0 ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Creates constant 0 node.]

Description []

SideEffects []

SeeAlso []

Definition at line 612 of file abcObj.c.

613{
614 Abc_Obj_t * pNode;
615 assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsNetlist(pNtk) );
616 pNode = Abc_NtkCreateNode( pNtk );
617 if ( Abc_NtkHasSop(pNtk) || Abc_NtkHasBlifMv(pNtk) )
618 pNode->pData = Abc_SopRegister( (Mem_Flex_t *)pNtk->pManFunc, " 0\n" );
619#ifdef ABC_USE_CUDD
620 else if ( Abc_NtkHasBdd(pNtk) )
621 pNode->pData = Cudd_ReadLogicZero((DdManager *)pNtk->pManFunc), Cudd_Ref( (DdNode *)pNode->pData );
622#endif
623 else if ( Abc_NtkHasAig(pNtk) )
624 pNode->pData = Hop_ManConst0((Hop_Man_t *)pNtk->pManFunc);
625 else if ( Abc_NtkHasMapping(pNtk) )
627 else if ( !Abc_NtkHasBlackbox(pNtk) )
628 assert( 0 );
629 return pNode;
630}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkCreateNodeConst1()

ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeConst1 ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Creates constant 1 node.]

Description []

SideEffects []

SeeAlso []

Definition at line 643 of file abcObj.c.

644{
645 Abc_Obj_t * pNode;
646 assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsNetlist(pNtk) );
647 pNode = Abc_NtkCreateNode( pNtk );
648 if ( Abc_NtkHasSop(pNtk) || Abc_NtkHasBlifMv(pNtk) )
649 pNode->pData = Abc_SopRegister( (Mem_Flex_t *)pNtk->pManFunc, " 1\n" );
650#ifdef ABC_USE_CUDD
651 else if ( Abc_NtkHasBdd(pNtk) )
652 pNode->pData = Cudd_ReadOne((DdManager *)pNtk->pManFunc), Cudd_Ref( (DdNode *)pNode->pData );
653#endif
654 else if ( Abc_NtkHasAig(pNtk) )
655 pNode->pData = Hop_ManConst1((Hop_Man_t *)pNtk->pManFunc);
656 else if ( Abc_NtkHasMapping(pNtk) )
658 else if ( !Abc_NtkHasBlackbox(pNtk) )
659 assert( 0 );
660 return pNode;
661}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkCreateNodeExor()

ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeExor ( Abc_Ntk_t * pNtk,
Vec_Ptr_t * vFanins )
extern

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

Synopsis [Creates EXOR.]

Description []

SideEffects []

SeeAlso []

Definition at line 802 of file abcObj.c.

803{
804 Abc_Obj_t * pNode;
805 int i;
806 assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsNetlist(pNtk) );
807 pNode = Abc_NtkCreateNode( pNtk );
808 for ( i = 0; i < vFanins->nSize; i++ )
809 Abc_ObjAddFanin( pNode, (Abc_Obj_t *)vFanins->pArray[i] );
810 if ( Abc_NtkHasSop(pNtk) )
811 pNode->pData = Abc_SopCreateXorSpecial( (Mem_Flex_t *)pNtk->pManFunc, Vec_PtrSize(vFanins) );
812#ifdef ABC_USE_CUDD
813 else if ( Abc_NtkHasBdd(pNtk) )
814 pNode->pData = Extra_bddCreateExor( (DdManager *)pNtk->pManFunc, Vec_PtrSize(vFanins) ), Cudd_Ref((DdNode *)pNode->pData);
815#endif
816 else if ( Abc_NtkHasAig(pNtk) )
817 pNode->pData = Hop_CreateExor( (Hop_Man_t *)pNtk->pManFunc, Vec_PtrSize(vFanins) );
818 else
819 assert( 0 );
820 return pNode;
821}
ABC_DLL char * Abc_SopCreateXorSpecial(Mem_Flex_t *pMan, int nVars)
Definition abcSop.c:297
DdNode * Extra_bddCreateExor(DdManager *dd, int nVars)
Hop_Obj_t * Hop_CreateExor(Hop_Man_t *p, int nVars)
Definition hopOper.c:362
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkCreateNodeInv()

ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeInv ( Abc_Ntk_t * pNtk,
Abc_Obj_t * pFanin )
extern

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

Synopsis [Creates inverter.]

Description []

SideEffects []

SeeAlso []

Definition at line 674 of file abcObj.c.

675{
676 Abc_Obj_t * pNode;
677 assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsNetlist(pNtk) );
678 pNode = Abc_NtkCreateNode( pNtk );
679 if ( pFanin ) Abc_ObjAddFanin( pNode, pFanin );
680 if ( Abc_NtkHasSop(pNtk) )
681 pNode->pData = Abc_SopRegister( (Mem_Flex_t *)pNtk->pManFunc, "0 1\n" );
682#ifdef ABC_USE_CUDD
683 else if ( Abc_NtkHasBdd(pNtk) )
684 pNode->pData = Cudd_Not(Cudd_bddIthVar((DdManager *)pNtk->pManFunc,0)), Cudd_Ref( (DdNode *)pNode->pData );
685#endif
686 else if ( Abc_NtkHasAig(pNtk) )
687 pNode->pData = Hop_Not(Hop_IthVar((Hop_Man_t *)pNtk->pManFunc,0));
688 else if ( Abc_NtkHasMapping(pNtk) )
690 else
691 assert( 0 );
692 return pNode;
693}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkCreateNodeMux()

ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeMux ( Abc_Ntk_t * pNtk,
Abc_Obj_t * pNodeC,
Abc_Obj_t * pNode1,
Abc_Obj_t * pNode0 )
extern

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

Synopsis [Creates MUX.]

Description []

SideEffects []

SeeAlso []

Definition at line 834 of file abcObj.c.

835{
836 Abc_Obj_t * pNode;
837 assert( Abc_NtkIsLogic(pNtk) );
838 pNode = Abc_NtkCreateNode( pNtk );
839 Abc_ObjAddFanin( pNode, pNodeC );
840 Abc_ObjAddFanin( pNode, pNode1 );
841 Abc_ObjAddFanin( pNode, pNode0 );
842 if ( Abc_NtkHasSop(pNtk) )
843 pNode->pData = Abc_SopRegister( (Mem_Flex_t *)pNtk->pManFunc, "11- 1\n0-1 1\n" );
844#ifdef ABC_USE_CUDD
845 else if ( Abc_NtkHasBdd(pNtk) )
846 pNode->pData = Cudd_bddIte((DdManager *)pNtk->pManFunc,Cudd_bddIthVar((DdManager *)pNtk->pManFunc,0),Cudd_bddIthVar((DdManager *)pNtk->pManFunc,1),Cudd_bddIthVar((DdManager *)pNtk->pManFunc,2)), Cudd_Ref( (DdNode *)pNode->pData );
847#endif
848 else if ( Abc_NtkHasAig(pNtk) )
850 else
851 assert( 0 );
852 return pNode;
853}
Hop_Obj_t * Hop_Mux(Hop_Man_t *p, Hop_Obj_t *pC, Hop_Obj_t *p1, Hop_Obj_t *p0)
Definition hopOper.c:187
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkCreateNodeOr()

ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeOr ( Abc_Ntk_t * pNtk,
Vec_Ptr_t * vFanins )
extern

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

Synopsis [Creates OR.]

Description []

SideEffects []

SeeAlso []

Definition at line 770 of file abcObj.c.

771{
772 Abc_Obj_t * pNode;
773 int i;
774 assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsNetlist(pNtk) );
775 pNode = Abc_NtkCreateNode( pNtk );
776 for ( i = 0; i < vFanins->nSize; i++ )
777 Abc_ObjAddFanin( pNode, (Abc_Obj_t *)vFanins->pArray[i] );
778 if ( Abc_NtkHasSop(pNtk) )
779 pNode->pData = Abc_SopCreateOr( (Mem_Flex_t *)pNtk->pManFunc, Vec_PtrSize(vFanins), NULL );
780#ifdef ABC_USE_CUDD
781 else if ( Abc_NtkHasBdd(pNtk) )
782 pNode->pData = Extra_bddCreateOr( (DdManager *)pNtk->pManFunc, Vec_PtrSize(vFanins) ), Cudd_Ref((DdNode *)pNode->pData);
783#endif
784 else if ( Abc_NtkHasAig(pNtk) )
785 pNode->pData = Hop_CreateOr( (Hop_Man_t *)pNtk->pManFunc, Vec_PtrSize(vFanins) );
786 else
787 assert( 0 );
788 return pNode;
789}
ABC_DLL char * Abc_SopCreateOr(Mem_Flex_t *pMan, int nVars, int *pfCompl)
Definition abcSop.c:212
DdNode * Extra_bddCreateOr(DdManager *dd, int nVars)
Hop_Obj_t * Hop_CreateOr(Hop_Man_t *p, int nVars)
Definition hopOper.c:341
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkCreateObj()

ABC_DLL Abc_Obj_t * Abc_NtkCreateObj ( Abc_Ntk_t * pNtk,
Abc_ObjType_t Type )
extern

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

Synopsis [Adds the node to the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 109 of file abcObj.c.

110{
111 Abc_Obj_t * pObj;
112 // create new object, assign ID, and add to the array
113 pObj = Abc_ObjAlloc( pNtk, Type );
114 pObj->Id = pNtk->vObjs->nSize;
115 Vec_PtrPush( pNtk->vObjs, pObj );
116 pNtk->nObjCounts[Type]++;
117 pNtk->nObjs++;
118 // perform specialized operations depending on the object type
119 switch (Type)
120 {
121 case ABC_OBJ_NONE:
122 assert(0);
123 break;
124 case ABC_OBJ_CONST1:
125 assert(0);
126 break;
127 case ABC_OBJ_PI:
128// pObj->iTemp = Vec_PtrSize(pNtk->vCis);
129 Vec_PtrPush( pNtk->vPis, pObj );
130 Vec_PtrPush( pNtk->vCis, pObj );
131 break;
132 case ABC_OBJ_PO:
133// pObj->iTemp = Vec_PtrSize(pNtk->vCos);
134 Vec_PtrPush( pNtk->vPos, pObj );
135 Vec_PtrPush( pNtk->vCos, pObj );
136 break;
137 case ABC_OBJ_BI:
138 if ( pNtk->vCos ) Vec_PtrPush( pNtk->vCos, pObj );
139 break;
140 case ABC_OBJ_BO:
141 if ( pNtk->vCis ) Vec_PtrPush( pNtk->vCis, pObj );
142 break;
143 case ABC_OBJ_NET:
144 case ABC_OBJ_NODE:
145 break;
146 case ABC_OBJ_LATCH:
147 pObj->pData = (void *)ABC_INIT_NONE;
148 case ABC_OBJ_WHITEBOX:
149 case ABC_OBJ_BLACKBOX:
150 if ( pNtk->vBoxes ) Vec_PtrPush( pNtk->vBoxes, pObj );
151 break;
152 default:
153 assert(0);
154 break;
155 }
156 return pObj;
157}
ABC_NAMESPACE_IMPL_START Abc_Obj_t * Abc_ObjAlloc(Abc_Ntk_t *pNtk, Abc_ObjType_t Type)
DECLARATIONS ///.
Definition abcObj.c:52
int nObjs
Definition abc.h:172
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkCreateTarget()

ABC_DLL Abc_Ntk_t * Abc_NtkCreateTarget ( Abc_Ntk_t * pNtk,
Vec_Ptr_t * vRoots,
Vec_Int_t * vValues )
extern

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

Synopsis [Creates the miter composed of one multi-output cone.]

Description []

SideEffects []

SeeAlso []

Definition at line 1200 of file abcNtk.c.

1201{
1202 Vec_Ptr_t * vNodes;
1203 Abc_Ntk_t * pNtkNew;
1204 Abc_Obj_t * pObj, * pFinal, * pOther, * pNodePo;
1205 int i;
1206
1207 assert( Abc_NtkIsLogic(pNtk) );
1208
1209 // start the network
1210 Abc_NtkCleanCopy( pNtk );
1211 pNtkNew = Abc_NtkAlloc( ABC_NTK_STRASH, ABC_FUNC_AIG, 1 );
1212 pNtkNew->pName = Extra_UtilStrsav(pNtk->pName);
1213
1214 // collect the nodes in the TFI of the output
1215 vNodes = Abc_NtkDfsNodes( pNtk, (Abc_Obj_t **)vRoots->pArray, vRoots->nSize );
1216 // create the PIs
1217 Abc_NtkForEachCi( pNtk, pObj, i )
1218 {
1219 pObj->pCopy = Abc_NtkCreatePi(pNtkNew);
1220 Abc_ObjAssignName( pObj->pCopy, Abc_ObjName(pObj), NULL );
1221 }
1222 // copy the nodes
1223 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
1224 pObj->pCopy = Abc_NodeStrash( pNtkNew, pObj, 0 );
1225 Vec_PtrFree( vNodes );
1226
1227 // add the PO
1228 pFinal = Abc_AigConst1( pNtkNew );
1229 Vec_PtrForEachEntry( Abc_Obj_t *, vRoots, pObj, i )
1230 {
1231 if ( Abc_ObjIsCo(pObj) )
1232 pOther = Abc_ObjFanin0(pObj)->pCopy;
1233 else
1234 pOther = pObj->pCopy;
1235 if ( Vec_IntEntry(vValues, i) == 0 )
1236 pOther = Abc_ObjNot(pOther);
1237 pFinal = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, pFinal, pOther );
1238 }
1239
1240 // add the PO corresponding to this output
1241 pNodePo = Abc_NtkCreatePo( pNtkNew );
1242 Abc_ObjAddFanin( pNodePo, pFinal );
1243 Abc_ObjAssignName( pNodePo, "miter", NULL );
1244 if ( !Abc_NtkCheck( pNtkNew ) )
1245 fprintf( stdout, "Abc_NtkCreateTarget(): Network check has failed.\n" );
1246 return pNtkNew;
1247}
ABC_DLL Abc_Obj_t * Abc_NodeStrash(Abc_Ntk_t *pNtkNew, Abc_Obj_t *pNode, int fRecord)
Definition abcStrash.c:468
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkCreateWithNode()

ABC_DLL Abc_Ntk_t * Abc_NtkCreateWithNode ( char * pSop)
extern

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

Synopsis [Creates the network composed of one node with the given SOP.]

Description []

SideEffects []

SeeAlso []

Definition at line 1333 of file abcNtk.c.

1334{
1335 Abc_Ntk_t * pNtkNew;
1336 Abc_Obj_t * pFanin, * pNode, * pNodePo;
1337 Vec_Ptr_t * vNames;
1338 int i, nVars;
1339 // start the network
1340 pNtkNew = Abc_NtkAlloc( ABC_NTK_LOGIC, ABC_FUNC_SOP, 1 );
1341 pNtkNew->pName = Extra_UtilStrsav("ex");
1342 // create PIs
1343 Vec_PtrPush( pNtkNew->vObjs, NULL );
1344 nVars = Abc_SopGetVarNum( pSop );
1345 vNames = Abc_NodeGetFakeNames( nVars );
1346 for ( i = 0; i < nVars; i++ )
1347 Abc_ObjAssignName( Abc_NtkCreatePi(pNtkNew), (char *)Vec_PtrEntry(vNames, i), NULL );
1348 Abc_NodeFreeNames( vNames );
1349 // create the node, add PIs as fanins, set the function
1350 pNode = Abc_NtkCreateNode( pNtkNew );
1351 Abc_NtkForEachPi( pNtkNew, pFanin, i )
1352 Abc_ObjAddFanin( pNode, pFanin );
1353 pNode->pData = Abc_SopRegister( (Mem_Flex_t *)pNtkNew->pManFunc, pSop );
1354 // create the only PO
1355 pNodePo = Abc_NtkCreatePo(pNtkNew);
1356 Abc_ObjAddFanin( pNodePo, pNode );
1357 Abc_ObjAssignName( pNodePo, "F", NULL );
1358 if ( !Abc_NtkCheck( pNtkNew ) )
1359 fprintf( stdout, "Abc_NtkCreateWithNode(): Network check has failed.\n" );
1360 return pNtkNew;
1361}
ABC_DLL int Abc_SopGetVarNum(char *pSop)
Definition abcSop.c:584
ABC_DLL Vec_Ptr_t * Abc_NodeGetFakeNames(int nNames)
Definition abcNames.c:228
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkCreateWithNodes()

ABC_DLL Abc_Ntk_t * Abc_NtkCreateWithNodes ( Vec_Ptr_t * vSop)
extern

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

Synopsis [Creates the network composed of one node with the given SOP.]

Description []

SideEffects []

SeeAlso []

Definition at line 1374 of file abcNtk.c.

1375{
1376 Abc_Ntk_t * pNtkNew;
1377 Abc_Obj_t * pFanin, * pNode, * pNodePo;
1378 Vec_Ptr_t * vNames;
1379 int i, k, nVars; char Buffer[100];
1380 char * pSop = (char *)Vec_PtrEntry(vSop, 0);
1381 // start the network
1382 pNtkNew = Abc_NtkAlloc( ABC_NTK_LOGIC, ABC_FUNC_SOP, 1 );
1383 pNtkNew->pName = Extra_UtilStrsav("ex");
1384 // create PIs
1385 Vec_PtrPush( pNtkNew->vObjs, NULL );
1386 nVars = Abc_SopGetVarNum( pSop );
1387 vNames = Abc_NodeGetFakeNames( nVars );
1388 for ( i = 0; i < nVars; i++ )
1389 Abc_ObjAssignName( Abc_NtkCreatePi(pNtkNew), (char *)Vec_PtrEntry(vNames, i), NULL );
1390 Abc_NodeFreeNames( vNames );
1391 // create the node, add PIs as fanins, set the function
1392 Vec_PtrForEachEntry( char *, vSop, pSop, i )
1393 {
1394 pNode = Abc_NtkCreateNode( pNtkNew );
1395 if ( Abc_SopGetVarNum(pSop) > 0 )
1396 Abc_NtkForEachPi( pNtkNew, pFanin, k )
1397 Abc_ObjAddFanin( pNode, pFanin );
1398 pNode->pData = Abc_SopRegister( (Mem_Flex_t *)pNtkNew->pManFunc, pSop );
1399 // create the only PO
1400 pNodePo = Abc_NtkCreatePo(pNtkNew);
1401 Abc_ObjAddFanin( pNodePo, pNode );
1402 sprintf( Buffer, "F%d", i );
1403 Abc_ObjAssignName( pNodePo, Buffer, NULL );
1404 }
1405 if ( !Abc_NtkCheck( pNtkNew ) )
1406 fprintf( stdout, "Abc_NtkCreateWithNode(): Network check has failed.\n" );
1407 return pNtkNew;
1408}
Here is the call graph for this function:

◆ Abc_NtkDarLatchSweep()

ABC_DLL Abc_Ntk_t * Abc_NtkDarLatchSweep ( Abc_Ntk_t * pNtk,
int fLatchConst,
int fLatchEqual,
int fSaveNames,
int fUseMvSweep,
int nFramesSymb,
int nFramesSatur,
int fVerbose,
int fVeryVerbose )
extern

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

Synopsis [Gives the current ABC network to AIG manager for processing.]

Description []

SideEffects []

SeeAlso []

Definition at line 3317 of file abcDar.c.

3318{
3319 extern void Aig_ManPrintControlFanouts( Aig_Man_t * p );
3320 Abc_Ntk_t * pNtkAig;
3321 Aig_Man_t * pMan, * pTemp;
3322 pMan = Abc_NtkToDar( pNtk, 0, 1 );
3323 if ( pMan == NULL )
3324 return NULL;
3325 if ( fSaveNames )
3326 {
3327 Aig_ManSeqCleanup( pMan );
3328 if ( fLatchConst && pMan->nRegs )
3329 pMan = Aig_ManConstReduce( pMan, fUseMvSweep, nFramesSymb, nFramesSatur, fVerbose, fVeryVerbose );
3330 if ( fLatchEqual && pMan->nRegs )
3331 pMan = Aig_ManReduceLaches( pMan, fVerbose );
3332 }
3333 else
3334 {
3335 if ( pMan->vFlopNums )
3336 Vec_IntFree( pMan->vFlopNums );
3337 pMan->vFlopNums = NULL;
3338 pMan = Aig_ManScl( pTemp = pMan, fLatchConst, fLatchEqual, fUseMvSweep, nFramesSymb, nFramesSatur, fVerbose, fVeryVerbose );
3339 Aig_ManStop( pTemp );
3340 }
3341
3342 pNtkAig = Abc_NtkFromDarSeqSweep( pNtk, pMan );
3343//Aig_ManPrintControlFanouts( pMan );
3344 Aig_ManStop( pMan );
3345 return pNtkAig;
3346}
Abc_Ntk_t * Abc_NtkFromDarSeqSweep(Abc_Ntk_t *pNtkOld, Aig_Man_t *pMan)
Definition abcDar.c:473
void Aig_ManPrintControlFanouts(Aig_Man_t *p)
Definition aigUtil.c:1040
int Aig_ManSeqCleanup(Aig_Man_t *p)
Definition aigScl.c:158
Aig_Man_t * Aig_ManReduceLaches(Aig_Man_t *p, int fVerbose)
Definition aigScl.c:455
Aig_Man_t * Aig_ManConstReduce(Aig_Man_t *p, int fUseMvSweep, int nFramesSymb, int nFramesSatur, int fVerbose, int fVeryVerbose)
Definition aigTsim.c:498
Aig_Man_t * Aig_ManScl(Aig_Man_t *pAig, int fLatchConst, int fLatchEqual, int fUseMvSweep, int nFramesSymb, int nFramesSatur, int fVerbose, int fVeryVerbose)
Definition aigScl.c:650
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkDarPrintCone()

ABC_DLL int Abc_NtkDarPrintCone ( Abc_Ntk_t * pNtk)
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 4054 of file abcDar.c.

4055{
4056 extern void Saig_ManPrintCones( Aig_Man_t * pAig );
4057 Aig_Man_t * pMan;
4058 pMan = Abc_NtkToDar( pNtk, 0, 1 );
4059 if ( pMan == NULL )
4060 return 0;
4061 assert( Aig_ManRegNum(pMan) > 0 );
4062 Saig_ManPrintCones( pMan );
4063 Aig_ManStop( pMan );
4064 return 1;
4065}
void Saig_ManPrintCones(Aig_Man_t *p)
FUNCTION DECLARATIONS ///.
Definition saigCone.c:159
Here is the call graph for this function:

◆ Abc_NtkDelayTrace()

ABC_DLL float Abc_NtkDelayTrace ( Abc_Ntk_t * pNtk,
Abc_Obj_t * pOut,
Abc_Obj_t * pIn,
int fPrint )
extern

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

Synopsis [Performs delay-trace of the network. If input (pIn) or output (pOut) are given, finds the most-timing-critical path between them and prints it to the standard output. If input and/or output are not given, finds the most-critical path in the network and prints it.]

Description []

SideEffects []

SeeAlso []

Definition at line 1031 of file abcTiming.c.

1032{
1033 Vec_Int_t * vSlacks = NULL;
1034 Abc_Obj_t * pNode, * pDriver;
1035 Vec_Ptr_t * vNodes;
1036 Abc_Time_t * pTime;
1037 float tArrivalMax;
1038 int i;
1039
1040 assert( Abc_NtkIsMappedLogic(pNtk) );
1041 assert( pOut == NULL || Abc_ObjIsCo(pOut) );
1042 assert( pIn == NULL || Abc_ObjIsCi(pIn) );
1043
1044 // create slacks (need slacks if printing is requested even if pIn/pOut are not given)
1045 if ( pOut || pIn || fPrint )
1046 vSlacks = Abc_NtkDelayTraceSlackStart( pNtk );
1047
1048 // compute the timing
1049 Abc_NtkTimePrepare( pNtk );
1050 vNodes = Abc_NtkDfs( pNtk, 1 );
1051 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
1052 Abc_NodeDelayTraceArrival( pNode, vSlacks );
1053 Vec_PtrFree( vNodes );
1054
1055 // get the latest arrival times
1056 tArrivalMax = -ABC_INFINITY;
1057 Abc_NtkForEachCo( pNtk, pNode, i )
1058 {
1059 pDriver = Abc_ObjFanin0(pNode);
1060 pTime = Abc_NodeArrival(pDriver);
1061 if ( tArrivalMax < Abc_MaxFloat(pTime->Fall, pTime->Rise) )
1062 tArrivalMax = Abc_MaxFloat(pTime->Fall, pTime->Rise);
1063 }
1064
1065 // determine the output to print
1066 if ( fPrint && pOut == NULL )
1067 {
1068 Abc_NtkForEachCo( pNtk, pNode, i )
1069 {
1070 pDriver = Abc_ObjFanin0(pNode);
1071 pTime = Abc_NodeArrival(pDriver);
1072 if ( tArrivalMax == Abc_MaxFloat(pTime->Fall, pTime->Rise) )
1073 pOut = pNode;
1074 }
1075 assert( pOut != NULL );
1076 }
1077
1078 if ( fPrint )
1079 {
1080 Vec_Ptr_t * vPath = Vec_PtrAlloc( 100 );
1081 Vec_Int_t * vBest = Vec_IntStartFull( Abc_NtkObjNumMax(pNtk) );
1082 // traverse to determine the critical path
1083 Abc_NtkIncrementTravId( pNtk );
1084 if ( !Abc_NtkDelayTraceCritPath_rec( vSlacks, Abc_ObjFanin0(pOut), pIn, vBest ) )
1085 {
1086 if ( pIn == NULL )
1087 printf( "The logic cone of PO \"%s\" has no primary inputs.\n", Abc_ObjName(pOut) );
1088 else
1089 printf( "There is no combinational path between PI \"%s\" and PO \"%s\".\n", Abc_ObjName(pIn), Abc_ObjName(pOut) );
1090 }
1091 else
1092 {
1093 float Slack = 0.0, SlackAdd;
1094 int k, iFanin, Length = 0;
1095 Abc_Obj_t * pFanin;
1096 // check the additional slack
1097 SlackAdd = Abc_NodeReadRequiredWorst(pOut) - Abc_NodeReadArrivalWorst(Abc_ObjFanin0(pOut));
1098 // collect the critical path
1099 Abc_NtkDelayTraceCritPathCollect_rec( vSlacks, Abc_ObjFanin0(pOut), vBest, vPath );
1100 if ( pIn == NULL )
1101 pIn = (Abc_Obj_t *)Vec_PtrEntry( vPath, 0 );
1102 // find the longest gate name
1103 Vec_PtrForEachEntry( Abc_Obj_t *, vPath, pNode, i )
1104 if ( Abc_ObjIsNode(pNode) )
1105 Length = Abc_MaxInt( Length, strlen(Mio_GateReadName((Mio_Gate_t *)pNode->pData)) );
1106 // print critical path
1107 Abc_NtkLevel( pNtk );
1108 printf( "Critical path from PI \"%s\" to PO \"%s\":\n", Abc_ObjName(pIn), Abc_ObjName(pOut) );
1109 Vec_PtrForEachEntry( Abc_Obj_t *, vPath, pNode, i )
1110 {
1111 printf( "Level %3d : ", Abc_ObjLevel(pNode) );
1112 if ( Abc_ObjIsCi(pNode) )
1113 {
1114 printf( "Primary input \"%s\". ", Abc_ObjName(pNode) );
1115 printf( "Arrival time =%6.1f. ", Abc_NodeReadArrivalWorst(pNode) );
1116 printf( "\n" );
1117 continue;
1118 }
1119 if ( Abc_ObjIsCo(pNode) )
1120 {
1121 printf( "Primary output \"%s\". ", Abc_ObjName(pNode) );
1122 printf( "Arrival =%6.1f. ", Abc_NodeReadArrivalWorst(pNode) );
1123 }
1124 else
1125 {
1126 assert( Abc_ObjIsNode(pNode) );
1127 iFanin = Abc_NodeFindFanin( pNode, (Abc_Obj_t *)Vec_PtrEntry(vPath,i-1) );
1128 Slack = Abc_NtkDelayTraceSlack(vSlacks, pNode, iFanin);
1129 printf( "%10s/", Abc_ObjName(pNode) );
1130 printf( "%-4s", Mio_GateReadPinName((Mio_Gate_t *)pNode->pData, iFanin) );
1131 printf( " (%s)", Mio_GateReadName((Mio_Gate_t *)pNode->pData) );
1132 for ( k = strlen(Mio_GateReadName((Mio_Gate_t *)pNode->pData)); k < Length; k++ )
1133 printf( " " );
1134 printf( " " );
1135 printf( "Arrival =%6.1f. ", Abc_NodeReadArrivalWorst(pNode) );
1136 printf( "I/O times: (" );
1137 Abc_ObjForEachFanin( pNode, pFanin, k )
1138 printf( "%s%.1f", (k? ", ":""), Abc_NodeReadArrivalWorst(pFanin) );
1139// printf( " -> %.1f)", Abc_NodeReadArrival(pNode)->Worst + Slack + SlackAdd );
1140 printf( " -> %.1f)", Abc_NodeReadArrivalWorst(pNode) );
1141 }
1142 printf( "\n" );
1143 }
1144 printf( "Level %3d : ", Abc_ObjLevel(Abc_ObjFanin0(pOut)) + 1 );
1145 printf( "Primary output \"%s\". ", Abc_ObjName(pOut) );
1146 printf( "Required time = %6.1f. ", Abc_NodeReadRequiredWorst(pOut) );
1147 printf( "Path slack = %6.1f.\n", SlackAdd );
1148 }
1149 Vec_PtrFree( vPath );
1150 Vec_IntFree( vBest );
1151 }
1152
1153 Vec_IntFreeP( &vSlacks );
1154 return tArrivalMax;
1155}
float Abc_NodeReadArrivalWorst(Abc_Obj_t *pNode)
Definition abcTiming.c:111
void Abc_NtkDelayTraceCritPathCollect_rec(Vec_Int_t *vSlacks, Abc_Obj_t *pNode, Vec_Int_t *vBest, Vec_Ptr_t *vPath)
Definition abcTiming.c:916
Vec_Int_t * Abc_NtkDelayTraceSlackStart(Abc_Ntk_t *pNtk)
Definition abcTiming.c:828
int Abc_NtkDelayTraceCritPath_rec(Vec_Int_t *vSlacks, Abc_Obj_t *pNode, Abc_Obj_t *pLeaf, Vec_Int_t *vBest)
Definition abcTiming.c:876
void Abc_NtkTimePrepare(Abc_Ntk_t *pNtk)
Definition abcTiming.c:424
void Abc_NodeDelayTraceArrival(Abc_Obj_t *pNode, Vec_Int_t *vSlacks)
Definition abcTiming.c:939
float Abc_NodeReadRequiredWorst(Abc_Obj_t *pNode)
Definition abcTiming.c:115
ABC_DLL int Abc_NodeFindFanin(Abc_Obj_t *pNode, Abc_Obj_t *pFanin)
Definition abcUtil.c:791
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition abc_global.h:250
char * Mio_GateReadPinName(Mio_Gate_t *pGate, int iPin)
Definition mioApi.c:230
char * Mio_GateReadName(Mio_Gate_t *pGate)
Definition mioApi.c:169
int strlen()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkDelayTraceLut()

ABC_DLL float Abc_NtkDelayTraceLut ( Abc_Ntk_t * pNtk,
int fUseLutLib )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 100 of file abcSpeedup.c.

101{
102 int fUseSorting = 1;
103 int pPinPerm[32];
104 float pPinDelays[32];
105 If_LibLut_t * pLutLib;
106 Abc_Obj_t * pNode, * pFanin;
107 Vec_Ptr_t * vNodes;
108 float tArrival, tRequired, tSlack, * pDelays;
109 int i, k;
110
111 assert( Abc_NtkIsLogic(pNtk) );
112 // get the library
113 pLutLib = fUseLutLib? (If_LibLut_t *)Abc_FrameReadLibLut() : NULL;
114 if ( pLutLib && pLutLib->LutMax < Abc_NtkGetFaninMax(pNtk) )
115 {
116 printf( "The max LUT size (%d) is less than the max fanin count (%d).\n",
117 pLutLib->LutMax, Abc_NtkGetFaninMax(pNtk) );
118 return -ABC_INFINITY;
119 }
120
121 // initialize the arrival times
122 ABC_FREE( pNtk->pLutTimes );
123 pNtk->pLutTimes = ABC_ALLOC( float, 3 * Abc_NtkObjNumMax(pNtk) );
124 for ( i = 0; i < Abc_NtkObjNumMax(pNtk); i++ )
125 {
126 pNtk->pLutTimes[3*i+0] = pNtk->pLutTimes[3*i+2] = 0;
127 pNtk->pLutTimes[3*i+1] = ABC_INFINITY;
128 }
129
130 // propagate arrival times
131 vNodes = Abc_NtkDfs( pNtk, 1 );
132 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
133 {
134 tArrival = -ABC_INFINITY;
135 if ( pLutLib == NULL )
136 {
137 Abc_ObjForEachFanin( pNode, pFanin, k )
138 if ( tArrival < Abc_ObjArrival(pFanin) + 1.0 )
139 tArrival = Abc_ObjArrival(pFanin) + 1.0;
140 }
141 else if ( !pLutLib->fVarPinDelays )
142 {
143 pDelays = pLutLib->pLutDelays[Abc_ObjFaninNum(pNode)];
144 Abc_ObjForEachFanin( pNode, pFanin, k )
145 if ( tArrival < Abc_ObjArrival(pFanin) + pDelays[0] )
146 tArrival = Abc_ObjArrival(pFanin) + pDelays[0];
147 }
148 else
149 {
150 pDelays = pLutLib->pLutDelays[Abc_ObjFaninNum(pNode)];
151 if ( fUseSorting )
152 {
153 Abc_NtkDelayTraceSortPins( pNode, pPinPerm, pPinDelays );
154 Abc_ObjForEachFanin( pNode, pFanin, k )
155 if ( tArrival < Abc_ObjArrival(Abc_ObjFanin(pNode,pPinPerm[k])) + pDelays[k] )
156 tArrival = Abc_ObjArrival(Abc_ObjFanin(pNode,pPinPerm[k])) + pDelays[k];
157 }
158 else
159 {
160 Abc_ObjForEachFanin( pNode, pFanin, k )
161 if ( tArrival < Abc_ObjArrival(pFanin) + pDelays[k] )
162 tArrival = Abc_ObjArrival(pFanin) + pDelays[k];
163 }
164 }
165 if ( Abc_ObjFaninNum(pNode) == 0 )
166 tArrival = 0.0;
167 Abc_ObjSetArrival( pNode, tArrival );
168 }
169 Vec_PtrFree( vNodes );
170
171 // get the latest arrival times
172 tArrival = -ABC_INFINITY;
173 Abc_NtkForEachCo( pNtk, pNode, i )
174 if ( tArrival < Abc_ObjArrival(Abc_ObjFanin0(pNode)) )
175 tArrival = Abc_ObjArrival(Abc_ObjFanin0(pNode));
176
177 // initialize the required times
178 Abc_NtkForEachCo( pNtk, pNode, i )
179 if ( Abc_ObjRequired(Abc_ObjFanin0(pNode)) > tArrival )
180 Abc_ObjSetRequired( Abc_ObjFanin0(pNode), tArrival );
181
182 // propagate the required times
183 vNodes = Abc_NtkDfsReverse( pNtk );
184 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
185 {
186 if ( pLutLib == NULL )
187 {
188 tRequired = Abc_ObjRequired(pNode) - (float)1.0;
189 Abc_ObjForEachFanin( pNode, pFanin, k )
190 if ( Abc_ObjRequired(pFanin) > tRequired )
191 Abc_ObjSetRequired( pFanin, tRequired );
192 }
193 else if ( !pLutLib->fVarPinDelays )
194 {
195 pDelays = pLutLib->pLutDelays[Abc_ObjFaninNum(pNode)];
196 tRequired = Abc_ObjRequired(pNode) - pDelays[0];
197 Abc_ObjForEachFanin( pNode, pFanin, k )
198 if ( Abc_ObjRequired(pFanin) > tRequired )
199 Abc_ObjSetRequired( pFanin, tRequired );
200 }
201 else
202 {
203 pDelays = pLutLib->pLutDelays[Abc_ObjFaninNum(pNode)];
204 if ( fUseSorting )
205 {
206 Abc_NtkDelayTraceSortPins( pNode, pPinPerm, pPinDelays );
207 Abc_ObjForEachFanin( pNode, pFanin, k )
208 {
209 tRequired = Abc_ObjRequired(pNode) - pDelays[k];
210 if ( Abc_ObjRequired(Abc_ObjFanin(pNode,pPinPerm[k])) > tRequired )
211 Abc_ObjSetRequired( Abc_ObjFanin(pNode,pPinPerm[k]), tRequired );
212 }
213 }
214 else
215 {
216 Abc_ObjForEachFanin( pNode, pFanin, k )
217 {
218 tRequired = Abc_ObjRequired(pNode) - pDelays[k];
219 if ( Abc_ObjRequired(pFanin) > tRequired )
220 Abc_ObjSetRequired( pFanin, tRequired );
221 }
222 }
223 }
224 // set slack for this object
225 tSlack = Abc_ObjRequired(pNode) - Abc_ObjArrival(pNode);
226 assert( tSlack + 0.001 > 0.0 );
227 Abc_ObjSetSlack( pNode, tSlack < 0.0 ? 0.0 : tSlack );
228 }
229 Vec_PtrFree( vNodes );
230 return tArrival;
231}
void Abc_NtkDelayTraceSortPins(Abc_Obj_t *pNode, int *pPinPerm, float *pPinDelays)
FUNCTION DEFINITIONS ///.
Definition abcSpeedup.c:56
ABC_DLL int Abc_NtkGetFaninMax(Abc_Ntk_t *pNtk)
Definition abcUtil.c:486
ABC_DLL Vec_Ptr_t * Abc_NtkDfsReverse(Abc_Ntk_t *pNtk)
Definition abcDfs.c:221
ABC_DLL void * Abc_FrameReadLibLut()
Definition mainFrame.c:57
struct If_LibLut_t_ If_LibLut_t
Definition if.h:82
float * pLutTimes
Definition abc.h:210
int fVarPinDelays
Definition if.h:191
int LutMax
Definition if.h:190
float pLutDelays[IF_MAX_LUTSIZE+1][IF_MAX_LUTSIZE+1]
Definition if.h:193
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkDelete()

ABC_DLL void Abc_NtkDelete ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Deletes the Ntk.]

Description []

SideEffects []

SeeAlso []

Definition at line 1421 of file abcNtk.c.

1422{
1423 Abc_Obj_t * pObj;
1424 void * pAttrMan;
1425 int TotalMemory, i;
1426 int fWarning = 0;
1427// int LargePiece = (4 << ABC_NUM_STEPS);
1428 if ( pNtk == NULL )
1429 return;
1430 // free EXDC Ntk
1431 if ( pNtk->pExdc )
1432 Abc_NtkDelete( pNtk->pExdc );
1433 if ( pNtk->pExcare )
1434 Abc_NtkDelete( (Abc_Ntk_t *)pNtk->pExcare );
1435 // dereference the BDDs
1436 if ( Abc_NtkHasBdd(pNtk) )
1437 {
1438#ifdef ABC_USE_CUDD
1439 Abc_NtkForEachNode( pNtk, pObj, i )
1440 Cudd_RecursiveDeref( (DdManager *)pNtk->pManFunc, (DdNode *)pObj->pData );
1441#endif
1442 }
1443 // make sure all the marks are clean
1444 Abc_NtkForEachObj( pNtk, pObj, i )
1445 {
1446 // free large fanout arrays
1447// if ( pNtk->pMmObj && pObj->vFanouts.nCap * 4 > LargePiece )
1448// ABC_FREE( pObj->vFanouts.pArray );
1449 // these flags should be always zero
1450 // if this is not true, something is wrong somewhere
1451// assert( pObj->fMarkA == 0 );
1452// assert( pObj->fMarkB == 0 );
1453// assert( pObj->fMarkC == 0 );
1454 if ( !fWarning && (pObj->fMarkA || pObj->fMarkB || pObj->fMarkC) )
1455 { printf( "Flags A, B, or C are not zero.\n" ), fWarning = 1; }
1456 }
1457 // free the nodes
1458 if ( pNtk->pMmStep == NULL )
1459 {
1460 Abc_NtkForEachObj( pNtk, pObj, i )
1461 {
1462 ABC_FREE( pObj->vFanouts.pArray );
1463 ABC_FREE( pObj->vFanins.pArray );
1464 }
1465 }
1466 if ( pNtk->pMmObj == NULL )
1467 {
1468 Abc_NtkForEachObj( pNtk, pObj, i )
1469 ABC_FREE( pObj );
1470 }
1471
1472 // free the arrays
1473 Vec_PtrFree( pNtk->vPios );
1474 Vec_PtrFree( pNtk->vPis );
1475 Vec_PtrFree( pNtk->vPos );
1476 Vec_PtrFree( pNtk->vCis );
1477 Vec_PtrFree( pNtk->vCos );
1478 Vec_PtrFree( pNtk->vObjs );
1479 Vec_PtrFree( pNtk->vBoxes );
1480 ABC_FREE( pNtk->vTravIds.pArray );
1481 if ( pNtk->vLevelsR ) Vec_IntFree( pNtk->vLevelsR );
1482 ABC_FREE( pNtk->pModel );
1483 ABC_FREE( pNtk->pSeqModel );
1484 if ( pNtk->vSeqModelVec )
1485 Vec_PtrFreeFree( pNtk->vSeqModelVec );
1486 TotalMemory = 0;
1487 TotalMemory += pNtk->pMmObj? Mem_FixedReadMemUsage(pNtk->pMmObj) : 0;
1488 TotalMemory += pNtk->pMmStep? Mem_StepReadMemUsage(pNtk->pMmStep) : 0;
1489// fprintf( stdout, "The total memory allocated internally by the network = %0.2f MB.\n", ((double)TotalMemory)/(1<<20) );
1490 // free the storage
1491 if ( pNtk->pMmObj )
1492 Mem_FixedStop( pNtk->pMmObj, 0 );
1493 if ( pNtk->pMmStep )
1494 Mem_StepStop ( pNtk->pMmStep, 0 );
1495 // name manager
1496 Nm_ManFree( pNtk->pManName );
1497 // free the timing manager
1498 if ( pNtk->pManTime )
1499 Abc_ManTimeStop( pNtk->pManTime );
1500 Vec_IntFreeP( &pNtk->vPhases );
1501 // start the functionality manager
1502 if ( Abc_NtkIsStrash(pNtk) )
1503 Abc_AigFree( (Abc_Aig_t *)pNtk->pManFunc );
1504 else if ( Abc_NtkHasSop(pNtk) || Abc_NtkHasBlifMv(pNtk) )
1505 Mem_FlexStop( (Mem_Flex_t *)pNtk->pManFunc, 0 );
1506#ifdef ABC_USE_CUDD
1507 else if ( Abc_NtkHasBdd(pNtk) )
1508 Extra_StopManager( (DdManager *)pNtk->pManFunc );
1509#endif
1510 else if ( Abc_NtkHasAig(pNtk) )
1511 { if ( pNtk->pManFunc ) Hop_ManStop( (Hop_Man_t *)pNtk->pManFunc ); }
1512 else if ( Abc_NtkHasMapping(pNtk) )
1513 pNtk->pManFunc = NULL;
1514 else if ( !Abc_NtkHasBlackbox(pNtk) )
1515 assert( 0 );
1516 // free the hierarchy
1517 if ( pNtk->pDesign )
1518 {
1519 Abc_DesFree( pNtk->pDesign, pNtk );
1520 pNtk->pDesign = NULL;
1521 }
1522// if ( pNtk->pBlackBoxes )
1523// Vec_IntFree( pNtk->pBlackBoxes );
1524 // free node attributes
1525 Vec_PtrForEachEntry( Abc_Obj_t *, pNtk->vAttrs, pAttrMan, i )
1526 if ( pAttrMan )
1527 Vec_AttFree( (Vec_Att_t *)pAttrMan, 1 );
1528 assert( pNtk->pSCLib == NULL );
1529 Vec_IntFreeP( &pNtk->vGates );
1530 Vec_PtrFree( pNtk->vAttrs );
1531 Vec_IntFreeP( &pNtk->vNameIds );
1532 ABC_FREE( pNtk->pWLoadUsed );
1533 ABC_FREE( pNtk->pName );
1534 ABC_FREE( pNtk->pSpec );
1535 ABC_FREE( pNtk->pLutTimes );
1536 if ( pNtk->vOnehots )
1537 Vec_VecFree( (Vec_Vec_t *)pNtk->vOnehots );
1538 Vec_PtrFreeP( &pNtk->vLtlProperties );
1539 Vec_IntFreeP( &pNtk->vObjPerm );
1540 Vec_IntFreeP( &pNtk->vTopo );
1541 Vec_IntFreeP( &pNtk->vFins );
1542 Vec_IntFreeP( &pNtk->vOrigNodeIds );
1543 ABC_FREE( pNtk );
1544}
void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition abcNtk.c:1421
ABC_DLL void Abc_DesFree(Abc_Des_t *p, Abc_Ntk_t *pNtk)
Definition abcLib.c:94
ABC_DLL void Abc_AigFree(Abc_Aig_t *pMan)
Definition abcAig.c:165
ABC_DLL void Abc_ManTimeStop(Abc_ManTime_t *p)
Definition abcTiming.c:547
void Extra_StopManager(DdManager *dd)
int Mem_FixedReadMemUsage(Mem_Fixed_t *p)
Definition mem.c:293
void Mem_FixedStop(Mem_Fixed_t *p, int fVerbose)
Definition mem.c:139
void Mem_StepStop(Mem_Step_t *p, int fVerbose)
Definition mem.c:526
void Mem_FlexStop(Mem_Flex_t *p, int fVerbose)
Definition mem.c:359
int Mem_StepReadMemUsage(Mem_Step_t *p)
Definition mem.c:609
Abc_Cex_t * pSeqModel
Definition abc.h:199
char * pWLoadUsed
Definition abc.h:209
Vec_Int_t * vGates
Definition abc.h:207
Vec_Int_t * vOrigNodeIds
Definition abc.h:217
Vec_Int_t * vNameIds
Definition abc.h:215
void * pSCLib
Definition abc.h:206
Vec_Int_t * vFins
Definition abc.h:216
Vec_Int_t * vTopo
Definition abc.h:213
void * pExcare
Definition abc.h:202
int * pModel
Definition abc.h:198
Vec_Int_t * vObjPerm
Definition abc.h:212
Vec_Int_t vTravIds
Definition abc.h:188
Vec_Int_t * vPhases
Definition abc.h:208
Vec_Ptr_t * vSeqModelVec
Definition abc.h:200
Here is the call graph for this function:

◆ Abc_NtkDeleteAll_rec()

ABC_DLL void Abc_NtkDeleteAll_rec ( Abc_Obj_t * pObj)
extern

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

Synopsis [Deletes the node and MFFC of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 315 of file abcObj.c.

316{
317 Vec_Ptr_t * vNodes;
318 int i;
319 assert( !Abc_ObjIsComplement(pObj) );
320 assert( Abc_ObjFanoutNum(pObj) == 0 );
321 // delete fanins and fanouts
322 vNodes = Vec_PtrAlloc( 100 );
323 Abc_NodeCollectFanins( pObj, vNodes );
324 Abc_NtkDeleteObj( pObj );
325 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
326 if ( !Abc_ObjIsNode(pObj) && Abc_ObjFanoutNum(pObj) == 0 )
327 Abc_NtkDeleteAll_rec( pObj );
328 Vec_PtrFree( vNodes );
329}
void Abc_NtkDeleteAll_rec(Abc_Obj_t *pObj)
Definition abcObj.c:315
void Abc_NtkDeleteObj(Abc_Obj_t *pObj)
Definition abcObj.c:170
ABC_DLL void Abc_NodeCollectFanins(Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
Definition abcUtil.c:1627
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkDeleteObj()

ABC_DLL void Abc_NtkDeleteObj ( Abc_Obj_t * pObj)
extern

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

Synopsis [Deletes the object from the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 170 of file abcObj.c.

171{
172 Abc_Ntk_t * pNtk = pObj->pNtk;
173 Vec_Ptr_t * vNodes;
174 int i;
175 assert( !Abc_ObjIsComplement(pObj) );
176 // remove from the table of names
177 if ( Nm_ManFindNameById(pObj->pNtk->pManName, pObj->Id) )
178 Nm_ManDeleteIdName(pObj->pNtk->pManName, pObj->Id);
179 // delete fanins and fanouts
180 vNodes = Vec_PtrAlloc( 100 );
181 Abc_NodeCollectFanouts( pObj, vNodes );
182 for ( i = 0; i < vNodes->nSize; i++ )
183 Abc_ObjDeleteFanin( (Abc_Obj_t *)vNodes->pArray[i], pObj );
184 Abc_NodeCollectFanins( pObj, vNodes );
185 for ( i = 0; i < vNodes->nSize; i++ )
186 Abc_ObjDeleteFanin( pObj, (Abc_Obj_t *)vNodes->pArray[i] );
187 Vec_PtrFree( vNodes );
188 // remove from the list of objects
189 Vec_PtrWriteEntry( pNtk->vObjs, pObj->Id, NULL );
190 pObj->Id = (1<<26)-1;
191 pNtk->nObjCounts[pObj->Type]--;
192 pNtk->nObjs--;
193 // perform specialized operations depending on the object type
194 switch (pObj->Type)
195 {
196 case ABC_OBJ_NONE:
197 assert(0);
198 break;
199 case ABC_OBJ_CONST1:
200 assert(0);
201 break;
202 case ABC_OBJ_PI:
203 Vec_PtrRemove( pNtk->vPis, pObj );
204 Vec_PtrRemove( pNtk->vCis, pObj );
205 break;
206 case ABC_OBJ_PO:
207 Vec_PtrRemove( pNtk->vPos, pObj );
208 Vec_PtrRemove( pNtk->vCos, pObj );
209 break;
210 case ABC_OBJ_BI:
211 if ( pNtk->vCos ) Vec_PtrRemove( pNtk->vCos, pObj );
212 break;
213 case ABC_OBJ_BO:
214 if ( pNtk->vCis ) Vec_PtrRemove( pNtk->vCis, pObj );
215 break;
216 case ABC_OBJ_NET:
217 break;
218 case ABC_OBJ_NODE:
219#ifdef ABC_USE_CUDD
220 if ( Abc_NtkHasBdd(pNtk) )
221 Cudd_RecursiveDeref( (DdManager *)pNtk->pManFunc, (DdNode *)pObj->pData );
222#endif
223 pObj->pData = NULL;
224 break;
225 case ABC_OBJ_LATCH:
226 case ABC_OBJ_WHITEBOX:
227 case ABC_OBJ_BLACKBOX:
228 if ( pNtk->vBoxes ) Vec_PtrRemove( pNtk->vBoxes, pObj );
229 break;
230 default:
231 assert(0);
232 break;
233 }
234 // recycle the object memory
235 Abc_ObjRecycle( pObj );
236}
void Abc_ObjRecycle(Abc_Obj_t *pObj)
Definition abcObj.c:77
ABC_DLL void Abc_NodeCollectFanouts(Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
Definition abcUtil.c:1647
ABC_DLL void Abc_ObjDeleteFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
Definition abcFanio.c:111
char * Nm_ManFindNameById(Nm_Man_t *p, int ObjId)
Definition nmApi.c:199
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkDeleteObj_rec()

ABC_DLL void Abc_NtkDeleteObj_rec ( Abc_Obj_t * pObj,
int fOnlyNodes )
extern

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

Synopsis [Deletes the node and MFFC of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 278 of file abcObj.c.

279{
280 Vec_Ptr_t * vNodes;
281 int i;
282 assert( !Abc_ObjIsComplement(pObj) );
283 assert( !Abc_ObjIsPi(pObj) );
284 assert( Abc_ObjFanoutNum(pObj) == 0 );
285 // delete fanins and fanouts
286 vNodes = Vec_PtrAlloc( 100 );
287 Abc_NodeCollectFanins( pObj, vNodes );
288 Abc_NtkDeleteObj( pObj );
289 if ( fOnlyNodes )
290 {
291 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
292 if ( Abc_ObjIsNode(pObj) && Abc_ObjFanoutNum(pObj) == 0 )
293 Abc_NtkDeleteObj_rec( pObj, fOnlyNodes );
294 }
295 else
296 {
297 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
298 if ( !Abc_ObjIsPi(pObj) && Abc_ObjFanoutNum(pObj) == 0 )
299 Abc_NtkDeleteObj_rec( pObj, fOnlyNodes );
300 }
301 Vec_PtrFree( vNodes );
302}
void Abc_NtkDeleteObj_rec(Abc_Obj_t *pObj, int fOnlyNodes)
Definition abcObj.c:278
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkDeleteObjPo()

ABC_DLL void Abc_NtkDeleteObjPo ( Abc_Obj_t * pObj)
extern

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

Synopsis [Deletes the PO from the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 249 of file abcObj.c.

250{
251 assert( Abc_ObjIsPo(pObj) );
252 // remove from the table of names
253 if ( Nm_ManFindNameById(pObj->pNtk->pManName, pObj->Id) )
254 Nm_ManDeleteIdName(pObj->pNtk->pManName, pObj->Id);
255 // delete fanins
256 Abc_ObjDeleteFanin( pObj, Abc_ObjFanin0(pObj) );
257 // remove from the list of objects
258 Vec_PtrWriteEntry( pObj->pNtk->vObjs, pObj->Id, NULL );
259 pObj->Id = (1<<26)-1;
260 pObj->pNtk->nObjCounts[pObj->Type]--;
261 pObj->pNtk->nObjs--;
262 // recycle the object memory
263 Abc_ObjRecycle( pObj );
264}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkDeriveFromBdd()

ABC_DLL Abc_Ntk_t * Abc_NtkDeriveFromBdd ( void * dd,
void * bFunc,
char * pNamePo,
Vec_Ptr_t * vNamesPi )
extern
Here is the caller graph for this function:

◆ Abc_NtkDfs()

ABC_DLL Vec_Ptr_t * Abc_NtkDfs ( Abc_Ntk_t * pNtk,
int fCollectAll )
extern

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

Synopsis [Returns the DFS ordered array of logic nodes.]

Description [Collects only the internal nodes, leaving out CIs and CO. However it marks with the current TravId both CIs and COs.]

SideEffects []

SeeAlso []

Definition at line 82 of file abcDfs.c.

83{
84 Vec_Ptr_t * vNodes;
85 Abc_Obj_t * pObj;
86 int i;
87 // set the traversal ID
88 Abc_NtkIncrementTravId( pNtk );
89 // start the array of nodes
90 vNodes = Vec_PtrAlloc( 100 );
91 if ( pNtk->nBarBufs2 > 0 )
92 {
93 Abc_NtkForEachBarBuf( pNtk, pObj, i )
94 {
95 Abc_NodeSetTravIdCurrent( pObj );
96 Abc_NtkDfs_rec( Abc_ObjFanin0Ntk(Abc_ObjFanin0(pObj)), vNodes );
97 Vec_PtrPush( vNodes, pObj );
98 }
99 }
100 Abc_NtkForEachCo( pNtk, pObj, i )
101 {
102 Abc_NodeSetTravIdCurrent( pObj );
103 Abc_NtkDfs_rec( Abc_ObjFanin0Ntk(Abc_ObjFanin0(pObj)), vNodes );
104 }
105 // collect dangling nodes if asked to
106 if ( fCollectAll )
107 {
108 Abc_NtkForEachNode( pNtk, pObj, i )
109 if ( !Abc_NodeIsTravIdCurrent(pObj) )
110 Abc_NtkDfs_rec( pObj, vNodes );
111 }
112 return vNodes;
113}
ABC_NAMESPACE_IMPL_START void Abc_NtkDfs_rec(Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
DECLARATIONS ///.
Definition abcDfs.c:46
#define Abc_NtkForEachBarBuf(pNtk, pNode, i)
Definition abc.h:482
int nBarBufs2
Definition abc.h:175
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkDfs2()

ABC_DLL Vec_Ptr_t * Abc_NtkDfs2 ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Returns the DFS ordered array of logic nodes.]

Description [Collects only the internal nodes, leaving out CIs and CO. However it marks with the current TravId both CIs and COs.]

SideEffects []

SeeAlso []

Definition at line 127 of file abcDfs.c.

128{
129 Vec_Ptr_t * vNodes = Vec_PtrAlloc( 100 );
130 Abc_Obj_t * pObj; int i;
131 Abc_NtkIncrementTravId( pNtk );
132 Abc_NtkForEachCo( pNtk, pObj, i )
133 {
134 Abc_NodeSetTravIdCurrent( pObj );
135 Abc_NtkDfs_rec( Abc_ObjFanin0Ntk(Abc_ObjFanin0(pObj)), vNodes );
136 }
137 return vNodes;
138}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkDfsHie()

ABC_DLL Vec_Ptr_t * Abc_NtkDfsHie ( Abc_Ntk_t * pNtk,
int fCollectAll )
extern

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

Synopsis [Returns the DFS ordered array of all objects.]

Description [This procedure collects everything from POs to PIs.]

SideEffects []

SeeAlso []

Definition at line 665 of file abcDfs.c.

666{
667 Vec_Ptr_t * vNodes;
668 Abc_Obj_t * pObj;
669 int i;
670 // set the traversal ID
671 Abc_NtkIncrementTravId( pNtk );
672 // start the array of nodes
673 vNodes = Vec_PtrAlloc( 100 );
674 Abc_NtkForEachPo( pNtk, pObj, i )
675 Abc_NtkDfsHie_rec( pObj, vNodes );
676 // collect dangling nodes if asked to
677 if ( fCollectAll )
678 {
679 Abc_NtkForEachObj( pNtk, pObj, i )
680 if ( !Abc_NodeIsTravIdCurrent(pObj) )
681 Abc_NtkDfs_rec( pObj, vNodes );
682 }
683 return vNodes;
684}
void Abc_NtkDfsHie_rec(Abc_Obj_t *pObj, Vec_Ptr_t *vNodes)
Definition abcDfs.c:638
Here is the call graph for this function:

◆ Abc_NtkDfsIter()

ABC_DLL Vec_Ptr_t * Abc_NtkDfsIter ( Abc_Ntk_t * pNtk,
int fCollectAll )
extern

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

Synopsis [Returns the DFS ordered array of logic nodes.]

Description [Collects only the internal nodes, leaving CIs and CO. However it marks with the current TravId both CIs and COs.]

SideEffects []

SeeAlso []

Definition at line 573 of file abcDfs.c.

574{
575 Vec_Ptr_t * vNodes, * vStack;
576 Abc_Obj_t * pObj;
577 int i;
578 // set the traversal ID
579 Abc_NtkIncrementTravId( pNtk );
580 // start the array of nodes
581 vNodes = Vec_PtrAlloc( 1000 );
582 vStack = Vec_PtrAlloc( 1000 );
583 Abc_NtkForEachCo( pNtk, pObj, i )
584 {
585 Abc_NodeSetTravIdCurrent( pObj );
586 Abc_NtkDfs_iter( vStack, Abc_ObjFanin0Ntk(Abc_ObjFanin0(pObj)), vNodes );
587 }
588 // collect dangling nodes if asked to
589 if ( fCollectAll )
590 {
591 Abc_NtkForEachNode( pNtk, pObj, i )
592 if ( !Abc_NodeIsTravIdCurrent(pObj) )
593 Abc_NtkDfs_iter( vStack, pObj, vNodes );
594 }
595 Vec_PtrFree( vStack );
596 return vNodes;
597}
void Abc_NtkDfs_iter(Vec_Ptr_t *vStack, Abc_Obj_t *pRoot, Vec_Ptr_t *vNodes)
Definition abcDfs.c:515
Here is the call graph for this function:

◆ Abc_NtkDfsIterNodes()

ABC_DLL Vec_Ptr_t * Abc_NtkDfsIterNodes ( Abc_Ntk_t * pNtk,
Vec_Ptr_t * vRoots )
extern

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

Synopsis [Returns the DFS ordered array of logic nodes.]

Description [Collects only the internal nodes, leaving CIs and CO. However it marks with the current TravId both CIs and COs.]

SideEffects []

SeeAlso []

Definition at line 611 of file abcDfs.c.

612{
613 Vec_Ptr_t * vNodes, * vStack;
614 Abc_Obj_t * pObj;
615 int i;
616 Abc_NtkIncrementTravId( pNtk );
617 vNodes = Vec_PtrAlloc( 1000 );
618 vStack = Vec_PtrAlloc( 1000 );
619 Vec_PtrForEachEntry( Abc_Obj_t *, vRoots, pObj, i )
620 if ( !Abc_NodeIsTravIdCurrent(Abc_ObjRegular(pObj)) )
621 Abc_NtkDfs_iter( vStack, Abc_ObjRegular(pObj), vNodes );
622 Vec_PtrFree( vStack );
623 return vNodes;
624}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkDfsNodes()

ABC_DLL Vec_Ptr_t * Abc_NtkDfsNodes ( Abc_Ntk_t * pNtk,
Abc_Obj_t ** ppNodes,
int nNodes )
extern

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

Synopsis [Returns the DFS ordered array of logic nodes.]

Description [Collects only the internal nodes, leaving out PIs, POs and latches.]

SideEffects []

SeeAlso []

Definition at line 151 of file abcDfs.c.

152{
153 Vec_Ptr_t * vNodes;
154 int i;
155 // set the traversal ID
156 Abc_NtkIncrementTravId( pNtk );
157 // start the array of nodes
158 vNodes = Vec_PtrAlloc( 100 );
159 // go through the PO nodes and call for each of them
160 for ( i = 0; i < nNodes; i++ )
161 {
162 if ( Abc_NtkIsStrash(pNtk) && Abc_AigNodeIsConst(ppNodes[i]) )
163 continue;
164 if ( Abc_ObjIsCo(ppNodes[i]) )
165 {
166 Abc_NodeSetTravIdCurrent(ppNodes[i]);
167 Abc_NtkDfs_rec( Abc_ObjFanin0Ntk(Abc_ObjFanin0(ppNodes[i])), vNodes );
168 }
169 else if ( Abc_ObjIsNode(ppNodes[i]) || Abc_ObjIsCi(ppNodes[i]) )
170 Abc_NtkDfs_rec( ppNodes[i], vNodes );
171 }
172 return vNodes;
173}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkDfsReverse()

ABC_DLL Vec_Ptr_t * Abc_NtkDfsReverse ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Returns the reverse DFS ordered array of logic nodes.]

Description [Collects only the internal nodes, leaving out CIs/COs. However it marks both CIs and COs with the current TravId.]

SideEffects []

SeeAlso []

Definition at line 221 of file abcDfs.c.

222{
223 Vec_Ptr_t * vNodes;
224 Abc_Obj_t * pObj, * pFanout;
225 int i, k;
226 // set the traversal ID
227 Abc_NtkIncrementTravId( pNtk );
228 // start the array of nodes
229 vNodes = Vec_PtrAlloc( 100 );
230 Abc_NtkForEachCi( pNtk, pObj, i )
231 {
232 Abc_NodeSetTravIdCurrent( pObj );
233 pObj = Abc_ObjFanout0Ntk(pObj);
234 Abc_ObjForEachFanout( pObj, pFanout, k )
235 Abc_NtkDfsReverse_rec( pFanout, vNodes );
236 }
237 // add constant nodes in the end
238 if ( !Abc_NtkIsStrash(pNtk) ) {
239 Abc_NtkForEachNode( pNtk, pObj, i )
240 if ( Abc_NodeIsConst(pObj) )
241 Vec_PtrPush( vNodes, pObj );
242 }
243 return vNodes;
244}
void Abc_NtkDfsReverse_rec(Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
Definition abcDfs.c:187
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkDfsReverseNodes()

ABC_DLL Vec_Ptr_t * Abc_NtkDfsReverseNodes ( Abc_Ntk_t * pNtk,
Abc_Obj_t ** ppNodes,
int nNodes )
extern

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

Synopsis [Returns the levelized array of TFO nodes.]

Description [Collects the levelized array of internal nodes, leaving out CIs/COs. However it marks both CIs and COs with the current TravId.]

SideEffects []

SeeAlso []

Definition at line 294 of file abcDfs.c.

295{
296 Vec_Ptr_t * vNodes;
297 Abc_Obj_t * pObj, * pFanout;
298 int i, k;
299 assert( Abc_NtkIsStrash(pNtk) );
300 // set the traversal ID
301 Abc_NtkIncrementTravId( pNtk );
302 // start the array of nodes
303 vNodes = Vec_PtrStart( Abc_AigLevel(pNtk) + 1 );
304 for ( i = 0; i < nNodes; i++ )
305 {
306 pObj = ppNodes[i];
307 assert( Abc_ObjIsCi(pObj) );
308 Abc_NodeSetTravIdCurrent( pObj );
309 pObj = Abc_ObjFanout0Ntk(pObj);
310 Abc_ObjForEachFanout( pObj, pFanout, k )
311 Abc_NtkDfsReverseNodes_rec( pFanout, vNodes );
312 }
313 return vNodes;
314}
void Abc_NtkDfsReverseNodes_rec(Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
Definition abcDfs.c:257
ABC_DLL int Abc_AigLevel(Abc_Ntk_t *pNtk)
Definition abcAig.c:292
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkDfsReverseNodesContained()

ABC_DLL Vec_Ptr_t * Abc_NtkDfsReverseNodesContained ( Abc_Ntk_t * pNtk,
Abc_Obj_t ** ppNodes,
int nNodes )
extern

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

Synopsis [Returns the levelized array of TFO nodes.]

Description [Collects the levelized array of internal nodes, leaving out CIs/COs. However it marks both CIs and COs with the current TravId. Collects only the nodes whose support does not exceed the set of given CI nodes.]

SideEffects []

SeeAlso []

Definition at line 329 of file abcDfs.c.

330{
331 Vec_Ptr_t * vNodes;
332 Abc_Obj_t * pObj, * pFanout, * pFanin;
333 int i, k, m, nLevels;
334 // set the levels
335 nLevels = Abc_NtkLevel( pNtk );
336 // set the traversal ID
337 Abc_NtkIncrementTravId( pNtk );
338 // start the array of nodes
339 vNodes = Vec_PtrStart( nLevels + 2 );
340 for ( i = 0; i < nNodes; i++ )
341 {
342 pObj = ppNodes[i];
343 assert( Abc_ObjIsCi(pObj) );
344 Abc_NodeSetTravIdCurrent( pObj );
345 // add to the array
346 assert( pObj->Level == 0 );
347 pObj->pCopy = (Abc_Obj_t *)Vec_PtrEntry( vNodes, pObj->Level );
348 Vec_PtrWriteEntry( vNodes, pObj->Level, pObj );
349 }
350 // iterate through the levels
351 for ( i = 0; i <= nLevels; i++ )
352 {
353 // iterate through the nodes on each level
354 for ( pObj = (Abc_Obj_t *)Vec_PtrEntry(vNodes, i); pObj; pObj = pObj->pCopy )
355 {
356 // iterate through the fanouts of each node
357 Abc_ObjForEachFanout( pObj, pFanout, k )
358 {
359 // skip visited nodes
360 if ( Abc_NodeIsTravIdCurrent(pFanout) )
361 continue;
362 // visit the fanins of this fanout
363 Abc_ObjForEachFanin( pFanout, pFanin, m )
364 {
365 if ( !Abc_NodeIsTravIdCurrent(pFanin) )
366 break;
367 }
368 if ( m < Abc_ObjFaninNum(pFanout) )
369 continue;
370 // all fanins are already collected
371
372 // mark the node as visited
373 Abc_NodeSetTravIdCurrent( pFanout );
374 // handle the COs
375 if ( Abc_ObjIsCo(pFanout) )
376 pFanout->Level = nLevels + 1;
377 // add to the array
378 pFanout->pCopy = (Abc_Obj_t *)Vec_PtrEntry( vNodes, pFanout->Level );
379 Vec_PtrWriteEntry( vNodes, pFanout->Level, pFanout );
380 // handle the COs
381 if ( Abc_ObjIsCo(pFanout) )
382 pFanout->Level = 0;
383 }
384 }
385 }
386 return vNodes;
387}
int Abc_NtkLevel(Abc_Ntk_t *pNtk)
Definition abcDfs.c:1449
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkDfsSeq()

ABC_DLL Vec_Ptr_t * Abc_NtkDfsSeq ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Returns the array of nodes and latches reachable from POs.]

Description []

SideEffects []

SeeAlso []

Definition at line 428 of file abcDfs.c.

429{
430 Vec_Ptr_t * vNodes;
431 Abc_Obj_t * pObj;
432 int i;
433 assert( !Abc_NtkIsNetlist(pNtk) );
434 // set the traversal ID
435 Abc_NtkIncrementTravId( pNtk );
436 // start the array of nodes
437 vNodes = Vec_PtrAlloc( 100 );
438 Abc_NtkForEachPo( pNtk, pObj, i )
439 Abc_NtkDfsSeq_rec( pObj, vNodes );
440 // mark the PIs
441 Abc_NtkForEachPi( pNtk, pObj, i )
442 Abc_NtkDfsSeq_rec( pObj, vNodes );
443 return vNodes;
444}
void Abc_NtkDfsSeq_rec(Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
Definition abcDfs.c:401
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkDfsSeqReverse()

ABC_DLL Vec_Ptr_t * Abc_NtkDfsSeqReverse ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Returns the array of nodes and latches reachable from POs.]

Description []

SideEffects []

SeeAlso []

Definition at line 485 of file abcDfs.c.

486{
487 Vec_Ptr_t * vNodes;
488 Abc_Obj_t * pObj;
489 int i;
490 assert( !Abc_NtkIsNetlist(pNtk) );
491 // set the traversal ID
492 Abc_NtkIncrementTravId( pNtk );
493 // start the array of nodes
494 vNodes = Vec_PtrAlloc( 100 );
495 Abc_NtkForEachPi( pNtk, pObj, i )
496 Abc_NtkDfsSeqReverse_rec( pObj, vNodes );
497 // mark the logic feeding into POs
498 Abc_NtkForEachPo( pNtk, pObj, i )
499 Abc_NtkDfsSeq_rec( pObj, vNodes );
500 return vNodes;
501}
void Abc_NtkDfsSeqReverse_rec(Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
Definition abcDfs.c:458
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkDfsWithBoxes()

ABC_DLL Vec_Ptr_t * Abc_NtkDfsWithBoxes ( Abc_Ntk_t * pNtk)
extern

Definition at line 799 of file abcDfs.c.

800{
801 Vec_Ptr_t * vNodes;
802 Abc_Obj_t * pObj;
803 int i;
804 Abc_NtkIncrementTravId( pNtk );
805 vNodes = Vec_PtrAlloc( 100 );
806 Abc_NtkForEachPo( pNtk, pObj, i )
807 {
808 assert( Abc_ObjIsNet(Abc_ObjFanin0(pObj)) );
809 Abc_NtkDfsWithBoxes_rec( Abc_ObjFanin0Ntk(Abc_ObjFanin0(pObj)), vNodes );
810 }
811 return vNodes;
812}
void Abc_NtkDfsWithBoxes_rec(Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
Definition abcDfs.c:777
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkDoCheck()

ABC_DLL int Abc_NtkDoCheck ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Checks the integrity of the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 96 of file abcCheck.c.

97{
98 Abc_Obj_t * pObj, * pNet, * pNode;
99 int i;
100
101 // check network types
102 if ( !Abc_NtkIsNetlist(pNtk) && !Abc_NtkIsLogic(pNtk) && !Abc_NtkIsStrash(pNtk) )
103 {
104 fprintf( stdout, "NetworkCheck: Unknown network type.\n" );
105 return 0;
106 }
107 if ( !Abc_NtkHasSop(pNtk) && !Abc_NtkHasBdd(pNtk) && !Abc_NtkHasAig(pNtk) && !Abc_NtkHasMapping(pNtk) && !Abc_NtkHasBlifMv(pNtk) && !Abc_NtkHasBlackbox(pNtk) )
108 {
109 fprintf( stdout, "NetworkCheck: Unknown functionality type.\n" );
110 return 0;
111 }
112 if ( Abc_NtkHasMapping(pNtk) )
113 {
114 if ( pNtk->pManFunc != Abc_FrameReadLibGen() )
115 {
116 fprintf( stdout, "NetworkCheck: The library of the mapped network is not the global library.\n" );
117 return 0;
118 }
119 }
120
121 if ( Abc_NtkHasOnlyLatchBoxes(pNtk) )
122 {
123 // check CI/CO numbers
124 if ( Abc_NtkPiNum(pNtk) + Abc_NtkLatchNum(pNtk) != Abc_NtkCiNum(pNtk) )
125 {
126 fprintf( stdout, "NetworkCheck: Number of CIs does not match number of PIs and latches.\n" );
127 fprintf( stdout, "One possible reason is that latches are added twice:\n" );
128 fprintf( stdout, "in procedure Abc_NtkCreateObj() and in the user's code.\n" );
129 return 0;
130 }
131 if ( Abc_NtkPoNum(pNtk) + Abc_NtkLatchNum(pNtk) != Abc_NtkCoNum(pNtk) )
132 {
133 fprintf( stdout, "NetworkCheck: Number of COs does not match number of POs, asserts, and latches.\n" );
134 fprintf( stdout, "One possible reason is that latches are added twice:\n" );
135 fprintf( stdout, "in procedure Abc_NtkCreateObj() and in the user's code.\n" );
136 return 0;
137 }
138 }
139
140 // check the names
141 if ( !Abc_NtkCheckNames( pNtk ) )
142 return 0;
143
144 // check PIs and POs
145 Abc_NtkCleanCopy( pNtk );
146 if ( !Abc_NtkCheckPis( pNtk ) )
147 return 0;
148 if ( !Abc_NtkCheckPos( pNtk ) )
149 return 0;
150
151 if ( Abc_NtkHasBlackbox(pNtk) )
152 return 1;
153
154 // check the connectivity of objects
155 Abc_NtkForEachObj( pNtk, pObj, i )
156 if ( !Abc_NtkCheckObj( pNtk, pObj ) )
157 return 0;
158
159 // if it is a netlist change nets and latches
160 if ( Abc_NtkIsNetlist(pNtk) )
161 {
162 if ( Abc_NtkNetNum(pNtk) == 0 )
163 fprintf( stdout, "NetworkCheck: Warning! Netlist has no nets.\n" );
164 // check the nets
165 Abc_NtkForEachNet( pNtk, pNet, i )
166 if ( !Abc_NtkCheckNet( pNtk, pNet ) )
167 return 0;
168 }
169 else
170 {
171 if ( Abc_NtkNetNum(pNtk) != 0 )
172 {
173 fprintf( stdout, "NetworkCheck: A network that is not a netlist has nets.\n" );
174 return 0;
175 }
176 }
177
178 // check the nodes
179 if ( Abc_NtkIsStrash(pNtk) )
180 {
181 if ( !Abc_AigCheck( (Abc_Aig_t *)pNtk->pManFunc ) )
182 return 0;
183 }
184 else
185 {
186 Abc_NtkForEachNode( pNtk, pNode, i )
187 if ( !Abc_NtkCheckNode( pNtk, pNode ) )
188 return 0;
189 }
190
191 // check the latches
192 Abc_NtkForEachLatch( pNtk, pNode, i )
193 if ( !Abc_NtkCheckLatch( pNtk, pNode ) )
194 return 0;
195
196 // finally, check for combinational loops
197// clk = Abc_Clock();
198 if ( !Abc_NtkIsAcyclic( pNtk ) )
199 {
200 fprintf( stdout, "NetworkCheck: Network contains a combinational loop.\n" );
201 return 0;
202 }
203// ABC_PRT( "Acyclic ", Abc_Clock() - clk );
204
205 // check the EXDC network if present
206 if ( pNtk->pExdc )
207 Abc_NtkCheck( pNtk->pExdc );
208/*
209 // check the hierarchy
210 if ( Abc_NtkIsNetlist(pNtk) && pNtk->tName2Model )
211 {
212 stmm_generator * gen;
213 Abc_Ntk_t * pNtkTemp;
214 char * pName;
215 // check other networks
216 stmm_foreach_item( pNtk->tName2Model, gen, &pName, (char **)&pNtkTemp )
217 {
218 pNtkTemp->fHiePath = pNtkTemp->fHieVisited = 0;
219 if ( !Abc_NtkCheck( pNtkTemp ) )
220 return 0;
221 }
222 // check acyclic dependency of the models
223 if ( !Abc_NtkIsAcyclicHierarchy( pNtk ) )
224 {
225 fprintf( stdout, "NetworkCheck: Network hierarchical dependences contains a cycle.\n" );
226 return 0;
227 }
228 }
229*/
230 return 1;
231}
int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition abcCheck.c:64
int Abc_NtkCheckObj(Abc_Ntk_t *pNtk, Abc_Obj_t *pObj)
Definition abcCheck.c:420
#define Abc_NtkForEachNet(pNtk, pNet, i)
Definition abc.h:461
ABC_DLL int Abc_AigCheck(Abc_Aig_t *pMan)
Definition abcAig.c:226
ABC_DLL int Abc_NtkIsAcyclic(Abc_Ntk_t *pNtk)
Definition abcDfs.c:1614
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkDontCareAlloc()

ABC_DLL Odc_Man_t * Abc_NtkDontCareAlloc ( int nVarsMax,
int nLevels,
int fVerbose,
int fVeryVerbose )
extern

FUNCTION DEFINITIONS ///.

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

Synopsis [Allocates the don't-care manager.]

Description [The parameters are the max number of cut variables, the number of fanout levels used for the ODC computation, and verbosiness.]

SideEffects []

SeeAlso []

Definition at line 163 of file abcOdc.c.

164{
165 Odc_Man_t * p;
166 unsigned * pData;
167 int i, k;
168 p = ABC_ALLOC( Odc_Man_t, 1 );
169 memset( p, 0, sizeof(Odc_Man_t) );
170 assert( nVarsMax > 4 && nVarsMax < 16 );
171 assert( nLevels > 0 && nLevels < 10 );
172
173 srand( 0xABC );
174
175 // dont'-care parameters
176 p->nVarsMax = nVarsMax;
177 p->nLevels = nLevels;
178 p->fVerbose = fVerbose;
179 p->fVeryVerbose = fVeryVerbose;
180 p->nPercCutoff = 10;
181 p->skipQuant = 0;
182
183 // windowing
184 p->vRoots = Vec_PtrAlloc( 128 );
185 p->vBranches = Vec_PtrAlloc( 128 );
186
187 // internal AIG package
188 // allocate room for objects
189 p->nObjsAlloc = ABC_DC_MAX_NODES;
190 p->pObjs = ABC_ALLOC( Odc_Obj_t, p->nObjsAlloc * sizeof(Odc_Obj_t) );
191 p->nPis = nVarsMax + 32;
192 p->nObjs = 1 + p->nPis;
193 memset( p->pObjs, 0, p->nObjs * sizeof(Odc_Obj_t) );
194 // set the PI masks
195 for ( i = 0; i < 32; i++ )
196 p->pObjs[1 + p->nVarsMax + i].uMask = (1 << i);
197 // allocate hash table
198 p->nTableSize = p->nObjsAlloc/3 + 1;
199 p->pTable = ABC_ALLOC( Odc_Lit_t, p->nTableSize * sizeof(Odc_Lit_t) );
200 memset( p->pTable, 0, p->nTableSize * sizeof(Odc_Lit_t) );
201 p->vUsedSpots = Vec_IntAlloc( 1000 );
202
203 // truth tables
204 p->nWords = Abc_TruthWordNum( p->nVarsMax );
205 p->nBits = p->nWords * 8 * sizeof(unsigned);
206 p->vTruths = Vec_PtrAllocSimInfo( p->nObjsAlloc, p->nWords );
207 p->vTruthsElem = Vec_PtrAllocSimInfo( p->nVarsMax, p->nWords );
208
209 // set elementary truth tables
210 Abc_InfoFill( (unsigned *)Vec_PtrEntry(p->vTruths, 0), p->nWords );
211 for ( k = 0; k < p->nVarsMax; k++ )
212 {
213// pData = Odc_ObjTruth( p, Odc_Var(p, k) );
214 pData = (unsigned *)Vec_PtrEntry( p->vTruthsElem, k );
215 Abc_InfoClear( pData, p->nWords );
216 for ( i = 0; i < p->nBits; i++ )
217 if ( i & (1 << k) )
218 pData[i>>5] |= (1 << (i&31));
219 }
220
221 // set random truth table for the additional inputs
222 for ( k = p->nVarsMax; k < p->nPis; k++ )
223 {
224 pData = Odc_ObjTruth( p, Odc_Var(p, k) );
225 Abc_InfoRandom( pData, p->nWords );
226 }
227
228 // set the miter to the unused value
229 p->iRoot = 0xffff;
230 return p;
231}
unsigned short Odc_Lit_t
Definition abcOdc.c:32
#define ABC_DC_MAX_NODES
DECLARATIONS ///.
Definition abcOdc.c:30
struct Odc_Obj_t_ Odc_Obj_t
Definition abcOdc.c:34
struct Odc_Man_t_ Odc_Man_t
Definition abc.h:832
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkDontCareClear()

ABC_DLL void Abc_NtkDontCareClear ( Odc_Man_t * p)
extern

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

Synopsis [Clears the manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 244 of file abcOdc.c.

245{
246 abctime clk = Abc_Clock();
247 // clean the structural hashing table
248 if ( Vec_IntSize(p->vUsedSpots) > p->nTableSize/3 ) // more than one third
249 memset( p->pTable, 0, sizeof(Odc_Lit_t) * p->nTableSize );
250 else
251 {
252 int iSpot, i;
253 Vec_IntForEachEntry( p->vUsedSpots, iSpot, i )
254 p->pTable[iSpot] = 0;
255 }
256 Vec_IntClear( p->vUsedSpots );
257 // reset the number of nodes
258 p->nObjs = 1 + p->nPis;
259 // reset the root node
260 p->iRoot = 0xffff;
261
262p->timeClean += Abc_Clock() - clk;
263}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkDontCareCompute()

ABC_DLL int Abc_NtkDontCareCompute ( Odc_Man_t * p,
Abc_Obj_t * pNode,
Vec_Ptr_t * vLeaves,
unsigned * puTruth )
extern

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

Synopsis [Computes ODCs for the node in terms of the cut variables.]

Description [Returns the number of don't care minterms in the truth table. In particular, this procedure returns 0 if there is no don't-cares.]

SideEffects []

SeeAlso []

Definition at line 1042 of file abcOdc.c.

1043{
1044 int nMints, RetValue;
1045 abctime clk, clkTotal = Abc_Clock();
1046
1047 p->nWins++;
1048
1049 // set the parameters
1050 assert( !Abc_ObjIsComplement(pNode) );
1051 assert( Abc_ObjIsNode(pNode) );
1052 assert( Vec_PtrSize(vLeaves) <= p->nVarsMax );
1053 p->vLeaves = vLeaves;
1054 p->pNode = pNode;
1055
1056 // compute the window
1057clk = Abc_Clock();
1058 RetValue = Abc_NtkDontCareWindow( p );
1059p->timeWin += Abc_Clock() - clk;
1060 if ( !RetValue )
1061 {
1062p->timeAbort += Abc_Clock() - clkTotal;
1063 Abc_InfoFill( puTruth, p->nWords );
1064 p->nWinsEmpty++;
1065 return 0;
1066 }
1067
1068 if ( p->fVeryVerbose )
1069 {
1070 printf( " %5d : ", pNode->Id );
1071 printf( "Leaf = %2d ", Vec_PtrSize(p->vLeaves) );
1072 printf( "Root = %2d ", Vec_PtrSize(p->vRoots) );
1073 printf( "Bran = %2d ", Vec_PtrSize(p->vBranches) );
1074 printf( " | " );
1075 }
1076
1077 // transfer the window into the AIG package
1078clk = Abc_Clock();
1080p->timeMiter += Abc_Clock() - clk;
1081
1082 // simulate to estimate the amount of don't-cares
1083clk = Abc_Clock();
1084 nMints = Abc_NtkDontCareSimulateBefore( p, puTruth );
1085p->timeSim += Abc_Clock() - clk;
1086 if ( p->fVeryVerbose )
1087 {
1088 printf( "AIG = %5d ", Odc_NodeNum(p) );
1089 printf( "%6.2f %% ", 100.0 * (p->nBits - nMints) / p->nBits );
1090 }
1091
1092 // if there is less then the given percentage of don't-cares, skip
1093 if ( 100.0 * (p->nBits - nMints) / p->nBits < 1.0 * p->nPercCutoff )
1094 {
1095p->timeAbort += Abc_Clock() - clkTotal;
1096 if ( p->fVeryVerbose )
1097 printf( "Simulation cutoff.\n" );
1098 Abc_InfoFill( puTruth, p->nWords );
1099 p->nSimsEmpty++;
1100 return 0;
1101 }
1102
1103 // quantify external variables
1104clk = Abc_Clock();
1105 RetValue = Abc_NtkDontCareQuantify( p );
1106p->timeQuant += Abc_Clock() - clk;
1107 if ( !RetValue )
1108 {
1109p->timeAbort += Abc_Clock() - clkTotal;
1110 if ( p->fVeryVerbose )
1111 printf( "=== Overflow! ===\n" );
1112 Abc_InfoFill( puTruth, p->nWords );
1113 p->nQuantsOver++;
1114 return 0;
1115 }
1116
1117 // get the truth table
1118clk = Abc_Clock();
1120 nMints = Abc_NtkDontCareSimulate( p, puTruth );
1121p->timeTruth += Abc_Clock() - clk;
1122 if ( p->fVeryVerbose )
1123 {
1124 printf( "AIG = %5d ", Odc_NodeNum(p) );
1125 printf( "%6.2f %% ", 100.0 * (p->nBits - nMints) / p->nBits );
1126 printf( "\n" );
1127 }
1128p->timeTotal += Abc_Clock() - clkTotal;
1129 p->nWinsFinish++;
1130 p->nTotalDcs += (int)(100.0 * (p->nBits - nMints) / p->nBits);
1131 return nMints;
1132}
int Abc_NtkDontCareTransfer(Odc_Man_t *p)
Definition abcOdc.c:690
int Abc_NtkDontCareQuantify(Odc_Man_t *p)
Definition abcOdc.c:787
int Abc_NtkDontCareWindow(Odc_Man_t *p)
Definition abcOdc.c:479
int Abc_NtkDontCareSimulateBefore(Odc_Man_t *p, unsigned *puTruth)
Definition abcOdc.c:1012
int Abc_NtkDontCareSimulate(Odc_Man_t *p, unsigned *puTruth)
Definition abcOdc.c:991
void Abc_NtkDontCareSimulateSetElem(Odc_Man_t *p)
Definition abcOdc.c:852
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkDontCareFree()

ABC_DLL void Abc_NtkDontCareFree ( Odc_Man_t * p)
extern

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

Synopsis [Frees the don't-care manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 276 of file abcOdc.c.

277{
278 if ( p->fVerbose )
279 {
280 printf( "Wins = %5d. Empty = %5d. SimsEmpty = %5d. QuantOver = %5d. WinsFinish = %5d.\n",
281 p->nWins, p->nWinsEmpty, p->nSimsEmpty, p->nQuantsOver, p->nWinsFinish );
282 printf( "Ave DCs per window = %6.2f %%. Ave DCs per finished window = %6.2f %%.\n",
283 1.0*p->nTotalDcs/p->nWins, 1.0*p->nTotalDcs/p->nWinsFinish );
284 printf( "Runtime stats of the ODC manager:\n" );
285 ABC_PRT( "Cleaning ", p->timeClean );
286 ABC_PRT( "Windowing ", p->timeWin );
287 ABC_PRT( "Miter ", p->timeMiter );
288 ABC_PRT( "Simulation ", p->timeSim );
289 ABC_PRT( "Quantifying ", p->timeQuant );
290 ABC_PRT( "Truth table ", p->timeTruth );
291 ABC_PRT( "TOTAL ", p->timeTotal );
292 ABC_PRT( "Aborted ", p->timeAbort );
293 }
294 Vec_PtrFree( p->vRoots );
295 Vec_PtrFree( p->vBranches );
296 Vec_PtrFree( p->vTruths );
297 Vec_PtrFree( p->vTruthsElem );
298 Vec_IntFree( p->vUsedSpots );
299 ABC_FREE( p->pObjs );
300 ABC_FREE( p->pTable );
301 ABC_FREE( p );
302}
#define ABC_PRT(a, t)
Definition abc_global.h:255
Here is the caller graph for this function:

◆ Abc_NtkDup()

ABC_DLL Abc_Ntk_t * Abc_NtkDup ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Duplicate the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 472 of file abcNtk.c.

473{
474 Abc_Ntk_t * pNtkNew;
475 Abc_Obj_t * pObj, * pFanin;
476 int i, k;
477 if ( pNtk == NULL )
478 return NULL;
479 // start the network
480 pNtkNew = Abc_NtkStartFrom( pNtk, pNtk->ntkType, pNtk->ntkFunc );
481 // copy the internal nodes
482 if ( Abc_NtkIsStrash(pNtk) )
483 {
484 // copy the AND gates
485 Abc_AigForEachAnd( pNtk, pObj, i )
486 pObj->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
487 // relink the choice nodes
488 Abc_AigForEachAnd( pNtk, pObj, i )
489 if ( pObj->pData )
490 pObj->pCopy->pData = ((Abc_Obj_t *)pObj->pData)->pCopy;
491 // relink the CO nodes
492 Abc_NtkForEachCo( pNtk, pObj, i )
493 Abc_ObjAddFanin( pObj->pCopy, Abc_ObjChild0Copy(pObj) );
494 // get the number of nodes before and after
495 if ( Abc_NtkNodeNum(pNtk) != Abc_NtkNodeNum(pNtkNew) )
496 printf( "Warning: Structural hashing during duplication reduced %d nodes (this is a minor bug).\n",
497 Abc_NtkNodeNum(pNtk) - Abc_NtkNodeNum(pNtkNew) );
498 }
499 else
500 {
501 // duplicate the nets and nodes (CIs/COs/latches already dupped)
502 Abc_NtkForEachObj( pNtk, pObj, i )
503 if ( pObj->pCopy == NULL )
504 Abc_NtkDupObj(pNtkNew, pObj, Abc_NtkHasBlackbox(pNtk) && Abc_ObjIsNet(pObj));
505 // reconnect all objects (no need to transfer attributes on edges)
506 Abc_NtkForEachObj( pNtk, pObj, i )
507 if ( !Abc_ObjIsBox(pObj) && !Abc_ObjIsBo(pObj) )
508 Abc_ObjForEachFanin( pObj, pFanin, k )
509 Abc_ObjAddFanin( pObj->pCopy, pFanin->pCopy );
510 // move object IDs
511 if ( pNtk->vOrigNodeIds )
512 {
513 pNtkNew->vOrigNodeIds = Vec_IntStartFull( Abc_NtkObjNumMax(pNtkNew) );
514 Abc_NtkForEachObj( pNtk, pObj, i )
515 if ( pObj->pCopy && Vec_IntEntry(pNtk->vOrigNodeIds, pObj->Id) > 0 )
516 Vec_IntWriteEntry( pNtkNew->vOrigNodeIds, pObj->pCopy->Id, Vec_IntEntry(pNtk->vOrigNodeIds, pObj->Id) );
517 }
518
519 }
520 // duplicate the EXDC Ntk
521 if ( pNtk->pExdc )
522 pNtkNew->pExdc = Abc_NtkDup( pNtk->pExdc );
523 if ( pNtk->pExcare )
524 pNtkNew->pExcare = Abc_NtkDup( (Abc_Ntk_t *)pNtk->pExcare );
525 // duplicate timing manager
526 if ( pNtk->pManTime )
527 Abc_NtkTimeInitialize( pNtkNew, pNtk );
528 if ( pNtk->vPhases )
529 Abc_NtkTransferPhases( pNtkNew, pNtk );
530 if ( pNtk->pWLoadUsed )
531 pNtkNew->pWLoadUsed = Abc_UtilStrsav( pNtk->pWLoadUsed );
532 // check correctness
533 if ( !Abc_NtkCheck( pNtkNew ) )
534 fprintf( stdout, "Abc_NtkDup(): Network check has failed.\n" );
535 pNtk->pCopy = pNtkNew;
536 return pNtkNew;
537}
Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
Definition abcNtk.c:472
Abc_Ntk_t * Abc_NtkStartFrom(Abc_Ntk_t *pNtk, Abc_NtkType_t Type, Abc_NtkFunc_t Func)
Definition abcNtk.c:157
ABC_DLL void Abc_NtkTransferPhases(Abc_Ntk_t *pNtkNew, Abc_Ntk_t *pNtk)
Definition abcUtil.c:2924
ABC_DLL void Abc_NtkTimeInitialize(Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtkOld)
Definition abcTiming.c:343
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkDupBox()

ABC_DLL Abc_Obj_t * Abc_NtkDupBox ( Abc_Ntk_t * pNtkNew,
Abc_Obj_t * pBox,
int fCopyName )
extern

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

Synopsis [Duplicates the latch with its input/output terminals.]

Description []

SideEffects []

SeeAlso []

Definition at line 415 of file abcObj.c.

416{
417 Abc_Obj_t * pTerm, * pBoxNew;
418 int i;
419 assert( Abc_ObjIsBox(pBox) );
420 // duplicate the box
421 pBoxNew = Abc_NtkDupObj( pNtkNew, pBox, fCopyName );
422 // duplicate the fanins and connect them
423 Abc_ObjForEachFanin( pBox, pTerm, i )
424 Abc_ObjAddFanin( pBoxNew, Abc_NtkDupObj(pNtkNew, pTerm, fCopyName) );
425 // duplicate the fanouts and connect them
426 Abc_ObjForEachFanout( pBox, pTerm, i )
427 Abc_ObjAddFanin( Abc_NtkDupObj(pNtkNew, pTerm, fCopyName), pBoxNew );
428 return pBoxNew;
429}
Abc_Obj_t * Abc_NtkDupObj(Abc_Ntk_t *pNtkNew, Abc_Obj_t *pObj, int fCopyName)
Definition abcObj.c:342
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkDupDfs()

ABC_DLL Abc_Ntk_t * Abc_NtkDupDfs ( Abc_Ntk_t * pNtk)
extern

Definition at line 538 of file abcNtk.c.

539{
540 Vec_Ptr_t * vNodes;
541 Abc_Ntk_t * pNtkNew;
542 Abc_Obj_t * pObj, * pFanin;
543 int i, k;
544 if ( pNtk == NULL )
545 return NULL;
546 assert( !Abc_NtkIsStrash(pNtk) && !Abc_NtkIsNetlist(pNtk) );
547 // start the network
548 pNtkNew = Abc_NtkStartFrom( pNtk, pNtk->ntkType, pNtk->ntkFunc );
549 // copy the internal nodes
550 vNodes = Abc_NtkDfs( pNtk, 0 );
551 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
552 Abc_NtkDupObj( pNtkNew, pObj, 0 );
553 Vec_PtrFree( vNodes );
554 // reconnect all objects (no need to transfer attributes on edges)
555 Abc_NtkForEachObj( pNtk, pObj, i )
556 if ( !Abc_ObjIsBox(pObj) && !Abc_ObjIsBo(pObj) )
557 Abc_ObjForEachFanin( pObj, pFanin, k )
558 if ( pObj->pCopy && pFanin->pCopy )
559 Abc_ObjAddFanin( pObj->pCopy, pFanin->pCopy );
560 // duplicate the EXDC Ntk
561 if ( pNtk->pExdc )
562 pNtkNew->pExdc = Abc_NtkDup( pNtk->pExdc );
563 if ( pNtk->pExcare )
564 pNtkNew->pExcare = Abc_NtkDup( (Abc_Ntk_t *)pNtk->pExcare );
565 // duplicate timing manager
566 if ( pNtk->pManTime )
567 Abc_NtkTimeInitialize( pNtkNew, pNtk );
568 if ( pNtk->vPhases )
569 Abc_NtkTransferPhases( pNtkNew, pNtk );
570 if ( pNtk->pWLoadUsed )
571 pNtkNew->pWLoadUsed = Abc_UtilStrsav( pNtk->pWLoadUsed );
572 // check correctness
573 if ( !Abc_NtkCheck( pNtkNew ) )
574 fprintf( stdout, "Abc_NtkDup(): Network check has failed.\n" );
575 pNtk->pCopy = pNtkNew;
576 return pNtkNew;
577}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkDupDfsNoBarBufs()

ABC_DLL Abc_Ntk_t * Abc_NtkDupDfsNoBarBufs ( Abc_Ntk_t * pNtk)
extern

Definition at line 578 of file abcNtk.c.

579{
580 Vec_Ptr_t * vNodes;
581 Abc_Ntk_t * pNtkNew;
582 Abc_Obj_t * pObj, * pFanin;
583 int i, k;
584 if ( pNtk == NULL )
585 return NULL;
586 assert( Abc_NtkIsLogic(pNtk) );
587 assert( pNtk->nBarBufs2 > 0 );
588 // start the network
589 pNtkNew = Abc_NtkStartFrom( pNtk, pNtk->ntkType, pNtk->ntkFunc );
590 // copy the internal nodes
591 vNodes = Abc_NtkDfs2( pNtk );
592 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
593 if ( Abc_ObjIsBarBuf(pObj) )
594 pObj->pCopy = Abc_ObjFanin0(pObj)->pCopy;
595 else
596 Abc_NtkDupObj( pNtkNew, pObj, 0 );
597 Vec_PtrFree( vNodes );
598 // reconnect all objects (no need to transfer attributes on edges)
599 Abc_NtkForEachObj( pNtk, pObj, i )
600 if ( !Abc_ObjIsBox(pObj) && !Abc_ObjIsBo(pObj) && !Abc_ObjIsBarBuf(pObj) )
601 Abc_ObjForEachFanin( pObj, pFanin, k )
602 if ( pObj->pCopy && pFanin->pCopy )
603 Abc_ObjAddFanin( pObj->pCopy, pFanin->pCopy );
604 // duplicate the EXDC Ntk
605 if ( pNtk->pExdc )
606 pNtkNew->pExdc = Abc_NtkDup( pNtk->pExdc );
607 if ( pNtk->pExcare )
608 pNtkNew->pExcare = Abc_NtkDup( (Abc_Ntk_t *)pNtk->pExcare );
609 // duplicate timing manager
610 if ( pNtk->pManTime )
611 Abc_NtkTimeInitialize( pNtkNew, pNtk );
612 if ( pNtk->vPhases )
613 Abc_NtkTransferPhases( pNtkNew, pNtk );
614 if ( pNtk->pWLoadUsed )
615 pNtkNew->pWLoadUsed = Abc_UtilStrsav( pNtk->pWLoadUsed );
616 // check correctness
617 if ( !Abc_NtkCheck( pNtkNew ) )
618 fprintf( stdout, "Abc_NtkDup(): Network check has failed.\n" );
619 pNtk->pCopy = pNtkNew;
620 return pNtkNew;
621}
ABC_DLL Vec_Ptr_t * Abc_NtkDfs2(Abc_Ntk_t *pNtk)
Definition abcDfs.c:127
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkDupObj()

ABC_DLL Abc_Obj_t * Abc_NtkDupObj ( Abc_Ntk_t * pNtkNew,
Abc_Obj_t * pObj,
int fCopyName )
extern

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

Synopsis [Duplicate the Obj.]

Description []

SideEffects []

SeeAlso []

Definition at line 342 of file abcObj.c.

343{
344 Abc_Obj_t * pObjNew;
345 // create the new object
346 pObjNew = Abc_NtkCreateObj( pNtkNew, (Abc_ObjType_t)pObj->Type );
347 // transfer names of the terminal objects
348 if ( fCopyName )
349 {
350 if ( Abc_ObjIsCi(pObj) )
351 {
352 if ( !Abc_NtkIsNetlist(pNtkNew) )
353 Abc_ObjAssignName( pObjNew, Abc_ObjName(Abc_ObjFanout0Ntk(pObj)), NULL );
354 }
355 else if ( Abc_ObjIsCo(pObj) )
356 {
357 if ( !Abc_NtkIsNetlist(pNtkNew) )
358 {
359 if ( Abc_ObjIsPo(pObj) )
360 Abc_ObjAssignName( pObjNew, Abc_ObjName(Abc_ObjFanin0Ntk(pObj)), NULL );
361 else
362 {
363 assert( Abc_ObjIsLatch(Abc_ObjFanout0(pObj)) );
364 Abc_ObjAssignName( pObjNew, Abc_ObjName(pObj), NULL );
365 }
366 }
367 }
368 else if ( Abc_ObjIsBox(pObj) || Abc_ObjIsNet(pObj) )
369 Abc_ObjAssignName( pObjNew, Abc_ObjName(pObj), NULL );
370 }
371 // copy functionality/names
372 if ( Abc_ObjIsNode(pObj) ) // copy the function if functionality is compatible
373 {
374 if ( pNtkNew->ntkFunc == pObj->pNtk->ntkFunc )
375 {
376 if ( Abc_NtkIsStrash(pNtkNew) )
377 {}
378 else if ( Abc_NtkHasSop(pNtkNew) || Abc_NtkHasBlifMv(pNtkNew) )
379 pObjNew->pData = Abc_SopRegister( (Mem_Flex_t *)pNtkNew->pManFunc, (char *)pObj->pData );
380#ifdef ABC_USE_CUDD
381 else if ( Abc_NtkHasBdd(pNtkNew) )
382 pObjNew->pData = Cudd_bddTransfer((DdManager *)pObj->pNtk->pManFunc, (DdManager *)pNtkNew->pManFunc, (DdNode *)pObj->pData), Cudd_Ref((DdNode *)pObjNew->pData);
383#endif
384 else if ( Abc_NtkHasAig(pNtkNew) )
385 pObjNew->pData = Hop_Transfer((Hop_Man_t *)pObj->pNtk->pManFunc, (Hop_Man_t *)pNtkNew->pManFunc, (Hop_Obj_t *)pObj->pData, Abc_ObjFaninNum(pObj));
386 else if ( Abc_NtkHasMapping(pNtkNew) )
387 pObjNew->pData = pObj->pData, pNtkNew->nBarBufs2 += !pObj->pData;
388 else assert( 0 );
389 }
390 }
391 else if ( Abc_ObjIsNet(pObj) ) // copy the name
392 {
393 }
394 else if ( Abc_ObjIsLatch(pObj) ) // copy the reset value
395 pObjNew->pData = pObj->pData;
396 pObjNew->fPersist = pObj->fPersist;
397 // transfer HAIG
398// pObjNew->pEquiv = pObj->pEquiv;
399 // remember the new node in the old node
400 pObj->pCopy = pObjNew;
401 return pObjNew;
402}
Hop_Obj_t * Hop_Transfer(Hop_Man_t *pSour, Hop_Man_t *pDest, Hop_Obj_t *pObj, int nVars)
Definition hopDfs.c:353
unsigned fPersist
Definition abc.h:139
Here is the call graph for this function:

◆ Abc_NtkDupTransformMiter()

ABC_DLL Abc_Ntk_t * Abc_NtkDupTransformMiter ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Duplicate the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 669 of file abcNtk.c.

670{
671 Abc_Ntk_t * pNtkNew;
672 Abc_Obj_t * pObj, * pObj2, * pMiter;
673 int i;
674 assert( Abc_NtkIsStrash(pNtk) );
675 // start the network
676 pNtkNew = Abc_NtkAlloc( pNtk->ntkType, pNtk->ntkFunc, 1 );
677 pNtkNew->nConstrs = pNtk->nConstrs;
678 pNtkNew->nBarBufs = pNtk->nBarBufs;
679 // duplicate the name and the spec
680 pNtkNew->pName = Extra_UtilStrsav(pNtk->pName);
681 pNtkNew->pSpec = Extra_UtilStrsav(pNtk->pSpec);
682 // clean the node copy fields
683 Abc_NtkCleanCopy( pNtk );
684 // map the constant nodes
685 Abc_AigConst1(pNtk)->pCopy = Abc_AigConst1(pNtkNew);
686 // clone CIs/CIs/boxes
687 Abc_NtkForEachPi( pNtk, pObj, i )
688 Abc_NtkDupObj( pNtkNew, pObj, 1 );
689 Abc_NtkForEachPo( pNtk, pObj, i )
690 Abc_NtkDupObj( pNtkNew, pObj, 1 ), i++;
691 Abc_NtkForEachBox( pNtk, pObj, i )
692 Abc_NtkDupBox( pNtkNew, pObj, 1 );
693 // copy the AND gates
694 Abc_AigForEachAnd( pNtk, pObj, i )
695 pObj->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
696 // create new miters
697 Abc_NtkForEachPo( pNtk, pObj, i )
698 {
699 pObj2 = Abc_NtkPo( pNtk, ++i );
700 pMiter = Abc_AigXor( (Abc_Aig_t *)pNtkNew->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild0Copy(pObj2) );
701 Abc_ObjAddFanin( pObj->pCopy, pMiter );
702 }
703 Abc_NtkForEachLatchInput( pNtk, pObj, i )
704 Abc_ObjAddFanin( pObj->pCopy, Abc_ObjChild0Copy(pObj) );
705 // cleanup
706 Abc_AigCleanup( (Abc_Aig_t *)pNtkNew->pManFunc );
707 // check that the CI/CO/latches are copied correctly
708 assert( Abc_NtkPiNum(pNtk) == Abc_NtkPiNum(pNtkNew) );
709 assert( Abc_NtkPoNum(pNtk) == 2*Abc_NtkPoNum(pNtkNew) );
710 assert( Abc_NtkLatchNum(pNtk) == Abc_NtkLatchNum(pNtkNew) );
711 return pNtkNew;
712}
ABC_DLL Abc_Obj_t * Abc_NtkDupBox(Abc_Ntk_t *pNtkNew, Abc_Obj_t *pBox, int fCopyName)
Definition abcObj.c:415
int nConstrs
Definition abc.h:173
Here is the call graph for this function:

◆ Abc_NtkFanoutCounts()

ABC_DLL Vec_Int_t * Abc_NtkFanoutCounts ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Creates the array of fanout counters.]

Description []

SideEffects []

SeeAlso []

Definition at line 1741 of file abcUtil.c.

1742{
1743 Vec_Int_t * vFanNums;
1744 Abc_Obj_t * pObj;
1745 int i;
1746 vFanNums = Vec_IntAlloc( 0 );
1747 Vec_IntFill( vFanNums, Abc_NtkObjNumMax(pNtk), -1 );
1748 Abc_NtkForEachObj( pNtk, pObj, i )
1749 if ( Abc_ObjIsCi(pObj) || Abc_ObjIsNode(pObj) )
1750 Vec_IntWriteEntry( vFanNums, i, Abc_ObjFanoutNum(pObj) );
1751 return vFanNums;
1752}
Here is the caller graph for this function:

◆ Abc_NtkFetchTwinNode()

ABC_DLL Abc_Obj_t * Abc_NtkFetchTwinNode ( Abc_Obj_t * pNode)
extern

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

Synopsis [Returns the twin node if it exists.]

Description []

SideEffects []

SeeAlso []

Definition at line 804 of file abcMap.c.

805{
806 Abc_Obj_t * pNode2;
807 Mio_Gate_t * pGate = (Mio_Gate_t *)pNode->pData;
808 assert( Abc_NtkHasMapping(pNode->pNtk) );
809 if ( pGate == NULL || Mio_GateReadTwin(pGate) == NULL )
810 return NULL;
811 // assuming the twin node is following next
812 if ( (int)Abc_ObjId(pNode) == Abc_NtkObjNumMax(pNode->pNtk) - 1 )
813 return NULL;
814 pNode2 = Abc_NtkObj( pNode->pNtk, Abc_ObjId(pNode) + 1 );
815 if ( pNode2 == NULL || !Abc_ObjIsNode(pNode2) || Abc_ObjFaninNum(pNode) != Abc_ObjFaninNum(pNode2) )
816 return NULL;
817 if ( Mio_GateReadTwin(pGate) != (Mio_Gate_t *)pNode2->pData )
818 return NULL;
819 return pNode2;
820}
Mio_Gate_t * Mio_GateReadTwin(Mio_Gate_t *pGate)
Definition mioApi.c:176
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkFillTemp()

ABC_DLL void Abc_NtkFillTemp ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Cleans the copy field of all objects.]

Description []

SideEffects []

SeeAlso []

Definition at line 586 of file abcUtil.c.

587{
588 Abc_Obj_t * pObj;
589 int i;
590 Abc_NtkForEachObj( pNtk, pObj, i )
591 pObj->iTemp = -1;
592}
Here is the caller graph for this function:

◆ Abc_NtkFinalize()

ABC_DLL void Abc_NtkFinalize ( Abc_Ntk_t * pNtk,
Abc_Ntk_t * pNtkNew )
extern

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

Synopsis [Finalizes the network using the existing network as a model.]

Description []

SideEffects []

SeeAlso []

Definition at line 355 of file abcNtk.c.

356{
357 Abc_Obj_t * pObj, * pDriver, * pDriverNew;
358 int i;
359 // set the COs of the strashed network
360 Abc_NtkForEachCo( pNtk, pObj, i )
361 {
362 pDriver = Abc_ObjFanin0Ntk( Abc_ObjFanin0(pObj) );
363 pDriverNew = Abc_ObjNotCond(pDriver->pCopy, Abc_ObjFaninC0(pObj));
364 Abc_ObjAddFanin( pObj->pCopy, pDriverNew );
365 }
366 // duplicate timing manager
367 if ( pNtk->pManTime )
368 Abc_NtkTimeInitialize( pNtkNew, pNtk );
369 if ( pNtk->vPhases )
370 Abc_NtkTransferPhases( pNtkNew, pNtk );
371 if ( pNtk->pWLoadUsed )
372 pNtkNew->pWLoadUsed = Abc_UtilStrsav( pNtk->pWLoadUsed );
373}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkFinalizeRead()

ABC_DLL void Abc_NtkFinalizeRead ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Finalizes the network using the existing network as a model.]

Description []

SideEffects []

SeeAlso []

Definition at line 413 of file abcNtk.c.

414{
415 Abc_Obj_t * pBox, * pObj, * pTerm, * pNet;
416 int i;
417 if ( Abc_NtkHasBlackbox(pNtk) && Abc_NtkBoxNum(pNtk) == 0 )
418 {
419 pBox = Abc_NtkCreateBlackbox(pNtk);
420 Abc_NtkForEachPi( pNtk, pObj, i )
421 {
422 pTerm = Abc_NtkCreateBi(pNtk);
423 Abc_ObjAddFanin( pTerm, Abc_ObjFanout0(pObj) );
424 Abc_ObjAddFanin( pBox, pTerm );
425 }
426 Abc_NtkForEachPo( pNtk, pObj, i )
427 {
428 pTerm = Abc_NtkCreateBo(pNtk);
429 Abc_ObjAddFanin( pTerm, pBox );
430 Abc_ObjAddFanin( Abc_ObjFanin0(pObj), pTerm );
431 }
432 return;
433 }
434 assert( Abc_NtkIsNetlist(pNtk) );
435
436 // check if constant 0 net is used
437 pNet = Abc_NtkFindNet( pNtk, "1\'b0" );
438 if ( pNet )
439 {
440 if ( Abc_ObjFanoutNum(pNet) == 0 )
441 Abc_NtkDeleteObj(pNet);
442 else if ( Abc_ObjFaninNum(pNet) == 0 )
444 }
445 // check if constant 1 net is used
446 pNet = Abc_NtkFindNet( pNtk, "1\'b1" );
447 if ( pNet )
448 {
449 if ( Abc_ObjFanoutNum(pNet) == 0 )
450 Abc_NtkDeleteObj(pNet);
451 else if ( Abc_ObjFaninNum(pNet) == 0 )
453 }
454 // fix the net drivers
456
457 // reorder the CI/COs to PI/POs first
458 Abc_NtkOrderCisCos( pNtk );
459}
void Abc_NtkFixNonDrivenNets(Abc_Ntk_t *pNtk)
Definition abcNtk.c:1557
ABC_DLL Abc_Obj_t * Abc_NtkFindNet(Abc_Ntk_t *pNtk, char *pName)
Definition abcObj.c:515
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkFindCi()

ABC_DLL Abc_Obj_t * Abc_NtkFindCi ( Abc_Ntk_t * pNtk,
char * pName )
extern

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

Synopsis [Returns CI with the given name.]

Description []

SideEffects []

SeeAlso []

Definition at line 538 of file abcObj.c.

539{
540 int Num;
541 assert( !Abc_NtkIsNetlist(pNtk) );
542 Num = Nm_ManFindIdByName( pNtk->pManName, pName, ABC_OBJ_PI );
543 if ( Num >= 0 )
544 return Abc_NtkObj( pNtk, Num );
545 Num = Nm_ManFindIdByName( pNtk->pManName, pName, ABC_OBJ_BO );
546 if ( Num >= 0 )
547 return Abc_NtkObj( pNtk, Num );
548 return NULL;
549}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkFindCo()

ABC_DLL Abc_Obj_t * Abc_NtkFindCo ( Abc_Ntk_t * pNtk,
char * pName )
extern

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

Synopsis [Returns CO with the given name.]

Description []

SideEffects []

SeeAlso []

Definition at line 562 of file abcObj.c.

563{
564 int Num;
565 assert( !Abc_NtkIsNetlist(pNtk) );
566 Num = Nm_ManFindIdByName( pNtk->pManName, pName, ABC_OBJ_PO );
567 if ( Num >= 0 )
568 return Abc_NtkObj( pNtk, Num );
569 Num = Nm_ManFindIdByName( pNtk->pManName, pName, ABC_OBJ_BI );
570 if ( Num >= 0 )
571 return Abc_NtkObj( pNtk, Num );
572 return NULL;
573}
Here is the call graph for this function:

◆ Abc_NtkFindExact()

ABC_DLL Abc_Ntk_t * Abc_NtkFindExact ( word * pTruth,
int nVars,
int nFunc,
int nMaxDepth,
int * pArrTimeProfile,
int nBTLimit,
int nStartGates,
int fVerbose )
extern

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

Synopsis [Find minimum size networks with a SAT solver.]

Description [If nMaxDepth is -1, then depth constraints are ignored. If nMaxDepth is not -1, one can set pArrTimeProfile which should have the length of nVars. One can ignore pArrTimeProfile by setting it to NULL.]

SideEffects []

SeeAlso []

Definition at line 2414 of file abcExact.c.

2415{
2416 Ses_Man_t * pSes;
2417 char * pSol;
2418 Abc_Ntk_t * pNtk = NULL;
2419 abctime timeStart;
2420
2421 /* some checks */
2422 assert( nVars >= 2 && nVars <= 8 );
2423
2424 timeStart = Abc_Clock();
2425
2426 pSes = Ses_ManAlloc( pTruth, nVars, nFunc, nMaxDepth, pArrTimeProfile, 0, nBTLimit, fVerbose );
2427 pSes->nStartGates = nStartGates;
2428 pSes->fReasonVerbose = 0;
2429 pSes->fSatVerbose = 0;
2430 if ( fVerbose )
2431 Ses_ManPrintFuncs( pSes );
2432
2433 if ( ( pSol = Ses_ManFindMinimumSize( pSes ) ) != NULL )
2434 {
2435 pNtk = Ses_ManExtractNtk( pSol );
2436 ABC_FREE( pSol );
2437 }
2438
2439 pSes->timeTotal = Abc_Clock() - timeStart;
2440
2441 if ( fVerbose )
2442 Ses_ManPrintRuntime( pSes );
2443
2444 /* cleanup */
2445 Ses_ManClean( pSes );
2446
2447 return pNtk;
2448}
struct Ses_Man_t_ Ses_Man_t
Definition abcExact.c:215
int fSatVerbose
Definition abcExact.c:237
int fReasonVerbose
Definition abcExact.c:238
int nStartGates
Definition abcExact.c:246
abctime timeTotal
Definition abcExact.c:273
Here is the caller graph for this function:

◆ Abc_NtkFindNet()

ABC_DLL Abc_Obj_t * Abc_NtkFindNet ( Abc_Ntk_t * pNtk,
char * pName )
extern

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

Synopsis [Returns the net with the given name.]

Description []

SideEffects []

SeeAlso []

Definition at line 515 of file abcObj.c.

516{
517 Abc_Obj_t * pNet;
518 int ObjId;
519 assert( Abc_NtkIsNetlist(pNtk) );
520 ObjId = Nm_ManFindIdByName( pNtk->pManName, pName, ABC_OBJ_NET );
521 if ( ObjId == -1 )
522 return NULL;
523 pNet = Abc_NtkObj( pNtk, ObjId );
524 return pNet;
525}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkFindNode()

ABC_DLL Abc_Obj_t * Abc_NtkFindNode ( Abc_Ntk_t * pNtk,
char * pName )
extern

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

Synopsis [Returns the net with the given name.]

Description []

SideEffects []

SeeAlso []

Definition at line 464 of file abcObj.c.

465{
466 Abc_Obj_t * pObj;
467 int Num;
468 // try to find the terminal
469 Num = Nm_ManFindIdByName( pNtk->pManName, pName, ABC_OBJ_PO );
470 if ( Num >= 0 )
471 return Abc_ObjFanin0( Abc_NtkObj( pNtk, Num ) );
472 Num = Nm_ManFindIdByName( pNtk->pManName, pName, ABC_OBJ_BI );
473 if ( Num >= 0 )
474 return Abc_ObjFanin0( Abc_NtkObj( pNtk, Num ) );
475 Num = Nm_ManFindIdByName( pNtk->pManName, pName, ABC_OBJ_NODE );
476 if ( Num >= 0 )
477 return Abc_NtkObj( pNtk, Num );
478 // find the internal node
479 if ( pName[0] != 'n' )
480 {
481 printf( "Name \"%s\" is not found among CO or node names (internal names often look as \"n<num>\").\n", pName );
482 return NULL;
483 }
484 Num = atoi( pName + 1 );
485 if ( Num < 0 || Num >= Abc_NtkObjNumMax(pNtk) )
486 {
487 printf( "The node \"%s\" with ID %d is not in the current network.\n", pName, Num );
488 return NULL;
489 }
490 pObj = Abc_NtkObj( pNtk, Num );
491 if ( pObj == NULL )
492 {
493 printf( "The node \"%s\" with ID %d has been removed from the current network.\n", pName, Num );
494 return NULL;
495 }
496 if ( !Abc_ObjIsNode(pObj) )
497 {
498 printf( "Object with ID %d is not a node.\n", Num );
499 return NULL;
500 }
501 return pObj;
502}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkFindOrCreateNet()

ABC_DLL Abc_Obj_t * Abc_NtkFindOrCreateNet ( Abc_Ntk_t * pNtk,
char * pName )
extern

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

Synopsis [Finds or creates the net.]

Description []

SideEffects []

SeeAlso []

Definition at line 587 of file abcObj.c.

588{
589 Abc_Obj_t * pNet;
590 assert( Abc_NtkIsNetlist(pNtk) );
591 if ( pName && (pNet = Abc_NtkFindNet( pNtk, pName )) )
592 return pNet;
593//printf( "Creating net %s.\n", pName );
594 // create a new net
595 pNet = Abc_NtkCreateNet( pNtk );
596 if ( pName )
597 Nm_ManStoreIdName( pNtk->pManName, pNet->Id, pNet->Type, pName, NULL );
598 return pNet;
599}
Abc_Obj_t * Abc_NtkFindNet(Abc_Ntk_t *pNtk, char *pName)
Definition abcObj.c:515
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkFixNonDrivenNets()

ABC_DLL void Abc_NtkFixNonDrivenNets ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Reads the verilog file.]

Description []

SideEffects []

SeeAlso []

Definition at line 1557 of file abcNtk.c.

1558{
1559 Vec_Ptr_t * vNets;
1560 Abc_Obj_t * pNet, * pNode;
1561 int i;
1562
1563 if ( Abc_NtkNodeNum(pNtk) == 0 && Abc_NtkBoxNum(pNtk) == 0 )
1564 return;
1565
1566 // special case
1567 pNet = Abc_NtkFindNet( pNtk, "$false" );
1568 if ( pNet != NULL )
1569 {
1570 pNode = Abc_NtkCreateNodeConst0( pNtk );
1571 Abc_ObjAddFanin( pNet, pNode );
1572 }
1573 pNet = Abc_NtkFindNet( pNtk, "$undef" );
1574 if ( pNet != NULL )
1575 {
1576 pNode = Abc_NtkCreateNodeConst0( pNtk );
1577 Abc_ObjAddFanin( pNet, pNode );
1578 }
1579 pNet = Abc_NtkFindNet( pNtk, "$true" );
1580 if ( pNet != NULL )
1581 {
1582 pNode = Abc_NtkCreateNodeConst1( pNtk );
1583 Abc_ObjAddFanin( pNet, pNode );
1584 }
1585 pNet = Abc_NtkFindNet( pNtk, "[_c1_]" );
1586 if ( pNet != NULL )
1587 {
1588 pNode = Abc_NtkCreateNodeConst1( pNtk );
1589 Abc_ObjAddFanin( pNet, pNode );
1590 }
1591
1592 // check for non-driven nets
1593 vNets = Vec_PtrAlloc( 100 );
1594 Abc_NtkForEachNet( pNtk, pNet, i )
1595 {
1596 if ( Abc_ObjFaninNum(pNet) > 0 )
1597 continue;
1598 // add the constant 0 driver
1599 pNode = Abc_NtkCreateNodeConst0( pNtk );
1600 // add the fanout net
1601 Abc_ObjAddFanin( pNet, pNode );
1602 // add the net to those for which the warning will be printed
1603 Vec_PtrPush( vNets, pNet );
1604 }
1605
1606 // print the warning
1607 if ( vNets->nSize > 0 )
1608 {
1609 printf( "Warning: Constant-0 drivers added to %d non-driven nets in network \"%s\":\n", Vec_PtrSize(vNets), pNtk->pName );
1610 Vec_PtrForEachEntry( Abc_Obj_t *, vNets, pNet, i )
1611 {
1612 printf( "%s%s", (i? ", ": ""), Abc_ObjName(pNet) );
1613 if ( i == 3 )
1614 {
1615 if ( Vec_PtrSize(vNets) > 3 )
1616 printf( " ..." );
1617 break;
1618 }
1619 }
1620 printf( "\n" );
1621 }
1622 Vec_PtrFree( vNets );
1623}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkFlattenHierarchyGia()

ABC_DLL Gia_Man_t * Abc_NtkFlattenHierarchyGia ( Abc_Ntk_t * pNtk,
Vec_Ptr_t ** pvBuffers,
int fVerbose )
extern

Definition at line 418 of file abcHieGia.c.

419{
420 int fUseBufs = 1;
421 Gia_Man_t * pNew, * pTemp;
422 Abc_Ntk_t * pModel;
423 Abc_Obj_t * pTerm;
424 Vec_Ptr_t * vSupers;
425 Vec_Ptr_t * vBuffers = fUseBufs ? Vec_PtrAlloc(1000) : NULL;
426 int i, Counter = 0;
427 assert( Abc_NtkIsNetlist(pNtk) );
428// Abc_NtkPrintBoxInfo( pNtk );
429
430 // set the PI/PO numbers
431 Counter -= Abc_NtkPiNum(pNtk) + Abc_NtkPoNum(pNtk);
432 if ( !pNtk->pDesign )
433 Counter += Gia_ManFlattenLogicPrepare( pNtk );
434 else
435 Vec_PtrForEachEntry( Abc_Ntk_t *, pNtk->pDesign->vModules, pModel, i )
436 Counter += Gia_ManFlattenLogicPrepare( pModel );
437
438 // start the manager
439 pNew = Gia_ManStart( Abc_NtkObjNumMax(pNtk) );
440 pNew->pName = Abc_UtilStrsav(pNtk->pName);
441 pNew->pSpec = Abc_UtilStrsav(pNtk->pSpec);
442
443 // create PIs and buffers
444 Abc_NtkForEachPi( pNtk, pTerm, i )
445 pTerm->iTemp = Gia_ManAppendCi( pNew );
446
447 // call recursively
448 vSupers = Vec_PtrAlloc( 100 );
449 Gia_ManHashAlloc( pNew );
450 Abc_NtkForEachPo( pNtk, pTerm, i )
451 Abc_NtkFlattenHierarchyGia_rec( pNew, vSupers, pTerm, vBuffers );
452 Gia_ManHashStop( pNew );
453 Vec_PtrFree( vSupers );
454 printf( "Hierarchy reader flattened %d instances of boxes and added %d barbufs (out of %d).\n",
455 pNtk->pDesign ? Vec_PtrSize(pNtk->pDesign->vModules)-1 : 0, Vec_PtrSize(vBuffers), Counter );
456
457 // create buffers and POs
458 Abc_NtkForEachPo( pNtk, pTerm, i )
459 Gia_ManAppendCo( pNew, pTerm->iTemp );
460
461 if ( pvBuffers )
462 *pvBuffers = vBuffers;
463 else
464 Vec_PtrFreeP( &vBuffers );
465
466 // cleanup
467 pNew = Gia_ManCleanup( pTemp = pNew );
468 Gia_ManStop( pTemp );
469// Gia_ManPrintStats( pNew, NULL );
470 pNew = Gia_ManSweepHierarchy( pTemp = pNew );
471 Gia_ManStop( pTemp );
472// Gia_ManPrintStats( pNew, NULL );
473 return pNew;
474}
Gia_Man_t * Gia_ManSweepHierarchy(Gia_Man_t *p)
Definition abcHieGia.c:292
int Abc_NtkFlattenHierarchyGia_rec(Gia_Man_t *pNew, Vec_Ptr_t *vSupers, Abc_Obj_t *pObj, Vec_Ptr_t *vBuffers)
Definition abcHieGia.c:374
int Gia_ManFlattenLogicPrepare(Abc_Ntk_t *pNtk)
Definition abcHieGia.c:355
void Gia_ManHashAlloc(Gia_Man_t *p)
Definition giaHash.c:105
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
Definition giaScl.c:84
void Gia_ManHashStop(Gia_Man_t *p)
Definition giaHash.c:149
Vec_Ptr_t * vModules
Definition abc.h:225
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkFlattenLogicHierarchy()

ABC_DLL Abc_Ntk_t * Abc_NtkFlattenLogicHierarchy ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Flattens the logic hierarchy of the netlist.]

Description []

SideEffects []

SeeAlso []

Definition at line 514 of file abcHie.c.

515{
516 extern Abc_Des_t * Abc_DesDupBlackboxes( Abc_Des_t * p, Abc_Ntk_t * pNtkSave );
517 Vec_Str_t * vPref;
518 Abc_Ntk_t * pNtkNew;
519 Abc_Obj_t * pTerm, * pNet;
520 int i, Counter = -1;
521
522 assert( Abc_NtkIsNetlist(pNtk) );
523// Abc_NtkPrintBoxInfo( pNtk );
524
525 // start the network
526 pNtkNew = Abc_NtkAlloc( pNtk->ntkType, pNtk->ntkFunc, 1 );
527 // duplicate the name and the spec
528 pNtkNew->pName = Extra_UtilStrsav(pNtk->pName);
529 pNtkNew->pSpec = Extra_UtilStrsav(pNtk->pSpec);
530
531 // clean the node copy fields
532 Abc_NtkCleanCopy( pNtk );
533
534 // duplicate PIs/POs and their nets
535 Abc_NtkForEachPi( pNtk, pTerm, i )
536 {
537 Abc_NtkDupObj( pNtkNew, pTerm, 0 );
538 pNet = Abc_ObjFanout0( pTerm );
539 pNet->pCopy = Abc_NtkFindOrCreateNet( pNtkNew, Abc_ObjName(pNet) );
540 Abc_ObjAddFanin( pNet->pCopy, pTerm->pCopy );
541 }
542 Abc_NtkForEachPo( pNtk, pTerm, i )
543 {
544 Abc_NtkDupObj( pNtkNew, pTerm, 0 );
545 pNet = Abc_ObjFanin0( pTerm );
546 pNet->pCopy = Abc_NtkFindOrCreateNet( pNtkNew, Abc_ObjName(pNet) );
547 Abc_ObjAddFanin( pTerm->pCopy, pNet->pCopy );
548 }
549
550 // recursively flatten hierarchy, create internal logic, add new PI/PO names if there are black boxes
551 vPref = Vec_StrAlloc( 1000 );
552 Vec_StrPrintStr( vPref, Abc_NtkName(pNtk) );
553 Abc_NtkFlattenLogicHierarchy_rec( pNtkNew, pNtk, &Counter, vPref );
554 printf( "Hierarchy reader flattened %d instances of logic boxes and left %d black boxes.\n",
555 Counter, Abc_NtkBlackboxNum(pNtkNew) );
556 Vec_StrFree( vPref );
557
558 if ( pNtk->pDesign )
559 {
560 // pass on the design
561 assert( Vec_PtrEntry(pNtk->pDesign->vTops, 0) == pNtk );
562 pNtkNew->pDesign = Abc_DesDupBlackboxes( pNtk->pDesign, pNtkNew );
563 // update the pointers
564 Abc_NtkForEachBlackbox( pNtkNew, pTerm, i )
565 pTerm->pData = ((Abc_Ntk_t *)pTerm->pData)->pCopy;
566 }
567
568 // we may have added property outputs
569 Abc_NtkOrderCisCos( pNtkNew );
570
571 // copy the timing information
572// Abc_ManTimeDup( pNtk, pNtkNew );
573 // duplicate EXDC
574 if ( pNtk->pExdc )
575 printf( "EXDC is not transformed.\n" );
576 if ( !Abc_NtkCheck( pNtkNew ) )
577 {
578 fprintf( stdout, "Abc_NtkFlattenLogicHierarchy(): Network check has failed.\n" );
579 Abc_NtkDelete( pNtkNew );
580 return NULL;
581 }
582 return pNtkNew;
583}
void Abc_NtkFlattenLogicHierarchy_rec(Abc_Ntk_t *pNtkNew, Abc_Ntk_t *pNtk, int *pCounter, Vec_Str_t *vPref)
Definition abcHie.c:265
Abc_Des_t * Abc_DesDupBlackboxes(Abc_Des_t *p, Abc_Ntk_t *pNtkSave)
Definition abcLib.c:165
ABC_DLL Abc_Obj_t * Abc_NtkFindOrCreateNet(Abc_Ntk_t *pNtk, char *pName)
Definition abcObj.c:587
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkFraig()

ABC_DLL Abc_Ntk_t * Abc_NtkFraig ( Abc_Ntk_t * pNtk,
void * pParams,
int fAllNodes,
int fExdc )
extern

FUNCTION DEFINITIONS ///.

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

Synopsis [Interfaces the network with the FRAIG package.]

Description []

SideEffects []

SeeAlso []

Definition at line 58 of file abcFraig.c.

59{
60 Fraig_Params_t * pPars = (Fraig_Params_t *)pParams;
61 Abc_Ntk_t * pNtkNew;
62 Fraig_Man_t * pMan;
63 // check if EXDC is present
64 if ( fExdc && pNtk->pExdc == NULL )
65 fExdc = 0, printf( "Warning: Networks has no EXDC.\n" );
66 // perform fraiging
67 pMan = (Fraig_Man_t *)Abc_NtkToFraig( pNtk, pParams, fAllNodes, fExdc );
68 // add algebraic choices
69// if ( pPars->fChoicing )
70// Fraig_ManAddChoices( pMan, 0, 6 );
71 // prove the miter if asked to
72 if ( pPars->fTryProve )
73 Fraig_ManProveMiter( pMan );
74 // reconstruct FRAIG in the new network
75 if ( fExdc )
76 pNtkNew = Abc_NtkFromFraig2( pMan, pNtk );
77 else
78 pNtkNew = Abc_NtkFromFraig( pMan, pNtk );
79 Fraig_ManFree( pMan );
80 if ( pNtk->pExdc )
81 pNtkNew->pExdc = Abc_NtkDup( pNtk->pExdc );
82 // make sure that everything is okay
83 if ( !Abc_NtkCheck( pNtkNew ) )
84 {
85 printf( "Abc_NtkFraig: The network check has failed.\n" );
86 Abc_NtkDelete( pNtkNew );
87 return NULL;
88 }
89 return pNtkNew;
90}
ABC_NAMESPACE_IMPL_START Abc_Ntk_t * Abc_NtkFromFraig(Fraig_Man_t *pMan, Abc_Ntk_t *pNtk)
DECLARATIONS ///.
Definition abcFraig.c:279
void * Abc_NtkToFraig(Abc_Ntk_t *pNtk, void *pParams, int fAllNodes, int fExdc)
Definition abcFraig.c:103
void Fraig_ManProveMiter(Fraig_Man_t *p)
Definition fraigSat.c:85
void Fraig_ManFree(Fraig_Man_t *pMan)
Definition fraigMan.c:262
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
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkFraigRestore()

ABC_DLL Abc_Ntk_t * Abc_NtkFraigRestore ( int nPatsRand,
int nPatsDyna,
int nBTLimit )
extern

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

Synopsis [Interfaces the network with the FRAIG package.]

Description []

SideEffects []

SeeAlso []

Definition at line 698 of file abcFraig.c.

699{
700 extern Abc_Ntk_t * Abc_NtkFraigPartitioned( Vec_Ptr_t * vStore, void * pParams );
701 Fraig_Params_t Params;
702 Vec_Ptr_t * vStore;
703 Abc_Ntk_t * pNtk, * pFraig;
704 int nWords1, nWords2, nWordsMin;
705// abctime clk = Abc_Clock();
706
707 // get the stored network
708 vStore = Abc_FrameReadStore();
709 if ( Vec_PtrSize(vStore) == 0 )
710 {
711 printf( "There are no network currently in storage.\n" );
712 return NULL;
713 }
714// printf( "Currently stored %d networks will be fraiged.\n", Vec_PtrSize(vStore) );
715 pNtk = (Abc_Ntk_t *)Vec_PtrEntry( vStore, 0 );
716
717 // swap the first and last network
718 // this should lead to the primary choice being "better" because of synthesis
719 if ( Vec_PtrSize(vStore) > 1 )
720 {
721 pNtk = (Abc_Ntk_t *)Vec_PtrPop( vStore );
722 Vec_PtrPush( vStore, Vec_PtrEntry(vStore,0) );
723 Vec_PtrWriteEntry( vStore, 0, pNtk );
724 }
725
726 // to determine the number of simulation patterns
727 // use the following strategy
728 // at least 64 words (32 words random and 32 words dynamic)
729 // no more than 256M for one circuit (128M + 128M)
730 nWords1 = 32;
731 nWords2 = (1<<27) / (Abc_NtkNodeNum(pNtk) + Abc_NtkCiNum(pNtk));
732 nWordsMin = Abc_MinInt( nWords1, nWords2 );
733
734 // set parameters for fraiging
735 Fraig_ParamsSetDefault( &Params );
736 Params.nPatsRand = nPatsRand ? nPatsRand : nWordsMin * 32; // the number of words of random simulation info
737 Params.nPatsDyna = nPatsDyna ? nPatsDyna : nWordsMin * 32; // the number of words of dynamic simulation info
738 Params.nBTLimit = nBTLimit; // the max number of backtracks to perform
739 Params.fFuncRed = 1; // performs only one level hashing
740 Params.fFeedBack = 1; // enables solver feedback
741 Params.fDist1Pats = 1; // enables distance-1 patterns
742 Params.fDoSparse = 1; // performs equiv tests for sparse functions
743 Params.fChoicing = 1; // enables recording structural choices
744 Params.fTryProve = 0; // tries to solve the final miter
745 Params.fInternal = 1; // does not show progress bar
746 Params.fVerbose = 0; // the verbosiness flag
747
748 // perform partitioned computation of structural choices
749 pFraig = Abc_NtkFraigPartitioned( vStore, &Params );
751//ABC_PRT( "Total choicing time", Abc_Clock() - clk );
752 return pFraig;
753}
void Abc_NtkFraigStoreClean()
Definition abcFraig.c:766
Abc_Ntk_t * Abc_NtkFraigPartitioned(Vec_Ptr_t *vStore, void *pParams)
Definition abcPart.c:1106
ABC_DLL Vec_Ptr_t * Abc_FrameReadStore()
FUNCTION DEFINITIONS ///.
Definition mainFrame.c:55
void Fraig_ParamsSetDefault(Fraig_Params_t *pParams)
Definition fraigMan.c:122
Here is the call graph for this function:

◆ Abc_NtkFraigStore()

ABC_DLL int Abc_NtkFraigStore ( Abc_Ntk_t * pNtkAdd)
extern

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

Synopsis [Interfaces the network with the FRAIG package.]

Description []

SideEffects []

SeeAlso []

Definition at line 654 of file abcFraig.c.

655{
656 Vec_Ptr_t * vStore;
657 Abc_Ntk_t * pNtk;
658 // create the network to be stored
659 pNtk = Abc_NtkStrash( pNtkAdd, 0, 0, 0 );
660 if ( pNtk == NULL )
661 {
662 printf( "Abc_NtkFraigStore: Initial strashing has failed.\n" );
663 return 0;
664 }
665 // get the network currently stored
666 vStore = Abc_FrameReadStore();
667 if ( Vec_PtrSize(vStore) > 0 )
668 {
669 // check that the networks have the same PIs
670 extern int Abc_NodeCompareCiCo( Abc_Ntk_t * pNtkOld, Abc_Ntk_t * pNtkNew );
671 if ( !Abc_NodeCompareCiCo(pNtk, (Abc_Ntk_t *)Vec_PtrEntry(vStore, 0)) )
672 {
673 // reorder PIs of pNtk2 according to pNtk1
674 if ( !Abc_NtkCompareSignals( pNtk, (Abc_Ntk_t *)Vec_PtrEntry(vStore, 0), 1, 1 ) )
675 {
676 printf( "Trying to store the network with different primary inputs.\n" );
677 printf( "The previously stored networks are deleted and this one is added.\n" );
679 }
680 }
681 }
682 Vec_PtrPush( vStore, pNtk );
683// printf( "The number of AIG nodes added to storage = %5d.\n", Abc_NtkNodeNum(pNtk) );
684 return 1;
685}
int Abc_NodeCompareCiCo(Abc_Ntk_t *pNtkOld, Abc_Ntk_t *pNtkNew)
Definition abcNames.c:466
ABC_DLL 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:

◆ Abc_NtkFraigStoreClean()

ABC_DLL void Abc_NtkFraigStoreClean ( )
extern

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

Synopsis [Interfaces the network with the FRAIG package.]

Description []

SideEffects []

SeeAlso []

Definition at line 766 of file abcFraig.c.

767{
768 Vec_Ptr_t * vStore;
769 Abc_Ntk_t * pNtk;
770 int i;
771 vStore = Abc_FrameReadStore();
772 Vec_PtrForEachEntry( Abc_Ntk_t *, vStore, pNtk, i )
773 Abc_NtkDelete( pNtk );
774 Vec_PtrClear( vStore );
775}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkFraigTrust()

ABC_DLL Abc_Ntk_t * Abc_NtkFraigTrust ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Interfaces the network with the FRAIG package.]

Description []

SideEffects []

SeeAlso []

Definition at line 485 of file abcFraig.c.

486{
487 Abc_Ntk_t * pNtkNew;
488
489 if ( !Abc_NtkIsSopLogic(pNtk) )
490 {
491 printf( "Abc_NtkFraigTrust: Trust mode works for netlists and logic SOP networks.\n" );
492 return NULL;
493 }
494
495 if ( !Abc_NtkFraigTrustCheck(pNtk) )
496 {
497 printf( "Abc_NtkFraigTrust: The network does not look like an AIG with choice nodes.\n" );
498 return NULL;
499 }
500
501 // perform strashing
502 pNtkNew = Abc_NtkStartFrom( pNtk, ABC_NTK_STRASH, ABC_FUNC_AIG );
503 Abc_NtkFraigTrustOne( pNtk, pNtkNew );
504 Abc_NtkFinalize( pNtk, pNtkNew );
505 Abc_NtkReassignIds( pNtkNew );
506
507 // print a warning about choice nodes
508 printf( "Warning: The resulting AIG contains %d choice nodes.\n", Abc_NtkGetChoiceNum( pNtkNew ) );
509
510 // make sure that everything is okay
511 if ( !Abc_NtkCheck( pNtkNew ) )
512 {
513 printf( "Abc_NtkFraigTrust: The network check has failed.\n" );
514 Abc_NtkDelete( pNtkNew );
515 return NULL;
516 }
517 return pNtkNew;
518}
ABC_DLL int Abc_NtkGetChoiceNum(Abc_Ntk_t *pNtk)
Definition abcUtil.c:463
ABC_DLL void Abc_NtkReassignIds(Abc_Ntk_t *pNtk)
Definition abcUtil.c:1809
Here is the call graph for this function:

◆ Abc_NtkFrames()

ABC_DLL Abc_Ntk_t * Abc_NtkFrames ( Abc_Ntk_t * pNtk,
int nFrames,
int fInitial,
int fVerbose )
extern

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

Synopsis [Derives the timeframes of the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 775 of file abcMiter.c.

776{
777 char Buffer[1000];
778 ProgressBar * pProgress;
779 Abc_Ntk_t * pNtkFrames;
780 Abc_Obj_t * pLatch, * pLatchOut;
781 int i, Counter;
782 assert( nFrames > 0 );
783 assert( Abc_NtkIsStrash(pNtk) );
785 assert( Abc_NtkHasOnlyLatchBoxes(pNtk) );
786 // start the new network
787 pNtkFrames = Abc_NtkAlloc( ABC_NTK_STRASH, ABC_FUNC_AIG, 1 );
788 sprintf( Buffer, "%s_%d_frames", pNtk->pName, nFrames );
789 pNtkFrames->pName = Extra_UtilStrsav(Buffer);
790 // map the constant nodes
791 Abc_AigConst1(pNtk)->pCopy = Abc_AigConst1(pNtkFrames);
792
793 // create new latches (or their initial values) and remember them in the new latches
794 if ( !fInitial )
795 {
796 Abc_NtkForEachLatch( pNtk, pLatch, i )
797 Abc_NtkDupBox( pNtkFrames, pLatch, 1 );
798 }
799 else
800 {
801 Counter = 0;
802 Abc_NtkForEachLatch( pNtk, pLatch, i )
803 {
804 pLatchOut = Abc_ObjFanout0(pLatch);
805 if ( Abc_LatchIsInitNone(pLatch) || Abc_LatchIsInitDc(pLatch) ) // don't-care initial value - create a new PI
806 {
807 pLatchOut->pCopy = Abc_NtkCreatePi(pNtkFrames);
808 Abc_ObjAssignName( pLatchOut->pCopy, Abc_ObjName(pLatchOut), NULL );
809 Counter++;
810 }
811 else
812 pLatchOut->pCopy = Abc_ObjNotCond( Abc_AigConst1(pNtkFrames), Abc_LatchIsInit0(pLatch) );
813 }
814 if ( Counter )
815 printf( "Warning: %d uninitialized latches are replaced by free PI variables.\n", Counter );
816 }
817
818 // create the timeframes
819 pProgress = Extra_ProgressBarStart( stdout, nFrames );
820 for ( i = 0; i < nFrames; i++ )
821 {
822 Extra_ProgressBarUpdate( pProgress, i, NULL );
823 Abc_NtkAddFrame( pNtkFrames, pNtk, i );
824 }
825 Extra_ProgressBarStop( pProgress );
826
827 // connect the new latches to the outputs of the last frame
828 if ( !fInitial )
829 {
830 // we cannot use pLatch->pCopy here because pLatch->pCopy is used for temporary storage of strashed values
831 Abc_NtkForEachLatch( pNtk, pLatch, i )
832 Abc_ObjAddFanin( Abc_ObjFanin0(pLatch)->pCopy, Abc_ObjFanout0(pLatch)->pCopy );
833 }
834
835 // remove dangling nodes
836 Abc_AigCleanup( (Abc_Aig_t *)pNtkFrames->pManFunc );
837 // reorder the latches
838 Abc_NtkOrderCisCos( pNtkFrames );
839 // make sure that everything is okay
840 if ( !Abc_NtkCheck( pNtkFrames ) )
841 {
842 printf( "Abc_NtkFrames: The network check has failed.\n" );
843 Abc_NtkDelete( pNtkFrames );
844 return NULL;
845 }
846 return pNtkFrames;
847}
ABC_NAMESPACE_IMPL_START typedef char ProgressBar
Definition bbrNtbdd.c:27
void Extra_ProgressBarStop(ProgressBar *p)
ProgressBar * Extra_ProgressBarStart(FILE *pFile, int nItemsTotal)
FUNCTION DEFINITIONS ///.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkFreeGlobalBdds()

ABC_DLL void * Abc_NtkFreeGlobalBdds ( Abc_Ntk_t * pNtk,
int fFreeMan )
extern

◆ Abc_NtkFreeMvVars()

ABC_DLL void Abc_NtkFreeMvVars ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Stops the Mv-Var manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 69 of file abcBlifMv.c.

70{
71 Mem_Flex_t * pUserMan;
72 pUserMan = (Mem_Flex_t *)Abc_NtkAttrFree( pNtk, VEC_ATTR_GLOBAL_BDD, 0 );
73 Mem_FlexStop( pUserMan, 0 );
74}
ABC_DLL void * Abc_NtkAttrFree(Abc_Ntk_t *pNtk, int Attr, int fFreeMan)
DECLARATIONS ///.
Definition abcUtil.c:55
@ VEC_ATTR_GLOBAL_BDD
Definition vecAtt.h:47
Here is the call graph for this function:

◆ Abc_NtkFromBarBufs()

ABC_DLL Abc_Ntk_t * Abc_NtkFromBarBufs ( Abc_Ntk_t * pNtkBase,
Abc_Ntk_t * pNtk )
extern

Definition at line 263 of file abcBarBuf.c.

264{
265 Abc_Ntk_t * pNtkNew, * pTemp;
266 Vec_Ptr_t * vLiMaps, * vLoMaps;
267 Abc_Obj_t * pObj, * pLiMap, * pLoMap;
268 int i, k;
269 assert( pNtkBase->pDesign != NULL );
270 assert( Abc_NtkIsNetlist(pNtk) );
271 assert( Abc_NtkIsNetlist(pNtkBase) );
272 assert( Abc_NtkLatchNum(pNtkBase) == 0 );
273 assert( Abc_NtkLatchNum(pNtk) == pNtk->nBarBufs );
274 assert( Abc_NtkWhiteboxNum(pNtk) == 0 );
275 assert( Abc_NtkBlackboxNum(pNtk) == 0 );
276 assert( Abc_NtkPiNum(pNtk) == Abc_NtkPiNum(pNtkBase) );
277 assert( Abc_NtkPoNum(pNtk) == Abc_NtkPoNum(pNtkBase) );
278 // start networks
279 Abc_NtkCleanCopy_rec( pNtkBase );
280 Vec_PtrForEachEntry( Abc_Ntk_t *, pNtkBase->pDesign->vModules, pTemp, i )
281 pTemp->pCopy = Abc_NtkStartFrom( pTemp, pNtk->ntkType, pNtk->ntkFunc );
282 Vec_PtrForEachEntry( Abc_Ntk_t *, pNtkBase->pDesign->vModules, pTemp, i )
283 pTemp->pCopy->pAltView = pTemp->pAltView ? pTemp->pAltView->pCopy : NULL;
284 // update box models
285 Vec_PtrForEachEntry( Abc_Ntk_t *, pNtkBase->pDesign->vModules, pTemp, i )
286 Abc_NtkForEachBox( pTemp, pObj, k )
287 if ( Abc_ObjIsWhitebox(pObj) || Abc_ObjIsBlackbox(pObj) )
288 pObj->pCopy->pData = Abc_ObjModel(pObj)->pCopy;
289 // create the design
290 pNtkNew = pNtkBase->pCopy;
291 pNtkNew->pDesign = Abc_DesCreate( pNtkBase->pDesign->pName );
292 Vec_PtrForEachEntry( Abc_Ntk_t *, pNtkBase->pDesign->vModules, pTemp, i )
293 Abc_DesAddModel( pNtkNew->pDesign, pTemp->pCopy );
294 Vec_PtrForEachEntry( Abc_Ntk_t *, pNtkBase->pDesign->vTops, pTemp, i )
295 Vec_PtrPush( pNtkNew->pDesign->vTops, pTemp->pCopy );
296 assert( Vec_PtrEntry(pNtkNew->pDesign->vTops, 0) == pNtkNew );
297 // transfer copy attributes to pNtk
298 Abc_NtkCleanCopy( pNtk );
299 Abc_NtkForEachPi( pNtk, pObj, i )
300 pObj->pCopy = Abc_NtkPi(pNtkNew, i);
301 Abc_NtkForEachPo( pNtk, pObj, i )
302 pObj->pCopy = Abc_NtkPo(pNtkNew, i);
303 Abc_NtkCollectPiPos( pNtkBase, &vLiMaps, &vLoMaps );
304 assert( Vec_PtrSize(vLiMaps) == Abc_NtkLatchNum(pNtk) );
305 assert( Vec_PtrSize(vLoMaps) == Abc_NtkLatchNum(pNtk) );
306 Vec_PtrForEachEntryTwo( Abc_Obj_t *, vLiMaps, Abc_Obj_t *, vLoMaps, pLiMap, pLoMap, i )
307 {
308 pObj = Abc_NtkBox( pNtk, i );
309 Abc_ObjFanin0(pObj)->pCopy = pLiMap->pCopy;
310 Abc_ObjFanout0(pObj)->pCopy = pLoMap->pCopy;
311 }
312 Vec_PtrFree( vLiMaps );
313 Vec_PtrFree( vLoMaps );
314 // create internal nodes
315 Abc_NtkForEachCo( pNtk, pObj, i )
316 Abc_ObjAddFanin( pObj->pCopy, Abc_NtkFromBarBufs_rec(pObj->pCopy->pNtk, Abc_ObjFanin0(pObj)) );
317 // transfer net names
318 Abc_NtkForEachCi( pNtk, pObj, i )
319 {
320 if ( Abc_ObjFanoutNum(pObj->pCopy) == 0 ) // handle PI without fanout
321 Abc_ObjAddFanin( Abc_NtkCreateNet(pObj->pCopy->pNtk), pObj->pCopy );
322 Nm_ManStoreIdName( pObj->pCopy->pNtk->pManName, Abc_ObjFanout0(pObj->pCopy)->Id, Abc_ObjFanout0(pObj->pCopy)->Type, Abc_ObjName(Abc_ObjFanout0(pObj)), NULL );
323 }
324 Abc_NtkForEachCo( pNtk, pObj, i )
325 Nm_ManStoreIdName( pObj->pCopy->pNtk->pManName, Abc_ObjFanin0(pObj->pCopy)->Id, Abc_ObjFanin0(pObj->pCopy)->Type, Abc_ObjName(Abc_ObjFanin0(pObj)), NULL );
326 return pNtkNew;
327}
Abc_Obj_t * Abc_NtkFromBarBufs_rec(Abc_Ntk_t *pNtkNew, Abc_Obj_t *pObj)
Definition abcBarBuf.c:252
int Abc_NtkCollectPiPos(Abc_Ntk_t *pNtk, Vec_Ptr_t **pvLiMaps, Vec_Ptr_t **pvLoMaps)
Definition abcBarBuf.c:147
ABC_DLL void Abc_NtkCleanCopy_rec(Abc_Ntk_t *pNtk)
Definition abcUtil.c:547
ABC_DLL Abc_Des_t * Abc_DesCreate(char *pName)
DECLARATIONS ///.
Definition abcLib.c:45
ABC_DLL int Abc_DesAddModel(Abc_Des_t *p, Abc_Ntk_t *pNtk)
Definition abcLib.c:226
char * pName
Definition abc.h:222
#define Vec_PtrForEachEntryTwo(Type1, vVec1, Type2, vVec2, pEntry1, pEntry2, i)
Definition vecPtr.h:65
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkFunctionalIso()

ABC_DLL int Abc_NtkFunctionalIso ( Abc_Ntk_t * pNtk,
int iCo1,
int iCo2,
int fCommon )
extern

Definition at line 1048 of file abcDfs.c.

1049{
1050 Abc_Ntk_t * pNtkNew; int Result;
1051 if ( Abc_NtkIsStrash(pNtk) )
1052 return Abc_NtkFunctionalIsoInt( pNtk, iCo1, iCo2, fCommon );
1053 pNtkNew = Abc_NtkStrash( pNtk, 0, 0, 0 );
1054 Result = Abc_NtkFunctionalIsoInt( pNtkNew, iCo1, iCo2, fCommon );
1055 Abc_NtkDelete( pNtkNew );
1056 return Result;
1057}
int Abc_NtkFunctionalIsoInt(Abc_Ntk_t *pNtk, int iCo1, int iCo2, int fCommon)
Definition abcDfs.c:1033
Here is the call graph for this function:

◆ Abc_NtkGetAigNodeNum()

ABC_DLL int Abc_NtkGetAigNodeNum ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Reads the number of BDD nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 276 of file abcUtil.c.

277{
278 Abc_Obj_t * pNode;
279 int i, nNodes = 0;
280 assert( Abc_NtkIsAigLogic(pNtk) );
281 Abc_NtkForEachNode( pNtk, pNode, i )
282 {
283 assert( pNode->pData );
284 if ( Abc_ObjFaninNum(pNode) < 2 )
285 continue;
286//printf( "%d ", Hop_DagSize( pNode->pData ) );
287 nNodes += pNode->pData? Hop_DagSize( (Hop_Obj_t *)pNode->pData ) : 0;
288 }
289 return nNodes;
290}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkGetBddNodeNum()

ABC_DLL int Abc_NtkGetBddNodeNum ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Reads the number of BDD nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 247 of file abcUtil.c.

248{
249 int nNodes = 0;
250#ifdef ABC_USE_CUDD
251 Abc_Obj_t * pNode;
252 int i;
253 assert( Abc_NtkIsBddLogic(pNtk) );
254 Abc_NtkForEachNode( pNtk, pNode, i )
255 {
256 assert( pNode->pData );
257 if ( Abc_ObjFaninNum(pNode) < 2 )
258 continue;
259 nNodes += pNode->pData? -1 + Cudd_DagSize( (DdNode *)pNode->pData ) : 0;
260 }
261#endif
262 return nNodes;
263}
Here is the caller graph for this function:

◆ Abc_NtkGetBufNum()

ABC_DLL int Abc_NtkGetBufNum ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Counts the number of exors.]

Description []

SideEffects []

SeeAlso []

Definition at line 423 of file abcUtil.c.

424{
425 Abc_Obj_t * pNode;
426 int i, Counter = 0;
427 Abc_NtkForEachNode( pNtk, pNode, i )
428 Counter += (Abc_ObjFaninNum(pNode) == 1);
429 return Counter;
430}
Here is the caller graph for this function:

◆ Abc_NtkGetChoiceNum()

ABC_DLL int Abc_NtkGetChoiceNum ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Returns 1 if it is an AIG with choice nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 463 of file abcUtil.c.

464{
465 Abc_Obj_t * pNode;
466 int i, Counter;
467 if ( !Abc_NtkIsStrash(pNtk) )
468 return 0;
469 Counter = 0;
470 Abc_NtkForEachNode( pNtk, pNode, i )
471 Counter += Abc_AigNodeIsChoice( pNode );
472 return Counter;
473}
Here is the caller graph for this function:

◆ Abc_NtkGetCiArrivalFloats()

ABC_DLL float * Abc_NtkGetCiArrivalFloats ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Sets the CI node levels according to the arrival info.]

Description []

SideEffects []

SeeAlso []

Definition at line 789 of file abcTiming.c.

790{
791 float * p;
792 Abc_Obj_t * pNode;
793 int i;
794 p = ABC_CALLOC( float, Abc_NtkCiNum(pNtk) );
795 if ( pNtk->pManTime == NULL )
796 return p;
797 // set the PI arrival times
798 Abc_NtkForEachCi( pNtk, pNode, i )
799 p[i] = Abc_NodeReadArrivalWorst(pNode);
800 return p;
801}
#define ABC_CALLOC(type, num)
Definition abc_global.h:265
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkGetCiArrivalTimes()

ABC_DLL Abc_Time_t * Abc_NtkGetCiArrivalTimes ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Sets the CI node levels according to the arrival info.]

Description []

SideEffects []

SeeAlso []

Definition at line 750 of file abcTiming.c.

751{
752 Abc_Time_t * p;
753 Abc_Obj_t * pNode;
754 int i;
755 p = ABC_CALLOC( Abc_Time_t, Abc_NtkCiNum(pNtk) );
756 if ( pNtk->pManTime == NULL )
757 return p;
758 // set the PI arrival times
759 Abc_NtkForEachCi( pNtk, pNode, i )
760 p[i] = *Abc_NodeArrival(pNode);
761 return p;
762}
Here is the caller graph for this function:

◆ Abc_NtkGetCiIds()

ABC_DLL Vec_Int_t * Abc_NtkGetCiIds ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Returns the array of CI IDs.]

Description []

SideEffects []

SeeAlso []

Definition at line 1787 of file abcUtil.c.

1788{
1789 Vec_Int_t * vCiIds;
1790 Abc_Obj_t * pObj;
1791 int i;
1792 vCiIds = Vec_IntAlloc( Abc_NtkCiNum(pNtk) );
1793 Abc_NtkForEachCi( pNtk, pObj, i )
1794 Vec_IntPush( vCiIds, pObj->Id );
1795 return vCiIds;
1796}

◆ Abc_NtkGetClauseNum()

ABC_DLL int Abc_NtkGetClauseNum ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Reads the number of BDD nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 303 of file abcUtil.c.

304{
305 int nClauses = 0;
306#ifdef ABC_USE_CUDD
307 extern int Abc_CountZddCubes( DdManager * dd, DdNode * zCover );
308 Abc_Obj_t * pNode;
309 DdNode * bCover, * zCover, * bFunc;
310 DdManager * dd = (DdManager *)pNtk->pManFunc;
311 int i;
312 assert( Abc_NtkIsBddLogic(pNtk) );
313 Abc_NtkForEachNode( pNtk, pNode, i )
314 {
315 assert( pNode->pData );
316 bFunc = (DdNode *)pNode->pData;
317
318 bCover = Cudd_zddIsop( dd, bFunc, bFunc, &zCover );
319 Cudd_Ref( bCover );
320 Cudd_Ref( zCover );
321 nClauses += Abc_CountZddCubes( dd, zCover );
322 Cudd_RecursiveDeref( dd, bCover );
323 Cudd_RecursiveDerefZdd( dd, zCover );
324
325 bCover = Cudd_zddIsop( dd, Cudd_Not(bFunc), Cudd_Not(bFunc), &zCover );
326 Cudd_Ref( bCover );
327 Cudd_Ref( zCover );
328 nClauses += Abc_CountZddCubes( dd, zCover );
329 Cudd_RecursiveDeref( dd, bCover );
330 Cudd_RecursiveDerefZdd( dd, zCover );
331 }
332#endif
333 return nClauses;
334}

◆ Abc_NtkGetCoRequiredFloats()

ABC_DLL float * Abc_NtkGetCoRequiredFloats ( Abc_Ntk_t * pNtk)
extern

Definition at line 802 of file abcTiming.c.

803{
804 float * p;
805 Abc_Obj_t * pNode;
806 int i;
807 if ( pNtk->pManTime == NULL )
808 return NULL;
809 // set the PO required times
810 p = ABC_CALLOC( float, Abc_NtkCoNum(pNtk) );
811 Abc_NtkForEachCo( pNtk, pNode, i )
812 p[i] = Abc_NodeReadRequiredWorst(pNode);
813 return p;
814}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkGetCoRequiredTimes()

ABC_DLL Abc_Time_t * Abc_NtkGetCoRequiredTimes ( Abc_Ntk_t * pNtk)
extern

Definition at line 763 of file abcTiming.c.

764{
765 Abc_Time_t * p;
766 Abc_Obj_t * pNode;
767 int i;
768 p = ABC_CALLOC( Abc_Time_t, Abc_NtkCoNum(pNtk) );
769 if ( pNtk->pManTime == NULL )
770 return p;
771 // set the PO required times
772 Abc_NtkForEachCo( pNtk, pNode, i )
773 p[i] = *Abc_NodeRequired(pNode);
774 return p;
775}
Here is the caller graph for this function:

◆ Abc_NtkGetCubeNum()

ABC_DLL int Abc_NtkGetCubeNum ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Reads the number of cubes of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 117 of file abcUtil.c.

118{
119 Abc_Obj_t * pNode;
120 int i, nCubes = 0;
121 assert( Abc_NtkHasSop(pNtk) );
122 Abc_NtkForEachNode( pNtk, pNode, i )
123 {
124 if ( Abc_NodeIsConst(pNode) )
125 continue;
126 assert( pNode->pData );
127 nCubes += Abc_SopGetCubeNum( (char *)pNode->pData );
128 }
129 return nCubes;
130}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkGetCubePairNum()

ABC_DLL int Abc_NtkGetCubePairNum ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Reads the number of cubes of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 143 of file abcUtil.c.

144{
145 Abc_Obj_t * pNode;
146 int i;
147 word nCubes, nCubePairs = 0;
148 assert( Abc_NtkHasSop(pNtk) );
149 Abc_NtkForEachNode( pNtk, pNode, i )
150 {
151 if ( Abc_NodeIsConst(pNode) )
152 continue;
153 assert( pNode->pData );
154 nCubes = (word)Abc_SopGetCubeNum( (char *)pNode->pData );
155 if ( nCubes > 1 )
156 nCubePairs += nCubes * (nCubes - 1) / 2;
157 }
158 return (int)(nCubePairs > (1<<30) ? (1<<30) : nCubePairs);
159}
unsigned __int64 word
DECLARATIONS ///.
Definition kitPerm.c:36
Here is the call graph for this function:

◆ Abc_NtkGetExorNum()

ABC_DLL int Abc_NtkGetExorNum ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Counts the number of exors.]

Description []

SideEffects []

SeeAlso []

Definition at line 383 of file abcUtil.c.

384{
385 Abc_Obj_t * pNode;
386 int i, Counter = 0;
387 Abc_NtkForEachNode( pNtk, pNode, i )
388 Counter += pNode->fExor;
389 return Counter;
390}
unsigned fExor
Definition abc.h:138
Here is the caller graph for this function:

◆ Abc_NtkGetFaninMax()

ABC_DLL int Abc_NtkGetFaninMax ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Reads the maximum number of fanins.]

Description []

SideEffects []

SeeAlso []

Definition at line 486 of file abcUtil.c.

487{
488 Abc_Obj_t * pNode;
489 int i, nFaninsMax = 0;
490 Abc_NtkForEachNode( pNtk, pNode, i )
491 {
492 if ( nFaninsMax < Abc_ObjFaninNum(pNode) )
493 nFaninsMax = Abc_ObjFaninNum(pNode);
494 }
495 return nFaninsMax;
496}
Here is the caller graph for this function:

◆ Abc_NtkGetFanoutMax()

ABC_DLL int Abc_NtkGetFanoutMax ( Abc_Ntk_t * pNtk)
extern

Definition at line 497 of file abcUtil.c.

498{
499 Abc_Obj_t * pNode;
500 int i, nFaninsMax = 0;
501 Abc_NtkForEachNode( pNtk, pNode, i )
502 {
503 if ( nFaninsMax < Abc_ObjFanoutNum(pNode) )
504 nFaninsMax = Abc_ObjFanoutNum(pNode);
505 }
506 return nFaninsMax;
507}
Here is the caller graph for this function:

◆ Abc_NtkGetLargeNodeNum()

ABC_DLL int Abc_NtkGetLargeNodeNum ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Counts the number of exors.]

Description []

SideEffects []

SeeAlso []

Definition at line 443 of file abcUtil.c.

444{
445 Abc_Obj_t * pNode;
446 int i, Counter = 0;
447 Abc_NtkForEachNode( pNtk, pNode, i )
448 Counter += (Abc_ObjFaninNum(pNode) > 1);
449 return Counter;
450}
Here is the caller graph for this function:

◆ Abc_NtkGetLitFactNum()

ABC_DLL int Abc_NtkGetLitFactNum ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Counts the number of literals in the factored forms.]

Description []

SideEffects []

SeeAlso []

Definition at line 196 of file abcUtil.c.

197{
198 Dec_Graph_t * pFactor;
199 Abc_Obj_t * pNode;
200 int nNodes, i;
201 assert( Abc_NtkHasSop(pNtk) );
202 nNodes = 0;
203 Abc_NtkForEachNode( pNtk, pNode, i )
204 {
205 if ( Abc_NodeIsConst(pNode) )
206 continue;
207 pFactor = Dec_Factor( (char *)pNode->pData );
208 nNodes += 1 + Dec_GraphNodeNum(pFactor);
209 Dec_GraphFree( pFactor );
210 }
211 return nNodes;
212}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkGetLitNum()

ABC_DLL int Abc_NtkGetLitNum ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Reads the number of literals in the SOPs of the nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 172 of file abcUtil.c.

173{
174 Abc_Obj_t * pNode;
175 int i, nLits = 0;
176 assert( Abc_NtkHasSop(pNtk) );
177 Abc_NtkForEachNode( pNtk, pNode, i )
178 {
179 assert( pNode->pData );
180 nLits += Abc_SopGetLitNum( (char *)pNode->pData );
181 }
182 return nLits;
183}
ABC_DLL int Abc_SopGetLitNum(char *pSop)
Definition abcSop.c:559
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkGetMappedArea()

ABC_DLL double Abc_NtkGetMappedArea ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Computes the area of the mapped circuit.]

Description []

SideEffects []

SeeAlso []

Definition at line 347 of file abcUtil.c.

348{
349 Abc_Obj_t * pObj;
350 double TotalArea;
351 int i;
352 assert( Abc_NtkHasMapping(pNtk) );
353 TotalArea = 0.0;
354 Abc_NtkForEachNode( pNtk, pObj, i )
355 {
356 if ( Abc_ObjIsBarBuf(pObj) )
357 continue;
358// assert( pObj->pData );
359 if ( pObj->pData == NULL )
360 {
361 printf( "Node without mapping is encountered.\n" );
362 continue;
363 }
364 TotalArea += Mio_GateReadArea( (Mio_Gate_t *)pObj->pData );
365 // assuming that twin gates follow each other
366 if ( Abc_NtkFetchTwinNode(pObj) )
367 i++;
368 }
369 return TotalArea;
370}
ABC_DLL Abc_Obj_t * Abc_NtkFetchTwinNode(Abc_Obj_t *pNode)
Definition abcMap.c:804
double Mio_GateReadArea(Mio_Gate_t *pGate)
Definition mioApi.c:171
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkGetMuxNum()

ABC_DLL int Abc_NtkGetMuxNum ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Counts the number of exors.]

Description []

SideEffects []

SeeAlso []

Definition at line 403 of file abcUtil.c.

404{
405 Abc_Obj_t * pNode;
406 int i, Counter = 0;
407 Abc_NtkForEachNode( pNtk, pNode, i )
408 Counter += Abc_NodeIsMuxType(pNode);
409 return Counter;
410}
Here is the call graph for this function:

◆ Abc_NtkGetTotalFanins()

ABC_DLL int Abc_NtkGetTotalFanins ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Reads the total number of all fanins.]

Description []

SideEffects []

SeeAlso []

Definition at line 520 of file abcUtil.c.

521{
522 Abc_Obj_t * pNode;
523 int i, nFanins = 0;
524 Abc_NtkForEachNode( pNtk, pNode, i )
525 nFanins += Abc_ObjFaninNum(pNode);
526 return nFanins;
527}
Here is the caller graph for this function:

◆ Abc_NtkHaigStart()

ABC_DLL int Abc_NtkHaigStart ( Abc_Ntk_t * pNtk)
extern

◆ Abc_NtkHaigStop()

ABC_DLL int Abc_NtkHaigStop ( Abc_Ntk_t * pNtk)
extern

◆ Abc_NtkHaigUse()

ABC_DLL Abc_Ntk_t * Abc_NtkHaigUse ( Abc_Ntk_t * pNtk)
extern

◆ Abc_NtkInsertBlifMv()

ABC_DLL Abc_Ntk_t * Abc_NtkInsertBlifMv ( Abc_Ntk_t * pNtkBase,
Abc_Ntk_t * pNtkLogic )
extern

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

Synopsis [Inserts processed network into original base MV network.]

Description [The original network remembers the interface of combinational logic (PIs/POs/latches names and values). The processed network may be binary or multi-valued (currently, multi-value is not supported). The resulting network has the same interface as the original network while the internal logic is the same as that of the processed network.]

SideEffects []

SeeAlso []

Definition at line 912 of file abcBlifMv.c.

913{
914 Abc_Ntk_t * pNtkSkel, * pNtkNew;
915 Abc_Obj_t * pBox;
916
917 assert( Abc_NtkIsNetlist(pNtkBase) );
918 assert( Abc_NtkHasBlifMv(pNtkBase) );
919 assert( Abc_NtkWhiteboxNum(pNtkBase) == 0 );
920 assert( Abc_NtkBlackboxNum(pNtkBase) == 0 );
921
922 assert( Abc_NtkIsNetlist(pNtkLogic) );
923 assert( Abc_NtkHasBlifMv(pNtkLogic) );
924 assert( Abc_NtkWhiteboxNum(pNtkLogic) == 0 );
925 assert( Abc_NtkBlackboxNum(pNtkLogic) == 0 );
926
927 // extract the skeleton of the old network
928 pNtkSkel = Abc_NtkSkeletonBlifMv( pNtkBase );
929
930 // set the implementation of the box to be the same as the processed network
931 assert( Abc_NtkWhiteboxNum(pNtkSkel) == 1 );
932 pBox = Abc_NtkBox( pNtkSkel, 0 );
933 assert( Abc_ObjIsWhitebox(pBox) );
934 assert( pBox->pData == NULL );
935 assert( Abc_ObjFaninNum(pBox) == Abc_NtkPiNum(pNtkLogic) );
936 assert( Abc_ObjFanoutNum(pBox) == Abc_NtkPoNum(pNtkLogic) );
937 pBox->pData = pNtkLogic;
938
939 // flatten the hierarchy to insert the processed network
940 pNtkNew = Abc_NtkFlattenLogicHierarchy( pNtkSkel );
941 pBox->pData = NULL;
942 Abc_NtkDelete( pNtkSkel );
943 return pNtkNew;
944}
Abc_Ntk_t * Abc_NtkSkeletonBlifMv(Abc_Ntk_t *pNtk)
Definition abcBlifMv.c:727
ABC_DLL Abc_Ntk_t * Abc_NtkFlattenLogicHierarchy(Abc_Ntk_t *pNtk)
Definition abcHie.c:514
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkInsertHierarchyGia()

ABC_DLL void Abc_NtkInsertHierarchyGia ( Abc_Ntk_t * pNtk,
Abc_Ntk_t * pNew,
int fVerbose )
extern

Definition at line 535 of file abcHieGia.c.

536{
537 Vec_Ptr_t * vBuffers;
538 Gia_Man_t * pGia = Abc_NtkFlattenHierarchyGia( pNtk, &vBuffers, 0 );
539 Abc_Ntk_t * pModel;
540 Abc_Obj_t * pObj;
541 int i, k = 0;
542
543 assert( Gia_ManPiNum(pGia) == Abc_NtkPiNum(pNtk) );
544 assert( Gia_ManPiNum(pGia) == Abc_NtkPiNum(pNew) );
545 assert( Gia_ManPoNum(pGia) == Abc_NtkPoNum(pNtk) );
546 assert( Gia_ManPoNum(pGia) == Abc_NtkPoNum(pNew) );
547 assert( Gia_ManBufNum(pGia) == Vec_PtrSize(vBuffers) );
548 assert( Gia_ManBufNum(pGia) == pNew->nBarBufs2 );
549 Gia_ManStop( pGia );
550
551 // clean the networks
552 if ( !pNtk->pDesign )
553 Abc_NtkCleanCopy( pNtk );
554 else
555 Vec_PtrForEachEntry( Abc_Ntk_t *, pNtk->pDesign->vModules, pModel, i )
556 Abc_NtkCleanCopy( pModel );
557
558 // annotate PIs and POs of each network with barbufs
559 Abc_NtkForEachPi( pNew, pObj, i )
560 Abc_NtkPi(pNtk, i)->pCopy = pObj;
561 Abc_NtkForEachPo( pNew, pObj, i )
562 Abc_NtkPo(pNtk, i)->pCopy = pObj;
563 Abc_NtkForEachBarBuf( pNew, pObj, i )
564 ((Abc_Obj_t *)Vec_PtrEntry(vBuffers, k++))->pCopy = pObj;
565 Vec_PtrFree( vBuffers );
566
567 // connect each model
568 Abc_NtkCleanCopy( pNew );
569 Gia_ManInsertOne( pNtk, pNew );
570 if ( pNtk->pDesign )
571 Vec_PtrForEachEntry( Abc_Ntk_t *, pNtk->pDesign->vModules, pModel, i )
572 if ( pModel != pNtk )
573 Gia_ManInsertOne( pModel, pNew );
574}
Gia_Man_t * Abc_NtkFlattenHierarchyGia(Abc_Ntk_t *pNtk, Vec_Ptr_t **pvBuffers, int fVerbose)
Definition abcHieGia.c:418
void Gia_ManInsertOne(Abc_Ntk_t *pNtk, Abc_Ntk_t *pNew)
Definition abcHieGia.c:503
Here is the call graph for this function:

◆ Abc_NtkInsertLatchValues()

ABC_DLL void Abc_NtkInsertLatchValues ( Abc_Ntk_t * pNtk,
Vec_Int_t * vValues )
extern

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

Synopsis [Strashes one logic node using its SOP.]

Description []

SideEffects []

SeeAlso []

Definition at line 235 of file abcLatch.c.

236{
237 Abc_Obj_t * pLatch;
238 int i;
239 Abc_NtkForEachLatch( pNtk, pLatch, i )
240 pLatch->pData = (void *)(ABC_PTRINT_T)(vValues? (Vec_IntEntry(vValues,i)? ABC_INIT_ONE : ABC_INIT_ZERO) : ABC_INIT_DC);
241}
Here is the caller graph for this function:

◆ Abc_NtkInsertNewLogic()

ABC_DLL Abc_Ntk_t * Abc_NtkInsertNewLogic ( Abc_Ntk_t * pNtkH,
Abc_Ntk_t * pNtkL )
extern

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

Synopsis [Inserts blackboxes into the netlist.]

Description [The first arg is the netlist with blackboxes without logic hierarchy. The second arg is a non-hierarchical netlist derived from the above netlist after processing. This procedure create a new netlist, which is comparable to the original netlist with blackboxes, except that it contains logic nodes from the netlist after processing.]

SideEffects [This procedure silently assumes that blackboxes appear only in the top-level model. If they appear in other models as well, the name of the model and its number were appended to the names of blackbox inputs/outputs.]

SeeAlso []

Definition at line 691 of file abcHie.c.

692{
693 Abc_Des_t * pDesign;
694 Abc_Ntk_t * pNtkNew;
695 Abc_Obj_t * pObjH, * pObjL, * pNetH, * pNetL, * pTermH;
696 int i, k;
697
698 assert( Abc_NtkIsNetlist(pNtkH) );
699 assert( Abc_NtkWhiteboxNum(pNtkH) == 0 );
700 assert( Abc_NtkBlackboxNum(pNtkH) > 0 );
701
702 assert( Abc_NtkIsNetlist(pNtkL) );
703 assert( Abc_NtkWhiteboxNum(pNtkL) == 0 );
704 assert( Abc_NtkBlackboxNum(pNtkL) == 0 );
705
706 // prepare the logic network for copying
707 Abc_NtkCleanCopy( pNtkL );
708
709 // start the network
710 pNtkNew = Abc_NtkAlloc( pNtkL->ntkType, pNtkL->ntkFunc, 1 );
711 // duplicate the name and the spec
712 pNtkNew->pName = Extra_UtilStrsav( pNtkH->pName );
713 pNtkNew->pSpec = Extra_UtilStrsav( pNtkH->pSpec );
714
715 // make sure every PI/PO has a PI/PO in the processed network
716 Abc_NtkForEachPi( pNtkH, pObjH, i )
717 {
718 pNetH = Abc_ObjFanout0(pObjH);
719 pNetL = Abc_NtkFindNet( pNtkL, Abc_ObjName(pNetH) );
720 if ( pNetL == NULL || !Abc_ObjIsPi( Abc_ObjFanin0(pNetL) ) )
721 {
722 printf( "Error in Abc_NtkInsertNewLogic(): There is no PI corresponding to the PI %s.\n", Abc_ObjName(pNetH) );
723 Abc_NtkDelete( pNtkNew );
724 return NULL;
725 }
726 if ( pNetL->pCopy )
727 {
728 printf( "Error in Abc_NtkInsertNewLogic(): Primary input %s is repeated twice.\n", Abc_ObjName(pNetH) );
729 Abc_NtkDelete( pNtkNew );
730 return NULL;
731 }
732 // create the new net
733 pNetL->pCopy = Abc_NtkFindOrCreateNet( pNtkNew, Abc_ObjName(pNetH) );
734 Abc_NtkDupObj( pNtkNew, Abc_ObjFanin0(pNetL), 0 );
735 }
736
737 // make sure every BB has a PI/PO in the processed network
738 Abc_NtkForEachBlackbox( pNtkH, pObjH, i )
739 {
740 // duplicate the box
741 Abc_NtkDupBox( pNtkNew, pObjH, 0 );
742 pObjH->pCopy->pData = pObjH->pData;
743 // create PIs
744 Abc_ObjForEachFanout( pObjH, pTermH, k )
745 {
746 pNetH = Abc_ObjFanout0( pTermH );
747 pNetL = Abc_NtkFindNet( pNtkL, Abc_ObjName(pNetH) );
748 if ( pNetL == NULL || !Abc_ObjIsPi( Abc_ObjFanin0(pNetL) ) )
749 {
750 printf( "Error in Abc_NtkInsertNewLogic(): There is no PI corresponding to the inpout %s of blackbox %s.\n", Abc_ObjName(pNetH), Abc_ObjName(pObjH) );
751 Abc_NtkDelete( pNtkNew );
752 return NULL;
753 }
754 if ( pNetL->pCopy )
755 {
756 printf( "Error in Abc_NtkInsertNewLogic(): Box output %s is repeated twice.\n", Abc_ObjName(pNetH) );
757 Abc_NtkDelete( pNtkNew );
758 return NULL;
759 }
760 // create net and map the PI
761 pNetL->pCopy = Abc_NtkFindOrCreateNet( pNtkNew, Abc_ObjName(pNetH) );
762 Abc_ObjFanin0(pNetL)->pCopy = pTermH->pCopy;
763 }
764 }
765
766 Abc_NtkForEachPo( pNtkH, pObjH, i )
767 {
768 pNetH = Abc_ObjFanin0(pObjH);
769 pNetL = Abc_NtkFindNet( pNtkL, Abc_ObjName(pNetH) );
770 if ( pNetL == NULL || !Abc_ObjIsPo( Abc_ObjFanout0(pNetL) ) )
771 {
772 printf( "Error in Abc_NtkInsertNewLogic(): There is no PO corresponding to the PO %s.\n", Abc_ObjName(pNetH) );
773 Abc_NtkDelete( pNtkNew );
774 return NULL;
775 }
776 if ( pNetL->pCopy )
777 continue;
778 // create the new net
779 pNetL->pCopy = Abc_NtkFindOrCreateNet( pNtkNew, Abc_ObjName(pNetH) );
780 Abc_NtkDupObj( pNtkNew, Abc_ObjFanout0(pNetL), 0 );
781 }
782 Abc_NtkForEachBlackbox( pNtkH, pObjH, i )
783 {
784 Abc_ObjForEachFanin( pObjH, pTermH, k )
785 {
786 char * pName;
787 pNetH = Abc_ObjFanin0( pTermH );
788 pName = Abc_ObjName(pNetH);
789 pNetL = Abc_NtkFindNet( pNtkL, Abc_ObjName(pNetH) );
790 if ( pNetL == NULL || !Abc_ObjIsPo( Abc_ObjFanout0(pNetL) ) )
791 {
792 printf( "There is no PO corresponding to the input %s of blackbox %s.\n", Abc_ObjName(pNetH), Abc_ObjName(pObjH) );
793 Abc_NtkDelete( pNtkNew );
794 return NULL;
795 }
796 // create net and map the PO
797 if ( pNetL->pCopy )
798 {
799 if ( Abc_ObjFanout0(pNetL)->pCopy == NULL )
800 Abc_ObjFanout0(pNetL)->pCopy = pTermH->pCopy;
801 else
802 Abc_ObjAddFanin( pTermH->pCopy, pNetL->pCopy );
803 continue;
804 }
805 pNetL->pCopy = Abc_NtkFindOrCreateNet( pNtkNew, Abc_ObjName(pNetH) );
806 Abc_ObjFanout0(pNetL)->pCopy = pTermH->pCopy;
807 }
808 }
809
810 // duplicate other objects of the logic network
811 Abc_NtkForEachObj( pNtkL, pObjL, i )
812 if ( pObjL->pCopy == NULL && !Abc_ObjIsPo(pObjL) ) // skip POs feeding into PIs
813 Abc_NtkDupObj( pNtkNew, pObjL, Abc_ObjIsNet(pObjL) );
814
815 // connect objects
816 Abc_NtkForEachObj( pNtkL, pObjL, i )
817 Abc_ObjForEachFanin( pObjL, pNetL, k )
818 if ( pObjL->pCopy )
819 Abc_ObjAddFanin( pObjL->pCopy, pNetL->pCopy );
820
821 // transfer the design
822 pDesign = pNtkH->pDesign; pNtkH->pDesign = NULL;
823 assert( Vec_PtrEntry( pDesign->vModules, 0 ) == pNtkH );
824 Vec_PtrWriteEntry( pDesign->vModules, 0, pNtkNew );
825 pNtkNew->pDesign = pDesign;
826
827 // check integrity
828 if ( !Abc_NtkCheck( pNtkNew ) )
829 {
830 fprintf( stdout, "Abc_NtkInsertNewLogic(): Network check has failed.\n" );
831 Abc_NtkDelete( pNtkNew );
832 return NULL;
833 }
834 return pNtkNew;
835}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkInvertConstraints()

ABC_DLL void Abc_NtkInvertConstraints ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Complements the constraint outputs.]

Description []

SideEffects []

SeeAlso []

Definition at line 2244 of file abcUtil.c.

2245{
2246 Abc_Obj_t * pObj;
2247 int i;
2248 if ( Abc_NtkConstrNum(pNtk) == 0 )
2249 return;
2250 Abc_NtkForEachPo( pNtk, pObj, i )
2251 {
2252 if ( i >= Abc_NtkPoNum(pNtk) - Abc_NtkConstrNum(pNtk) )
2253 Abc_ObjXorFaninC( pObj, 0 );
2254 }
2255}
Here is the caller graph for this function:

◆ Abc_NtkIsAcyclic()

ABC_DLL int Abc_NtkIsAcyclic ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Detects combinational loops.]

Description [This procedure is based on the idea suggested by Donald Chai. As we traverse the network and visit the nodes, we need to distinquish three types of nodes: (1) those that are visited for the first time, (2) those that have been visited in this traversal but are currently not on the traversal path, (3) those that have been visited and are currently on the travesal path. When the node of type (3) is encountered, it means that there is a combinational loop. To mark the three types of nodes, two new values of the traversal IDs are used.]

SideEffects []

SeeAlso []

Definition at line 1614 of file abcDfs.c.

1615{
1616 Abc_Obj_t * pNode;
1617 int fAcyclic;
1618 int i;
1619 // set the traversal ID for this DFS ordering
1620 Abc_NtkIncrementTravId( pNtk );
1621 Abc_NtkIncrementTravId( pNtk );
1622 // pNode->TravId == pNet->nTravIds means "pNode is on the path"
1623 // pNode->TravId == pNet->nTravIds - 1 means "pNode is visited but is not on the path"
1624 // pNode->TravId < pNet->nTravIds - 1 means "pNode is not visited"
1625 // traverse the network to detect cycles
1626 fAcyclic = 1;
1627 Abc_NtkForEachCo( pNtk, pNode, i )
1628 {
1629 pNode = Abc_ObjFanin0Ntk(Abc_ObjFanin0(pNode));
1630 if ( Abc_NodeIsTravIdPrevious(pNode) )
1631 continue;
1632 // traverse the output logic cone
1633 if ( (fAcyclic = Abc_NtkIsAcyclic_rec(pNode)) )
1634 continue;
1635 // stop as soon as the first loop is detected
1636 fprintf( stdout, " CO \"%s\"\n", Abc_ObjName(Abc_ObjFanout0(pNode)) );
1637 break;
1638 }
1639 return fAcyclic;
1640}
int Abc_NtkIsAcyclic_rec(Abc_Obj_t *pNode)
Definition abcDfs.c:1538
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkIsAcyclicHierarchy()

ABC_DLL int Abc_NtkIsAcyclicHierarchy ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Returns 0 if the network hierachy contains a cycle.]

Description []

SideEffects []

SeeAlso []

Definition at line 817 of file abcCheck.c.

818{
819 Abc_Ntk_t * pTemp;
820 int i, RetValue;
821 assert( Abc_NtkIsNetlist(pNtk) && pNtk->pDesign );
822 // clear the modules
823 Vec_PtrForEachEntry( Abc_Ntk_t *, pNtk->pDesign->vModules, pTemp, i )
824 pTemp->fHieVisited = pTemp->fHiePath = 0;
825 // traverse
826 pNtk->fHiePath = 1;
827 RetValue = Abc_NtkIsAcyclicHierarchy_rec( pNtk );
828 pNtk->fHiePath = 0;
829 // clear the modules
830 Vec_PtrForEachEntry( Abc_Ntk_t *, pNtk->pDesign->vModules, pTemp, i )
831 pTemp->fHieVisited = pTemp->fHiePath = 0;
832 return RetValue;
833}
int Abc_NtkIsAcyclicHierarchy_rec(Abc_Ntk_t *pNtk)
Definition abcCheck.c:776
int fHiePath
Definition abc.h:183
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkIsAcyclicWithBoxes()

ABC_DLL int Abc_NtkIsAcyclicWithBoxes ( Abc_Ntk_t * pNtk)
extern

Definition at line 1702 of file abcDfs.c.

1703{
1704 Abc_Obj_t * pNode;
1705 int fAcyclic;
1706 int i;
1707 // set the traversal ID for this DFS ordering
1708 Abc_NtkIncrementTravId( pNtk );
1709 Abc_NtkIncrementTravId( pNtk );
1710 // pNode->TravId == pNet->nTravIds means "pNode is on the path"
1711 // pNode->TravId == pNet->nTravIds - 1 means "pNode is visited but is not on the path"
1712 // pNode->TravId < pNet->nTravIds - 1 means "pNode is not visited"
1713 // traverse the network to detect cycles
1714 fAcyclic = 1;
1715 Abc_NtkForEachPo( pNtk, pNode, i )
1716 {
1717 pNode = Abc_ObjFanin0Ntk(Abc_ObjFanin0(pNode));
1718 if ( Abc_ObjIsBo(pNode) )
1719 pNode = Abc_ObjFanin0(pNode);
1720 if ( Abc_NodeIsTravIdPrevious(pNode) )
1721 continue;
1722 // traverse the output logic cone
1723 if ( (fAcyclic = Abc_NtkIsAcyclicWithBoxes_rec(pNode)) )
1724 continue;
1725 // stop as soon as the first loop is detected
1726 fprintf( stdout, " PO \"%s\"\n", Abc_ObjName(Abc_ObjFanout0(pNode)) );
1727 break;
1728 }
1729 if ( fAcyclic )
1730 {
1731 Abc_NtkForEachLatchInput( pNtk, pNode, i )
1732 {
1733 pNode = Abc_ObjFanin0Ntk(Abc_ObjFanin0(pNode));
1734 if ( Abc_ObjIsBo(pNode) )
1735 pNode = Abc_ObjFanin0(pNode);
1736 if ( Abc_NodeIsTravIdPrevious(pNode) )
1737 continue;
1738 // traverse the output logic cone
1739 if ( (fAcyclic = Abc_NtkIsAcyclicWithBoxes_rec(pNode)) )
1740 continue;
1741 // stop as soon as the first loop is detected
1742 fprintf( stdout, " PO \"%s\"\n", Abc_ObjName(Abc_ObjFanout0(pNode)) );
1743 break;
1744 }
1745 }
1746 return fAcyclic;
1747}
int Abc_NtkIsAcyclicWithBoxes_rec(Abc_Obj_t *pNode)
Definition abcDfs.c:1653
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkIsDfsOrdered()

ABC_DLL int Abc_NtkIsDfsOrdered ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Returns 1 if the ordering of nodes is DFS.]

Description []

SideEffects []

SeeAlso []

Definition at line 698 of file abcDfs.c.

699{
700 Abc_Obj_t * pNode, * pFanin;
701 int i, k;
702 // set the traversal ID
703 Abc_NtkIncrementTravId( pNtk );
704 // mark the CIs
705 Abc_NtkForEachCi( pNtk, pNode, i )
706 Abc_NodeSetTravIdCurrent( pNode );
707 // go through the nodes
708 Abc_NtkForEachNode( pNtk, pNode, i )
709 {
710 // check the fanins of the node
711 Abc_ObjForEachFanin( pNode, pFanin, k )
712 if ( !Abc_NodeIsTravIdCurrent(pFanin) )
713 return 0;
714 // check the choices of the node
715 if ( Abc_NtkIsStrash(pNtk) && Abc_AigNodeIsChoice(pNode) )
716 for ( pFanin = (Abc_Obj_t *)pNode->pData; pFanin; pFanin = (Abc_Obj_t *)pFanin->pData )
717 if ( !Abc_NodeIsTravIdCurrent(pFanin) )
718 return 0;
719 // mark the node as visited
720 Abc_NodeSetTravIdCurrent( pNode );
721 }
722 return 1;
723}
Here is the caller graph for this function:

◆ Abc_NtkIsTopo()

ABC_DLL int Abc_NtkIsTopo ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Checks if the logic network is in the topological order.]

Description []

SideEffects []

SeeAlso []

Definition at line 2888 of file abcUtil.c.

2889{
2890 Abc_Obj_t * pObj, * pFanin;
2891 int i, k, Counter = 0;
2892 Abc_NtkIncrementTravId( pNtk );
2893 Abc_NtkForEachCi( pNtk, pObj, i )
2894 Abc_NodeSetTravIdCurrent(pObj);
2895 Abc_NtkForEachNode( pNtk, pObj, i )
2896 {
2897 // check if fanins are in the topo order
2898 Abc_ObjForEachFanin( pObj, pFanin, k )
2899 if ( !Abc_NodeIsTravIdCurrent(pFanin) )
2900 break;
2901 if ( k != Abc_ObjFaninNum(pObj) )
2902 {
2903 if ( Counter++ == 0 )
2904 printf( "Node %d is out of topo order.\n", Abc_ObjId(pObj) );
2905 }
2906 Abc_NodeSetTravIdCurrent(pObj);
2907 }
2908 if ( Counter )
2909 printf( "Topological order does not hold for %d internal nodes.\n", Counter );
2910 return (int)(Counter == 0);
2911}
Here is the caller graph for this function:

◆ Abc_NtkIsTrueCex()

ABC_DLL int Abc_NtkIsTrueCex ( Abc_Ntk_t * pNtk,
Abc_Cex_t * pCex )
extern

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

Synopsis [Returns the PO values under the given input pattern.]

Description []

SideEffects []

SeeAlso []

Definition at line 1074 of file abcVerify.c.

1075{
1076 extern Aig_Man_t * Abc_NtkToDar( Abc_Ntk_t * pNtk, int fExors, int fRegisters );
1077 Aig_Man_t * pMan;
1078 int status = 0, fStrashed = 0;
1079 if ( !Abc_NtkIsStrash(pNtk) )
1080 {
1081 pNtk = Abc_NtkStrash(pNtk, 0, 0, 0);
1082 fStrashed = 1;
1083 }
1084 pMan = Abc_NtkToDar( pNtk, 0, 1 );
1085 if ( pMan )
1086 {
1087 status = Saig_ManVerifyCex( pMan, pCex );
1088 Aig_ManStop( pMan );
1089 }
1090 if ( fStrashed )
1091 Abc_NtkDelete( pNtk );
1092 return status;
1093}
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
Definition abcDar.c:237
int Saig_ManVerifyCex(Aig_Man_t *pAig, Abc_Cex_t *p)
Definition saigDup.c:281
Here is the call graph for this function:

◆ Abc_NtkIsValidCex()

ABC_DLL int Abc_NtkIsValidCex ( Abc_Ntk_t * pNtk,
Abc_Cex_t * pCex )
extern

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

Synopsis [Returns 1 if the number of PIs matches.]

Description []

SideEffects []

SeeAlso []

Definition at line 1106 of file abcVerify.c.

1107{
1108 return Abc_NtkPiNum(pNtk) == pCex->nPis;
1109}

◆ Abc_NtkIvyProve()

ABC_DLL int Abc_NtkIvyProve ( Abc_Ntk_t ** ppNtk,
void * pPars )
extern

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

Synopsis [Gives the current ABC network to AIG manager for processing.]

Description []

SideEffects []

SeeAlso []

Definition at line 503 of file abcIvy.c.

504{
505 Prove_Params_t * pParams = (Prove_Params_t *)pPars;
506 Abc_Ntk_t * pNtk = *ppNtk, * pNtkTemp;
507 Abc_Obj_t * pObj, * pFanin;
508 Ivy_Man_t * pMan;
509 Aig_Man_t * pMan2;
510 int RetValue;
511 assert( Abc_NtkIsStrash(pNtk) || Abc_NtkIsLogic(pNtk) );
512 // experiment with various parameters settings
513// pParams->fUseBdds = 1;
514// pParams->fBddReorder = 1;
515// pParams->nTotalBacktrackLimit = 10000;
516
517 // strash the network if it is not strashed already
518 if ( !Abc_NtkIsStrash(pNtk) )
519 {
520 pNtk = Abc_NtkStrash( pNtkTemp = pNtk, 0, 1, 0 );
521 Abc_NtkDelete( pNtkTemp );
522 }
523
524 // check the case when the 0000 simulation pattern detect the bug
525 pObj = Abc_NtkPo(pNtk,0);
526 pFanin = Abc_ObjFanin0(pObj);
527 if ( Abc_ObjFanin0(pObj)->fPhase != (unsigned)Abc_ObjFaninC0(pObj) )
528 {
529 pNtk->pModel = ABC_CALLOC( int, Abc_NtkCiNum(pNtk) );
530 return 0;
531 }
532
533 // changed in "src\sat\fraig\fraigMan.c"
534 // pParams->nMiteringLimitStart = 300; // starting mitering limit
535 // to be
536 // pParams->nMiteringLimitStart = 5000; // starting mitering limit
537
538 // if SAT only, solve without iteration
539// RetValue = Abc_NtkMiterSat( pNtk, 2*(ABC_INT64_T)pParams->nMiteringLimitStart, (ABC_INT64_T)0, 0, NULL, NULL );
540 pMan2 = Abc_NtkToDar( pNtk, 0, 0 );
541 RetValue = Fra_FraigSat( pMan2, (ABC_INT64_T)pParams->nMiteringLimitStart, (ABC_INT64_T)0, 0, 0, 0, 1, 0, 0, 0 );
542 pNtk->pModel = (int *)pMan2->pData, pMan2->pData = NULL;
543 Aig_ManStop( pMan2 );
544// pNtk->pModel = Aig_ManReleaseData( pMan2 );
545 if ( RetValue >= 0 )
546 return RetValue;
547
548 // apply AIG rewriting
549 if ( pParams->fUseRewriting && Abc_NtkNodeNum(pNtk) > 500 )
550 {
551// abctime clk = Abc_Clock();
552//printf( "Before rwsat = %d. ", Abc_NtkNodeNum(pNtk) );
553 pParams->fUseRewriting = 0;
554 pNtk = Abc_NtkBalance( pNtkTemp = pNtk, 0, 0, 0 );
555 Abc_NtkDelete( pNtkTemp );
556 Abc_NtkRewrite( pNtk, 0, 0, 0, 0, 0 );
557 pNtk = Abc_NtkBalance( pNtkTemp = pNtk, 0, 0, 0 );
558 Abc_NtkDelete( pNtkTemp );
559 Abc_NtkRewrite( pNtk, 0, 0, 0, 0, 0 );
560 Abc_NtkRefactor( pNtk, 10, 1, 16, 0, 0, 0, 0 );
561//printf( "After rwsat = %d. ", Abc_NtkNodeNum(pNtk) );
562//ABC_PRT( "Time", Abc_Clock() - clk );
563 }
564
565 // convert ABC network into IVY network
566 pMan = Abc_NtkIvyBefore( pNtk, 0, 0 );
567
568 // solve the CEC problem
569 RetValue = Ivy_FraigProve( &pMan, pParams );
570// RetValue = -1;
571
572 // convert IVY network into ABC network
573 pNtk = Abc_NtkIvyAfter( pNtkTemp = pNtk, pMan, 0, 0 );
574 Abc_NtkDelete( pNtkTemp );
575 // transfer model if given
576 pNtk->pModel = (int *)pMan->pData; pMan->pData = NULL;
577 Ivy_ManStop( pMan );
578
579 // try to prove it using brute force SAT with good CNF encoding
580 if ( RetValue < 0 )
581 {
582 pMan2 = Abc_NtkToDar( pNtk, 0, 0 );
583 // dump the miter before entering high-effort solving
584 if ( pParams->fVerbose )
585 {
586 char pFileName[100];
587 sprintf( pFileName, "cecmiter.aig" );
588 Ioa_WriteAiger( pMan2, pFileName, 0, 0 );
589 printf( "Intermediate reduced miter is written into file \"%s\".\n", pFileName );
590 }
591 RetValue = Fra_FraigSat( pMan2, pParams->nMiteringLimitLast, 0, 0, 0, 0, 0, 0, 0, pParams->fVerbose );
592 pNtk->pModel = (int *)pMan2->pData, pMan2->pData = NULL;
593 Aig_ManStop( pMan2 );
594 }
595
596 // try to prove it using brute force BDDs
597#ifdef ABC_USE_CUDD
598 if ( RetValue < 0 && pParams->fUseBdds )
599 {
600 if ( pParams->fVerbose )
601 {
602 printf( "Attempting BDDs with node limit %d ...\n", pParams->nBddSizeLimit );
603 fflush( stdout );
604 }
605 pNtk = Abc_NtkCollapse( pNtkTemp = pNtk, pParams->nBddSizeLimit, 0, pParams->fBddReorder, 0, 0, 0 );
606 if ( pNtk )
607 {
608 Abc_NtkDelete( pNtkTemp );
609 RetValue = ( (Abc_NtkNodeNum(pNtk) == 1) && (Abc_ObjFanin0(Abc_NtkPo(pNtk,0))->pData == Cudd_ReadLogicZero((DdManager *)pNtk->pManFunc)) );
610 }
611 else
612 pNtk = pNtkTemp;
613 }
614#endif
615
616 // return the result
617 *ppNtk = pNtk;
618 return RetValue;
619}
void Aig_ManStop(Aig_Man_t *pMan)
Definition aigMan.c:187
ABC_NAMESPACE_IMPL_START Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
DECLARATIONS ///.
Definition abcDar.c:237
Ivy_Man_t * Abc_NtkIvyBefore(Abc_Ntk_t *pNtk, int fSeq, int fUseDc)
FUNCTION DEFINITIONS ///.
Definition abcIvy.c:88
Abc_Ntk_t * Abc_NtkIvyAfter(Abc_Ntk_t *pNtk, Ivy_Man_t *pMan, int fSeq, int fHaig)
Definition abcIvy.c:141
ABC_DLL Abc_Ntk_t * Abc_NtkCollapse(Abc_Ntk_t *pNtk, int fBddSizeMax, int fDualRail, int fReorder, int fReverse, int fDumpOrder, int fVerbose)
DECLARATIONS ///.
ABC_DLL int Abc_NtkRewrite(Abc_Ntk_t *pNtk, int fUpdateLevel, int fUseZeros, int fVerbose, int fVeryVerbose, int fPlaceEnable)
FUNCTION DEFINITIONS ///.
Definition abcRewrite.c:61
ABC_DLL Abc_Ntk_t * Abc_NtkBalance(Abc_Ntk_t *pNtk, int fDuplicate, int fSelective, int fUpdateLevel)
FUNCTION DEFINITIONS ///.
Definition abcBalance.c:53
ABC_DLL int Abc_NtkRefactor(Abc_Ntk_t *pNtk, int nNodeSizeMax, int nMinSaved, int nConeSizeMax, int fUpdateLevel, int fUseZeros, int fUseDcs, int fVerbose)
int Fra_FraigSat(Aig_Man_t *pMan, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, int nLearnedStart, int nLearnedDelta, int nLearnedPerce, int fFlipBits, int fAndOuts, int fNewSolver, int fVerbose)
ITERATORS ///.
Definition fraCec.c:47
void Ioa_WriteAiger(Aig_Man_t *pMan, char *pFileName, int fWriteSymbols, int fCompact)
struct Prove_ParamsStruct_t_ Prove_Params_t
Definition ivyFraig.c:108
typedefABC_NAMESPACE_HEADER_START struct Ivy_Man_t_ Ivy_Man_t
INCLUDES ///.
Definition ivy.h:46
void Ivy_ManStop(Ivy_Man_t *p)
Definition ivyMan.c:238
int Ivy_FraigProve(Ivy_Man_t **ppManAig, void *pPars)
Definition ivyFraig.c:255
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkLatchIsSelfFeed()

ABC_DLL int Abc_NtkLatchIsSelfFeed ( Abc_Obj_t * pLatch)
extern

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

Synopsis [Checks if latches form self-loop.]

Description []

SideEffects []

SeeAlso []

Definition at line 71 of file abcLatch.c.

72{
73 Abc_Obj_t * pFanin;
74 assert( Abc_ObjIsLatch(pLatch) );
75 pFanin = Abc_ObjFanin0(Abc_ObjFanin0(pLatch));
76 if ( !Abc_ObjIsBo(pFanin) || !Abc_ObjIsLatch(Abc_ObjFanin0(pFanin)) )
77 return 0;
78 return Abc_NtkLatchIsSelfFeed_rec( Abc_ObjFanin0(pFanin), pLatch );
79}
ABC_NAMESPACE_IMPL_START int Abc_NtkLatchIsSelfFeed_rec(Abc_Obj_t *pLatch, Abc_Obj_t *pLatchRoot)
DECLARATIONS ///.
Definition abcLatch.c:48
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkLevel()

ABC_DLL int Abc_NtkLevel ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Computes the number of logic levels not counting PIs/POs.]

Description []

SideEffects []

SeeAlso []

Definition at line 1449 of file abcDfs.c.

1450{
1451 Abc_Obj_t * pNode;
1452 int i, LevelsMax;
1453 // set the CI levels
1454 if ( pNtk->pManTime == NULL || pNtk->AndGateDelay <= 0 )
1455 Abc_NtkForEachCi( pNtk, pNode, i )
1456 pNode->Level = 0;
1457 else
1458 Abc_NtkForEachCi( pNtk, pNode, i )
1459 pNode->Level = (int)(Abc_MaxFloat(0, Abc_NodeReadArrivalWorst(pNode)) / pNtk->AndGateDelay);
1460 // perform the traversal
1461 LevelsMax = 0;
1462 Abc_NtkIncrementTravId( pNtk );
1463 if ( pNtk->nBarBufs == 0 )
1464 {
1465 Abc_NtkForEachNode( pNtk, pNode, i )
1466 {
1467 Abc_NtkLevel_rec( pNode );
1468 if ( LevelsMax < (int)pNode->Level )
1469 LevelsMax = (int)pNode->Level;
1470 }
1471 }
1472 else
1473 {
1474 Abc_NtkForEachLiPo( pNtk, pNode, i )
1475 {
1476 Abc_Obj_t * pDriver = Abc_ObjFanin0(pNode);
1477 Abc_NtkLevel_rec( pDriver );
1478 if ( LevelsMax < (int)pDriver->Level )
1479 LevelsMax = (int)pDriver->Level;
1480 // transfer the delay
1481 if ( i < pNtk->nBarBufs )
1482 Abc_ObjFanout0(Abc_ObjFanout0(pNode))->Level = pDriver->Level;
1483 }
1484 }
1485 return LevelsMax;
1486}
int Abc_NtkLevel_rec(Abc_Obj_t *pNode)
Definition abcDfs.c:1347
ABC_DLL float Abc_NodeReadArrivalWorst(Abc_Obj_t *pNode)
Definition abcTiming.c:111
#define Abc_NtkForEachLiPo(pNtk, pCo, i)
Definition abc.h:524
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkLevelize()

ABC_DLL Vec_Vec_t * Abc_NtkLevelize ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Computes the number of logic levels not counting PIs/POs.]

Description []

SideEffects []

SeeAlso []

Definition at line 1423 of file abcDfs.c.

1424{
1425 Abc_Obj_t * pObj;
1426 Vec_Vec_t * vLevels;
1427 int nLevels, i;
1428 nLevels = Abc_NtkLevel( pNtk );
1429 vLevels = Vec_VecStart( nLevels + 1 );
1430 Abc_NtkForEachNode( pNtk, pObj, i )
1431 {
1432 assert( (int)pObj->Level <= nLevels );
1433 Vec_VecPush( vLevels, pObj->Level, pObj );
1434 }
1435 return vLevels;
1436}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkLevelR()

ABC_DLL int Abc_NtkLevelR ( Abc_Ntk_t * pNtk)
extern

Definition at line 1517 of file abcDfs.c.

1518{
1519 int i, LevelMax = Abc_NtkLevelReverse( pNtk );
1520 Abc_Obj_t * pNode;
1521 Abc_NtkForEachObj( pNtk, pNode, i )
1522 pNode->Level = (int)(LevelMax - pNode->Level + 1);
1523 return LevelMax;
1524}
int Abc_NtkLevelReverse(Abc_Ntk_t *pNtk)
Definition abcDfs.c:1499
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkLevelReverse()

ABC_DLL int Abc_NtkLevelReverse ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Computes the number of logic levels not counting PIs/POs.]

Description []

SideEffects []

SeeAlso []

Definition at line 1499 of file abcDfs.c.

1500{
1501 Abc_Obj_t * pNode;
1502 int i, LevelsMax;
1503 // set the CO levels to zero
1504 Abc_NtkForEachCo( pNtk, pNode, i )
1505 pNode->Level = 0;
1506 // perform the traversal
1507 LevelsMax = 0;
1508 Abc_NtkIncrementTravId( pNtk );
1509 Abc_NtkForEachNode( pNtk, pNode, i )
1510 {
1511 Abc_NtkLevelReverse_rec( pNode );
1512 if ( LevelsMax < (int)pNode->Level )
1513 LevelsMax = (int)pNode->Level;
1514 }
1515 return LevelsMax;
1516}
int Abc_NtkLevelReverse_rec(Abc_Obj_t *pNode)
Definition abcDfs.c:1385
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkLoadCopy()

ABC_DLL void Abc_NtkLoadCopy ( Abc_Ntk_t * pNtk,
Vec_Ptr_t * vCopies )
extern

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

Synopsis [Loads copy field of the objects.]

Description []

SideEffects []

SeeAlso []

Definition at line 650 of file abcUtil.c.

651{
652 Abc_Obj_t * pObj;
653 int i;
654 Abc_NtkForEachObj( pNtk, pObj, i )
655 pObj->pCopy = (Abc_Obj_t *)Vec_PtrEntry( vCopies, i );
656}
Here is the caller graph for this function:

◆ Abc_NtkLogicHasSimpleCos()

ABC_DLL int Abc_NtkLogicHasSimpleCos ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Returns 1 if COs of a logic network are simple.]

Description [The COs of a logic network are simple under three conditions: (1) The edge from CO to its driver is not complemented. (2) If CI is a driver of a CO, they have the same name.] (3) If two COs share the same driver, they have the same name.]

SideEffects []

SeeAlso []

Definition at line 942 of file abcUtil.c.

943{
944 Abc_Obj_t * pNode, * pDriver;
945 int i;
946 assert( Abc_NtkIsLogic(pNtk) );
947 Abc_NtkIncrementTravId( pNtk );
948 Abc_NtkForEachCo( pNtk, pNode, i )
949 {
950 // if the driver is complemented, this is an error
951 pDriver = Abc_ObjFanin0(pNode);
952 if ( Abc_ObjFaninC0(pNode) )
953 return 0;
954 // if the driver is a CI and has different name, this is an error
955 if ( Abc_ObjIsCi(pDriver) && strcmp(Abc_ObjName(pDriver), Abc_ObjName(pNode)) )
956 return 0;
957 // if the driver is visited for the first time, remember the CO name
958 if ( !Abc_NodeIsTravIdCurrent(pDriver) )
959 {
960 pDriver->pNext = (Abc_Obj_t *)Abc_ObjName(pNode);
961 Abc_NodeSetTravIdCurrent(pDriver);
962 continue;
963 }
964 // the driver has second CO - if they have different name, this is an error
965 if ( strcmp((char *)pDriver->pNext, Abc_ObjName(pNode)) ) // diff names
966 return 0;
967 }
968 return 1;
969}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkLogicMakeDirectSops()

ABC_DLL void Abc_NtkLogicMakeDirectSops ( Abc_Ntk_t * pNtk)
extern

Definition at line 868 of file abcFunc.c.

868{}

◆ Abc_NtkLogicMakeSimpleCos()

ABC_DLL int Abc_NtkLogicMakeSimpleCos ( Abc_Ntk_t * pNtk,
int fDuplicate )
extern

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

Synopsis [Transforms the network to have simple COs.]

Description []

SideEffects []

SeeAlso []

Definition at line 1080 of file abcUtil.c.

1081{
1082 int fAddBuffers = 1;
1083 Vec_Ptr_t * vDrivers, * vCoTerms;
1084 Abc_Obj_t * pNode, * pDriver, * pDriverNew, * pFanin;
1085 int i, k, LevelMax, nTotal = 0;
1086 assert( Abc_NtkIsLogic(pNtk) );
1087 LevelMax = Abc_NtkLevel(pNtk);
1088// Abc_NtkLogicMakeSimpleCosTest( pNtk, fDuplicate );
1089
1090 // fix constant drivers
1091 Abc_NtkForEachCo( pNtk, pNode, i )
1092 {
1093 pDriver = Abc_ObjFanin0(pNode);
1094 if ( !Abc_NodeIsConst(pDriver) )
1095 continue;
1096 pDriverNew = (Abc_ObjFaninC0(pNode) == Abc_NodeIsConst0(pDriver)) ? Abc_NtkCreateNodeConst1(pNtk) : Abc_NtkCreateNodeConst0(pNtk);
1097 if ( Abc_ObjFaninC0(pNode) )
1098 Abc_ObjXorFaninC( pNode, 0 );
1099 Abc_ObjPatchFanin( pNode, pDriver, pDriverNew );
1100 if ( Abc_ObjFanoutNum(pDriver) == 0 )
1101 Abc_NtkDeleteObj( pDriver );
1102 }
1103
1104 // collect drivers pointed by complemented edges
1105 vDrivers = Vec_PtrAlloc( 100 );
1106 Abc_NtkIncrementTravId( pNtk );
1107 Abc_NtkForEachCo( pNtk, pNode, i )
1108 {
1109 if ( !Abc_ObjFaninC0(pNode) )
1110 continue;
1111 pDriver = Abc_ObjFanin0(pNode);
1112 if ( Abc_NodeIsTravIdCurrent(pDriver) )
1113 continue;
1114 Abc_NodeSetTravIdCurrent(pDriver);
1115 Vec_PtrPush( vDrivers, pDriver );
1116 }
1117 // fix complemented drivers
1118 if ( Vec_PtrSize(vDrivers) > 0 )
1119 {
1120 int nDupGates = 0, nDupInvs = 0, nDupChange = 0;
1121 Vec_Ptr_t * vFanouts = Vec_PtrAlloc( 100 );
1122 Vec_PtrForEachEntry( Abc_Obj_t *, vDrivers, pDriver, i )
1123 {
1124 int fHasDir = 0, fHasInv = 0, fHasOther = 0;
1125 Abc_ObjForEachFanout( pDriver, pNode, k )
1126 {
1127 if ( !Abc_ObjIsCo(pNode) )
1128 {
1129 assert( !Abc_ObjFaninC0(pNode) );
1130 fHasOther = 1;
1131 continue;
1132 }
1133 if ( Abc_ObjFaninC0(pNode) )
1134 fHasInv = 1;
1135 else //if ( Abc_ObjFaninC0(pNode) )
1136 fHasDir = 1;
1137 }
1138 assert( fHasInv );
1139 if ( Abc_ObjIsCi(pDriver) || fHasDir || (fHasOther && Abc_NtkHasMapping(pNtk)) ) // cannot change
1140 {
1141 // duplicate if critical
1142 if ( fDuplicate && Abc_ObjIsNode(pDriver) && Abc_ObjLevel(pDriver) == LevelMax )
1143 {
1144 pDriverNew = Abc_NtkDupObj( pNtk, pDriver, 0 );
1145 Abc_ObjForEachFanin( pDriver, pFanin, k )
1146 Abc_ObjAddFanin( pDriverNew, pFanin );
1147 Abc_NodeComplement( pDriverNew );
1148 nDupGates++;
1149 }
1150 else // add inverter
1151 {
1152 pDriverNew = Abc_NtkCreateNodeInv( pNtk, pDriver );
1153 nDupInvs++;
1154 }
1155 // collect CO fanouts to be redirected to the new node
1156 Vec_PtrClear( vFanouts );
1157 Abc_ObjForEachFanout( pDriver, pNode, k )
1158 if ( Abc_ObjIsCo(pNode) && Abc_ObjFaninC0(pNode) )
1159 Vec_PtrPush( vFanouts, pNode );
1160 assert( Vec_PtrSize(vFanouts) > 0 );
1161 Vec_PtrForEachEntry( Abc_Obj_t *, vFanouts, pNode, k )
1162 {
1163 Abc_ObjXorFaninC( pNode, 0 );
1164 Abc_ObjPatchFanin( pNode, pDriver, pDriverNew );
1165 assert( Abc_ObjIsCi(pDriver) || Abc_ObjFanoutNum(pDriver) > 0 );
1166 }
1167 }
1168 else // can change
1169 {
1170 // change polarity of the driver
1171 assert( Abc_ObjIsNode(pDriver) );
1172 Abc_NodeComplement( pDriver );
1173 Abc_ObjForEachFanout( pDriver, pNode, k )
1174 {
1175 if ( Abc_ObjIsCo(pNode) )
1176 {
1177 assert( Abc_ObjFaninC0(pNode) );
1178 Abc_ObjXorFaninC( pNode, 0 );
1179 }
1180 else if ( Abc_ObjIsNode(pNode) )
1181 Abc_NodeComplementInput( pNode, pDriver );
1182 else assert( 0 );
1183 }
1184 nDupChange++;
1185 }
1186 }
1187 Vec_PtrFree( vFanouts );
1188// printf( "Resolving inverted CO drivers: Invs = %d. Dups = %d. Changes = %d.\n",
1189// nDupInvs, nDupGates, nDupChange );
1190 nTotal += nDupInvs + nDupGates;
1191 }
1192 Vec_PtrFree( vDrivers );
1193
1194 // collect COs that needs fixing by adding buffers or duplicating
1195 vCoTerms = Vec_PtrAlloc( 100 );
1196 Abc_NtkIncrementTravId( pNtk );
1197
1198 // The following cases should be addressed only if the network is written
1199 // into a BLIF file. Otherwise, it is possible to skip them:
1200 // (1) if a CO points to a CI with a different name
1201 // (2) if an internal node drives more than one CO
1202 if ( fAddBuffers )
1203 Abc_NtkForEachCo( pNtk, pNode, i )
1204 {
1205 // if the driver is a CI and has different name, this is an error
1206 pDriver = Abc_ObjFanin0(pNode);
1207 if ( Abc_ObjIsCi(pDriver) && strcmp(Abc_ObjName(pDriver), Abc_ObjName(pNode)) )
1208 {
1209 Vec_PtrPush( vCoTerms, pNode );
1210 continue;
1211 }
1212 // if the driver is visited for the first time, remember the CO name
1213 if ( !Abc_NodeIsTravIdCurrent(pDriver) )
1214 {
1215 pDriver->pNext = (Abc_Obj_t *)Abc_ObjName(pNode);
1216 Abc_NodeSetTravIdCurrent(pDriver);
1217 continue;
1218 }
1219 // the driver has second CO - if they have different name, this is an error
1220 if ( strcmp((char *)pDriver->pNext, Abc_ObjName(pNode)) ) // diff names
1221 {
1222 Vec_PtrPush( vCoTerms, pNode );
1223 continue;
1224 }
1225 }
1226 // fix duplication problem
1227 if ( Vec_PtrSize(vCoTerms) > 0 )
1228 {
1229 int nDupBufs = 0, nDupGates = 0;
1230 Vec_PtrForEachEntry( Abc_Obj_t *, vCoTerms, pNode, i )
1231 {
1232 pDriver = Abc_ObjFanin0(pNode);
1233 // duplicate if critical
1234 if ( fDuplicate && Abc_ObjIsNode(pDriver) && (Abc_NtkHasMapping(pNtk) || Abc_ObjLevel(pDriver) == LevelMax) )
1235 {
1236 pDriverNew = Abc_NtkDupObj( pNtk, pDriver, 0 );
1237 Abc_ObjForEachFanin( pDriver, pFanin, k )
1238 Abc_ObjAddFanin( pDriverNew, pFanin );
1239 nDupGates++;
1240 }
1241 else // add buffer
1242 {
1243 pDriverNew = Abc_NtkCreateNodeBuf( pNtk, pDriver );
1244 Abc_ObjAssignName( pDriverNew, Abc_ObjName(pDriver), "_buf" );
1245 nDupBufs++;
1246 }
1247 // swing the PO
1248 Abc_ObjPatchFanin( pNode, pDriver, pDriverNew );
1249 assert( Abc_ObjIsCi(pDriver) || Abc_ObjFanoutNum(pDriver) > 0 );
1250 }
1251// printf( "Resolving shared CO drivers: Bufs = %d. Dups = %d.\n", nDupBufs, nDupGates );
1252 nTotal += nDupBufs + nDupGates;
1253 }
1254 Vec_PtrFree( vCoTerms );
1255 return nTotal;
1256}
ABC_DLL void Abc_NodeComplementInput(Abc_Obj_t *pNode, Abc_Obj_t *pFanin)
Definition abcObj.c:1039
ABC_DLL void Abc_NodeComplement(Abc_Obj_t *pNode)
Definition abcObj.c:1012
ABC_DLL int Abc_NodeIsConst0(Abc_Obj_t *pNode)
Definition abcObj.c:884
int nTotal
DECLARATIONS ///.
Definition cutTruth.c:37
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkMakeComb()

ABC_DLL void Abc_NtkMakeComb ( Abc_Ntk_t * pNtk,
int fRemoveLatches )
extern

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

Synopsis [Converts the network to combinational.]

Description []

SideEffects []

SeeAlso []

Definition at line 1637 of file abcNtk.c.

1638{
1639 Abc_Obj_t * pObj;
1640 int i;
1641
1642 if ( Abc_NtkIsComb(pNtk) )
1643 return;
1644
1645 assert( !Abc_NtkIsNetlist(pNtk) );
1646 assert( Abc_NtkHasOnlyLatchBoxes(pNtk) );
1647
1648 // detach the latches
1649// Abc_NtkForEachLatch( pNtk, pObj, i )
1650 Vec_PtrForEachEntryReverse( Abc_Obj_t *, pNtk->vBoxes, pObj, i )
1651 Abc_NtkDeleteObj( pObj );
1652 assert( Abc_NtkLatchNum(pNtk) == 0 );
1653 assert( Abc_NtkBoxNum(pNtk) == 0 );
1654
1655 // move CIs to become PIs
1656 Vec_PtrClear( pNtk->vPis );
1657 Abc_NtkForEachCi( pNtk, pObj, i )
1658 {
1659 if ( Abc_ObjIsBo(pObj) )
1660 {
1661 pObj->Type = ABC_OBJ_PI;
1662 pNtk->nObjCounts[ABC_OBJ_PI]++;
1663 pNtk->nObjCounts[ABC_OBJ_BO]--;
1664 }
1665 Vec_PtrPush( pNtk->vPis, pObj );
1666 }
1667 assert( Abc_NtkBoNum(pNtk) == 0 );
1668
1669 if ( fRemoveLatches )
1670 {
1671 // remove registers
1672 Vec_Ptr_t * vBos;
1673 vBos = Vec_PtrAlloc( 100 );
1674 Vec_PtrClear( pNtk->vPos );
1675 Abc_NtkForEachCo( pNtk, pObj, i )
1676 if ( Abc_ObjIsBi(pObj) )
1677 Vec_PtrPush( vBos, pObj );
1678 else
1679 Vec_PtrPush( pNtk->vPos, pObj );
1680 // remove COs
1681 Vec_PtrFree( pNtk->vCos );
1682 pNtk->vCos = NULL;
1683 // remove the BOs
1684 Vec_PtrForEachEntry( Abc_Obj_t *, vBos, pObj, i )
1685 Abc_NtkDeleteObj( pObj );
1686 Vec_PtrFree( vBos );
1687 // create COs
1688 pNtk->vCos = Vec_PtrDup( pNtk->vPos );
1689 // cleanup
1690 if ( Abc_NtkIsLogic(pNtk) )
1691 Abc_NtkCleanup( pNtk, 0 );
1692 else if ( Abc_NtkIsStrash(pNtk) )
1693 Abc_AigCleanup( (Abc_Aig_t *)pNtk->pManFunc );
1694 else
1695 assert( 0 );
1696 }
1697 else
1698 {
1699 // move COs to become POs
1700 Vec_PtrClear( pNtk->vPos );
1701 Abc_NtkForEachCo( pNtk, pObj, i )
1702 {
1703 if ( Abc_ObjIsBi(pObj) )
1704 {
1705 pObj->Type = ABC_OBJ_PO;
1706 pNtk->nObjCounts[ABC_OBJ_PO]++;
1707 pNtk->nObjCounts[ABC_OBJ_BI]--;
1708 }
1709 Vec_PtrPush( pNtk->vPos, pObj );
1710 }
1711 }
1712 assert( Abc_NtkBiNum(pNtk) == 0 );
1713
1714 if ( !Abc_NtkCheck( pNtk ) )
1715 fprintf( stdout, "Abc_NtkMakeComb(): Network check has failed.\n" );
1716}
ABC_DLL int Abc_NtkCleanup(Abc_Ntk_t *pNtk, int fVerbose)
Definition abcSweep.c:478
#define Vec_PtrForEachEntryReverse(Type, vVec, pEntry, i)
Definition vecPtr.h:63
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkMakeLegit()

ABC_DLL int Abc_NtkMakeLegit ( Abc_Ntk_t * pNtk)
extern

Definition at line 634 of file abcFanOrder.c.

635{
636 Abc_Obj_t * pNode;
637 int i, Counter = 0;
638 assert( Abc_NtkHasSop(pNtk) );
639 Abc_NtkForEachNode( pNtk, pNode, i )
640 Counter += Abc_NodeMakeLegit( pNode );
641 if ( Counter )
642 Abc_Print( 0, "%d nodes were made dist1-cube-free and/or single-cube-containment-free.\n", Counter );
643 return 1;
644}
int Abc_NodeMakeLegit(Abc_Obj_t *pNode)
Here is the call graph for this function:

◆ Abc_NtkManCutReadCutLarge()

ABC_DLL Vec_Ptr_t * Abc_NtkManCutReadCutLarge ( Abc_ManCut_t * p)
extern

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

Synopsis [Returns the leaves of the cone.]

Description []

SideEffects []

SeeAlso []

Definition at line 644 of file abcReconv.c.

645{
646 return p->vConeLeaves;
647}
Here is the caller graph for this function:

◆ Abc_NtkManCutReadCutSmall()

ABC_DLL Vec_Ptr_t * Abc_NtkManCutReadCutSmall ( Abc_ManCut_t * p)
extern

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

Synopsis [Returns the leaves of the cone.]

Description []

SideEffects []

SeeAlso []

Definition at line 660 of file abcReconv.c.

661{
662 return p->vNodeLeaves;
663}
Here is the caller graph for this function:

◆ Abc_NtkManCutReadVisited()

ABC_DLL Vec_Ptr_t * Abc_NtkManCutReadVisited ( Abc_ManCut_t * p)
extern

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

Synopsis [Returns the leaves of the cone.]

Description []

SideEffects []

SeeAlso []

Definition at line 676 of file abcReconv.c.

677{
678 return p->vVisited;
679}
Here is the caller graph for this function:

◆ Abc_NtkManCutStart()

ABC_DLL Abc_ManCut_t * Abc_NtkManCutStart ( int nNodeSizeMax,
int nConeSizeMax,
int nNodeFanStop,
int nConeFanStop )
extern

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

Synopsis [Starts the resynthesis manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 595 of file abcReconv.c.

596{
597 Abc_ManCut_t * p;
598 p = ABC_ALLOC( Abc_ManCut_t, 1 );
599 memset( p, 0, sizeof(Abc_ManCut_t) );
600 p->vNodeLeaves = Vec_PtrAlloc( 100 );
601 p->vConeLeaves = Vec_PtrAlloc( 100 );
602 p->vVisited = Vec_PtrAlloc( 100 );
603 p->vLevels = Vec_VecAlloc( 100 );
604 p->vNodesTfo = Vec_PtrAlloc( 100 );
605 p->nNodeSizeMax = nNodeSizeMax;
606 p->nConeSizeMax = nConeSizeMax;
607 p->nNodeFanStop = nNodeFanStop;
608 p->nConeFanStop = nConeFanStop;
609 return p;
610}
struct Abc_ManCut_t_ Abc_ManCut_t
Definition abc.h:119
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkManCutStop()

ABC_DLL void Abc_NtkManCutStop ( Abc_ManCut_t * p)
extern

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

Synopsis [Stops the resynthesis manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 623 of file abcReconv.c.

624{
625 Vec_PtrFree( p->vNodeLeaves );
626 Vec_PtrFree( p->vConeLeaves );
627 Vec_PtrFree( p->vVisited );
628 Vec_VecFree( p->vLevels );
629 Vec_PtrFree( p->vNodesTfo );
630 ABC_FREE( p );
631}
Here is the caller graph for this function:

◆ Abc_NtkMapToSop()

ABC_DLL int Abc_NtkMapToSop ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Unmaps the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 1228 of file abcFunc.c.

1229{
1230 extern void * Abc_FrameReadLibGen();
1232}
int Abc_NtkMapToSopUsingLibrary(Abc_Ntk_t *pNtk, void *library)
Definition abcFunc.c:1194
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkMapToSopUsingLibrary()

ABC_DLL int Abc_NtkMapToSopUsingLibrary ( Abc_Ntk_t * pNtk,
void * library )
extern

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

Synopsis [Unmaps the network with user provided Mio library.]

Description []

SideEffects []

SeeAlso []

Definition at line 1194 of file abcFunc.c.

1195{
1196 Abc_Obj_t * pNode;
1197 char * pSop;
1198 int i;
1199
1200 assert( Abc_NtkHasMapping(pNtk) );
1201 // update the functionality manager
1202 assert( pNtk->pManFunc == (void*) library );
1203 pNtk->pManFunc = Mem_FlexStart();
1204 // update the nodes
1205 Abc_NtkForEachNode( pNtk, pNode, i )
1206 {
1207 if ( Abc_ObjIsBarBuf(pNode) )
1208 continue;
1209 pSop = Mio_GateReadSop((Mio_Gate_t *)pNode->pData);
1210 assert( Abc_SopGetVarNum(pSop) == Abc_ObjFaninNum(pNode) );
1211 pNode->pData = Abc_SopRegister( (Mem_Flex_t *)pNtk->pManFunc, pSop );
1212 }
1213 pNtk->ntkFunc = ABC_FUNC_SOP;
1214 return 1;
1215}
char * Mio_GateReadSop(Mio_Gate_t *pGate)
Definition mioApi.c:179
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkMfsTotalGlitching()

ABC_DLL float Abc_NtkMfsTotalGlitching ( Abc_Ntk_t * pNtk,
int nPats,
int Prob,
int fVerbose )
extern

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

Synopsis [Returns the percentable of increased power due to glitching.]

Description []

SideEffects []

SeeAlso []

Definition at line 1942 of file abcPrint.c.

1943{
1944 int nSwitches, nGlitches;
1945 Gli_Man_t * p;
1946 Vec_Ptr_t * vNodes;
1947 Vec_Int_t * vFanins;
1948 Abc_Obj_t * pObj, * pFanin;
1949 int i, k, nFaninMax = Abc_NtkGetFaninMax(pNtk);
1950 if ( !Abc_NtkIsMappedLogic(pNtk) )
1951 return Abc_NtkMfsTotalGlitchingLut( pNtk, nPats, Prob, fVerbose );
1952 assert( Abc_NtkIsMappedLogic(pNtk) );
1953 if ( nFaninMax > 16 )
1954 {
1955 printf( "Abc_NtkMfsTotalGlitching() This procedure works only for mapped networks with LUTs size up to 6 inputs.\n" );
1956 return -1.0;
1957 }
1958 vNodes = Abc_NtkDfs( pNtk, 0 );
1959 vFanins = Vec_IntAlloc( 6 );
1960
1961 // derive network for glitch computation
1962 p = Gli_ManAlloc( Vec_PtrSize(vNodes) + Abc_NtkCiNum(pNtk) + Abc_NtkCoNum(pNtk),
1963 Abc_NtkLatchNum(pNtk), Abc_NtkGetTotalFanins(pNtk) + Abc_NtkCoNum(pNtk) );
1964 Abc_NtkForEachObj( pNtk, pObj, i )
1965 pObj->iTemp = -1;
1966 Abc_NtkForEachCi( pNtk, pObj, i )
1967 pObj->iTemp = Gli_ManCreateCi( p, Abc_ObjFanoutNum(pObj) );
1968 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
1969 {
1970 Vec_IntClear( vFanins );
1971 Abc_ObjForEachFanin( pObj, pFanin, k )
1972 Vec_IntPush( vFanins, pFanin->iTemp );
1973 pObj->iTemp = Gli_ManCreateNode( p, vFanins, Abc_ObjFanoutNum(pObj), Mio_GateReadTruthP((Mio_Gate_t *)pObj->pData) );
1974 }
1975 Abc_NtkForEachCo( pNtk, pObj, i )
1976 Gli_ManCreateCo( p, Abc_ObjFanin0(pObj)->iTemp );
1977
1978 // compute glitching
1979 Gli_ManSwitchesAndGlitches( p, nPats, 1.0/Prob, fVerbose );
1980
1981 // compute the ratio
1982 nSwitches = nGlitches = 0;
1983 Abc_NtkForEachObj( pNtk, pObj, i )
1984 if ( pObj->iTemp >= 0 )
1985 {
1986 nSwitches += Abc_ObjFanoutNum(pObj) * Gli_ObjNumSwitches(p, pObj->iTemp);
1987 nGlitches += Abc_ObjFanoutNum(pObj) * Gli_ObjNumGlitches(p, pObj->iTemp);
1988 }
1989
1990 Gli_ManStop( p );
1991 Vec_PtrFree( vNodes );
1992 Vec_IntFree( vFanins );
1993 return nSwitches ? 100.0*(nGlitches-nSwitches)/nSwitches : 0.0;
1994}
int Gli_ObjNumGlitches(Gli_Man_t *p, int iNode)
Definition giaGlitch.c:409
int Gli_ManCreateNode(Gli_Man_t *p, Vec_Int_t *vFanins, int nFanouts, word *pGateTruth)
Definition giaGlitch.c:369
Gli_Man_t * Gli_ManAlloc(int nObjs, int nRegs, int nFanioPairs)
FUNCTION DEFINITIONS ///.
Definition giaGlitch.c:144
int Gli_ManCreateCo(Gli_Man_t *p, int iFanin)
Definition giaGlitch.c:308
float Abc_NtkMfsTotalGlitchingLut(Abc_Ntk_t *pNtk, int nPats, int Prob, int fVerbose)
Definition abcPrint.c:1868
int Gli_ManCreateCi(Gli_Man_t *p, int nFanouts)
Definition giaGlitch.c:288
void Gli_ManStop(Gli_Man_t *p)
Definition giaGlitch.c:170
void Gli_ManSwitchesAndGlitches(Gli_Man_t *p, int nPatterns, float PiTransProb, int fVerbose)
Definition giaGlitch.c:740
int Gli_ObjNumSwitches(Gli_Man_t *p, int iNode)
Definition giaGlitch.c:393
ABC_DLL int Abc_NtkGetTotalFanins(Abc_Ntk_t *pNtk)
Definition abcUtil.c:520
struct Gli_Man_t_ Gli_Man_t
Definition giaGlitch.c:55
word * Mio_GateReadTruthP(Mio_Gate_t *pGate)
Definition mioApi.c:182
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkMfsTotalSwitching()

ABC_DLL float Abc_NtkMfsTotalSwitching ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Marks nodes for power-optimization.]

Description []

SideEffects []

SeeAlso []

Definition at line 163 of file abcPrint.c.

164{
165 extern Aig_Man_t * Abc_NtkToDar( Abc_Ntk_t * pNtk, int fExors, int fRegisters );
166 extern Vec_Int_t * Saig_ManComputeSwitchProbs( Aig_Man_t * p, int nFrames, int nPref, int fProbOne );
167 Vec_Int_t * vSwitching;
168 float * pSwitching;
169 Abc_Ntk_t * pNtkStr;
170 Aig_Man_t * pAig;
171 Aig_Obj_t * pObjAig;
172 Abc_Obj_t * pObjAbc, * pObjAbc2;
173 float Result = (float)0;
174 int i;
175 // strash the network
176 pNtkStr = Abc_NtkStrash( pNtk, 0, 1, 0 );
177 Abc_NtkForEachObj( pNtk, pObjAbc, i )
178 if ( (pObjAbc->pTemp && Abc_ObjRegular((Abc_Obj_t *)pObjAbc->pTemp)->Type == ABC_FUNC_NONE) || (!Abc_ObjIsCi(pObjAbc) && !Abc_ObjIsNode(pObjAbc)) )
179 pObjAbc->pTemp = NULL;
180 // map network into an AIG
181 pAig = Abc_NtkToDar( pNtkStr, 0, (int)(Abc_NtkLatchNum(pNtk) > 0) );
182 vSwitching = Saig_ManComputeSwitchProbs( pAig, 48, 16, 0 );
183 pSwitching = (float *)vSwitching->pArray;
184 Abc_NtkForEachObj( pNtk, pObjAbc, i )
185 {
186 if ( (pObjAbc2 = Abc_ObjRegular((Abc_Obj_t *)pObjAbc->pTemp)) && (pObjAig = Aig_Regular((Aig_Obj_t *)pObjAbc2->pTemp)) )
187 {
188 Result += Abc_ObjFanoutNum(pObjAbc) * pSwitching[pObjAig->Id];
189// Abc_ObjPrint( stdout, pObjAbc );
190// printf( "%d = %.2f\n", i, Abc_ObjFanoutNum(pObjAbc) * pSwitching[pObjAig->Id] );
191 }
192 }
193 Vec_IntFree( vSwitching );
194 Aig_ManStop( pAig );
195 Abc_NtkDelete( pNtkStr );
196 return Result;
197}
struct Aig_Obj_t_ Aig_Obj_t
Definition aig.h:51
Vec_Int_t * Saig_ManComputeSwitchProbs(Aig_Man_t *pAig, int nFrames, int nPref, int fProbOne)
Definition giaSwitch.c:711
void * pTemp
Definition abc.h:147
int Id
Definition aig.h:85
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkMinimumBase()

ABC_DLL int Abc_NtkMinimumBase ( Abc_Ntk_t * pNtk)
extern

DECLARATIONS ///.

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

FileName [abcMinBase.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Network and node package.]

Synopsis [Makes nodes of the network minimum base.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

]

Definition at line 892 of file abcMinBase.c.

892{ return 0; }
Here is the caller graph for this function:

◆ Abc_NtkMiter()

ABC_DLL Abc_Ntk_t * Abc_NtkMiter ( Abc_Ntk_t * pNtk1,
Abc_Ntk_t * pNtk2,
int fComb,
int nPartSize,
int fImplic,
int fMulti )
extern

FUNCTION DEFINITIONS ///.

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

Synopsis [Derives the miter of two networks.]

Description [Preprocesses the networks to make sure that they are strashed.]

SideEffects []

SeeAlso []

Definition at line 59 of file abcMiter.c.

60{
61 Abc_Ntk_t * pTemp = NULL;
62 int fRemove1, fRemove2;
63 assert( Abc_NtkHasOnlyLatchBoxes(pNtk1) );
64 assert( Abc_NtkHasOnlyLatchBoxes(pNtk2) );
65 // check that the networks have the same PIs/POs/latches
66 if ( !Abc_NtkCompareSignals( pNtk1, pNtk2, fImplic, fComb ) )
67 return NULL;
68 // make sure the circuits are strashed
69 fRemove1 = (!Abc_NtkIsStrash(pNtk1) || Abc_NtkGetChoiceNum(pNtk1)) && (pNtk1 = Abc_NtkStrash(pNtk1, 0, 0, 0));
70 fRemove2 = (!Abc_NtkIsStrash(pNtk2) || Abc_NtkGetChoiceNum(pNtk2)) && (pNtk2 = Abc_NtkStrash(pNtk2, 0, 0, 0));
71 if ( pNtk1 && pNtk2 )
72 pTemp = Abc_NtkMiterInt( pNtk1, pNtk2, fComb, nPartSize, fImplic, fMulti );
73 if ( fRemove1 ) Abc_NtkDelete( pNtk1 );
74 if ( fRemove2 ) Abc_NtkDelete( pNtk2 );
75 return pTemp;
76}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkMiterAddCone()

ABC_DLL void Abc_NtkMiterAddCone ( Abc_Ntk_t * pNtk,
Abc_Ntk_t * pNtkMiter,
Abc_Obj_t * pRoot )
extern

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

Synopsis [Performs mitering for one network.]

Description []

SideEffects []

SeeAlso []

Definition at line 254 of file abcMiter.c.

255{
256 Vec_Ptr_t * vNodes;
257 Abc_Obj_t * pNode;
258 int i;
259 // map the constant nodes
260 Abc_AigConst1(pNtk)->pCopy = Abc_AigConst1(pNtkMiter);
261 // perform strashing
262 vNodes = Abc_NtkDfsNodes( pNtk, &pRoot, 1 );
263 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
264 if ( Abc_AigNodeIsAnd(pNode) )
265 pNode->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkMiter->pManFunc, Abc_ObjChild0Copy(pNode), Abc_ObjChild1Copy(pNode) );
266 Vec_PtrFree( vNodes );
267}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkMiterAnd()

ABC_DLL Abc_Ntk_t * Abc_NtkMiterAnd ( Abc_Ntk_t * pNtk1,
Abc_Ntk_t * pNtk2,
int fOr,
int fCompl2 )
extern

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

Synopsis [Derives the AND of two miters.]

Description [The network should have the same names of PIs.]

SideEffects []

SeeAlso []

Definition at line 387 of file abcMiter.c.

388{
389 char Buffer[1000];
390 Abc_Ntk_t * pNtkMiter;
391 Abc_Obj_t * pOutput1, * pOutput2;
392 Abc_Obj_t * pRoot1, * pRoot2, * pMiter;
393
394 assert( Abc_NtkIsStrash(pNtk1) );
395 assert( Abc_NtkIsStrash(pNtk2) );
396 assert( 1 == Abc_NtkCoNum(pNtk1) );
397 assert( 1 == Abc_NtkCoNum(pNtk2) );
398 assert( 0 == Abc_NtkLatchNum(pNtk1) );
399 assert( 0 == Abc_NtkLatchNum(pNtk2) );
400 assert( Abc_NtkCiNum(pNtk1) == Abc_NtkCiNum(pNtk2) );
401 assert( Abc_NtkHasOnlyLatchBoxes(pNtk1) );
402 assert( Abc_NtkHasOnlyLatchBoxes(pNtk2) );
403
404 // start the new network
405 pNtkMiter = Abc_NtkAlloc( ABC_NTK_STRASH, ABC_FUNC_AIG, 1 );
406// sprintf( Buffer, "%s_%s_miter", pNtk1->pName, pNtk2->pName );
407 sprintf( Buffer, "product" );
408 pNtkMiter->pName = Extra_UtilStrsav(Buffer);
409
410 // perform strashing
411 Abc_NtkMiterPrepare( pNtk1, pNtk2, pNtkMiter, 1, -1, 0 );
412 Abc_NtkMiterAddOne( pNtk1, pNtkMiter );
413 Abc_NtkMiterAddOne( pNtk2, pNtkMiter );
414// Abc_NtkMiterFinalize( pNtk1, pNtk2, pNtkMiter, 1 );
415 pRoot1 = Abc_NtkPo(pNtk1,0);
416 pRoot2 = Abc_NtkPo(pNtk2,0);
417 pOutput1 = Abc_ObjNotCond( Abc_ObjFanin0(pRoot1)->pCopy, Abc_ObjFaninC0(pRoot1) );
418 pOutput2 = Abc_ObjNotCond( Abc_ObjFanin0(pRoot2)->pCopy, (int)Abc_ObjFaninC0(pRoot2) ^ fCompl2 );
419
420 // create the miter of the two outputs
421 if ( fOr )
422 pMiter = Abc_AigOr( (Abc_Aig_t *)pNtkMiter->pManFunc, pOutput1, pOutput2 );
423 else
424 pMiter = Abc_AigAnd( (Abc_Aig_t *)pNtkMiter->pManFunc, pOutput1, pOutput2 );
425 Abc_ObjAddFanin( Abc_NtkPo(pNtkMiter,0), pMiter );
426
427 // make sure that everything is okay
428 if ( !Abc_NtkCheck( pNtkMiter ) )
429 {
430 printf( "Abc_NtkMiterAnd: The network check has failed.\n" );
431 Abc_NtkDelete( pNtkMiter );
432 return NULL;
433 }
434 return pNtkMiter;
435}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkMiterCofactor()

ABC_DLL Abc_Ntk_t * Abc_NtkMiterCofactor ( Abc_Ntk_t * pNtk,
Vec_Int_t * vPiValues )
extern

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

Synopsis [Derives the cofactor of the miter w.r.t. the set of vars.]

Description [The array of variable values contains -1/0/1 for each PI. -1 means this PI remains, 0/1 means this PI is set to 0/1.]

SideEffects []

SeeAlso []

Definition at line 450 of file abcMiter.c.

451{
452 char Buffer[1000];
453 Abc_Ntk_t * pNtkMiter;
454 Abc_Obj_t * pRoot, * pOutput1;
455 int Value, i;
456
457 assert( Abc_NtkIsStrash(pNtk) );
458 assert( 1 == Abc_NtkCoNum(pNtk) );
459 assert( Abc_NtkHasOnlyLatchBoxes(pNtk) );
460
461 // start the new network
462 pNtkMiter = Abc_NtkAlloc( ABC_NTK_STRASH, ABC_FUNC_AIG, 1 );
463 sprintf( Buffer, "%s_miter", pNtk->pName );
464 pNtkMiter->pName = Extra_UtilStrsav(Buffer);
465
466 // get the root output
467 pRoot = Abc_NtkCo( pNtk, 0 );
468
469 // perform strashing
470 Abc_NtkMiterPrepare( pNtk, pNtk, pNtkMiter, 1, -1, 0 );
471 // set the first cofactor
472 Vec_IntForEachEntry( vPiValues, Value, i )
473 {
474 if ( Value == -1 )
475 continue;
476 if ( Value == 0 )
477 {
478 Abc_NtkCi(pNtk, i)->pCopy = Abc_ObjNot( Abc_AigConst1(pNtkMiter) );
479 continue;
480 }
481 if ( Value == 1 )
482 {
483 Abc_NtkCi(pNtk, i)->pCopy = Abc_AigConst1(pNtkMiter);
484 continue;
485 }
486 assert( 0 );
487 }
488 // add the first cofactor
489 Abc_NtkMiterAddCone( pNtk, pNtkMiter, pRoot );
490
491 // save the output
492 pOutput1 = Abc_ObjNotCond( Abc_ObjFanin0(pRoot)->pCopy, Abc_ObjFaninC0(pRoot) );
493
494 // create the miter of the two outputs
495 Abc_ObjAddFanin( Abc_NtkPo(pNtkMiter,0), pOutput1 );
496
497 // make sure that everything is okay
498 if ( !Abc_NtkCheck( pNtkMiter ) )
499 {
500 printf( "Abc_NtkMiterCofactor: The network check has failed.\n" );
501 Abc_NtkDelete( pNtkMiter );
502 return NULL;
503 }
504 return pNtkMiter;
505}
void Abc_NtkMiterAddCone(Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtkMiter, Abc_Obj_t *pRoot)
Definition abcMiter.c:254
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkMiterForCofactors()

ABC_DLL Abc_Ntk_t * Abc_NtkMiterForCofactors ( Abc_Ntk_t * pNtk,
int Out,
int In1,
int In2 )
extern

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

Synopsis [Derives the miter of two cofactors of one output.]

Description []

SideEffects []

SeeAlso []

Definition at line 517 of file abcMiter.c.

518{
519 char Buffer[1000];
520 Abc_Ntk_t * pNtkMiter;
521 Abc_Obj_t * pRoot, * pOutput1, * pOutput2, * pMiter;
522
523 assert( Abc_NtkIsStrash(pNtk) );
524 assert( Out < Abc_NtkCoNum(pNtk) );
525 assert( In1 < Abc_NtkCiNum(pNtk) );
526 assert( In2 < Abc_NtkCiNum(pNtk) );
527 assert( Abc_NtkHasOnlyLatchBoxes(pNtk) );
528
529 // start the new network
530 pNtkMiter = Abc_NtkAlloc( ABC_NTK_STRASH, ABC_FUNC_AIG, 1 );
531 sprintf( Buffer, "%s_miter", Abc_ObjName(Abc_NtkCo(pNtk, Out)) );
532 pNtkMiter->pName = Extra_UtilStrsav(Buffer);
533
534 // get the root output
535 pRoot = Abc_NtkCo( pNtk, Out );
536
537 // perform strashing
538 Abc_NtkMiterPrepare( pNtk, pNtk, pNtkMiter, 1, -1, 0 );
539 // set the first cofactor
540 Abc_NtkCi(pNtk, In1)->pCopy = Abc_ObjNot( Abc_AigConst1(pNtkMiter) );
541 if ( In2 >= 0 )
542 Abc_NtkCi(pNtk, In2)->pCopy = Abc_AigConst1(pNtkMiter);
543 // add the first cofactor
544 Abc_NtkMiterAddCone( pNtk, pNtkMiter, pRoot );
545
546 // save the output
547 pOutput1 = Abc_ObjFanin0(pRoot)->pCopy;
548
549 // set the second cofactor
550 Abc_NtkCi(pNtk, In1)->pCopy = Abc_AigConst1(pNtkMiter);
551 if ( In2 >= 0 )
552 Abc_NtkCi(pNtk, In2)->pCopy = Abc_ObjNot( Abc_AigConst1(pNtkMiter) );
553 // add the second cofactor
554 Abc_NtkMiterAddCone( pNtk, pNtkMiter, pRoot );
555
556 // save the output
557 pOutput2 = Abc_ObjFanin0(pRoot)->pCopy;
558
559 // create the miter of the two outputs
560 pMiter = Abc_AigXor( (Abc_Aig_t *)pNtkMiter->pManFunc, pOutput1, pOutput2 );
561 Abc_ObjAddFanin( Abc_NtkPo(pNtkMiter,0), pMiter );
562
563 // make sure that everything is okay
564 if ( !Abc_NtkCheck( pNtkMiter ) )
565 {
566 printf( "Abc_NtkMiter: The network check has failed.\n" );
567 Abc_NtkDelete( pNtkMiter );
568 return NULL;
569 }
570 return pNtkMiter;
571}
Here is the call graph for this function:

◆ Abc_NtkMiterIsConstant()

ABC_DLL int Abc_NtkMiterIsConstant ( Abc_Ntk_t * pMiter)
extern

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

Synopsis [Checks the status of the miter.]

Description [Return 0 if the miter is sat for at least one output. Return 1 if the miter is unsat for all its outputs. Returns -1 if the miter is undecided for some outputs.]

SideEffects []

SeeAlso []

Definition at line 682 of file abcMiter.c.

683{
684 Abc_Obj_t * pNodePo, * pChild;
685 int i;
686 assert( Abc_NtkIsStrash(pMiter) );
687 Abc_NtkForEachPo( pMiter, pNodePo, i )
688 {
689 pChild = Abc_ObjChild0( pNodePo );
690 // check if the output is constant 1
691 if ( Abc_AigNodeIsConst(pChild) )
692 {
693 assert( Abc_ObjRegular(pChild) == Abc_AigConst1(pMiter) );
694 if ( !Abc_ObjIsComplement(pChild) )
695 {
696 // if the miter is constant 1, return immediately
697// printf( "MITER IS CONSTANT 1!\n" );
698 return 0;
699 }
700 }
701/*
702 // check if the output is not constant 0
703 else if ( Abc_ObjRegular(pChild)->fPhase != (unsigned)Abc_ObjIsComplement(pChild) )
704 {
705 return 0;
706 }
707*/
708 // if the miter is undecided (or satisfiable), return immediately
709 else
710 return -1;
711 }
712 // return 1, meaning all outputs are constant zero
713 return 1;
714}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkMiterProve()

ABC_DLL int Abc_NtkMiterProve ( Abc_Ntk_t ** ppNtk,
void * pPars )
extern

FUNCTION DEFINITIONS ///.

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

Synopsis [Attempts to solve the miter using a number of tricks.]

Description [Returns -1 if timed out; 0 if SAT; 1 if UNSAT. Returns a simplified version of the original network (or a constant 0 network). In case the network is not a constant zero and a SAT assignment is found, pNtk->pModel contains a satisfying assignment.]

SideEffects []

SeeAlso []

Definition at line 62 of file abcProve.c.

63{
64 Prove_Params_t * pParams = (Prove_Params_t *)pPars;
65 Abc_Ntk_t * pNtk, * pNtkTemp;
66 int RetValue = -1, nIter, nSatFails, Counter;
67 abctime clk; //, timeStart = Abc_Clock();
68 ABC_INT64_T nSatConfs, nSatInspects, nInspectLimit;
69
70 // get the starting network
71 pNtk = *ppNtk;
72 assert( Abc_NtkIsStrash(pNtk) );
73 assert( Abc_NtkPoNum(pNtk) == 1 );
74
75 if ( pParams->fVerbose )
76 {
77 printf( "RESOURCE LIMITS: Iterations = %d. Rewriting = %s. Fraiging = %s.\n",
78 pParams->nItersMax, pParams->fUseRewriting? "yes":"no", pParams->fUseFraiging? "yes":"no" );
79 printf( "Miter = %d (%3.1f). Rwr = %d (%3.1f). Fraig = %d (%3.1f). Last = %d.\n",
80 pParams->nMiteringLimitStart, pParams->nMiteringLimitMulti,
82 pParams->nFraigingLimitStart, pParams->nFraigingLimitMulti, pParams->nMiteringLimitLast );
83 }
84
85 // if SAT only, solve without iteration
86 if ( !pParams->fUseRewriting && !pParams->fUseFraiging )
87 {
88 clk = Abc_Clock();
89 RetValue = Abc_NtkMiterSat( pNtk, (ABC_INT64_T)pParams->nMiteringLimitLast, (ABC_INT64_T)0, 0, NULL, NULL );
90 Abc_NtkMiterPrint( pNtk, "SAT solving", clk, pParams->fVerbose );
91 *ppNtk = pNtk;
92 return RetValue;
93 }
94
95 // check the current resource limits
96 for ( nIter = 0; nIter < pParams->nItersMax; nIter++ )
97 {
98 if ( pParams->fVerbose )
99 {
100 printf( "ITERATION %2d : Confs = %6d. FraigBTL = %3d. \n", nIter+1,
101 (int)(pParams->nMiteringLimitStart * pow(pParams->nMiteringLimitMulti,nIter)),
102 (int)(pParams->nFraigingLimitStart * pow(pParams->nFraigingLimitMulti,nIter)) );
103 fflush( stdout );
104 }
105
106 // try brute-force SAT
107 clk = Abc_Clock();
108 nInspectLimit = pParams->nTotalInspectLimit? pParams->nTotalInspectLimit - pParams->nTotalInspectsMade : 0;
109 RetValue = Abc_NtkMiterSat( pNtk, (ABC_INT64_T)(pParams->nMiteringLimitStart * pow(pParams->nMiteringLimitMulti,nIter)), (ABC_INT64_T)nInspectLimit, 0, &nSatConfs, &nSatInspects );
110 Abc_NtkMiterPrint( pNtk, "SAT solving", clk, pParams->fVerbose );
111 if ( RetValue >= 0 )
112 break;
113
114 // add to the number of backtracks and inspects
115 pParams->nTotalBacktracksMade += nSatConfs;
116 pParams->nTotalInspectsMade += nSatInspects;
117 // check if global resource limit is reached
118 if ( (pParams->nTotalBacktrackLimit && pParams->nTotalBacktracksMade >= pParams->nTotalBacktrackLimit) ||
119 (pParams->nTotalInspectLimit && pParams->nTotalInspectsMade >= pParams->nTotalInspectLimit) )
120 {
121 printf( "Reached global limit on conflicts/inspects. Quitting.\n" );
122 *ppNtk = pNtk;
123 return -1;
124 }
125
126 // try rewriting
127 if ( pParams->fUseRewriting )
128 {
129 clk = Abc_Clock();
130 Counter = (int)(pParams->nRewritingLimitStart * pow(pParams->nRewritingLimitMulti,nIter));
131// Counter = 1;
132 while ( 1 )
133 {
134/*
135 extern Abc_Ntk_t * Abc_NtkIvyResyn( Abc_Ntk_t * pNtk, int fUpdateLevel, int fVerbose );
136 pNtk = Abc_NtkIvyResyn( pNtkTemp = pNtk, 0, 0 ); Abc_NtkDelete( pNtkTemp );
137 if ( (RetValue = Abc_NtkMiterIsConstant(pNtk)) >= 0 )
138 break;
139 if ( --Counter == 0 )
140 break;
141*/
142/*
143 Abc_NtkRewrite( pNtk, 0, 0, 0, 0, 0 );
144 if ( (RetValue = Abc_NtkMiterIsConstant(pNtk)) >= 0 )
145 break;
146 if ( --Counter == 0 )
147 break;
148*/
149 Abc_NtkRewrite( pNtk, 0, 0, 0, 0, 0 );
150 if ( (RetValue = Abc_NtkMiterIsConstant(pNtk)) >= 0 )
151 break;
152 if ( --Counter == 0 )
153 break;
154 Abc_NtkRefactor( pNtk, 10, 1, 16, 0, 0, 0, 0 );
155 if ( (RetValue = Abc_NtkMiterIsConstant(pNtk)) >= 0 )
156 break;
157 if ( --Counter == 0 )
158 break;
159 pNtk = Abc_NtkBalance( pNtkTemp = pNtk, 0, 0, 0 ); Abc_NtkDelete( pNtkTemp );
160 if ( (RetValue = Abc_NtkMiterIsConstant(pNtk)) >= 0 )
161 break;
162 if ( --Counter == 0 )
163 break;
164 }
165 Abc_NtkMiterPrint( pNtk, "Rewriting ", clk, pParams->fVerbose );
166 }
167
168 if ( pParams->fUseFraiging )
169 {
170 // try FRAIGing
171 clk = Abc_Clock();
172 nInspectLimit = pParams->nTotalInspectLimit? pParams->nTotalInspectLimit - pParams->nTotalInspectsMade : 0;
173 pNtk = Abc_NtkMiterFraig( pNtkTemp = pNtk, (int)(pParams->nFraigingLimitStart * pow(pParams->nFraigingLimitMulti,nIter)), nInspectLimit, &RetValue, &nSatFails, &nSatConfs, &nSatInspects ); Abc_NtkDelete( pNtkTemp );
174 Abc_NtkMiterPrint( pNtk, "FRAIGing ", clk, pParams->fVerbose );
175// printf( "NumFails = %d\n", nSatFails );
176 if ( RetValue >= 0 )
177 break;
178
179 // add to the number of backtracks and inspects
180 pParams->nTotalBacktracksMade += nSatConfs;
181 pParams->nTotalInspectsMade += nSatInspects;
182 // check if global resource limit is reached
183 if ( (pParams->nTotalBacktrackLimit && pParams->nTotalBacktracksMade >= pParams->nTotalBacktrackLimit) ||
184 (pParams->nTotalInspectLimit && pParams->nTotalInspectsMade >= pParams->nTotalInspectLimit) )
185 {
186 printf( "Reached global limit on conflicts/inspects. Quitting.\n" );
187 *ppNtk = pNtk;
188 return -1;
189 }
190 }
191
192 }
193
194 // try to prove it using brute force SAT
195#ifdef ABC_USE_CUDD
196 if ( RetValue < 0 && pParams->fUseBdds )
197 {
198 if ( pParams->fVerbose )
199 {
200 printf( "Attempting BDDs with node limit %d ...\n", pParams->nBddSizeLimit );
201 fflush( stdout );
202 }
203 clk = Abc_Clock();
204 pNtk = Abc_NtkCollapse( pNtkTemp = pNtk, pParams->nBddSizeLimit, 0, pParams->fBddReorder, 0, 0, 0 );
205 if ( pNtk )
206 {
207 Abc_NtkDelete( pNtkTemp );
208 RetValue = ( (Abc_NtkNodeNum(pNtk) == 1) && (Abc_ObjFanin0(Abc_NtkPo(pNtk,0))->pData == Cudd_ReadLogicZero((DdManager *)pNtk->pManFunc)) );
209 }
210 else
211 pNtk = pNtkTemp;
212 Abc_NtkMiterPrint( pNtk, "BDD building", clk, pParams->fVerbose );
213 }
214#endif
215
216 if ( RetValue < 0 )
217 {
218 if ( pParams->fVerbose )
219 {
220 printf( "Attempting SAT with conflict limit %d ...\n", pParams->nMiteringLimitLast );
221 fflush( stdout );
222 }
223 clk = Abc_Clock();
224 nInspectLimit = pParams->nTotalInspectLimit? pParams->nTotalInspectLimit - pParams->nTotalInspectsMade : 0;
225 RetValue = Abc_NtkMiterSat( pNtk, (ABC_INT64_T)pParams->nMiteringLimitLast, (ABC_INT64_T)nInspectLimit, 0, NULL, NULL );
226 Abc_NtkMiterPrint( pNtk, "SAT solving", clk, pParams->fVerbose );
227 }
228
229 // assign the model if it was proved by rewriting (const 1 miter)
230 if ( RetValue == 0 && pNtk->pModel == NULL )
231 {
232 pNtk->pModel = ABC_ALLOC( int, Abc_NtkCiNum(pNtk) );
233 memset( pNtk->pModel, 0, sizeof(int) * Abc_NtkCiNum(pNtk) );
234 }
235 *ppNtk = pNtk;
236 return RetValue;
237}
ABC_NAMESPACE_IMPL_START int Abc_NtkRefactor(Abc_Ntk_t *pNtk, int nNodeSizeMax, int nMinSaved, int nConeSizeMax, int fUpdateLevel, int fUseZeros, int fUseDcs, int fVerbose)
DECLARATIONS ///.
ABC_DLL int Abc_NtkMiterSat(Abc_Ntk_t *pNtk, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, int fVerbose, ABC_INT64_T *pNumConfs, ABC_INT64_T *pNumInspects)
FUNCTION DEFINITIONS ///.
Definition abcSat.c:58
ABC_DLL int Abc_NtkMiterIsConstant(Abc_Ntk_t *pMiter)
Definition abcMiter.c:682
ABC_INT64_T nTotalBacktracksMade
Definition ivyFraig.c:136
ABC_INT64_T nTotalInspectsMade
Definition ivyFraig.c:137
ABC_INT64_T nTotalBacktrackLimit
Definition ivyFraig.c:133
ABC_INT64_T nTotalInspectLimit
Definition ivyFraig.c:134
Here is the call graph for this function:

◆ Abc_NtkMiterQuantify()

ABC_DLL Abc_Ntk_t * Abc_NtkMiterQuantify ( Abc_Ntk_t * pNtk,
int In,
int fExist )
extern

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

Synopsis [Derives the miter of two cofactors of one output.]

Description []

SideEffects []

SeeAlso []

Definition at line 585 of file abcMiter.c.

586{
587 Abc_Ntk_t * pNtkMiter;
588 Abc_Obj_t * pRoot, * pOutput1, * pOutput2, * pMiter;
589
590 assert( Abc_NtkIsStrash(pNtk) );
591 assert( 1 == Abc_NtkCoNum(pNtk) );
592 assert( In < Abc_NtkCiNum(pNtk) );
593 assert( Abc_NtkHasOnlyLatchBoxes(pNtk) );
594
595 // start the new network
596 pNtkMiter = Abc_NtkAlloc( ABC_NTK_STRASH, ABC_FUNC_AIG, 1 );
597 pNtkMiter->pName = Extra_UtilStrsav( Abc_ObjName(Abc_NtkCo(pNtk, 0)) );
598
599 // get the root output
600 pRoot = Abc_NtkCo( pNtk, 0 );
601
602 // perform strashing
603 Abc_NtkMiterPrepare( pNtk, pNtk, pNtkMiter, 1, -1, 0 );
604 // set the first cofactor
605 Abc_NtkCi(pNtk, In)->pCopy = Abc_ObjNot( Abc_AigConst1(pNtkMiter) );
606 // add the first cofactor
607 Abc_NtkMiterAddCone( pNtk, pNtkMiter, pRoot );
608 // save the output
609// pOutput1 = Abc_ObjFanin0(pRoot)->pCopy;
610 pOutput1 = Abc_ObjNotCond( Abc_ObjFanin0(pRoot)->pCopy, Abc_ObjFaninC0(pRoot) );
611
612 // set the second cofactor
613 Abc_NtkCi(pNtk, In)->pCopy = Abc_AigConst1(pNtkMiter);
614 // add the second cofactor
615 Abc_NtkMiterAddCone( pNtk, pNtkMiter, pRoot );
616 // save the output
617// pOutput2 = Abc_ObjFanin0(pRoot)->pCopy;
618 pOutput2 = Abc_ObjNotCond( Abc_ObjFanin0(pRoot)->pCopy, Abc_ObjFaninC0(pRoot) );
619
620 // create the miter of the two outputs
621 if ( fExist )
622 pMiter = Abc_AigOr( (Abc_Aig_t *)pNtkMiter->pManFunc, pOutput1, pOutput2 );
623 else
624 pMiter = Abc_AigAnd( (Abc_Aig_t *)pNtkMiter->pManFunc, pOutput1, pOutput2 );
625 Abc_ObjAddFanin( Abc_NtkPo(pNtkMiter,0), pMiter );
626
627 // make sure that everything is okay
628 if ( !Abc_NtkCheck( pNtkMiter ) )
629 {
630 printf( "Abc_NtkMiter: The network check has failed.\n" );
631 Abc_NtkDelete( pNtkMiter );
632 return NULL;
633 }
634 return pNtkMiter;
635}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkMiterQuantifyPis()

ABC_DLL Abc_Ntk_t * Abc_NtkMiterQuantifyPis ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Quantifies all the PIs existentially from the only PO of the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 648 of file abcMiter.c.

649{
650 Abc_Ntk_t * pNtkTemp;
651 Abc_Obj_t * pObj;
652 int i;
653 assert( Abc_NtkHasOnlyLatchBoxes(pNtk) );
654
655 Abc_NtkForEachPi( pNtk, pObj, i )
656 {
657 if ( Abc_ObjFanoutNum(pObj) == 0 )
658 continue;
659 pNtk = Abc_NtkMiterQuantify( pNtkTemp = pNtk, i, 1 );
660 Abc_NtkDelete( pNtkTemp );
661 }
662
663 return pNtk;
664}
Abc_Ntk_t * Abc_NtkMiterQuantify(Abc_Ntk_t *pNtk, int In, int fExist)
Definition abcMiter.c:585
Here is the call graph for this function:

◆ Abc_NtkMiterReport()

ABC_DLL void Abc_NtkMiterReport ( Abc_Ntk_t * pMiter)
extern

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

Synopsis [Reports the status of the miter.]

Description []

SideEffects []

SeeAlso []

Definition at line 727 of file abcMiter.c.

728{
729 Abc_Obj_t * pChild, * pNode;
730 int i;
731 if ( Abc_NtkPoNum(pMiter) == 1 )
732 {
733 pChild = Abc_ObjChild0( Abc_NtkPo(pMiter,0) );
734 if ( Abc_AigNodeIsConst(pChild) )
735 {
736 if ( Abc_ObjIsComplement(pChild) )
737 printf( "Unsatisfiable.\n" );
738 else
739 printf( "Satisfiable. (Constant 1).\n" );
740 }
741 else
742 printf( "Satisfiable.\n" );
743 }
744 else
745 {
746 Abc_NtkForEachPo( pMiter, pNode, i )
747 {
748 pChild = Abc_ObjChild0( Abc_NtkPo(pMiter,i) );
749 printf( "Output #%2d : ", i );
750 if ( Abc_AigNodeIsConst(pChild) )
751 {
752 if ( Abc_ObjIsComplement(pChild) )
753 printf( "Unsatisfiable.\n" );
754 else
755 printf( "Satisfiable. (Constant 1).\n" );
756 }
757 else
758 printf( "Satisfiable.\n" );
759 }
760 }
761}

◆ Abc_NtkMiterSat()

ABC_DLL int Abc_NtkMiterSat ( Abc_Ntk_t * pNtk,
ABC_INT64_T nConfLimit,
ABC_INT64_T nInsLimit,
int fVerbose,
ABC_INT64_T * pNumConfs,
ABC_INT64_T * pNumInspects )
extern

FUNCTION DEFINITIONS ///.

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

Synopsis [Attempts to solve the miter using an internal SAT sat_solver.]

Description [Returns -1 if timed out; 0 if SAT; 1 if UNSAT.]

SideEffects []

SeeAlso []

Definition at line 58 of file abcSat.c.

59{
60 sat_solver * pSat;
61 lbool status;
62 int RetValue = 0;
63 abctime clk;
64
65 if ( pNumConfs )
66 *pNumConfs = 0;
67 if ( pNumInspects )
68 *pNumInspects = 0;
69
70 assert( Abc_NtkLatchNum(pNtk) == 0 );
71
72// if ( Abc_NtkPoNum(pNtk) > 1 )
73// fprintf( stdout, "Warning: The miter has %d outputs. SAT will try to prove all of them.\n", Abc_NtkPoNum(pNtk) );
74
75 // load clauses into the sat_solver
76 clk = Abc_Clock();
77 pSat = (sat_solver *)Abc_NtkMiterSatCreate( pNtk, 0 );
78 if ( pSat == NULL )
79 return 1;
80//printf( "%d \n", pSat->clauses.size );
81//sat_solver_delete( pSat );
82//return 1;
83
84// printf( "Created SAT problem with %d variable and %d clauses. ", sat_solver_nvars(pSat), sat_solver_nclauses(pSat) );
85// ABC_PRT( "Time", Abc_Clock() - clk );
86
87 // simplify the problem
88 clk = Abc_Clock();
89 status = sat_solver_simplify(pSat);
90// printf( "Simplified the problem to %d variables and %d clauses. ", sat_solver_nvars(pSat), sat_solver_nclauses(pSat) );
91// ABC_PRT( "Time", Abc_Clock() - clk );
92 if ( status == 0 )
93 {
94 sat_solver_delete( pSat );
95// printf( "The problem is UNSATISFIABLE after simplification.\n" );
96 return 1;
97 }
98
99 // solve the miter
100 clk = Abc_Clock();
101 if ( fVerbose )
102 pSat->verbosity = 1;
103 status = sat_solver_solve( pSat, NULL, NULL, (ABC_INT64_T)nConfLimit, (ABC_INT64_T)nInsLimit, (ABC_INT64_T)0, (ABC_INT64_T)0 );
104 if ( status == l_Undef )
105 {
106// printf( "The problem timed out.\n" );
107 RetValue = -1;
108 }
109 else if ( status == l_True )
110 {
111// printf( "The problem is SATISFIABLE.\n" );
112 RetValue = 0;
113 }
114 else if ( status == l_False )
115 {
116// printf( "The problem is UNSATISFIABLE.\n" );
117 RetValue = 1;
118 }
119 else
120 assert( 0 );
121// ABC_PRT( "SAT sat_solver time", Abc_Clock() - clk );
122// printf( "The number of conflicts = %d.\n", (int)pSat->sat_solver_stats.conflicts );
123
124 // if the problem is SAT, get the counterexample
125 if ( status == l_True )
126 {
127// Vec_Int_t * vCiIds = Abc_NtkGetCiIds( pNtk );
128 Vec_Int_t * vCiIds = Abc_NtkGetCiSatVarNums( pNtk );
129 pNtk->pModel = Sat_SolverGetModel( pSat, vCiIds->pArray, vCiIds->nSize );
130 Vec_IntFree( vCiIds );
131 }
132 // free the sat_solver
133 if ( fVerbose )
134 Sat_SolverPrintStats( stdout, pSat );
135
136 if ( pNumConfs )
137 *pNumConfs = (int)pSat->stats.conflicts;
138 if ( pNumInspects )
139 *pNumInspects = (int)pSat->stats.inspects;
140
141sat_solver_store_write( pSat, "trace.cnf" );
143
144 sat_solver_delete( pSat );
145 return RetValue;
146}
void * Abc_NtkMiterSatCreate(Abc_Ntk_t *pNtk, int fAllPrimes)
Definition abcSat.c:664
Vec_Int_t * Abc_NtkGetCiSatVarNums(Abc_Ntk_t *pNtk)
Definition abcSat.c:189
#define l_True
Definition bmcBmcS.c:35
#define l_Undef
Definition bmcBmcS.c:34
#define l_False
Definition bmcBmcS.c:36
#define sat_solver
Definition cecSatG2.c:34
#define sat_solver_solve
Definition cecSatG2.c:45
int sat_solver_simplify(sat_solver *s)
Definition satSolver.c:1515
void sat_solver_store_free(sat_solver *s)
Definition satSolver.c:2400
void sat_solver_store_write(sat_solver *s, char *pFileName)
Definition satSolver.c:2395
void sat_solver_delete(sat_solver *s)
Definition satSolver.c:1341
int * Sat_SolverGetModel(sat_solver *p, int *pVars, int nVars)
Definition satUtil.c:270
void Sat_SolverPrintStats(FILE *pFile, sat_solver *p)
Definition satUtil.c:193
signed char lbool
Definition satVec.h:135
stats_t stats
Definition satSolver.h:163
ABC_INT64_T conflicts
Definition satVec.h:156
ABC_INT64_T inspects
Definition satVec.h:156
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkMiterSatCreate()

ABC_DLL void * Abc_NtkMiterSatCreate ( Abc_Ntk_t * pNtk,
int fAllPrimes )
extern

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

Synopsis [Sets up the SAT sat_solver.]

Description []

SideEffects []

SeeAlso []

Definition at line 664 of file abcSat.c.

665{
666 sat_solver * pSat;
667 Abc_Obj_t * pNode;
668 int RetValue, i; //, clk = Abc_Clock();
669
670 assert( Abc_NtkIsStrash(pNtk) || Abc_NtkIsBddLogic(pNtk) );
671 if ( Abc_NtkIsBddLogic(pNtk) )
672 return Abc_NtkMiterSatCreateLogic(pNtk, fAllPrimes);
673
674 nMuxes = 0;
675 pSat = sat_solver_new();
676//sat_solver_store_alloc( pSat );
677 RetValue = Abc_NtkMiterSatCreateInt( pSat, pNtk );
679
680 Abc_NtkForEachObj( pNtk, pNode, i )
681 pNode->fMarkA = 0;
682// ASat_SolverWriteDimacs( pSat, "temp_sat.cnf", NULL, NULL, 1 );
683 if ( RetValue == 0 )
684 {
685 sat_solver_delete(pSat);
686 return NULL;
687 }
688// printf( "Ands = %6d. Muxes = %6d (%5.2f %%). ", Abc_NtkNodeNum(pNtk), nMuxes, 300.0*nMuxes/Abc_NtkNodeNum(pNtk) );
689// ABC_PRT( "Creating sat_solver", Abc_Clock() - clk );
690 return pSat;
691}
int Abc_NtkMiterSatCreateInt(sat_solver *pSat, Abc_Ntk_t *pNtk)
Definition abcSat.c:501
sat_solver * sat_solver_new(void)
Definition satSolver.c:1137
void sat_solver_store_mark_roots(sat_solver *s)
Definition satSolver.c:2412
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkNodeSupport()

ABC_DLL Vec_Ptr_t * Abc_NtkNodeSupport ( Abc_Ntk_t * pNtk,
Abc_Obj_t ** ppNodes,
int nNodes )
extern

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

Synopsis [Returns the set of CI nodes in the support of the given nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 890 of file abcDfs.c.

891{
892 Vec_Ptr_t * vNodes;
893 int i;
894 // set the traversal ID
895 Abc_NtkIncrementTravId( pNtk );
896 // start the array of nodes
897 vNodes = Vec_PtrAlloc( 100 );
898 // go through the PO nodes and call for each of them
899 for ( i = 0; i < nNodes; i++ )
900 if ( Abc_ObjIsCo(ppNodes[i]) && Abc_ObjFaninNum(Abc_ObjFanin0(ppNodes[i])) != 0 )
901 Abc_NtkNodeSupport_rec( Abc_ObjFanin0(ppNodes[i]), vNodes );
902 else if ( !Abc_ObjIsCo(ppNodes[i]) && Abc_ObjFaninNum(ppNodes[i]) != 0 )
903 Abc_NtkNodeSupport_rec( ppNodes[i], vNodes );
904 return vNodes;
905}
void Abc_NtkNodeSupport_rec(Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
Definition abcDfs.c:826
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkNodeSupportInt()

ABC_DLL Vec_Int_t * Abc_NtkNodeSupportInt ( Abc_Ntk_t * pNtk,
int iCo )
extern

Definition at line 940 of file abcDfs.c.

941{
942 Vec_Int_t * vNodes;
943 Abc_Obj_t * pObj;
944 int i;
945 if ( iCo < 0 || iCo >= Abc_NtkCoNum(pNtk) )
946 return NULL;
947 // save node indices in the CI nodes
948 Abc_NtkForEachCi( pNtk, pObj, i )
949 pObj->iTemp = i;
950 // collect the indexes of CI nodes in the TFI of the CO node
951 Abc_NtkIncrementTravId( pNtk );
952 pObj = Abc_NtkCo( pNtk, iCo );
953 vNodes = Vec_IntAlloc( 100 );
954 Abc_NtkNodeSupportInt_rec( Abc_ObjFanin0(pObj), vNodes );
955 Vec_IntSort( vNodes, 0 );
956 return vNodes;
957}
void Abc_NtkNodeSupportInt_rec(Abc_Obj_t *pNode, Vec_Int_t *vNodes)
Definition abcDfs.c:918
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkOrderCisCos()

ABC_DLL void Abc_NtkOrderCisCos ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Order CI/COs.]

Description []

SideEffects []

SeeAlso []

Definition at line 76 of file abcUtil.c.

77{
78 Abc_Obj_t * pObj, * pTerm;
79 int i, k;
80 Vec_PtrClear( pNtk->vCis );
81 Vec_PtrClear( pNtk->vCos );
82 Abc_NtkForEachPi( pNtk, pObj, i )
83 Vec_PtrPush( pNtk->vCis, pObj );
84 Abc_NtkForEachPo( pNtk, pObj, i )
85 Vec_PtrPush( pNtk->vCos, pObj );
86 Abc_NtkForEachBox( pNtk, pObj, i )
87 {
88 if ( Abc_ObjIsLatch(pObj) )
89 continue;
90 Abc_ObjForEachFanin( pObj, pTerm, k )
91 Vec_PtrPush( pNtk->vCos, pTerm );
92 Abc_ObjForEachFanout( pObj, pTerm, k )
93 Vec_PtrPush( pNtk->vCis, pTerm );
94 }
95 Abc_NtkForEachBox( pNtk, pObj, i )
96 {
97 if ( !Abc_ObjIsLatch(pObj) )
98 continue;
99 Abc_ObjForEachFanin( pObj, pTerm, k )
100 Vec_PtrPush( pNtk->vCos, pTerm );
101 Abc_ObjForEachFanout( pObj, pTerm, k )
102 Vec_PtrPush( pNtk->vCis, pTerm );
103 }
104}
Here is the caller graph for this function:

◆ Abc_NtkOrderObjsByName()

ABC_DLL void Abc_NtkOrderObjsByName ( Abc_Ntk_t * pNtk,
int fComb )
extern

Definition at line 330 of file abcNames.c.

331{
332 Abc_Obj_t * pObj;
333 int i;
334 assert( Abc_NtkHasOnlyLatchBoxes(pNtk) );
335 // temporarily store the names in the copy field
336 Abc_NtkForEachPi( pNtk, pObj, i )
337 pObj->pCopy = (Abc_Obj_t *)Abc_ObjName(pObj);
338 Abc_NtkForEachPo( pNtk, pObj, i )
339 pObj->pCopy = (Abc_Obj_t *)Abc_ObjName(pObj);
340 Abc_NtkForEachBox( pNtk, pObj, i )
341 pObj->pCopy = (Abc_Obj_t *)Abc_ObjName(Abc_ObjFanout0(pObj));
342 // order objects alphabetically
343 qsort( (void *)Vec_PtrArray(pNtk->vPis), (size_t)Vec_PtrSize(pNtk->vPis), sizeof(Abc_Obj_t *),
344 (int (*)(const void *, const void *)) Abc_NodeCompareNames );
345 qsort( (void *)Vec_PtrArray(pNtk->vPos), (size_t)Vec_PtrSize(pNtk->vPos), sizeof(Abc_Obj_t *),
346 (int (*)(const void *, const void *)) Abc_NodeCompareNames );
347 // if the comparison if combinational (latches as PIs/POs), order them too
348 if ( fComb )
349 qsort( (void *)Vec_PtrArray(pNtk->vBoxes), (size_t)Vec_PtrSize(pNtk->vBoxes), sizeof(Abc_Obj_t *),
350 (int (*)(const void *, const void *)) Abc_NodeCompareNames );
351 // order CIs/COs first PIs/POs(Asserts) then latches
352 Abc_NtkOrderCisCos( pNtk );
353 // clean the copy fields
354 Abc_NtkForEachPi( pNtk, pObj, i )
355 pObj->pCopy = NULL;
356 Abc_NtkForEachPo( pNtk, pObj, i )
357 pObj->pCopy = NULL;
358 Abc_NtkForEachBox( pNtk, pObj, i )
359 pObj->pCopy = NULL;
360}
ABC_DLL int Abc_NodeCompareNames(Abc_Obj_t **pp1, Abc_Obj_t **pp2)
Definition abcNames.c:316
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkPermute()

ABC_DLL void Abc_NtkPermute ( Abc_Ntk_t * pNtk,
int fInputs,
int fOutputs,
int fFlops,
char * pInPermFile,
char * pOutPermFile,
char * pFlopPermFile )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 2206 of file abcNtk.c.

2207{
2208 Abc_Obj_t * pTemp;
2209 Vec_Int_t * vInputs, * vOutputs, * vFlops, * vTemp;
2210 int i, k, Entry;
2211 // start permutation arrays
2212 if ( pInPermFile )
2213 {
2214 vInputs = Abc_NtkReadSignalPerm( pInPermFile, Abc_NtkPiNum(pNtk) );
2215 if ( vInputs == NULL )
2216 return;
2217 fInputs = 1;
2218 }
2219 else
2220 vInputs = Vec_IntStartNatural( Abc_NtkPiNum(pNtk) );
2221 if ( pOutPermFile )
2222 {
2223 vOutputs = Abc_NtkReadSignalPerm( pOutPermFile, Abc_NtkPoNum(pNtk) );
2224 if ( vOutputs == NULL )
2225 return;
2226 fOutputs = 1;
2227 }
2228 else
2229 vOutputs = Vec_IntStartNatural( Abc_NtkPoNum(pNtk) );
2230 if ( pFlopPermFile )
2231 {
2232 vFlops = Abc_NtkReadSignalPerm( pFlopPermFile, Abc_NtkLatchNum(pNtk) );
2233 if ( vFlops == NULL )
2234 return;
2235 fFlops = 1;
2236 }
2237 else
2238 vFlops = Vec_IntStartNatural( Abc_NtkLatchNum(pNtk) );
2239 // permute inputs
2240 Vec_Ptr_t * vCis = Vec_PtrDup(pNtk->vCis);
2241 Vec_Ptr_t * vCos = Vec_PtrDup(pNtk->vCos);
2242 Vec_Ptr_t * vFfs = Vec_PtrDup(pNtk->vBoxes);
2243 if ( fInputs )
2244 for ( i = 0; i < Abc_NtkPiNum(pNtk); i++ )
2245 {
2246 if ( pInPermFile )
2247 {
2248 k = Vec_IntEntry( vInputs, i );
2249 pTemp = (Abc_Obj_t *)Vec_PtrEntry( vCis, k );
2250 Vec_PtrWriteEntry( pNtk->vPis, i, pTemp );
2251 Vec_PtrWriteEntry( pNtk->vCis, i, pTemp );
2252 }
2253 else
2254 {
2255 k = rand() % Abc_NtkPiNum(pNtk);
2256 // swap indexes
2257 Entry = Vec_IntEntry( vInputs, i );
2258 Vec_IntWriteEntry( vInputs, i, Vec_IntEntry(vInputs, k) );
2259 Vec_IntWriteEntry( vInputs, k, Entry );
2260 // swap PIs
2261 pTemp = (Abc_Obj_t *)Vec_PtrEntry( pNtk->vPis, i );
2262 Vec_PtrWriteEntry( pNtk->vPis, i, Vec_PtrEntry(pNtk->vPis, k) );
2263 Vec_PtrWriteEntry( pNtk->vPis, k, pTemp );
2264 // swap CIs
2265 pTemp = (Abc_Obj_t *)Vec_PtrEntry( pNtk->vCis, i );
2266 Vec_PtrWriteEntry( pNtk->vCis, i, Vec_PtrEntry(pNtk->vCis, k) );
2267 Vec_PtrWriteEntry( pNtk->vCis, k, pTemp );
2268 }
2269//printf( "Swapping PIs %d and %d.\n", i, k );
2270 }
2271 // permute outputs
2272 if ( fOutputs )
2273 for ( i = 0; i < Abc_NtkPoNum(pNtk); i++ )
2274 {
2275 if ( pOutPermFile )
2276 {
2277 k = Vec_IntEntry( vOutputs, i );
2278 pTemp = (Abc_Obj_t *)Vec_PtrEntry( vCos, k );
2279 Vec_PtrWriteEntry( pNtk->vPos, i, pTemp );
2280 Vec_PtrWriteEntry( pNtk->vCos, i, pTemp );
2281 }
2282 else
2283 {
2284 k = rand() % Abc_NtkPoNum(pNtk);
2285 // swap indexes
2286 Entry = Vec_IntEntry( vOutputs, i );
2287 Vec_IntWriteEntry( vOutputs, i, Vec_IntEntry(vOutputs, k) );
2288 Vec_IntWriteEntry( vOutputs, k, Entry );
2289 // swap POs
2290 pTemp = (Abc_Obj_t *)Vec_PtrEntry( pNtk->vPos, i );
2291 Vec_PtrWriteEntry( pNtk->vPos, i, Vec_PtrEntry(pNtk->vPos, k) );
2292 Vec_PtrWriteEntry( pNtk->vPos, k, pTemp );
2293 // swap COs
2294 pTemp = (Abc_Obj_t *)Vec_PtrEntry( pNtk->vCos, i );
2295 Vec_PtrWriteEntry( pNtk->vCos, i, Vec_PtrEntry(pNtk->vCos, k) );
2296 Vec_PtrWriteEntry( pNtk->vCos, k, pTemp );
2297 }
2298//printf( "Swapping POs %d and %d.\n", i, k );
2299 }
2300 // permute flops
2301 assert( Abc_NtkBoxNum(pNtk) == Abc_NtkLatchNum(pNtk) );
2302 if ( fFlops )
2303 for ( i = 0; i < Abc_NtkLatchNum(pNtk); i++ )
2304 {
2305 if ( pFlopPermFile )
2306 {
2307 k = Vec_IntEntry( vFlops, i );
2308 pTemp = (Abc_Obj_t *)Vec_PtrEntry( vFfs, k );
2309 Vec_PtrWriteEntry( pNtk->vBoxes, i, pTemp );
2310 pTemp = (Abc_Obj_t *)Vec_PtrEntry( vCis, Abc_NtkPiNum(pNtk)+k );
2311 Vec_PtrWriteEntry( pNtk->vCis, Abc_NtkPiNum(pNtk)+i, pTemp );
2312 pTemp = (Abc_Obj_t *)Vec_PtrEntry( vCos, Abc_NtkPoNum(pNtk)+k );
2313 Vec_PtrWriteEntry( pNtk->vCos, Abc_NtkPoNum(pNtk)+i, pTemp );
2314 }
2315 else
2316 {
2317 k = rand() % Abc_NtkLatchNum(pNtk);
2318 // swap indexes
2319 Entry = Vec_IntEntry( vFlops, i );
2320 Vec_IntWriteEntry( vFlops, i, Vec_IntEntry(vFlops, k) );
2321 Vec_IntWriteEntry( vFlops, k, Entry );
2322 // swap flops
2323 pTemp = (Abc_Obj_t *)Vec_PtrEntry( pNtk->vBoxes, i );
2324 Vec_PtrWriteEntry( pNtk->vBoxes, i, Vec_PtrEntry(pNtk->vBoxes, k) );
2325 Vec_PtrWriteEntry( pNtk->vBoxes, k, pTemp );
2326 // swap CIs
2327 pTemp = (Abc_Obj_t *)Vec_PtrEntry( pNtk->vCis, Abc_NtkPiNum(pNtk)+i );
2328 Vec_PtrWriteEntry( pNtk->vCis, Abc_NtkPiNum(pNtk)+i, Vec_PtrEntry(pNtk->vCis, Abc_NtkPiNum(pNtk)+k) );
2329 Vec_PtrWriteEntry( pNtk->vCis, Abc_NtkPiNum(pNtk)+k, pTemp );
2330 // swap COs
2331 pTemp = (Abc_Obj_t *)Vec_PtrEntry( pNtk->vCos, Abc_NtkPoNum(pNtk)+i );
2332 Vec_PtrWriteEntry( pNtk->vCos, Abc_NtkPoNum(pNtk)+i, Vec_PtrEntry(pNtk->vCos, Abc_NtkPoNum(pNtk)+k) );
2333 Vec_PtrWriteEntry( pNtk->vCos, Abc_NtkPoNum(pNtk)+k, pTemp );
2334 }
2335
2336//printf( "Swapping flops %d and %d.\n", i, k );
2337 }
2338 Vec_PtrFree(vCis);
2339 Vec_PtrFree(vCos);
2340 Vec_PtrFree(vFfs);
2341 // invert arrays
2342 vInputs = Vec_IntInvert( vTemp = vInputs, -1 );
2343 Vec_IntFree( vTemp );
2344 vOutputs = Vec_IntInvert( vTemp = vOutputs, -1 );
2345 Vec_IntFree( vTemp );
2346 vFlops = Vec_IntInvert( vTemp = vFlops, -1 );
2347 Vec_IntFree( vTemp );
2348 // pack the results into the output array
2349 Vec_IntFreeP( &pNtk->vObjPerm );
2350 pNtk->vObjPerm = Vec_IntAlloc( Abc_NtkPiNum(pNtk) + Abc_NtkPoNum(pNtk) + Abc_NtkLatchNum(pNtk) );
2351 Vec_IntForEachEntry( vInputs, Entry, i )
2352 Vec_IntPush( pNtk->vObjPerm, Entry );
2353 Vec_IntForEachEntry( vOutputs, Entry, i )
2354 Vec_IntPush( pNtk->vObjPerm, Entry );
2355 Vec_IntForEachEntry( vFlops, Entry, i )
2356 Vec_IntPush( pNtk->vObjPerm, Entry );
2357 // cleanup
2358 Vec_IntFree( vInputs );
2359 Vec_IntFree( vOutputs );
2360 Vec_IntFree( vFlops );
2361}
Vec_Int_t * Abc_NtkReadSignalPerm(char *pFileName, int nSignals)
Definition abcNtk.c:2163
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkPhaseFrameNum()

ABC_DLL int Abc_NtkPhaseFrameNum ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Performs phase abstraction.]

Description []

SideEffects []

SeeAlso []

Definition at line 4145 of file abcDar.c.

4146{
4147 extern int Saig_ManPhaseFrameNum( Aig_Man_t * p, Vec_Int_t * vInits );
4148 Vec_Int_t * vInits;
4149 Aig_Man_t * pMan;
4150 int nFrames;
4151 pMan = Abc_NtkToDar( pNtk, 0, 1 );
4152 if ( pMan == NULL )
4153 return 1;
4154 vInits = Abc_NtkGetLatchValues(pNtk);
4155 nFrames = Saig_ManPhaseFrameNum( pMan, vInits );
4156 Vec_IntFree( vInits );
4157 Aig_ManStop( pMan );
4158 return nFrames;
4159}
Vec_Int_t * Abc_NtkGetLatchValues(Abc_Ntk_t *pNtk)
Definition abcDar.c:1392
int Saig_ManPhaseFrameNum(Aig_Man_t *p, Vec_Int_t *vInits)
Definition saigPhase.c:841
Here is the call graph for this function:

◆ Abc_NtkPrepareTwoNtks()

ABC_DLL int Abc_NtkPrepareTwoNtks ( FILE * pErr,
Abc_Ntk_t * pNtk,
char ** argv,
int argc,
Abc_Ntk_t ** ppNtk1,
Abc_Ntk_t ** ppNtk2,
int * pfDelete1,
int * pfDelete2,
int fCheck )
extern

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

Synopsis [Prepares two network for a two-argument command similar to "verify".]

Description []

SideEffects []

SeeAlso []

Definition at line 1522 of file abcUtil.c.

1524{
1525 FILE * pFile;
1526 Abc_Ntk_t * pNtk1, * pNtk2, * pNtkTemp;
1527 int util_optind = 0;
1528
1529 *pfDelete1 = 0;
1530 *pfDelete2 = 0;
1531 if ( argc == util_optind )
1532 { // use the spec
1533 if ( pNtk == NULL )
1534 {
1535 fprintf( pErr, "Empty current network.\n" );
1536 return 0;
1537 }
1538 if ( pNtk->pSpec == NULL )
1539 {
1540 fprintf( pErr, "The external spec is not given.\n" );
1541 return 0;
1542 }
1543 pFile = fopen( pNtk->pSpec, "r" );
1544 if ( pFile == NULL )
1545 {
1546 fprintf( pErr, "Cannot open the external spec file \"%s\".\n", pNtk->pSpec );
1547 return 0;
1548 }
1549 else
1550 fclose( pFile );
1551 pNtk1 = Abc_NtkDup(pNtk);
1552 pNtk2 = Io_Read( pNtk->pSpec, Io_ReadFileType(pNtk->pSpec), fCheck, 0 );
1553 if ( pNtk2 == NULL )
1554 return 0;
1555 *pfDelete1 = 1;
1556 *pfDelete2 = 1;
1557 }
1558 else if ( argc == util_optind + 1 )
1559 {
1560 if ( pNtk == NULL )
1561 {
1562 fprintf( pErr, "Empty current network.\n" );
1563 return 0;
1564 }
1565 pNtk1 = Abc_NtkDup(pNtk);
1566 pNtk2 = Io_Read( argv[util_optind], Io_ReadFileType(argv[util_optind]), fCheck, 0 );
1567 if ( pNtk2 == NULL )
1568 return 0;
1569 *pfDelete1 = 1;
1570 *pfDelete2 = 1;
1571 }
1572 else if ( argc == util_optind + 2 )
1573 {
1574 pNtk1 = Io_Read( argv[util_optind], Io_ReadFileType(argv[util_optind]), fCheck, 0 );
1575 if ( pNtk1 == NULL )
1576 return 0;
1577 pNtk2 = Io_Read( argv[util_optind+1], Io_ReadFileType(argv[util_optind+1]), fCheck, 0 );
1578 if ( pNtk2 == NULL )
1579 {
1580 Abc_NtkDelete( pNtk1 );
1581 return 0;
1582 }
1583 *pfDelete1 = 1;
1584 *pfDelete2 = 1;
1585 }
1586 else
1587 {
1588 fprintf( pErr, "Wrong number of arguments.\n" );
1589 return 0;
1590 }
1591
1592 // make sure the networks are strashed
1593 if ( !Abc_NtkIsStrash(pNtk1) )
1594 {
1595 pNtkTemp = Abc_NtkStrash( pNtk1, 0, 1, 0 );
1596 if ( *pfDelete1 )
1597 Abc_NtkDelete( pNtk1 );
1598 pNtk1 = pNtkTemp;
1599 *pfDelete1 = 1;
1600 }
1601 if ( !Abc_NtkIsStrash(pNtk2) )
1602 {
1603 pNtkTemp = Abc_NtkStrash( pNtk2, 0, 1, 0 );
1604 if ( *pfDelete2 )
1605 Abc_NtkDelete( pNtk2 );
1606 pNtk2 = pNtkTemp;
1607 *pfDelete2 = 1;
1608 }
1609
1610 *ppNtk1 = pNtk1;
1611 *ppNtk2 = pNtk2;
1612 return 1;
1613}
Io_FileType_t Io_ReadFileType(char *pFileName)
DECLARATIONS ///.
Definition ioUtil.c:47
Abc_Ntk_t * Io_Read(char *pFileName, Io_FileType_t FileType, int fCheck, int fBarBufs)
Definition ioUtil.c:241
int util_optind
Here is the call graph for this function:

◆ Abc_NtkPrintBoxInfo()

ABC_DLL void Abc_NtkPrintBoxInfo ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Prints information about boxes.]

Description []

SideEffects []

SeeAlso []

Definition at line 431 of file abcHie.c.

432{
433 Vec_Ptr_t * vMods;
434 Abc_Ntk_t * pModel, * pBoxModel;
435 Abc_Obj_t * pObj;
436 Vec_Int_t * vCounts;
437 int i, k, Num;
438 if ( pNtk->pDesign == NULL || pNtk->pDesign->vModules == NULL )
439 {
440// printf( "There is no hierarchy information.\n" );
441 return;
442 }
443 // sort models by name
444 vMods = pNtk->pDesign->vModules;
445 Vec_PtrSort( vMods, (int(*)(const void *, const void *))Abc_NtkCompareNames );
446// Vec_PtrForEachEntry( Abc_Ntk_t *, vMods, pModel, i )
447// printf( "%s\n", Abc_NtkName(pModel) );
448
449 // swap the first model
450 Num = Vec_PtrFind( vMods, pNtk );
451 assert( Num >= 0 && Num < Vec_PtrSize(vMods) );
452 pBoxModel = (Abc_Ntk_t *)Vec_PtrEntry(vMods, 0);
453 Vec_PtrWriteEntry(vMods, 0, (Abc_Ntk_t *)Vec_PtrEntry(vMods, Num) );
454 Vec_PtrWriteEntry(vMods, Num, pBoxModel );
455
456 // print models
457 vCounts = Vec_IntStart( Vec_PtrSize(vMods) );
458 Vec_PtrForEachEntry( Abc_Ntk_t *, vMods, pModel, i )
459 {
460 if ( Abc_NtkBoxNum(pModel) == 0 )
461 continue;
462 Vec_IntFill( vCounts, Vec_IntSize(vCounts), 0 );
463 Abc_NtkForEachBox( pModel, pObj, k )
464 {
465 pBoxModel = (Abc_Ntk_t *)pObj->pData;
466 if ( pBoxModel == NULL )
467 continue;
468 Num = Vec_PtrFind( vMods, pBoxModel );
469 assert( Num >= 0 && Num < Vec_PtrSize(vMods) );
470 Vec_IntAddToEntry( vCounts, Num, 1 );
471 }
472
473// Abc_NtkPrintStats( pModel, 0, 0, 0, 0, 0, 0, 0, 0, 0 );
474 printf( "MODULE " );
475 printf( "%-30s : ", Abc_NtkName(pModel) );
476 printf( "PI=%6d ", Abc_NtkPiNum(pModel) );
477 printf( "PO=%6d ", Abc_NtkPoNum(pModel) );
478 printf( "BB=%6d ", Abc_NtkBoxNum(pModel) );
479 printf( "ND=%6d ", Abc_NtkNodeNum(pModel) ); // sans constants
480 printf( "Lev=%5d ", Abc_NtkLevel(pModel) );
481 printf( "\n" );
482
483 Vec_IntForEachEntry( vCounts, Num, k )
484 if ( Num )
485 printf( "%15d : %s\n", Num, Abc_NtkName((Abc_Ntk_t *)Vec_PtrEntry(vMods, k)) );
486 }
487 Vec_IntFree( vCounts );
488 Vec_PtrForEachEntry( Abc_Ntk_t *, vMods, pModel, i )
489 {
490 if ( Abc_NtkBoxNum(pModel) != 0 )
491 continue;
492 printf( "MODULE " );
493 printf( "%-30s : ", Abc_NtkName(pModel) );
494 printf( "PI=%6d ", Abc_NtkPiNum(pModel) );
495 printf( "PO=%6d ", Abc_NtkPoNum(pModel) );
496 printf( "BB=%6d ", Abc_NtkBoxNum(pModel) );
497 printf( "ND=%6d ", Abc_NtkNodeNum(pModel) );
498 printf( "Lev=%5d ", Abc_NtkLevel(pModel) );
499 printf( "\n" );
500 }
501}
int Abc_NtkCompareNames(Abc_Ntk_t **p1, Abc_Ntk_t **p2)
Definition abcHie.c:415
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkPrintCiLevels()

ABC_DLL void Abc_NtkPrintCiLevels ( Abc_Ntk_t * pNtk)
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 2268 of file abcUtil.c.

2269{
2270 Abc_Obj_t * pObj;
2271 int i;
2272 Abc_NtkForEachCi( pNtk, pObj, i )
2273 printf( "%c=%d ", 'a'+i, pObj->Level );
2274 printf( "\n" );
2275}

◆ Abc_NtkPrintFactor()

ABC_DLL void Abc_NtkPrintFactor ( FILE * pFile,
Abc_Ntk_t * pNtk,
int fUseRealNames )
extern

Definition at line 1129 of file abcPrint.c.

1130{
1131 Abc_Obj_t * pNode;
1132 int i;
1133 assert( Abc_NtkIsSopLogic(pNtk) );
1134 Abc_NtkForEachNode( pNtk, pNode, i )
1135 Abc_NodePrintFactor( pFile, pNode, fUseRealNames );
1136}
void Abc_NodePrintFactor(FILE *pFile, Abc_Obj_t *pNode, int fUseRealNames)
Definition abcPrint.c:1101
Here is the call graph for this function:

◆ Abc_NtkPrintFanio()

ABC_DLL void Abc_NtkPrintFanio ( FILE * pFile,
Abc_Ntk_t * pNtk,
int fUseFanio,
int fUsePio,
int fUseSupp,
int fUseCone )
extern

Definition at line 876 of file abcPrint.c.

877{
878 Vec_Int_t * vFan = Vec_IntAlloc( 0 );
879 Vec_Int_t * vFon = Vec_IntAlloc( 0 );
880 Vec_Int_t * vFanR = Vec_IntAlloc( 0 );
881 Vec_Int_t * vFonR = Vec_IntAlloc( 0 );
882 assert( fUseFanio + fUsePio + fUseSupp + fUseCone == 1 );
883 if ( fUseFanio )
884 {
885 Abc_NtkFaninFanoutCounters( pNtk, vFan, vFon, vFanR, vFonR );
886 Abc_NtkPrintDistribInternal( pFile, pNtk, "fanins", "fanouts", "Nodes", "fanin", "fanout", vFan, vFon, vFanR, vFonR );
887 }
888 else if ( fUsePio )
889 {
890 Abc_NtkInputOutputCounters( pNtk, vFan, vFon, vFanR, vFonR );
891 Abc_NtkPrintDistribInternal( pFile, pNtk, "fanins", "fanouts", "I/O", "fanin", "fanout", vFan, vFon, vFanR, vFonR );
892 }
893 else if ( fUseSupp )
894 {
895 Abc_NtkInOutSupportCounters( pNtk, vFan, vFon, vFanR, vFonR );
896 Abc_NtkPrintDistribInternal( pFile, pNtk, "input supports", "output supports", "I/O", "in-supp", "out-supp", vFan, vFon, vFanR, vFonR );
897 }
898 else if ( fUseCone )
899 {
900 Abc_NtkInOutConeCounters( pNtk, vFan, vFon, vFanR, vFonR );
901 Abc_NtkPrintDistribInternal( pFile, pNtk, "input cones", "output cones", "I/O", "in-cone", "out-cone", vFan, vFon, vFanR, vFonR );
902 }
903 Vec_IntFree( vFan );
904 Vec_IntFree( vFon );
905 Vec_IntFree( vFanR );
906 Vec_IntFree( vFonR );
907}
void Abc_NtkInputOutputCounters(Abc_Ntk_t *pNtk, Vec_Int_t *vFan, Vec_Int_t *vFon, Vec_Int_t *vFanR, Vec_Int_t *vFonR)
Definition abcPrint.c:633
void Abc_NtkPrintDistribInternal(FILE *pFile, Abc_Ntk_t *pNtk, char *pFanins, char *pFanouts, char *pNode, char *pFanin, char *pFanout, Vec_Int_t *vFan, Vec_Int_t *vFon, Vec_Int_t *vFanR, Vec_Int_t *vFonR)
Definition abcPrint.c:839
void Abc_NtkFaninFanoutCounters(Abc_Ntk_t *pNtk, Vec_Int_t *vFan, Vec_Int_t *vFon, Vec_Int_t *vFanR, Vec_Int_t *vFonR)
Definition abcPrint.c:609
void Abc_NtkInOutConeCounters(Abc_Ntk_t *pNtk, Vec_Int_t *vFan, Vec_Int_t *vFon, Vec_Int_t *vFanR, Vec_Int_t *vFonR)
Definition abcPrint.c:811
void Abc_NtkInOutSupportCounters(Abc_Ntk_t *pNtk, Vec_Int_t *vFan, Vec_Int_t *vFon, Vec_Int_t *vFanR, Vec_Int_t *vFonR)
Definition abcPrint.c:725
Here is the call graph for this function:

◆ Abc_NtkPrintFanioNew()

ABC_DLL void Abc_NtkPrintFanioNew ( FILE * pFile,
Abc_Ntk_t * pNtk,
int fMffc )
extern

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

Synopsis [Prints the distribution of fanins/fanouts in the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 921 of file abcPrint.c.

922{
923 char Buffer[100];
924 Abc_Obj_t * pNode;
925 Vec_Int_t * vFanins, * vFanouts;
926 int nFanins, nFanouts, nFaninsMax, nFanoutsMax, nFaninsAll, nFanoutsAll;
927 int i, k, nSizeMax;
928
929 // determine the largest fanin and fanout
930 nFaninsMax = nFanoutsMax = 0;
931 nFaninsAll = nFanoutsAll = 0;
932 Abc_NtkForEachNode( pNtk, pNode, i )
933 {
934 if ( fMffc && Abc_ObjFanoutNum(pNode) == 1 )
935 continue;
936 nFanins = Abc_ObjFaninNum(pNode);
937 if ( Abc_NtkIsNetlist(pNtk) )
938 nFanouts = Abc_ObjFanoutNum( Abc_ObjFanout0(pNode) );
939 else if ( fMffc )
940 nFanouts = Abc_NodeMffcSize(pNode);
941 else
942 nFanouts = Abc_ObjFanoutNum(pNode);
943 nFaninsAll += nFanins;
944 nFanoutsAll += nFanouts;
945 nFaninsMax = Abc_MaxInt( nFaninsMax, nFanins );
946 nFanoutsMax = Abc_MaxInt( nFanoutsMax, nFanouts );
947 }
948
949 // allocate storage for fanin/fanout numbers
950 nSizeMax = Abc_MaxInt( 10 * (Abc_Base10Log(nFaninsMax) + 1), 10 * (Abc_Base10Log(nFanoutsMax) + 1) );
951 vFanins = Vec_IntStart( nSizeMax );
952 vFanouts = Vec_IntStart( nSizeMax );
953
954 // count the number of fanins and fanouts
955 Abc_NtkForEachNode( pNtk, pNode, i )
956 {
957 if ( fMffc && Abc_ObjFanoutNum(pNode) == 1 )
958 continue;
959 nFanins = Abc_ObjFaninNum(pNode);
960 if ( Abc_NtkIsNetlist(pNtk) )
961 nFanouts = Abc_ObjFanoutNum( Abc_ObjFanout0(pNode) );
962 else if ( fMffc )
963 nFanouts = Abc_NodeMffcSize(pNode);
964 else
965 nFanouts = Abc_ObjFanoutNum(pNode);
966
967 if ( nFanins < 10 )
968 Vec_IntAddToEntry( vFanins, nFanins, 1 );
969 else if ( nFanins < 100 )
970 Vec_IntAddToEntry( vFanins, 10 + nFanins/10, 1 );
971 else if ( nFanins < 1000 )
972 Vec_IntAddToEntry( vFanins, 20 + nFanins/100, 1 );
973 else if ( nFanins < 10000 )
974 Vec_IntAddToEntry( vFanins, 30 + nFanins/1000, 1 );
975 else if ( nFanins < 100000 )
976 Vec_IntAddToEntry( vFanins, 40 + nFanins/10000, 1 );
977 else if ( nFanins < 1000000 )
978 Vec_IntAddToEntry( vFanins, 50 + nFanins/100000, 1 );
979 else if ( nFanins < 10000000 )
980 Vec_IntAddToEntry( vFanins, 60 + nFanins/1000000, 1 );
981
982 if ( nFanouts < 10 )
983 Vec_IntAddToEntry( vFanouts, nFanouts, 1 );
984 else if ( nFanouts < 100 )
985 Vec_IntAddToEntry( vFanouts, 10 + nFanouts/10, 1 );
986 else if ( nFanouts < 1000 )
987 Vec_IntAddToEntry( vFanouts, 20 + nFanouts/100, 1 );
988 else if ( nFanouts < 10000 )
989 Vec_IntAddToEntry( vFanouts, 30 + nFanouts/1000, 1 );
990 else if ( nFanouts < 100000 )
991 Vec_IntAddToEntry( vFanouts, 40 + nFanouts/10000, 1 );
992 else if ( nFanouts < 1000000 )
993 Vec_IntAddToEntry( vFanouts, 50 + nFanouts/100000, 1 );
994 else if ( nFanouts < 10000000 )
995 Vec_IntAddToEntry( vFanouts, 60 + nFanouts/1000000, 1 );
996 }
997
998 fprintf( pFile, "The distribution of fanins and fanouts in the network:\n" );
999 fprintf( pFile, " Number Nodes with fanin Nodes with fanout\n" );
1000 for ( k = 0; k < nSizeMax; k++ )
1001 {
1002 if ( vFanins->pArray[k] == 0 && vFanouts->pArray[k] == 0 )
1003 continue;
1004 if ( k < 10 )
1005 fprintf( pFile, "%15d : ", k );
1006 else
1007 {
1008 sprintf( Buffer, "%d - %d", (int)pow((double)10, k/10) * (k%10), (int)pow((double)10, k/10) * (k%10+1) - 1 );
1009 fprintf( pFile, "%15s : ", Buffer );
1010 }
1011 if ( vFanins->pArray[k] == 0 )
1012 fprintf( pFile, " " );
1013 else
1014 fprintf( pFile, "%12d ", vFanins->pArray[k] );
1015 fprintf( pFile, " " );
1016 if ( vFanouts->pArray[k] == 0 )
1017 fprintf( pFile, " " );
1018 else
1019 fprintf( pFile, "%12d ", vFanouts->pArray[k] );
1020 fprintf( pFile, "\n" );
1021 }
1022 Vec_IntFree( vFanins );
1023 Vec_IntFree( vFanouts );
1024
1025 fprintf( pFile, "Fanins: Max = %d. Ave = %.2f. Fanouts: Max = %d. Ave = %.2f.\n",
1026 nFaninsMax, 1.0*nFaninsAll/Abc_NtkNodeNum(pNtk),
1027 nFanoutsMax, 1.0*nFanoutsAll/Abc_NtkNodeNum(pNtk) );
1028/*
1029 Abc_NtkForEachCi( pNtk, pNode, i )
1030 {
1031 printf( "%d ", Abc_ObjFanoutNum(pNode) );
1032 }
1033 printf( "\n" );
1034*/
1035}
Here is the call graph for this function:

◆ Abc_NtkPrintIo()

ABC_DLL void Abc_NtkPrintIo ( FILE * pFile,
Abc_Ntk_t * pNtk,
int fPrintFlops )
extern

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

Synopsis [Prints PIs/POs and LIs/LOs.]

Description []

SideEffects []

SeeAlso []

Definition at line 499 of file abcPrint.c.

500{
501 Abc_Obj_t * pObj;
502 int i;
503
504 fprintf( pFile, "Primary inputs (%d): ", Abc_NtkPiNum(pNtk) );
505 Abc_NtkForEachPi( pNtk, pObj, i )
506 fprintf( pFile, " %d=%s", i, Abc_ObjName(pObj) );
507// fprintf( pFile, " %s(%d)", Abc_ObjName(pObj), Abc_ObjFanoutNum(pObj) );
508 fprintf( pFile, "\n" );
509
510 fprintf( pFile, "Primary outputs (%d):", Abc_NtkPoNum(pNtk) );
511 Abc_NtkForEachPo( pNtk, pObj, i )
512 fprintf( pFile, " %d=%s", i, Abc_ObjName(pObj) );
513 fprintf( pFile, "\n" );
514
515 if ( !fPrintFlops )
516 return;
517
518 fprintf( pFile, "Latches (%d): ", Abc_NtkLatchNum(pNtk) );
519 Abc_NtkForEachLatch( pNtk, pObj, i )
520 fprintf( pFile, " %s(%s=%s)", Abc_ObjName(pObj),
521 Abc_ObjName(Abc_ObjFanout0(pObj)), Abc_ObjName(Abc_ObjFanin0(pObj)) );
522 fprintf( pFile, "\n" );
523}
Here is the call graph for this function:

◆ Abc_NtkPrintLatch()

ABC_DLL void Abc_NtkPrintLatch ( FILE * pFile,
Abc_Ntk_t * pNtk )
extern

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

Synopsis [Prints statistics about latches.]

Description []

SideEffects []

SeeAlso []

Definition at line 536 of file abcPrint.c.

537{
538 Abc_Obj_t * pLatch, * pFanin;
539 int i, Counter0, Counter1, Counter2;
540 int InitNums[4], Init;
541
542 assert( !Abc_NtkIsNetlist(pNtk) );
543 if ( Abc_NtkLatchNum(pNtk) == 0 )
544 {
545 fprintf( pFile, "The network is combinational.\n" );
546 return;
547 }
548
549 for ( i = 0; i < 4; i++ )
550 InitNums[i] = 0;
551 Counter0 = Counter1 = Counter2 = 0;
552 Abc_NtkForEachLatch( pNtk, pLatch, i )
553 {
554 Init = Abc_LatchInit( pLatch );
555 assert( Init < 4 );
556 InitNums[Init]++;
557
558 pFanin = Abc_ObjFanin0(Abc_ObjFanin0(pLatch));
559 if ( Abc_NtkIsLogic(pNtk) )
560 {
561 if ( !Abc_NodeIsConst(pFanin) )
562 continue;
563 }
564 else if ( Abc_NtkIsStrash(pNtk) )
565 {
566 if ( !Abc_AigNodeIsConst(pFanin) )
567 continue;
568 }
569 else
570 assert( 0 );
571
572 // the latch input is a constant node
573 Counter0++;
574 if ( Abc_LatchIsInitDc(pLatch) )
575 {
576 Counter1++;
577 continue;
578 }
579 // count the number of cases when the constant is equal to the initial value
580 if ( Abc_NtkIsStrash(pNtk) )
581 {
582 if ( Abc_LatchIsInit1(pLatch) == !Abc_ObjFaninC0(pLatch) )
583 Counter2++;
584 }
585 else
586 {
587 if ( Abc_LatchIsInit1(pLatch) == Abc_NodeIsConst1(Abc_ObjFanin0(Abc_ObjFanin0(pLatch))) )
588 Counter2++;
589 }
590 }
591// fprintf( pFile, "%-15s: ", pNtk->pName );
592 fprintf( pFile, "Total latches = %5d. Init0 = %d. Init1 = %d. InitDC = %d. Const data = %d.\n",
593 Abc_NtkLatchNum(pNtk), InitNums[1], InitNums[2], InitNums[3], Counter0 );
594// fprintf( pFile, "Const fanin = %3d. DC init = %3d. Matching init = %3d. ", Counter0, Counter1, Counter2 );
595// fprintf( pFile, "Self-feed latches = %2d.\n", -1 ); //Abc_NtkCountSelfFeedLatches(pNtk) );
596}
ABC_DLL int Abc_NodeIsConst1(Abc_Obj_t *pNode)
Definition abcObj.c:916
Here is the call graph for this function:

◆ Abc_NtkPrintLevel()

ABC_DLL void Abc_NtkPrintLevel ( FILE * pFile,
Abc_Ntk_t * pNtk,
int fProfile,
int fListNodes,
int fOutputs,
int fVerbose )
extern

Definition at line 1231 of file abcPrint.c.

1232{
1233 Abc_Obj_t * pNode;
1234 int i, k, Length;
1235 if ( fOutputs )
1236 {
1237 Abc_NtkLevel(pNtk);
1238 printf( "Outputs by level: " );
1239 Abc_NtkForEachCo( pNtk, pNode, k )
1240 printf( "%d=%d ", k, Abc_ObjFanin0(pNode)->Level );
1241 printf( "\n" );
1242 return;
1243 }
1244 if ( fListNodes )
1245 {
1246 int nLevels;
1247 nLevels = Abc_NtkLevel(pNtk);
1248 printf( "Nodes by level:\n" );
1249 for ( i = 0; i <= nLevels; i++ )
1250 {
1251 printf( "%2d : ", i );
1252 Abc_NtkForEachNode( pNtk, pNode, k )
1253 if ( (int)pNode->Level == i )
1254 printf( " %s", Abc_NodeGetPrintName(pNode) );
1255 printf( "\n" );
1256 }
1257 return;
1258 }
1259
1260 // print the delay profile
1261 if ( fProfile && Abc_NtkHasMapping(pNtk) )
1262 {
1263 int nIntervals = 12;
1264 float DelayMax, DelayCur, DelayDelta;
1265 int * pLevelCounts;
1266 int DelayInt, nOutsSum, nOutsTotal;
1267
1268 // get the max delay and delta
1269 DelayMax = Abc_NtkDelayTrace( pNtk, NULL, NULL, 0 );
1270 DelayDelta = DelayMax/nIntervals;
1271 // collect outputs by delay
1272 pLevelCounts = ABC_ALLOC( int, nIntervals );
1273 memset( pLevelCounts, 0, sizeof(int) * nIntervals );
1274 Abc_NtkForEachCo( pNtk, pNode, i )
1275 {
1276 if ( Abc_ObjIsNode(Abc_ObjFanin0(pNode)) && Abc_ObjFaninNum(Abc_ObjFanin0(pNode)) == 0 )
1277 DelayInt = 0;
1278 else
1279 {
1280 DelayCur = Abc_NodeReadArrivalWorst( Abc_ObjFanin0(pNode) );
1281 DelayInt = (int)(DelayCur / DelayDelta);
1282 if ( DelayInt >= nIntervals )
1283 DelayInt = nIntervals - 1;
1284 }
1285 pLevelCounts[DelayInt]++;
1286 }
1287
1288 nOutsSum = 0;
1289 nOutsTotal = Abc_NtkCoNum(pNtk);
1290 for ( i = 0; i < nIntervals; i++ )
1291 {
1292 nOutsSum += pLevelCounts[i];
1293 printf( "[%8.2f - %8.2f] : COs = %4d. %5.1f %%\n",
1294 DelayDelta * i, DelayDelta * (i+1), pLevelCounts[i], 100.0 * nOutsSum/nOutsTotal );
1295 }
1296 ABC_FREE( pLevelCounts );
1297 return;
1298 }
1299 else if ( fProfile )
1300 {
1301 int LevelMax, * pLevelCounts;
1302 int nOutsSum, nOutsTotal;
1303
1304 if ( !Abc_NtkIsStrash(pNtk) )
1305 Abc_NtkLevel(pNtk);
1306
1307 LevelMax = 0;
1308 Abc_NtkForEachCo( pNtk, pNode, i )
1309 if ( LevelMax < (int)Abc_ObjFanin0(pNode)->Level )
1310 LevelMax = Abc_ObjFanin0(pNode)->Level;
1311 pLevelCounts = ABC_ALLOC( int, LevelMax + 1 );
1312 memset( pLevelCounts, 0, sizeof(int) * (LevelMax + 1) );
1313 Abc_NtkForEachCo( pNtk, pNode, i )
1314 pLevelCounts[Abc_ObjFanin0(pNode)->Level]++;
1315
1316 nOutsSum = 0;
1317 nOutsTotal = Abc_NtkCoNum(pNtk);
1318 for ( i = 0; i <= LevelMax; i++ )
1319 if ( pLevelCounts[i] )
1320 {
1321 nOutsSum += pLevelCounts[i];
1322 printf( "Level = %4d. COs = %4d. %5.1f %%\n", i, pLevelCounts[i], 100.0 * nOutsSum/nOutsTotal );
1323 }
1324 ABC_FREE( pLevelCounts );
1325 return;
1326 }
1327 assert( Abc_NtkIsStrash(pNtk) );
1328
1329 if ( fVerbose )
1330 {
1331 // find the longest name
1332 Length = 0;
1333 Abc_NtkForEachCo( pNtk, pNode, i )
1334 if ( Length < (int)strlen(Abc_ObjName(pNode)) )
1335 Length = strlen(Abc_ObjName(pNode));
1336 if ( Length < 5 )
1337 Length = 5;
1338 // print stats for each output
1339 Abc_NtkForEachCo( pNtk, pNode, i )
1340 {
1341 fprintf( pFile, "CO %4d : %*s ", i, Length, Abc_ObjName(pNode) );
1342 Abc_NodePrintLevel( pFile, pNode );
1343 }
1344 }
1345}
void Abc_NodePrintLevel(FILE *pFile, Abc_Obj_t *pNode)
Definition abcPrint.c:1358
char * Abc_NodeGetPrintName(Abc_Obj_t *pObj)
Definition abcPrint.c:1220
ABC_DLL float Abc_NtkDelayTrace(Abc_Ntk_t *pNtk, Abc_Obj_t *pOut, Abc_Obj_t *pIn, int fPrint)
Definition abcTiming.c:1031
Here is the call graph for this function:

◆ Abc_NtkPrintSkews()

ABC_DLL void Abc_NtkPrintSkews ( FILE * pFile,
Abc_Ntk_t * pNtk,
int fPrintAll )
extern

◆ Abc_NtkPrintStats()

ABC_DLL void Abc_NtkPrintStats ( Abc_Ntk_t * pNtk,
int fFactored,
int fSaveBest,
int fDumpResult,
int fUseLutLib,
int fPrintMuxes,
int fPower,
int fGlitch,
int fSkipBuf,
int fSkipSmall,
int fPrintMem )
extern

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

Synopsis [Print the vital stats of the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 269 of file abcPrint.c.

270{
271 int nSingles = fSkipBuf ? Abc_NtkGetBufNum(pNtk) : 0;
272 if ( fPrintMuxes && Abc_NtkIsStrash(pNtk) )
273 {
274 extern int Abc_NtkCountMuxes( Abc_Ntk_t * pNtk );
275 int nXors = Abc_NtkGetExorNum(pNtk);
276 int nMuxs = Abc_NtkCountMuxes(pNtk) - nXors;
277 int nAnds = Abc_NtkNodeNum(pNtk) - (nMuxs + nXors) * 3 - nSingles;
278 Abc_Print( 1, "XMA stats: " );
279 Abc_Print( 1,"Xor =%7d (%6.2f %%) ", nXors, 300.0 * nXors / Abc_NtkNodeNum(pNtk) );
280 Abc_Print( 1,"Mux =%7d (%6.2f %%) ", nMuxs, 300.0 * nMuxs / Abc_NtkNodeNum(pNtk) );
281 Abc_Print( 1,"And =%7d (%6.2f %%) ", nAnds, 100.0 * nAnds / Abc_NtkNodeNum(pNtk) );
282 Abc_Print( 1,"Total =%7d", nAnds + nXors + nMuxs );
283 Abc_Print( 1,"\n" );
284 return;
285 }
286 if ( fSaveBest )
288/*
289 if ( fDumpResult )
290 {
291 char Buffer[1000] = {0};
292 const char * pNameGen = pNtk->pSpec? Extra_FileNameGeneric( pNtk->pSpec ) : "nameless_";
293 sprintf( Buffer, "%s_dump.blif", pNameGen );
294 Io_Write( pNtk, Buffer, IO_FILE_BLIF );
295 if ( pNtk->pSpec ) ABC_FREE( pNameGen );
296 }
297*/
298
299// if ( Abc_NtkIsStrash(pNtk) )
300// Abc_AigCountNext( pNtk->pManFunc );
301
302#ifdef WIN32
303 SetConsoleTextAttribute( GetStdHandle(STD_OUTPUT_HANDLE), 15 ); // bright
304 Abc_Print( 1,"%-30s:", pNtk->pName );
305 SetConsoleTextAttribute( GetStdHandle(STD_OUTPUT_HANDLE), 7 ); // normal
306#else
307 Abc_Print( 1,"%s%-30s:%s", "\033[1;37m", pNtk->pName, "\033[0m" ); // bright
308#endif
309 Abc_Print( 1," i/o =%5d/%5d", Abc_NtkPiNum(pNtk), Abc_NtkPoNum(pNtk) );
310 if ( Abc_NtkConstrNum(pNtk) )
311 Abc_Print( 1,"(c=%d)", Abc_NtkConstrNum(pNtk) );
312 Abc_Print( 1," lat =%5d", Abc_NtkLatchNum(pNtk) );
313 if ( pNtk->nBarBufs )
314 Abc_Print( 1,"(b=%d)", pNtk->nBarBufs );
315 if ( Abc_NtkIsNetlist(pNtk) )
316 {
317 Abc_Print( 1," net =%5d", Abc_NtkNetNum(pNtk) );
318 Abc_Print( 1," nd =%5d", fSkipSmall ? Abc_NtkGetLargeNodeNum(pNtk) : Abc_NtkNodeNum(pNtk) - nSingles );
319 Abc_Print( 1," wbox =%3d", Abc_NtkWhiteboxNum(pNtk) );
320 Abc_Print( 1," bbox =%3d", Abc_NtkBlackboxNum(pNtk) );
321 }
322 else if ( Abc_NtkIsStrash(pNtk) )
323 {
324 Abc_Print( 1," and =%7d", Abc_NtkNodeNum(pNtk) );
325 if ( Abc_NtkGetChoiceNum(pNtk) )
326 Abc_Print( 1," (choice = %d)", Abc_NtkGetChoiceNum(pNtk) );
327 }
328 else
329 {
330 Abc_Print( 1," nd =%6d", fSkipSmall ? Abc_NtkGetLargeNodeNum(pNtk) : Abc_NtkNodeNum(pNtk) - nSingles );
331 Abc_Print( 1," edge =%7d", Abc_NtkGetTotalFanins(pNtk) - nSingles );
332 }
333
334 if ( Abc_NtkIsStrash(pNtk) || Abc_NtkIsNetlist(pNtk) )
335 {
336 }
337 else if ( Abc_NtkHasSop(pNtk) )
338 {
339
340 Abc_Print( 1," cube =%6d", Abc_NtkGetCubeNum(pNtk) - nSingles );
341 if ( fFactored )
342 Abc_Print( 1," lit(sop) =%6d", Abc_NtkGetLitNum(pNtk) - nSingles );
343 if ( fFactored )
344 Abc_Print( 1," lit(fac) =%6d", Abc_NtkGetLitFactNum(pNtk) - nSingles );
345 }
346 else if ( Abc_NtkHasAig(pNtk) )
347 Abc_Print( 1," aig =%6d", Abc_NtkGetAigNodeNum(pNtk) - nSingles );
348 else if ( Abc_NtkHasBdd(pNtk) )
349 Abc_Print( 1," bdd =%6d", Abc_NtkGetBddNodeNum(pNtk) - nSingles );
350 else if ( Abc_NtkHasMapping(pNtk) )
351 {
352 int fHasTimeMan = (int)(pNtk->pManTime != NULL);
353 assert( pNtk->pManFunc == Abc_FrameReadLibGen() );
354 Abc_Print( 1," area =%5.2f", Abc_NtkGetMappedArea(pNtk) );
355 Abc_Print( 1," delay =%5.2f", Abc_NtkDelayTrace(pNtk, NULL, NULL, 0) );
356 if ( !fHasTimeMan && pNtk->pManTime )
357 {
358 Abc_ManTimeStop( pNtk->pManTime );
359 pNtk->pManTime = NULL;
360 }
361 }
362 else if ( !Abc_NtkHasBlackbox(pNtk) )
363 {
364 assert( 0 );
365 }
366
367 if ( Abc_NtkIsStrash(pNtk) )
368 {
369 extern int Abc_NtkGetMultiRefNum( Abc_Ntk_t * pNtk );
370 Abc_Print( 1," lev =%3d", Abc_AigLevel(pNtk) );
371// Abc_Print( 1," ff = %5d", Abc_NtkNodeNum(pNtk) + 2 * (Abc_NtkCoNum(pNtk)+Abc_NtkGetMultiRefNum(pNtk)) );
372// Abc_Print( 1," var = %5d", Abc_NtkCiNum(pNtk) + Abc_NtkCoNum(pNtk)+Abc_NtkGetMultiRefNum(pNtk) );
373 }
374 else
375 Abc_Print( 1," lev = %d", Abc_NtkLevel(pNtk) );
376 if ( pNtk->nBarBufs2 )
377 Abc_Print( 1," buf = %d", pNtk->nBarBufs2 );
378 if ( fUseLutLib && Abc_FrameReadLibLut() )
379 Abc_Print( 1," delay =%5.2f", Abc_NtkDelayTraceLut(pNtk, 1) );
380 if ( fUseLutLib && Abc_FrameReadLibLut() )
381 Abc_Print( 1," area =%5.2f", Abc_NtkGetArea(pNtk) );
382 if ( fPower )
383 Abc_Print( 1," power =%7.2f", Abc_NtkMfsTotalSwitching(pNtk) );
384 if ( fGlitch )
385 {
386 if ( Abc_NtkIsLogic(pNtk) && Abc_NtkGetFaninMax(pNtk) <= 6 )
387 Abc_Print( 1," glitch =%7.2f %%", Abc_NtkMfsTotalGlitching(pNtk, 4000, 8, 0) );
388 else
389 printf( "\nCurrently computes glitching only for K-LUT networks with K <= 6." );
390 }
391 if ( fPrintMem )
392 Abc_Print( 1," mem =%5.2f MB", Abc_NtkMemory(pNtk)/(1<<20) );
393 Abc_Print( 1,"\n" );
394/*
395 // print the statistic into a file
396 if ( fDumpResult )
397 {
398 FILE * pTable = fopen( "abcstats.txt", "a+" );
399 fprintf( pTable, "%s ", pNtk->pName );
400 fprintf( pTable, "%d ", Abc_NtkPiNum(pNtk) );
401 fprintf( pTable, "%d ", Abc_NtkPoNum(pNtk) );
402 fprintf( pTable, "%d ", Abc_NtkNodeNum(pNtk) );
403 fprintf( pTable, "%d ", Abc_NtkGetTotalFanins(pNtk) );
404 fprintf( pTable, "%d ", Abc_NtkLevel(pNtk) );
405 fprintf( pTable, "\n" );
406 fclose( pTable );
407 }
408*/
409
410/*
411 {
412 FILE * pTable;
413 pTable = fopen( "ibm/seq_stats.txt", "a+" );
414// fprintf( pTable, "%s ", pNtk->pName );
415// fprintf( pTable, "%d ", Abc_NtkPiNum(pNtk) );
416// fprintf( pTable, "%d ", Abc_NtkPoNum(pNtk) );
417 fprintf( pTable, "%d ", Abc_NtkNodeNum(pNtk) );
418 fprintf( pTable, "%d ", Abc_NtkLatchNum(pNtk) );
419 fprintf( pTable, "%d ", Abc_NtkLevel(pNtk) );
420 fprintf( pTable, "\n" );
421 fclose( pTable );
422 }
423*/
424
425/*
426 // print the statistic into a file
427 {
428 FILE * pTable;
429 pTable = fopen( "x/stats_new.txt", "a+" );
430 fprintf( pTable, "%s ", pNtk->pName );
431// fprintf( pTable, "%d ", Abc_NtkPiNum(pNtk) );
432// fprintf( pTable, "%d ", Abc_NtkPoNum(pNtk) );
433// fprintf( pTable, "%d ", Abc_NtkLevel(pNtk) );
434// fprintf( pTable, "%d ", Abc_NtkNodeNum(pNtk) );
435// fprintf( pTable, "%d ", Abc_NtkGetTotalFanins(pNtk) );
436// fprintf( pTable, "%d ", Abc_NtkLatchNum(pNtk) );
437// fprintf( pTable, "%.2f ", (float)(s_MappingMem)/(float)(1<<20) );
438 fprintf( pTable, "%.2f", (float)(s_MappingTime)/(float)(CLOCKS_PER_SEC) );
439// fprintf( pTable, "%.2f", (float)(s_ResynTime)/(float)(CLOCKS_PER_SEC) );
440 fprintf( pTable, "\n" );
441 fclose( pTable );
442
443 s_ResynTime = 0;
444 }
445*/
446
447/*
448 // print the statistic into a file
449 {
450 static int Counter = 0;
451 extern int timeRetime;
452 FILE * pTable;
453 Counter++;
454 pTable = fopen( "d/stats.txt", "a+" );
455 fprintf( pTable, "%s ", pNtk->pName );
456// fprintf( pTable, "%d ", Abc_NtkPiNum(pNtk) );
457// fprintf( pTable, "%d ", Abc_NtkPoNum(pNtk) );
458// fprintf( pTable, "%d ", Abc_NtkLatchNum(pNtk) );
459 fprintf( pTable, "%d ", Abc_NtkNodeNum(pNtk) );
460 fprintf( pTable, "%.2f ", (float)(timeRetime)/(float)(CLOCKS_PER_SEC) );
461 fprintf( pTable, "\n" );
462 fclose( pTable );
463 }
464
465
466 s_TotalNodes += Abc_NtkNodeNum(pNtk);
467 printf( "Total nodes = %6d %6.2f MB Changes = %6d.\n",
468 s_TotalNodes, s_TotalNodes * 20.0 / (1<<20), s_TotalChanges );
469*/
470
471// if ( Abc_NtkHasSop(pNtk) )
472// printf( "The total number of cube pairs = %d.\n", Abc_NtkGetCubePairNum(pNtk) );
473
474 if ( 0 )
475 {
476 FILE * pTable = fopen( "stats.txt", "a+" );
477 if ( Abc_NtkIsStrash(pNtk) )
478 fprintf( pTable, "%s ", pNtk->pName );
479 fprintf( pTable, "%d ", Abc_NtkNodeNum(pNtk) );
480 fclose( pTable );
481 }
482
483 fflush( stdout );
484 if ( pNtk->pExdc )
485 Abc_NtkPrintStats( pNtk->pExdc, fFactored, fSaveBest, fDumpResult, fUseLutLib, fPrintMuxes, fPower, fGlitch, fSkipBuf, fSkipSmall, fPrintMem );
486}
double Abc_NtkMemory(Abc_Ntk_t *p)
Definition abcPrint.c:135
float Abc_NtkGetArea(Abc_Ntk_t *pNtk)
Definition abcPrint.c:210
int Abc_NtkCompareAndSaveBest(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition abcPrint.c:69
void Abc_NtkPrintStats(Abc_Ntk_t *pNtk, int fFactored, int fSaveBest, int fDumpResult, int fUseLutLib, int fPrintMuxes, int fPower, int fGlitch, int fSkipBuf, int fSkipSmall, int fPrintMem)
Definition abcPrint.c:269
float Abc_NtkMfsTotalGlitching(Abc_Ntk_t *pNtk, int nPats, int Prob, int fVerbose)
Definition abcPrint.c:1942
float Abc_NtkMfsTotalSwitching(Abc_Ntk_t *pNtk)
Definition abcPrint.c:163
int Abc_NtkCountMuxes(Abc_Ntk_t *pNtk)
Definition abcUtil.c:1377
int Abc_NtkGetMultiRefNum(Abc_Ntk_t *pNtk)
Definition abcUtil.c:225
ABC_DLL int Abc_NtkGetBufNum(Abc_Ntk_t *pNtk)
Definition abcUtil.c:423
ABC_DLL int Abc_NtkGetLitNum(Abc_Ntk_t *pNtk)
Definition abcUtil.c:172
ABC_DLL int Abc_NtkGetLitFactNum(Abc_Ntk_t *pNtk)
Definition abcUtil.c:196
ABC_DLL double Abc_NtkGetMappedArea(Abc_Ntk_t *pNtk)
Definition abcUtil.c:347
ABC_DLL int Abc_NtkGetExorNum(Abc_Ntk_t *pNtk)
Definition abcUtil.c:383
ABC_DLL float Abc_NtkDelayTraceLut(Abc_Ntk_t *pNtk, int fUseLutLib)
Definition abcSpeedup.c:100
ABC_DLL int Abc_NtkGetBddNodeNum(Abc_Ntk_t *pNtk)
Definition abcUtil.c:247
ABC_DLL int Abc_NtkGetAigNodeNum(Abc_Ntk_t *pNtk)
Definition abcUtil.c:276
ABC_DLL int Abc_NtkGetLargeNodeNum(Abc_Ntk_t *pNtk)
Definition abcUtil.c:443
ABC_DLL int Abc_NtkGetCubeNum(Abc_Ntk_t *pNtk)
Definition abcUtil.c:117
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkReadDefaultArrival()

ABC_DLL Abc_Time_t * Abc_NtkReadDefaultArrival ( Abc_Ntk_t * pNtk)
extern

FUNCTION DEFINITIONS ///.

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

Synopsis [Reads the arrival.required time of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 75 of file abcTiming.c.

76{
77 assert( pNtk->pManTime );
78 return &pNtk->pManTime->tArrDef;
79}
Here is the caller graph for this function:

◆ Abc_NtkReadDefaultArrivalWorst()

ABC_DLL float Abc_NtkReadDefaultArrivalWorst ( Abc_Ntk_t * pNtk)
extern

Definition at line 95 of file abcTiming.c.

96{
97 return 0.5 * pNtk->pManTime->tArrDef.Rise + 0.5 * pNtk->pManTime->tArrDef.Fall;
98}

◆ Abc_NtkReadDefaultInputDrive()

ABC_DLL Abc_Time_t * Abc_NtkReadDefaultInputDrive ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Reads the input drive / output load of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 131 of file abcTiming.c.

132{
133 assert( pNtk->pManTime );
134 return &pNtk->pManTime->tInDriveDef;
135}
Here is the caller graph for this function:

◆ Abc_NtkReadDefaultOutputLoad()

ABC_DLL Abc_Time_t * Abc_NtkReadDefaultOutputLoad ( Abc_Ntk_t * pNtk)
extern

Definition at line 136 of file abcTiming.c.

137{
138 assert( pNtk->pManTime );
139 return &pNtk->pManTime->tOutLoadDef;
140}
Here is the caller graph for this function:

◆ Abc_NtkReadDefaultRequired()

ABC_DLL Abc_Time_t * Abc_NtkReadDefaultRequired ( Abc_Ntk_t * pNtk)
extern

Definition at line 80 of file abcTiming.c.

81{
82 assert( pNtk->pManTime );
83 return &pNtk->pManTime->tReqDef;
84}
Here is the caller graph for this function:

◆ Abc_NtkReadDefaultRequiredWorst()

ABC_DLL float Abc_NtkReadDefaultRequiredWorst ( Abc_Ntk_t * pNtk)
extern

Definition at line 99 of file abcTiming.c.

100{
101 return 0.5 * pNtk->pManTime->tReqDef.Rise + 0.5 * pNtk->pManTime->tReqDef.Fall;
102}

◆ Abc_NtkReassignIds()

ABC_DLL void Abc_NtkReassignIds ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Puts the nodes into the DFS order and reassign their IDs.]

Description []

SideEffects []

SeeAlso []

Definition at line 1809 of file abcUtil.c.

1810{
1811 Vec_Ptr_t * vNodes;
1812 Vec_Ptr_t * vObjsNew;
1813 Abc_Obj_t * pNode, * pTemp, * pConst1;
1814 int i, k;
1815 assert( Abc_NtkIsStrash(pNtk) );
1816//printf( "Total = %d. Current = %d.\n", Abc_NtkObjNumMax(pNtk), Abc_NtkObjNum(pNtk) );
1817 // start the array of objects with new IDs
1818 vObjsNew = Vec_PtrAlloc( pNtk->nObjs );
1819 // put constant node first
1820 pConst1 = Abc_AigConst1(pNtk);
1821 assert( pConst1->Id == 0 );
1822 Vec_PtrPush( vObjsNew, pConst1 );
1823 // put PI nodes next
1824 Abc_NtkForEachPi( pNtk, pNode, i )
1825 {
1826 pNode->Id = Vec_PtrSize( vObjsNew );
1827 Vec_PtrPush( vObjsNew, pNode );
1828 }
1829 // put PO nodes next
1830 Abc_NtkForEachPo( pNtk, pNode, i )
1831 {
1832 pNode->Id = Vec_PtrSize( vObjsNew );
1833 Vec_PtrPush( vObjsNew, pNode );
1834 }
1835 // put latches and their inputs/outputs next
1836 Abc_NtkForEachBox( pNtk, pNode, i )
1837 {
1838 pNode->Id = Vec_PtrSize( vObjsNew );
1839 Vec_PtrPush( vObjsNew, pNode );
1840 Abc_ObjForEachFanin( pNode, pTemp, k )
1841 {
1842 pTemp->Id = Vec_PtrSize( vObjsNew );
1843 Vec_PtrPush( vObjsNew, pTemp );
1844 }
1845 Abc_ObjForEachFanout( pNode, pTemp, k )
1846 {
1847 pTemp->Id = Vec_PtrSize( vObjsNew );
1848 Vec_PtrPush( vObjsNew, pTemp );
1849 }
1850 }
1851 // finally, internal nodes in the DFS order
1852 vNodes = Abc_AigDfs( pNtk, 1, 0 );
1853 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
1854 {
1855 if ( pNode == pConst1 )
1856 continue;
1857 pNode->Id = Vec_PtrSize( vObjsNew );
1858 Vec_PtrPush( vObjsNew, pNode );
1859 }
1860 Vec_PtrFree( vNodes );
1861 assert( Vec_PtrSize(vObjsNew) == pNtk->nObjs );
1862
1863 // update the fanin/fanout arrays
1864 Abc_NtkForEachObj( pNtk, pNode, i )
1865 {
1866 Abc_ObjForEachFanin( pNode, pTemp, k )
1867 pNode->vFanins.pArray[k] = pTemp->Id;
1868 Abc_ObjForEachFanout( pNode, pTemp, k )
1869 pNode->vFanouts.pArray[k] = pTemp->Id;
1870 }
1871
1872 // replace the array of objs
1873 Vec_PtrFree( pNtk->vObjs );
1874 pNtk->vObjs = vObjsNew;
1875
1876 // rehash the AIG
1877 Abc_AigRehash( (Abc_Aig_t *)pNtk->pManFunc );
1878
1879 // update the name manager!!!
1880}
ABC_DLL Vec_Ptr_t * Abc_AigDfs(Abc_Ntk_t *pNtk, int fCollectAll, int fCollectCos)
Definition abcDfs.c:1198
ABC_DLL void Abc_AigRehash(Abc_Aig_t *pMan)
Definition abcAig.c:628
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkRecAdd3()

ABC_DLL void Abc_NtkRecAdd3 ( Abc_Ntk_t * pNtk,
int fUseSOPB )
extern

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

Synopsis [Top level procedure for library construction.]

Description []

SideEffects []

SeeAlso []

Definition at line 833 of file abcRec3.c.

834{
835 extern Abc_Ntk_t * Abc_NtkIf( Abc_Ntk_t * pNtk, If_Par_t * pPars );
836 If_Par_t Pars, * pPars = &Pars;
837 Abc_Ntk_t * pNtkNew;
838 int clk = Abc_Clock();
839 if ( Abc_NtkGetChoiceNum( pNtk ) )
840 printf( "Performing recoding structures with choices.\n" );
841 // remember that the manager was used for library construction
842 s_pMan3->fLibConstr = 1;
843 // create hash table if not available
844 if ( s_pMan3->pGia && Vec_IntSize(&s_pMan3->pGia->vHTable) == 0 )
845 Gia_ManHashStart( s_pMan3->pGia );
846
847 // set defaults
848 memset( pPars, 0, sizeof(If_Par_t) );
849 // user-controlable paramters
850 pPars->nLutSize = s_pMan3->nVars;
851 pPars->nCutsMax = s_pMan3->nCuts;
852 pPars->DelayTarget = -1;
853 pPars->Epsilon = (float)0.005;
854 pPars->fArea = 1;
855 // internal parameters
856 if ( fUseSOPB )
857 {
858 pPars->fTruth = 1;
859 pPars->fCutMin = 0;
860 pPars->fUsePerm = 1;
861 pPars->fDelayOpt = 1;
862 }
863 else
864 {
865 pPars->fTruth = 1;
866 pPars->fCutMin = 1;
867 pPars->fUsePerm = 0;
868 pPars->fDelayOpt = 0;
869 }
870 pPars->fSkipCutFilter = 0;
871 pPars->pFuncCost = NULL;
873 // perform recording
874 pNtkNew = Abc_NtkIf( pNtk, pPars );
875 Abc_NtkDelete( pNtkNew );
876s_pMan3->timeTotal += Abc_Clock() - clk;
877}
int Abc_NtkRecAddCut3(If_Man_t *pIfMan, If_Obj_t *pRoot, If_Cut_t *pCut)
Definition abcRec3.c:691
Abc_Ntk_t * Abc_NtkIf(Abc_Ntk_t *pNtk, If_Par_t *pPars)
Definition abcIf.c:107
void Gia_ManHashStart(Gia_Man_t *p)
Definition giaHash.c:125
struct If_Par_t_ If_Par_t
Definition if.h:78
int fDelayOpt
Definition if.h:126
int fSkipCutFilter
Definition if.h:158
float Epsilon
Definition if.h:111
int fTruth
Definition if.h:160
int nLutSize
Definition if.h:104
int(* pFuncUser)(If_Man_t *, If_Obj_t *, If_Cut_t *)
Definition if.h:179
int nCutsMax
Definition if.h:105
float DelayTarget
Definition if.h:110
int fCutMin
Definition if.h:125
int(* pFuncCost)(If_Man_t *, If_Cut_t *)
Definition if.h:178
int fUsePerm
Definition if.h:161
int fArea
Definition if.h:118
Here is the call graph for this function:

◆ Abc_NtkRecGetGia3()

ABC_DLL Gia_Man_t * Abc_NtkRecGetGia3 ( )
extern

Definition at line 1399 of file abcRec3.c.

1400{
1401 abctime clk = Abc_Clock();
1402 printf( "Before normalizing: Library has %d classes and %d AIG subgraphs with %d AND nodes.\n",
1403 Vec_MemEntryNum(s_pMan3->vTtMem), Gia_ManPoNum(s_pMan3->pGia), Gia_ManAndNum(s_pMan3->pGia) );
1404 Lms_GiaNormalize( s_pMan3 );
1405 printf( "After normalizing: Library has %d classes and %d AIG subgraphs with %d AND nodes.\n",
1406 Vec_MemEntryNum(s_pMan3->vTtMem), Gia_ManPoNum(s_pMan3->pGia), Gia_ManAndNum(s_pMan3->pGia) );
1407 Abc_PrintTime( 1, "Normalization runtime", Abc_Clock() - clk );
1408 s_pMan3->fLibConstr = 0;
1409 return s_pMan3->pGia;
1410}
void Lms_GiaNormalize(Lms_Man_t *p)
Definition abcRec3.c:1277
Here is the call graph for this function:

◆ Abc_NtkRecInputNum3()

ABC_DLL int Abc_NtkRecInputNum3 ( )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 1391 of file abcRec3.c.

1392{
1393 return Gia_ManCiNum(s_pMan3->pGia);
1394}

◆ Abc_NtkRecIsRunning3()

ABC_DLL int Abc_NtkRecIsRunning3 ( )
extern

Definition at line 1395 of file abcRec3.c.

1396{
1397 return s_pMan3 != NULL;
1398}
Here is the caller graph for this function:

◆ Abc_NtkRecLibMerge3()

ABC_DLL void Abc_NtkRecLibMerge3 ( Gia_Man_t * pLib)
extern

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

Synopsis [Recanonicizes the library and add it to the current library.]

Description []

SideEffects []

SeeAlso []

Definition at line 567 of file abcRec3.c.

568{
569 int fCheck = 0;
570 Lms_Man_t * p = s_pMan3;
571 Gia_Man_t * pGia = p->pGia;
572 Vec_Str_t * vSupps;
573 char pCanonPerm[LMS_VAR_MAX];
574 unsigned uCanonPhase;
575 word * pTruth;
576 int i, k, Index, iFanin0, iFanin1, nLeaves;
577 Gia_Obj_t * pObjPo, * pDriver, * pTemp = NULL;
578 abctime clk, clk2 = Abc_Clock();
579
580 if ( Gia_ManCiNum(pLib) != Gia_ManCiNum(pGia) )
581 {
582 printf( "The number of Library inputs (%d) differs from the number of Gia inputs (%d).\n", Gia_ManCiNum(pLib), Gia_ManCiNum(pGia) );
583 return;
584 }
585 assert( Gia_ManCiNum(pLib) == Gia_ManCiNum(pGia) );
586
587 // create hash table if not available
588 if ( Vec_IntSize(&pGia->vHTable) == 0 )
589 Gia_ManHashStart( pGia );
590
591 // add AIG subgraphs
592 vSupps = Lms_GiaSuppSizes( pLib );
593 Gia_ManForEachCo( pLib, pObjPo, k )
594 {
595 // get support size
596 nLeaves = Vec_StrEntry(vSupps, k);
597 assert( nLeaves > 1 );
598
599 // compute the truth table
600clk = Abc_Clock();
601 pTruth = Gia_ObjComputeTruthTable( pLib, Gia_ObjFanin0(pObjPo) );
602p->timeTruth += Abc_Clock() - clk;
603 // semi-canonicize
604clk = Abc_Clock();
605 memcpy( p->pTemp1, pTruth, p->nWords * sizeof(word) );
606#ifdef LMS_USE_OLD_FORM
607 uCanonPhase = Kit_TruthSemiCanonicize( (unsigned *)p->pTemp1, (unsigned *)p->pTemp2, nLeaves, pCanonPerm );
608#else
609 uCanonPhase = Abc_TtCanonicize( p->pTemp1, nLeaves, pCanonPerm );
610#endif
611 Abc_TtStretch5( (unsigned *)p->pTemp1, nLeaves, p->nVars );
612p->timeCanon += Abc_Clock() - clk;
613 // pCanonPerm and uCanonPhase show what was the variable corresponding to each var in the current truth
614 if ( nLeaves == 2 && Abc_TtSupportSize(pTruth, 2) != 2 )
615 continue;
616
617clk = Abc_Clock();
618 // map cut leaves into elementary variables of GIA
619 for ( i = 0; i < nLeaves; i++ )
620 Gia_ManCi( pLib, pCanonPerm[i] )->Value = Abc_Var2Lit( Gia_ObjId(pGia, Gia_ManPi(pGia, i)), (uCanonPhase >> i) & 1 );
621 // build internal nodes
622 assert( Vec_IntSize(pLib->vTtNodes) > 0 );
623 Gia_ManForEachObjVec( pLib->vTtNodes, pLib, pTemp, i )
624 {
625 iFanin0 = Abc_LitNotCond( Gia_ObjFanin0(pTemp)->Value, Gia_ObjFaninC0(pTemp) );
626 iFanin1 = Abc_LitNotCond( Gia_ObjFanin1(pTemp)->Value, Gia_ObjFaninC1(pTemp) );
627 pTemp->Value = Gia_ManHashAnd( pGia, iFanin0, iFanin1 );
628 }
629p->timeBuild += Abc_Clock() - clk;
630
631 // check if this node is already driving a PO
632 assert( Gia_ObjIsAnd(pTemp) );
633 pDriver = Gia_ManObj(pGia, Abc_Lit2Var(pTemp->Value));
634 if ( pDriver->fMark1 )
635 {
636 p->nFilterSame++;
637 continue;
638 }
639 pDriver->fMark1 = 1;
640 // create output
641 Gia_ManAppendCo( pGia, Abc_LitNotCond( pTemp->Value, (uCanonPhase >> nLeaves) & 1 ) );
642
643 // verify truth table
644 if ( fCheck )
645 {
646clk = Abc_Clock();
647 pTemp = Gia_ManCo(pGia, Gia_ManCoNum(pGia)-1);
648 pTruth = Gia_ObjComputeTruthTable( pGia, Gia_ManCo(pGia, Gia_ManCoNum(pGia)-1) );
649p->timeCheck += Abc_Clock() - clk;
650 if ( memcmp( p->pTemp1, pTruth, p->nWords * sizeof(word) ) != 0 )
651 {
652
653 Kit_DsdPrintFromTruth( (unsigned *)pTruth, nLeaves ); printf( "\n" );
654 Kit_DsdPrintFromTruth( (unsigned *)p->pTemp1, nLeaves ); printf( "\n" );
655 printf( "Truth table verification has failed.\n" );
656
657 // drive PO with constant
658 Gia_ManPatchCoDriver( pGia, Gia_ManCoNum(pGia)-1, 0 );
659 // save truth table ID
660 Vec_IntPush( p->vTruthIds, -1 );
661 p->nFilterTruth++;
662 continue;
663 }
664 }
665
666clk = Abc_Clock();
667 // add the resulting truth table to the hash table
668 Index = Vec_MemHashInsert( p->vTtMem, p->pTemp1 );
669 // save truth table ID
670 Vec_IntPush( p->vTruthIds, Index );
671 assert( Gia_ManCoNum(pGia) == Vec_IntSize(p->vTruthIds) );
672 p->nAdded++;
673p->timeInsert += Abc_Clock() - clk;
674 }
675 Vec_StrFree( vSupps );
676p->timeTotal += Abc_Clock() - clk2;
677}
struct Lms_Man_t_ Lms_Man_t
DECLARATIONS ///.
Definition abcRec3.c:48
#define LMS_VAR_MAX
Definition abcRec3.c:31
Vec_Str_t * Lms_GiaSuppSizes(Gia_Man_t *p)
Definition abcRec3.c:215
unsigned Abc_TtCanonicize(word *pTruth, int nVars, char *pCanonPerm)
FUNCTION DECLARATIONS ///.
Definition dauCanon.c:1036
#define Gia_ManForEachObjVec(vVec, p, pObj, i)
Definition gia.h:1194
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
Definition giaHash.c:576
word * Gia_ObjComputeTruthTable(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition giaTruth.c:447
unsigned Kit_TruthSemiCanonicize(unsigned *pInOut, unsigned *pAux, int nVars, char *pCanonPerm)
Definition kitTruth.c:1657
void Kit_DsdPrintFromTruth(unsigned *pTruth, int nVars)
Definition kitDsd.c:491
Vec_Int_t * vTtNodes
Definition gia.h:230
Vec_Int_t vHTable
Definition gia.h:113
unsigned fMark1
Definition gia.h:86
int memcmp()
Here is the call graph for this function:

◆ Abc_NtkRecPs3()

ABC_DLL void Abc_NtkRecPs3 ( int fPrintLib)
extern

Definition at line 1411 of file abcRec3.c.

1412{
1413 Lms_ManPrint( s_pMan3 );
1414}
void Lms_ManPrint(Lms_Man_t *p)
Definition abcRec3.c:524
Here is the call graph for this function:

◆ Abc_NtkRecStart3()

ABC_DLL void Abc_NtkRecStart3 ( Gia_Man_t * p,
int nVars,
int nCuts,
int fFuncOnly,
int fVerbose )
extern

Definition at line 1415 of file abcRec3.c.

1416{
1417 assert( s_pMan3 == NULL );
1418 s_pMan3 = Lms_ManStart( p, nVars, nCuts, fFuncOnly, fVerbose );
1419}
Lms_Man_t * Lms_ManStart(Gia_Man_t *pGia, int nVars, int nCuts, int fFuncOnly, int fVerbose)
Definition abcRec3.c:305
Here is the call graph for this function:

◆ Abc_NtkRecStop3()

ABC_DLL void Abc_NtkRecStop3 ( )
extern

Definition at line 1421 of file abcRec3.c.

1422{
1423 assert( s_pMan3 != NULL );
1424 Lms_ManStop( s_pMan3 );
1425 s_pMan3 = NULL;
1426}
void Lms_ManStop(Lms_Man_t *p)
Definition abcRec3.c:363
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkRefactor()

ABC_DLL int Abc_NtkRefactor ( Abc_Ntk_t * pNtk,
int nNodeSizeMax,
int nMinSaved,
int nConeSizeMax,
int fUpdateLevel,
int fUseZeros,
int fUseDcs,
int fVerbose )
extern

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

Synopsis [Performs incremental resynthesis of the AIG.]

Description [Starting from each node, computes a reconvergence-driven cut, derives BDD of the cut function, constructs ISOP, factors the ISOP, and replaces the current implementation of the MFFC of the node by the new factored form, if the number of AIG nodes is reduced and the total number of levels of the AIG network is not increated. Returns the number of AIG nodes saved.]

SideEffects []

SeeAlso []

Definition at line 329 of file abcRefactor.c.

330{
331 extern int Dec_GraphUpdateNetwork( Abc_Obj_t * pRoot, Dec_Graph_t * pGraph, int fUpdateLevel, int nGain );
332 ProgressBar * pProgress;
333 Abc_ManRef_t * pManRef;
334 Abc_ManCut_t * pManCut;
335 Dec_Graph_t * pFForm;
336 Vec_Ptr_t * vFanins;
337 Abc_Obj_t * pNode;
338 abctime clk, clkStart = Abc_Clock();
339 int i, nNodes, RetValue = 1;
340
341 assert( Abc_NtkIsStrash(pNtk) );
342 // cleanup the AIG
344 // start the managers
345 pManCut = Abc_NtkManCutStart( nNodeSizeMax, nConeSizeMax, 2, 1000 );
346 pManRef = Abc_NtkManRefStart( nNodeSizeMax, nConeSizeMax, fUseDcs, fVerbose );
347 pManRef->vLeaves = Abc_NtkManCutReadCutLarge( pManCut );
348 // compute the reverse levels if level update is requested
349 if ( fUpdateLevel )
350 Abc_NtkStartReverseLevels( pNtk, 0 );
351
352 // resynthesize each node once
353 pManRef->nNodesBeg = Abc_NtkNodeNum(pNtk);
354 nNodes = Abc_NtkObjNumMax(pNtk);
355 pProgress = Extra_ProgressBarStart( stdout, nNodes );
356 Abc_NtkForEachNode( pNtk, pNode, i )
357 {
358 Extra_ProgressBarUpdate( pProgress, i, NULL );
359 // skip the constant node
360// if ( Abc_NodeIsConst(pNode) )
361// continue;
362 // skip persistant nodes
363 if ( Abc_NodeIsPersistant(pNode) )
364 continue;
365 // skip the nodes with many fanouts
366 if ( Abc_ObjFanoutNum(pNode) > 1000 )
367 continue;
368 // stop if all nodes have been tried once
369 if ( i >= nNodes )
370 break;
371 // compute a reconvergence-driven cut
372clk = Abc_Clock();
373 vFanins = Abc_NodeFindCut( pManCut, pNode, fUseDcs );
374pManRef->timeCut += Abc_Clock() - clk;
375 // evaluate this cut
376clk = Abc_Clock();
377 pFForm = Abc_NodeRefactor( pManRef, pNode, vFanins, nMinSaved, fUpdateLevel, fUseZeros, fUseDcs, fVerbose );
378pManRef->timeRes += Abc_Clock() - clk;
379 if ( pFForm == NULL )
380 continue;
381 // acceptable replacement found, update the graph
382clk = Abc_Clock();
383 if ( !Dec_GraphUpdateNetwork( pNode, pFForm, fUpdateLevel, pManRef->nLastGain ) )
384 {
385 Dec_GraphFree( pFForm );
386 RetValue = -1;
387 break;
388 }
389pManRef->timeNtk += Abc_Clock() - clk;
390 Dec_GraphFree( pFForm );
391 }
392 Extra_ProgressBarStop( pProgress );
393pManRef->timeTotal = Abc_Clock() - clkStart;
394 pManRef->nNodesEnd = Abc_NtkNodeNum(pNtk);
395
396 // print statistics of the manager
397 if ( fVerbose )
398 Abc_NtkManRefPrintStats( pManRef );
399 // delete the managers
400 Abc_NtkManCutStop( pManCut );
401 Abc_NtkManRefStop( pManRef );
402 // put the nodes into the DFS order and reassign their IDs
403 Abc_NtkReassignIds( pNtk );
404// Abc_AigCheckFaninOrder( pNtk->pManFunc );
405 if ( RetValue != -1 )
406 {
407 // fix the levels
408 if ( fUpdateLevel )
410 else
411 Abc_NtkLevel( pNtk );
412 // check
413 if ( !Abc_NtkCheck( pNtk ) )
414 {
415 printf( "Abc_NtkRefactor: The network check has failed.\n" );
416 return 0;
417 }
418 }
419 return RetValue;
420}
int Dec_GraphUpdateNetwork(Abc_Obj_t *pRoot, Dec_Graph_t *pGraph, int fUpdateLevel, int nGain)
Definition decAbc.c:240
struct Abc_ManRef_t_ Abc_ManRef_t
Dec_Graph_t * Abc_NodeRefactor(Abc_ManRef_t *p, Abc_Obj_t *pNode, Vec_Ptr_t *vFanins, int nMinSaved, int fUpdateLevel, int fUseZeros, int fUseDcs, int fVerbose)
void Abc_NtkManRefStop(Abc_ManRef_t *p)
Abc_ManRef_t * Abc_NtkManRefStart(int nNodeSizeMax, int nConeSizeMax, int fUseDcs, int fVerbose)
void Abc_NtkManRefPrintStats(Abc_ManRef_t *p)
ABC_DLL void Abc_NtkManCutStop(Abc_ManCut_t *p)
Definition abcReconv.c:623
ABC_DLL Vec_Ptr_t * Abc_NodeFindCut(Abc_ManCut_t *p, Abc_Obj_t *pRoot, int fContain)
Definition abcReconv.c:256
ABC_DLL Vec_Ptr_t * Abc_NtkManCutReadCutLarge(Abc_ManCut_t *p)
Definition abcReconv.c:644
ABC_DLL Abc_ManCut_t * Abc_NtkManCutStart(int nNodeSizeMax, int nConeSizeMax, int nNodeFanStop, int nConeFanStop)
Definition abcReconv.c:595
Vec_Ptr_t * vLeaves
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkRemoveDupFanins()

ABC_DLL int Abc_NtkRemoveDupFanins ( Abc_Ntk_t * pNtk)
extern

Definition at line 894 of file abcMinBase.c.

894{ return 0; }

◆ Abc_NtkRemoveSelfFeedLatches()

ABC_DLL int Abc_NtkRemoveSelfFeedLatches ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Replaces self-feeding latches by latches with constant inputs.]

Description []

SideEffects []

SeeAlso []

Definition at line 117 of file abcLatch.c.

118{
119 Abc_Obj_t * pLatch, * pConst1;
120 int i, Counter;
121 Counter = 0;
122 Abc_NtkForEachLatch( pNtk, pLatch, i )
123 {
124 if ( Abc_NtkLatchIsSelfFeed( pLatch ) )
125 {
126 if ( Abc_NtkIsStrash(pNtk) )
127 pConst1 = Abc_AigConst1(pNtk);
128 else
129 pConst1 = Abc_NtkCreateNodeConst1(pNtk);
130 Abc_ObjPatchFanin( Abc_ObjFanin0(pLatch), Abc_ObjFanin0(Abc_ObjFanin0(pLatch)), pConst1 );
131 Counter++;
132 }
133 }
134 return Counter;
135}
Here is the call graph for this function:

◆ Abc_NtkRestrash()

ABC_DLL Abc_Ntk_t * Abc_NtkRestrash ( Abc_Ntk_t * pNtk,
int fCleanup )
extern

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

◆ Abc_NtkRestrashZero()

ABC_DLL Abc_Ntk_t * Abc_NtkRestrashZero ( Abc_Ntk_t * pNtk,
int fCleanup )
extern

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

◆ Abc_NtkReverseTopoOrder()

ABC_DLL void Abc_NtkReverseTopoOrder ( Abc_Ntk_t * pNtk)
extern

Definition at line 2664 of file abcUtil.c.

2665{
2666 Abc_Obj_t * pObj;
2667 int i;
2668 assert( p->vTopo == NULL );
2669 p->vTopo = Vec_IntAlloc( 10 * Abc_NtkObjNumMax(p) );
2670 Vec_IntFill( p->vTopo, 2 * Abc_NtkObjNumMax(p), 0 );
2671 Abc_NtkForEachNode( p, pObj, i )
2672 {
2673 if ( Abc_NtkTopoHasBeg(pObj) )
2674 continue;
2675 Abc_NtkIncrementTravId( p );
2676 Abc_NtkReverseTopoOrder_rec( pObj, 1 );
2677 }
2678 printf( "Nodes = %d. Size = %d. Ratio = %f.\n",
2679 Abc_NtkNodeNum(p), Vec_IntSize(p->vTopo), 1.0*Vec_IntSize(p->vTopo)/Abc_NtkNodeNum(p) );
2680}
void Abc_NtkReverseTopoOrder_rec(Abc_Obj_t *pObj, int fThisIsPivot)
Definition abcUtil.c:2630
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkRewrite()

ABC_DLL int Abc_NtkRewrite ( Abc_Ntk_t * pNtk,
int fUpdateLevel,
int fUseZeros,
int fVerbose,
int fVeryVerbose,
int fPlaceEnable )
extern

FUNCTION DEFINITIONS ///.

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

Synopsis [Performs incremental rewriting of the AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 61 of file abcRewrite.c.

62{
63 extern int Dec_GraphUpdateNetwork( Abc_Obj_t * pRoot, Dec_Graph_t * pGraph, int fUpdateLevel, int nGain );
64 ProgressBar * pProgress;
65 Cut_Man_t * pManCut;
66 Rwr_Man_t * pManRwr;
67 Abc_Obj_t * pNode;
68// Vec_Ptr_t * vAddedCells = NULL, * vUpdatedNets = NULL;
69 Dec_Graph_t * pGraph;
70 int i, nNodes, nGain, fCompl, RetValue = 1;
71 abctime clk, clkStart = Abc_Clock();
72
73 assert( Abc_NtkIsStrash(pNtk) );
74 // cleanup the AIG
76/*
77 {
78 Vec_Vec_t * vParts;
79 vParts = Abc_NtkPartitionSmart( pNtk, 50, 1 );
80 Vec_VecFree( vParts );
81 }
82*/
83
84 // start placement package
85// if ( fPlaceEnable )
86// {
87// Abc_PlaceBegin( pNtk );
88// vAddedCells = Abc_AigUpdateStart( pNtk->pManFunc, &vUpdatedNets );
89// }
90
91 // start the rewriting manager
92 pManRwr = Rwr_ManStart( 0 );
93 if ( pManRwr == NULL )
94 return 0;
95 // compute the reverse levels if level update is requested
96 if ( fUpdateLevel )
98 // start the cut manager
99clk = Abc_Clock();
100 pManCut = Abc_NtkStartCutManForRewrite( pNtk );
101Rwr_ManAddTimeCuts( pManRwr, Abc_Clock() - clk );
102 pNtk->pManCut = pManCut;
103
104 if ( fVeryVerbose )
105 Rwr_ScoresClean( pManRwr );
106
107 // resynthesize each node once
108 pManRwr->nNodesBeg = Abc_NtkNodeNum(pNtk);
109 nNodes = Abc_NtkObjNumMax(pNtk);
110 pProgress = Extra_ProgressBarStart( stdout, nNodes );
111 Abc_NtkForEachNode( pNtk, pNode, i )
112 {
113 Extra_ProgressBarUpdate( pProgress, i, NULL );
114 // stop if all nodes have been tried once
115 if ( i >= nNodes )
116 break;
117 // skip persistant nodes
118 if ( Abc_NodeIsPersistant(pNode) )
119 continue;
120 // skip the nodes with many fanouts
121 if ( Abc_ObjFanoutNum(pNode) > 1000 )
122 continue;
123
124 // for each cut, try to resynthesize it
125 nGain = Rwr_NodeRewrite( pManRwr, pManCut, pNode, fUpdateLevel, fUseZeros, fPlaceEnable );
126 if ( !(nGain > 0 || (nGain == 0 && fUseZeros)) )
127 continue;
128 // if we end up here, a rewriting step is accepted
129
130 // get hold of the new subgraph to be added to the AIG
131 pGraph = (Dec_Graph_t *)Rwr_ManReadDecs(pManRwr);
132 fCompl = Rwr_ManReadCompl(pManRwr);
133
134 // reset the array of the changed nodes
135 if ( fPlaceEnable )
137
138 // complement the FF if needed
139 if ( fCompl ) Dec_GraphComplement( pGraph );
140clk = Abc_Clock();
141 if ( !Dec_GraphUpdateNetwork( pNode, pGraph, fUpdateLevel, nGain ) )
142 {
143 RetValue = -1;
144 break;
145 }
146Rwr_ManAddTimeUpdate( pManRwr, Abc_Clock() - clk );
147 if ( fCompl ) Dec_GraphComplement( pGraph );
148
149 // use the array of changed nodes to update placement
150// if ( fPlaceEnable )
151// Abc_PlaceUpdate( vAddedCells, vUpdatedNets );
152 }
153 Extra_ProgressBarStop( pProgress );
154Rwr_ManAddTimeTotal( pManRwr, Abc_Clock() - clkStart );
155 // print stats
156 pManRwr->nNodesEnd = Abc_NtkNodeNum(pNtk);
157 if ( fVerbose )
158 Rwr_ManPrintStats( pManRwr );
159// Rwr_ManPrintStatsFile( pManRwr );
160 if ( fVeryVerbose )
161 Rwr_ScoresReport( pManRwr );
162 // delete the managers
163 Rwr_ManStop( pManRwr );
164 Cut_ManStop( pManCut );
165 pNtk->pManCut = NULL;
166
167 // start placement package
168// if ( fPlaceEnable )
169// {
170// Abc_PlaceEnd( pNtk );
171// Abc_AigUpdateStop( pNtk->pManFunc );
172// }
173
174 // put the nodes into the DFS order and reassign their IDs
175 {
176// abctime clk = Abc_Clock();
177 Abc_NtkReassignIds( pNtk );
178// ABC_PRT( "time", Abc_Clock() - clk );
179 }
180// Abc_AigCheckFaninOrder( pNtk->pManFunc );
181 // fix the levels
182 if ( RetValue >= 0 )
183 {
184 if ( fUpdateLevel )
186 else
187 Abc_NtkLevel( pNtk );
188 // check
189 if ( !Abc_NtkCheck( pNtk ) )
190 {
191 printf( "Abc_NtkRewrite: The network check has failed.\n" );
192 return 0;
193 }
194 }
195 return RetValue;
196}
ABC_DLL void Abc_AigUpdateReset(Abc_Aig_t *pMan)
Definition abcAig.c:1477
void Cut_ManStop(Cut_Man_t *p)
Definition cutMan.c:124
void Rwr_ManAddTimeUpdate(Rwr_Man_t *p, abctime Time)
Definition rwrMan.c:277
Rwr_Man_t * Rwr_ManStart(int fPrecompute)
DECLARATIONS ///.
Definition rwrMan.c:47
void Rwr_ScoresClean(Rwr_Man_t *p)
Definition rwrEva.c:504
void Rwr_ManAddTimeCuts(Rwr_Man_t *p, abctime Time)
Definition rwrMan.c:261
void Rwr_ManAddTimeTotal(Rwr_Man_t *p, abctime Time)
Definition rwrMan.c:293
void Rwr_ScoresReport(Rwr_Man_t *p)
Definition rwrEva.c:550
int Rwr_ManReadCompl(Rwr_Man_t *p)
Definition rwrMan.c:245
void Rwr_ManPrintStats(Rwr_Man_t *p)
Definition rwrMan.c:143
struct Rwr_Man_t_ Rwr_Man_t
Definition rwr.h:47
void Rwr_ManStop(Rwr_Man_t *p)
Definition rwrMan.c:109
int Rwr_NodeRewrite(Rwr_Man_t *p, Cut_Man_t *pManCut, Abc_Obj_t *pNode, int fUpdateLevel, int fUseZeros, int fPlaceEnable)
FUNCTION DEFINITIONS ///.
Definition rwrEva.c:59
void * Rwr_ManReadDecs(Rwr_Man_t *p)
Definition rwrMan.c:213
void * pManCut
Definition abc.h:193
int nNodesBeg
Definition rwr.h:82
int nNodesEnd
Definition rwr.h:83
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkSaveCopy()

ABC_DLL Vec_Ptr_t * Abc_NtkSaveCopy ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Saves copy field of the objects.]

Description []

SideEffects []

SeeAlso []

Definition at line 628 of file abcUtil.c.

629{
630 Vec_Ptr_t * vCopies;
631 Abc_Obj_t * pObj;
632 int i;
633 vCopies = Vec_PtrStart( Abc_NtkObjNumMax(pNtk) );
634 Abc_NtkForEachObj( pNtk, pObj, i )
635 Vec_PtrWriteEntry( vCopies, i, pObj->pCopy );
636 return vCopies;
637}
Here is the caller graph for this function:

◆ Abc_NtkSetMvVarValues()

ABC_DLL void Abc_NtkSetMvVarValues ( Abc_Obj_t * pObj,
int nValues )
extern

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

Synopsis [Duplicate the MV variable.]

Description []

SideEffects []

SeeAlso []

Definition at line 87 of file abcBlifMv.c.

88{
89 Mem_Flex_t * pFlex;
90 struct temp
91 {
92 int nValues;
93 char ** pNames;
94 } * pVarStruct;
95 assert( nValues > 1 );
96 // skip binary signals
97 if ( nValues == 2 )
98 return;
99 // skip already assigned signals
100 if ( Abc_ObjMvVar(pObj) != NULL )
101 return;
102 // create the structure
103 pFlex = (Mem_Flex_t *)Abc_NtkMvVarMan( pObj->pNtk );
104 pVarStruct = (struct temp *)Mem_FlexEntryFetch( pFlex, sizeof(struct temp) );
105 pVarStruct->nValues = nValues;
106 pVarStruct->pNames = NULL;
107 Abc_ObjSetMvVar( pObj, pVarStruct );
108}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkSetNodeLevelsArrival()

ABC_DLL void Abc_NtkSetNodeLevelsArrival ( Abc_Ntk_t * pNtkOld)
extern

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

Synopsis [Sets the CI node levels according to the arrival info.]

Description []

SideEffects []

SeeAlso []

Definition at line 722 of file abcTiming.c.

723{
724 Abc_Obj_t * pNodeOld, * pNodeNew;
725 float tAndDelay;
726 int i;
727 if ( pNtkOld->pManTime == NULL )
728 return;
730 return;
732 Abc_NtkForEachCi( pNtkOld, pNodeOld, i )
733 {
734 pNodeNew = pNodeOld->pCopy;
735 pNodeNew->Level = (int)(Abc_NodeReadArrivalWorst(pNodeOld) / tAndDelay);
736 }
737}
float Mio_LibraryReadDelayNand2Max(Mio_Library_t *pLib)
Definition mioApi.c:62
Mio_Gate_t * Mio_LibraryReadNand2(Mio_Library_t *pLib)
Definition mioApi.c:53
Here is the call graph for this function:

◆ Abc_NtkShortNames()

ABC_DLL void Abc_NtkShortNames ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Replaces names by short names.]

Description []

SideEffects []

SeeAlso []

Definition at line 619 of file abcNames.c.

620{
621 Nm_ManFree( pNtk->pManName );
622 pNtk->pManName = Nm_ManCreate( Abc_NtkCiNum(pNtk) + Abc_NtkCoNum(pNtk) + Abc_NtkBoxNum(pNtk) );
626}
void Abc_NtkAddDummyPoNames(Abc_Ntk_t *pNtk)
Definition abcNames.c:521
void Abc_NtkAddDummyPiNames(Abc_Ntk_t *pNtk)
Definition abcNames.c:495
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkShow6VarFunc()

ABC_DLL void Abc_NtkShow6VarFunc ( char * pF0,
char * pF1 )
extern

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

Synopsis [Prints K-map of 6-var function represented by truth table.]

Description []

SideEffects []

SeeAlso []

Definition at line 2089 of file abcPrint.c.

2090{
2091 word F0, F1;
2092 if ( strlen(pF0) != 16 )
2093 {
2094 printf( "Wrong length (%d) of 6-var truth table.\n", (int)strlen(pF0) );
2095 return;
2096 }
2097 if ( strlen(pF1) != 16 )
2098 {
2099 printf( "Wrong length (%d) of 6-var truth table.\n", (int)strlen(pF1) );
2100 return;
2101 }
2102 Extra_ReadHexadecimal( (unsigned *)&F0, pF0, 6 );
2103 Extra_ReadHexadecimal( (unsigned *)&F1, pF1, 6 );
2104 Abc_Show6VarFunc( F0, F1 );
2105}
void Abc_Show6VarFunc(word F0, word F1)
Definition abcPrint.c:2007
int Extra_ReadHexadecimal(unsigned Sign[], char *pString, int nVars)
Here is the call graph for this function:

◆ Abc_NtkSizeOfGlobalBdds()

ABC_DLL int Abc_NtkSizeOfGlobalBdds ( Abc_Ntk_t * pNtk)
extern

◆ Abc_NtkSopToAig()

ABC_DLL int Abc_NtkSopToAig ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Converts the network from SOP to AIG representation.]

Description []

SideEffects []

SeeAlso []

Definition at line 884 of file abcFunc.c.

885{
886 Abc_Obj_t * pNode;
887 Hop_Man_t * pMan;
888 int i, Max;
889
890 assert( Abc_NtkHasSop(pNtk) );
891
892 // make dist1-free and SCC-free
893// Abc_NtkMakeLegit( pNtk );
894
895 // start the functionality manager
896 pMan = Hop_ManStart();
897 Max = Abc_NtkGetFaninMax(pNtk);
898 if ( Max ) Hop_IthVar( pMan, Max-1 );
899
900 // convert each node from SOP to BDD
901 Abc_NtkForEachNode( pNtk, pNode, i )
902 {
903 if ( Abc_ObjIsBarBuf(pNode) )
904 continue;
905 assert( pNode->pData );
906 pNode->pData = Abc_ConvertSopToAig( pMan, (char *)pNode->pData );
907 if ( pNode->pData == NULL )
908 {
909 Hop_ManStop( pMan );
910 printf( "Abc_NtkSopToAig: Error while converting SOP into AIG.\n" );
911 return 0;
912 }
913 }
914 Mem_FlexStop( (Mem_Flex_t *)pNtk->pManFunc, 0 );
915 pNtk->pManFunc = pMan;
916
917 // update the network type
918 pNtk->ntkFunc = ABC_FUNC_AIG;
919 return 1;
920}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkSopToBdd()

ABC_DLL int Abc_NtkSopToBdd ( Abc_Ntk_t * pNtk)
extern

Definition at line 865 of file abcFunc.c.

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

◆ Abc_NtkSortSops()

ABC_DLL void Abc_NtkSortSops ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Sorts fanins of each node to make SOPs more readable.]

Description []

SideEffects []

SeeAlso []

Definition at line 520 of file abcFanOrder.c.

521{
522 Abc_NtkSortCubes( pNtk, 1 );
524 Abc_NtkSortCubes( pNtk, 0 );
526 Abc_NtkSortCubes( pNtk, 0 );
527}
void Abc_NtkOrderFaninsByLitCount(Abc_Ntk_t *pNtk)
void Abc_NtkOrderFaninsByLitCountAndCubeCount(Abc_Ntk_t *pNtk)
void Abc_NtkSortCubes(Abc_Ntk_t *pNtk, int fWeight)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkStartFrom()

ABC_DLL Abc_Ntk_t * Abc_NtkStartFrom ( Abc_Ntk_t * pNtk,
Abc_NtkType_t Type,
Abc_NtkFunc_t Func )
extern

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

Synopsis [Starts a new network using existing network as a model.]

Description []

SideEffects []

SeeAlso []

Definition at line 157 of file abcNtk.c.

158{
159 Abc_Ntk_t * pNtkNew;
160 Abc_Obj_t * pObj;
161 int fCopyNames, i;
162 if ( pNtk == NULL )
163 return NULL;
164 // decide whether to copy the names
165 fCopyNames = ( Type != ABC_NTK_NETLIST );
166 // start the network
167 pNtkNew = Func == ABC_FUNC_BDD ? Abc_NtkAllocBdd( Type, Func, 1, Abc_NtkCiNum(pNtk) ) : Abc_NtkAlloc( Type, Func, 1 );
168 pNtkNew->nConstrs = pNtk->nConstrs;
169 pNtkNew->nBarBufs = pNtk->nBarBufs;
170 // duplicate the name and the spec
171 pNtkNew->pName = Extra_UtilStrsav(pNtk->pName);
172 pNtkNew->pSpec = Extra_UtilStrsav(pNtk->pSpec);
173 // clean the node copy fields
174 Abc_NtkCleanCopy( pNtk );
175 // map the constant nodes
176 if ( Abc_NtkIsStrash(pNtk) && Abc_NtkIsStrash(pNtkNew) )
177 Abc_AigConst1(pNtk)->pCopy = Abc_AigConst1(pNtkNew);
178 // clone CIs/CIs/boxes
179 Abc_NtkForEachPi( pNtk, pObj, i )
180 Abc_NtkDupObj( pNtkNew, pObj, fCopyNames );
181 Abc_NtkForEachPo( pNtk, pObj, i )
182 Abc_NtkDupObj( pNtkNew, pObj, fCopyNames );
183 Abc_NtkForEachBox( pNtk, pObj, i )
184 Abc_NtkDupBox( pNtkNew, pObj, fCopyNames );
185 // transfer logic level
186 Abc_NtkForEachCi( pNtk, pObj, i )
187 pObj->pCopy->Level = pObj->Level;
188 // transfer the names
189// Abc_NtkTrasferNames( pNtk, pNtkNew );
190 Abc_ManTimeDup( pNtk, pNtkNew );
191 if ( pNtk->vOnehots )
192 pNtkNew->vOnehots = (Vec_Ptr_t *)Vec_VecDupInt( (Vec_Vec_t *)pNtk->vOnehots );
193 if ( pNtk->pSeqModel )
194 pNtkNew->pSeqModel = Abc_CexDup( pNtk->pSeqModel, Abc_NtkLatchNum(pNtk) );
195 if ( pNtk->vObjPerm )
196 pNtkNew->vObjPerm = Vec_IntDup( pNtk->vObjPerm );
197 pNtkNew->AndGateDelay = pNtk->AndGateDelay;
198 if ( pNtkNew->pManTime && Abc_FrameReadLibGen() && pNtkNew->AndGateDelay == 0.0 )
200 // initialize logic level of the CIs
201 if ( pNtk->AndGateDelay != 0.0 && pNtk->pManTime != NULL && pNtk->ntkType != ABC_NTK_STRASH && Type == ABC_NTK_STRASH )
202 {
203 Abc_NtkForEachCi( pNtk, pObj, i )
204 pObj->pCopy->Level = (int)(Abc_MaxFloat(0, Abc_NodeReadArrivalWorst(pObj)) / pNtk->AndGateDelay);
205 }
206 // check that the CI/CO/latches are copied correctly
207 assert( Abc_NtkCiNum(pNtk) == Abc_NtkCiNum(pNtkNew) );
208 assert( Abc_NtkCoNum(pNtk) == Abc_NtkCoNum(pNtkNew) );
209 assert( Abc_NtkLatchNum(pNtk) == Abc_NtkLatchNum(pNtkNew) );
210 return pNtkNew;
211}
Abc_Ntk_t * Abc_NtkAllocBdd(Abc_NtkType_t Type, Abc_NtkFunc_t Func, int fUseMemMan, int nVars)
Definition abcNtk.c:99
ABC_DLL void Abc_ManTimeDup(Abc_Ntk_t *pNtkOld, Abc_Ntk_t *pNtkNew)
Definition abcTiming.c:573
float Mio_LibraryReadDelayAigNode(Mio_Library_t *pLib)
Definition mioApi.c:64
Abc_Cex_t * Abc_CexDup(Abc_Cex_t *p, int nRegsNew)
Definition utilCex.c:145
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkStartFromNoLatches()

ABC_DLL Abc_Ntk_t * Abc_NtkStartFromNoLatches ( Abc_Ntk_t * pNtk,
Abc_NtkType_t Type,
Abc_NtkFunc_t Func )
extern

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

Synopsis [Starts a new network using existing network as a model.]

Description []

SideEffects []

SeeAlso []

Definition at line 301 of file abcNtk.c.

302{
303 Abc_Ntk_t * pNtkNew;
304 Abc_Obj_t * pObj;
305 int i;
306 if ( pNtk == NULL )
307 return NULL;
308 assert( Type != ABC_NTK_NETLIST );
309 // start the network
310 pNtkNew = Abc_NtkAlloc( Type, Func, 1 );
311 pNtkNew->nConstrs = pNtk->nConstrs;
312 pNtkNew->nBarBufs = pNtk->nBarBufs;
313 // duplicate the name and the spec
314 pNtkNew->pName = Extra_UtilStrsav(pNtk->pName);
315 pNtkNew->pSpec = Extra_UtilStrsav(pNtk->pSpec);
316 // clean the node copy fields
317 Abc_NtkCleanCopy( pNtk );
318 // map the constant nodes
319 if ( Abc_NtkIsStrash(pNtk) && Abc_NtkIsStrash(pNtkNew) )
320 Abc_AigConst1(pNtk)->pCopy = Abc_AigConst1(pNtkNew);
321 // clone CIs/CIs/boxes
322 Abc_NtkForEachPi( pNtk, pObj, i )
323 Abc_NtkDupObj( pNtkNew, pObj, 1 );
324 Abc_NtkForEachPo( pNtk, pObj, i )
325 Abc_NtkDupObj( pNtkNew, pObj, 1 );
326 Abc_NtkForEachBox( pNtk, pObj, i )
327 {
328 if ( Abc_ObjIsLatch(pObj) )
329 continue;
330 Abc_NtkDupBox(pNtkNew, pObj, 1);
331 }
332 if ( pNtk->vObjPerm )
333 pNtkNew->vObjPerm = Vec_IntDup( pNtk->vObjPerm );
334 pNtkNew->AndGateDelay = pNtk->AndGateDelay;
335 // transfer the names
336// Abc_NtkTrasferNamesNoLatches( pNtk, pNtkNew );
337 Abc_ManTimeDup( pNtk, pNtkNew );
338 // check that the CI/CO/latches are copied correctly
339 assert( Abc_NtkPiNum(pNtk) == Abc_NtkPiNum(pNtkNew) );
340 assert( Abc_NtkPoNum(pNtk) == Abc_NtkPoNum(pNtkNew) );
341 return pNtkNew;
342}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkStartMvVars()

ABC_DLL void Abc_NtkStartMvVars ( Abc_Ntk_t * pNtk)
extern

DECLARATIONS ///.

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

FileName [abcBlifMv.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Network and node package.]

Synopsis [Procedures to process BLIF-MV networks and AIGs.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

] FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis [Starts the Mv-Var manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 49 of file abcBlifMv.c.

50{
51 Vec_Att_t * pAttMan;
52 assert( Abc_NtkMvVar(pNtk) == NULL );
53 pAttMan = Vec_AttAlloc( Abc_NtkObjNumMax(pNtk) + 1, Mem_FlexStart(), (void(*)(void*))Mem_FlexStop, NULL, NULL );
54 Vec_PtrWriteEntry( pNtk->vAttrs, VEC_ATTR_MVVAR, pAttMan );
55//printf( "allocing attr\n" );
56}
@ VEC_ATTR_MVVAR
Definition vecAtt.h:52
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkStartNameIds()

ABC_DLL void Abc_NtkStartNameIds ( Abc_Ntk_t * p)
extern

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

Synopsis [Saves name IDs into a file.]

Description []

SideEffects []

SeeAlso []

Definition at line 711 of file abcNames.c.

712{
713 char pFileName[1000];
714 FILE * pFile;
715 Abc_Obj_t * pObj, * pFanin;
716 Vec_Ptr_t * vNodes;
717 int i, Counter = 1;
718 assert( Abc_NtkIsNetlist(p) );
719 assert( p->vNameIds == NULL );
720 assert( strlen(p->pSpec) < 1000 );
721 sprintf( pFileName, "%s_%s_names.txt", Extra_FileNameGenericAppend(p->pSpec,""), Extra_FileNameExtension(p->pSpec) );
722 pFile = fopen( pFileName, "wb" );
723 p->vNameIds = Vec_IntStart( Abc_NtkObjNumMax(p) );
724 // add inputs
725 Abc_NtkForEachCi( p, pObj, i )
726 fprintf( pFile, "%s \n", Abc_ObjName(Abc_ObjFanout0(pObj)) ), Vec_IntWriteEntry(p->vNameIds, Abc_ObjId(pObj), 2*Counter++);
727 // add outputs
728 Abc_NtkForEachCo( p, pObj, i )
729 {
730 pFanin = Abc_ObjFanin0(Abc_ObjFanin0(pObj));
731 if ( !Vec_IntEntry(p->vNameIds, Abc_ObjId(pFanin)) )
732 fprintf( pFile, "%s \n", Abc_ObjName(Abc_ObjFanout0(pFanin)) ), Vec_IntWriteEntry(p->vNameIds, Abc_ObjId(pFanin), 2*Counter++);
733 }
734 // add nodes in a topo order
735 vNodes = Abc_NtkDfs( p, 1 );
736 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
737 if ( !Vec_IntEntry(p->vNameIds, Abc_ObjId(pObj)) )
738 fprintf( pFile, "%s \n", Abc_ObjName(Abc_ObjFanout0(pObj)) ), Vec_IntWriteEntry(p->vNameIds, Abc_ObjId(pObj), 2*Counter++);
739 Vec_PtrFree( vNodes );
740 fclose( pFile );
741 // transfer driver node names to COs
742 Abc_NtkForEachCo( p, pObj, i )
743 {
744 pFanin = Abc_ObjFanin0(Abc_ObjFanin0(pObj));
745 Vec_IntWriteEntry( p->vNameIds, Abc_ObjId(pObj), Vec_IntEntry(p->vNameIds, Abc_ObjId(pFanin)) );
746 Vec_IntWriteEntry( p->vNameIds, Abc_ObjId(pFanin), 0 );
747 }
748}
char * Extra_FileNameGenericAppend(char *pBase, char *pSuffix)
char * Extra_FileNameExtension(char *FileName)
Here is the call graph for this function:

◆ Abc_NtkStartRead()

ABC_DLL Abc_Ntk_t * Abc_NtkStartRead ( char * pName)
extern

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

Synopsis [Starts a new network using existing network as a model.]

Description []

SideEffects []

SeeAlso []

Definition at line 386 of file abcNtk.c.

387{
388 Abc_Ntk_t * pNtkNew;
389 // allocate the empty network
391 // set the specs
392 pNtkNew->pName = Extra_FileNameGeneric(pName);
393 pNtkNew->pSpec = Extra_UtilStrsav(pName);
394 if ( pNtkNew->pName == NULL || strlen(pNtkNew->pName) == 0 )
395 {
396 ABC_FREE( pNtkNew->pName );
397 pNtkNew->pName = Extra_UtilStrsav("unknown");
398 }
399 return pNtkNew;
400}
char * Extra_FileNameGeneric(char *FileName)
Here is the call graph for this function:

◆ Abc_NtkStartReverseLevels()

ABC_DLL void Abc_NtkStartReverseLevels ( Abc_Ntk_t * pNtk,
int nMaxLevelIncrease )
extern

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

Synopsis [Prepares for the computation of required levels.]

Description [This procedure should be called before the required times are used. It starts internal data structures, which records the level from the COs of the network nodes in reverse topologogical order.]

SideEffects []

SeeAlso []

Definition at line 1274 of file abcTiming.c.

1275{
1276 Vec_Ptr_t * vNodes;
1277 Abc_Obj_t * pObj;
1278 int i;
1279 // remember the maximum number of direct levels
1280 pNtk->LevelMax = Abc_NtkLevel(pNtk) + nMaxLevelIncrease;
1281 // start the reverse levels
1282 pNtk->vLevelsR = Vec_IntAlloc( 0 );
1283 Vec_IntFill( pNtk->vLevelsR, 1 + Abc_NtkObjNumMax(pNtk), 0 );
1284 // compute levels in reverse topological order
1285 vNodes = Abc_NtkDfsReverse( pNtk );
1286 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
1288 Vec_PtrFree( vNodes );
1289}
void Abc_ObjSetReverseLevel(Abc_Obj_t *pObj, int LevelR)
Definition abcTiming.c:1253
int Abc_ObjReverseLevelNew(Abc_Obj_t *pObj)
Definition abcTiming.c:1190
int LevelMax
Definition abc.h:195
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkStopReverseLevels()

ABC_DLL void Abc_NtkStopReverseLevels ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Cleans the data structures used to compute required levels.]

Description []

SideEffects []

SeeAlso []

Definition at line 1302 of file abcTiming.c.

1303{
1304 assert( pNtk->vLevelsR );
1305 Vec_IntFree( pNtk->vLevelsR );
1306 pNtk->vLevelsR = NULL;
1307 pNtk->LevelMax = 0;
1308
1309}
Here is the caller graph for this function:

◆ Abc_NtkStrash()

ABC_DLL Abc_Ntk_t * Abc_NtkStrash ( Abc_Ntk_t * pNtk,
int fAllNodes,
int fCleanup,
int fRecord )
extern

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_NtkStrashBlifMv()

ABC_DLL Abc_Ntk_t * Abc_NtkStrashBlifMv ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Strashes the BLIF-MV netlist.]

Description []

SideEffects []

SeeAlso []

Definition at line 383 of file abcBlifMv.c.

384{
385 int fUsePositional = 0;
386 Vec_Ptr_t * vNodes;
387 Abc_Obj_t ** pBits;
388 Abc_Obj_t ** pValues;
389 Abc_Ntk_t * pNtkNew;
390 Abc_Obj_t * pObj, * pTemp, * pBit, * pNet;
391 int i, k, v, nValues, nValuesMax, nBits;
392 int nCount1, nCount2;
393
394 assert( Abc_NtkIsNetlist(pNtk) );
395 assert( Abc_NtkHasBlifMv(pNtk) );
396 assert( Abc_NtkWhiteboxNum(pNtk) == 0 );
397 assert( Abc_NtkBlackboxNum(pNtk) == 0 );
398
399 // get the largest number of values
400 nValuesMax = 2;
401 Abc_NtkForEachNet( pNtk, pObj, i )
402 {
403 nValues = Abc_ObjMvVarNum(pObj);
404 if ( nValuesMax < nValues )
405 nValuesMax = nValues;
406 }
407 nBits = Abc_Base2Log( nValuesMax );
408 pBits = ABC_ALLOC( Abc_Obj_t *, nBits );
409
410 // clean the node copy fields
411 Abc_NtkCleanCopy( pNtk );
412 // collect the nodes
413 vNodes = Abc_NtkDfs( pNtk, 0 );
414
415 // start the network
417 // duplicate the name and the spec
418 pNtkNew->pName = Extra_UtilStrsav( pNtk->pName );
419// pNtkNew->pSpec = Extra_UtilStrsav( pNtk->pName );
420
421 nCount1 = nCount2 = 0;
422 // encode the CI nets
423 Abc_NtkIncrementTravId( pNtk );
424 if ( fUsePositional )
425 {
426 Abc_NtkForEachCi( pNtk, pObj, i )
427 {
428 if ( !Abc_ObjIsPi(pObj) )
429 continue;
430 pNet = Abc_ObjFanout0(pObj);
431 nValues = Abc_ObjMvVarNum(pNet);
432 pValues = ABC_ALLOC( Abc_Obj_t *, nValues );
433 // create PIs for the values
434 for ( v = 0; v < nValues; v++ )
435 {
436 pValues[v] = Abc_NtkCreatePi( pNtkNew );
437 if ( nValuesMax == 2 )
438 Abc_ObjAssignName( pValues[v], Abc_ObjName(pNet), NULL );
439 else
440 Abc_NtkConvertAssignName( pValues[v], pNet, v );
441 }
442 // save the values in the fanout net
443 pNet->pCopy = (Abc_Obj_t *)pValues;
444 // mark the net
445 Abc_NodeSetTravIdCurrent( pNet );
446 }
447 Abc_NtkForEachCi( pNtk, pObj, i )
448 {
449 if ( Abc_ObjIsPi(pObj) )
450 continue;
451 pNet = Abc_ObjFanout0(pObj);
452 nValues = Abc_ObjMvVarNum(pNet);
453 pValues = ABC_ALLOC( Abc_Obj_t *, nValues );
454 // create PIs for the values
455 for ( v = 0; v < nValues; v++ )
456 {
457 pValues[v] = Abc_NtkCreateBo( pNtkNew );
458 if ( nValuesMax == 2 )
459 Abc_ObjAssignName( pValues[v], Abc_ObjName(pNet), NULL );
460 else
461 Abc_NtkConvertAssignName( pValues[v], pNet, v );
462 nCount1++;
463 }
464 // save the values in the fanout net
465 pNet->pCopy = (Abc_Obj_t *)pValues;
466 // mark the net
467 Abc_NodeSetTravIdCurrent( pNet );
468 }
469 }
470 else
471 {
472 Abc_NtkForEachCi( pNtk, pObj, i )
473 {
474 if ( !Abc_ObjIsPi(pObj) )
475 continue;
476 pNet = Abc_ObjFanout0(pObj);
477 nValues = Abc_ObjMvVarNum(pNet);
478 pValues = ABC_ALLOC( Abc_Obj_t *, nValues );
479 // create PIs for the encoding bits
480 nBits = Abc_Base2Log( nValues );
481 for ( k = 0; k < nBits; k++ )
482 {
483 pBits[k] = Abc_NtkCreatePi( pNtkNew );
484 if ( nValuesMax == 2 )
485 Abc_ObjAssignName( pBits[k], Abc_ObjName(pNet), NULL );
486 else
487 Abc_NtkConvertAssignName( pBits[k], pNet, k );
488 }
489 // encode the values
490 for ( v = 0; v < nValues; v++ )
491 {
492 pValues[v] = Abc_AigConst1(pNtkNew);
493 for ( k = 0; k < nBits; k++ )
494 {
495 pBit = Abc_ObjNotCond( pBits[k], (v&(1<<k)) == 0 );
496 pValues[v] = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, pValues[v], pBit );
497 }
498 }
499 // save the values in the fanout net
500 pNet->pCopy = (Abc_Obj_t *)pValues;
501 // mark the net
502 Abc_NodeSetTravIdCurrent( pNet );
503 }
504 Abc_NtkForEachCi( pNtk, pObj, i )
505 {
506 if ( Abc_ObjIsPi(pObj) )
507 continue;
508 pNet = Abc_ObjFanout0(pObj);
509 nValues = Abc_ObjMvVarNum(pNet);
510 pValues = ABC_ALLOC( Abc_Obj_t *, nValues );
511 // create PIs for the encoding bits
512 nBits = Abc_Base2Log( nValues );
513 for ( k = 0; k < nBits; k++ )
514 {
515 pBits[k] = Abc_NtkCreateBo( pNtkNew );
516 if ( nValuesMax == 2 )
517 Abc_ObjAssignName( pBits[k], Abc_ObjName(pNet), NULL );
518 else
519 Abc_NtkConvertAssignName( pBits[k], pNet, k );
520 nCount1++;
521 }
522 // encode the values
523 for ( v = 0; v < nValues; v++ )
524 {
525 pValues[v] = Abc_AigConst1(pNtkNew);
526 for ( k = 0; k < nBits; k++ )
527 {
528 pBit = Abc_ObjNotCond( pBits[k], (v&(1<<k)) == 0 );
529 pValues[v] = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, pValues[v], pBit );
530 }
531 }
532 // save the values in the fanout net
533 pNet->pCopy = (Abc_Obj_t *)pValues;
534 // mark the net
535 Abc_NodeSetTravIdCurrent( pNet );
536 }
537 }
538
539 // process nodes in the topological order
540 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
541 if ( !Abc_NodeStrashBlifMv( pNtkNew, pObj ) )
542 {
543 Abc_NtkDelete( pNtkNew );
544 return NULL;
545 }
546 Vec_PtrFree( vNodes );
547
548 // encode the CO nets
549 if ( fUsePositional )
550 {
551 Abc_NtkForEachCo( pNtk, pObj, i )
552 {
553 if ( !Abc_ObjIsPo(pObj) )
554 continue;
555 pNet = Abc_ObjFanin0(pObj);
556 // skip marked nets
557// if ( Abc_NodeIsTravIdCurrent(pNet) )
558// continue;
559// Abc_NodeSetTravIdCurrent( pNet );
560 nValues = Abc_ObjMvVarNum(pNet);
561 pValues = (Abc_Obj_t **)pNet->pCopy;
562 for ( v = 0; v < nValues; v++ )
563 {
564 pTemp = Abc_NtkCreatePo( pNtkNew );
565 Abc_ObjAddFanin( pTemp, pValues[v] );
566 if ( nValuesMax == 2 )
567 Abc_ObjAssignName( pTemp, Abc_ObjName(pNet), NULL );
568 else
569 Abc_NtkConvertAssignName( pTemp, pNet, v );
570 }
571 }
572 Abc_NtkForEachCo( pNtk, pObj, i )
573 {
574 if ( Abc_ObjIsPo(pObj) )
575 continue;
576 pNet = Abc_ObjFanin0(pObj);
577 // skip marked nets
578// if ( Abc_NodeIsTravIdCurrent(pNet) )
579// continue;
580// Abc_NodeSetTravIdCurrent( pNet );
581 nValues = Abc_ObjMvVarNum(pNet);
582 pValues = (Abc_Obj_t **)pNet->pCopy;
583 for ( v = 0; v < nValues; v++ )
584 {
585 pTemp = Abc_NtkCreateBi( pNtkNew );
586 Abc_ObjAddFanin( pTemp, pValues[v] );
587 if ( nValuesMax == 2 )
588 Abc_ObjAssignName( pTemp, Abc_ObjName(pNet), NULL );
589 else
590 Abc_NtkConvertAssignName( pTemp, pNet, v );
591 nCount2++;
592 }
593 }
594 }
595 else // if ( fPositional == 0 )
596 {
597 Abc_NtkForEachCo( pNtk, pObj, i )
598 {
599 if ( !Abc_ObjIsPo(pObj) )
600 continue;
601 pNet = Abc_ObjFanin0(pObj);
602 // skip marked nets
603// if ( Abc_NodeIsTravIdCurrent(pNet) )
604// continue;
605// Abc_NodeSetTravIdCurrent( pNet );
606 nValues = Abc_ObjMvVarNum(pNet);
607 pValues = (Abc_Obj_t **)pNet->pCopy;
608 nBits = Abc_Base2Log( nValues );
609 for ( k = 0; k < nBits; k++ )
610 {
611 pBit = Abc_ObjNot( Abc_AigConst1(pNtkNew) );
612 for ( v = 0; v < nValues; v++ )
613 if ( v & (1<<k) )
614 pBit = Abc_AigOr( (Abc_Aig_t *)pNtkNew->pManFunc, pBit, pValues[v] );
615 pTemp = Abc_NtkCreatePo( pNtkNew );
616 Abc_ObjAddFanin( pTemp, pBit );
617 if ( nValuesMax == 2 )
618 Abc_ObjAssignName( pTemp, Abc_ObjName(pNet), NULL );
619 else
620 Abc_NtkConvertAssignName( pTemp, pNet, k );
621 }
622 }
623 Abc_NtkForEachCo( pNtk, pObj, i )
624 {
625 if ( Abc_ObjIsPo(pObj) )
626 continue;
627 pNet = Abc_ObjFanin0(pObj);
628 // skip marked nets
629// if ( Abc_NodeIsTravIdCurrent(pNet) )
630// continue;
631// Abc_NodeSetTravIdCurrent( pNet );
632 nValues = Abc_ObjMvVarNum(pNet);
633 pValues = (Abc_Obj_t **)pNet->pCopy;
634 nBits = Abc_Base2Log( nValues );
635 for ( k = 0; k < nBits; k++ )
636 {
637 pBit = Abc_ObjNot( Abc_AigConst1(pNtkNew) );
638 for ( v = 0; v < nValues; v++ )
639 if ( v & (1<<k) )
640 pBit = Abc_AigOr( (Abc_Aig_t *)pNtkNew->pManFunc, pBit, pValues[v] );
641 pTemp = Abc_NtkCreateBi( pNtkNew );
642 Abc_ObjAddFanin( pTemp, pBit );
643 if ( nValuesMax == 2 )
644 Abc_ObjAssignName( pTemp, Abc_ObjName(pNet), NULL );
645 else
646 Abc_NtkConvertAssignName( pTemp, pNet, k );
647 nCount2++;
648 }
649 }
650 }
651
652 if ( Abc_NtkLatchNum(pNtk) )
653 {
654 Vec_Ptr_t * vTemp;
655 Abc_Obj_t * pLatch, * pObjLi, * pObjLo;
656 int i;
657 // move free vars to the front among the PIs
658 vTemp = Vec_PtrAlloc( Vec_PtrSize(pNtkNew->vPis) );
659 Abc_NtkForEachPi( pNtkNew, pObj, i )
660 if ( strncmp( Abc_ObjName(pObj), "free_var_", 9 ) == 0 )
661 Vec_PtrPush( vTemp, pObj );
662 Abc_NtkForEachPi( pNtkNew, pObj, i )
663 if ( strncmp( Abc_ObjName(pObj), "free_var_", 9 ) != 0 )
664 Vec_PtrPush( vTemp, pObj );
665 assert( Vec_PtrSize(vTemp) == Vec_PtrSize(pNtkNew->vPis) );
666 Vec_PtrFree( pNtkNew->vPis );
667 pNtkNew->vPis = vTemp;
668 // move free vars to the front among the CIs
669 vTemp = Vec_PtrAlloc( Vec_PtrSize(pNtkNew->vCis) );
670 Abc_NtkForEachCi( pNtkNew, pObj, i )
671 if ( strncmp( Abc_ObjName(pObj), "free_var_", 9 ) == 0 )
672 Vec_PtrPush( vTemp, pObj );
673 Abc_NtkForEachCi( pNtkNew, pObj, i )
674 if ( strncmp( Abc_ObjName(pObj), "free_var_", 9 ) != 0 )
675 Vec_PtrPush( vTemp, pObj );
676 assert( Vec_PtrSize(vTemp) == Vec_PtrSize(pNtkNew->vCis) );
677 Vec_PtrFree( pNtkNew->vCis );
678 pNtkNew->vCis = vTemp;
679 // create registers
680 assert( nCount1 == nCount2 );
681 for ( i = 0; i < nCount1; i++ )
682 {
683 // create latch
684 pLatch = Abc_NtkCreateLatch( pNtkNew );
685 Abc_LatchSetInit0( pLatch );
686 Abc_ObjAssignName( pLatch, Abc_ObjName(pLatch), NULL );
687 // connect
688 pObjLi = Abc_NtkCo( pNtkNew, Abc_NtkCoNum(pNtkNew)-nCount1+i );
689 pObjLo = Abc_NtkCi( pNtkNew, Abc_NtkCiNum(pNtkNew)-nCount1+i );
690 Abc_ObjAddFanin( pLatch, pObjLi );
691 Abc_ObjAddFanin( pObjLo, pLatch );
692 }
693 }
694
695 // cleanup
696 ABC_FREE( pBits );
697 Abc_NtkForEachObj( pNtk, pObj, i )
698 if ( pObj->pCopy )
699 ABC_FREE( pObj->pCopy );
700
701 // remove dangling nodes
702 i = Abc_AigCleanup((Abc_Aig_t *)pNtkNew->pManFunc);
703// printf( "Cleanup removed %d nodes.\n", i );
704// Abc_NtkReassignIds( pNtkNew );
705
706 // check integrity
707 if ( !Abc_NtkCheck( pNtkNew ) )
708 {
709 fprintf( stdout, "Abc_NtkStrashBlifMv(): Network check has failed.\n" );
710 Abc_NtkDelete( pNtkNew );
711 return NULL;
712 }
713 return pNtkNew;
714}
int Abc_NodeStrashBlifMv(Abc_Ntk_t *pNtkNew, Abc_Obj_t *pObj)
Definition abcBlifMv.c:143
int strncmp()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkSupport()

ABC_DLL Vec_Ptr_t * Abc_NtkSupport ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Returns the set of CI nodes in the support of the given nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 859 of file abcDfs.c.

860{
861 Vec_Ptr_t * vNodes;
862 Abc_Obj_t * pNode;
863 int i;
864 // set the traversal ID
865 Abc_NtkIncrementTravId( pNtk );
866 // start the array of nodes
867 vNodes = Vec_PtrAlloc( 100 );
868 // go through the PO nodes and call for each of them
869 Abc_NtkForEachCo( pNtk, pNode, i )
870 Abc_NtkNodeSupport_rec( Abc_ObjFanin0(pNode), vNodes );
871 // add unused CIs
872 Abc_NtkForEachCi( pNtk, pNode, i )
873 if ( !Abc_NodeIsTravIdCurrent( pNode ) )
874 Vec_PtrPush( vNodes, pNode );
875 assert( Vec_PtrSize(vNodes) == Abc_NtkCiNum(pNtk) );
876 return vNodes;
877}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkSweep()

ABC_DLL int Abc_NtkSweep ( Abc_Ntk_t * pNtk,
int fVerbose )
extern

Definition at line 692 of file abcSweep.c.

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

◆ Abc_NtkSweepBufsInvs()

ABC_DLL int Abc_NtkSweepBufsInvs ( Abc_Ntk_t * pNtk,
int fVerbose )
extern

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_NodeIsInv(Abc_Obj_t *pNode)
Definition abcObj.c:980
Hop_Obj_t * Hop_Compose(Hop_Man_t *p, Hop_Obj_t *pRoot, Hop_Obj_t *pFunc, int iVar)
Definition hopDfs.c:415
Here is the call graph for this function:

◆ Abc_NtkTimeInitialize()

ABC_DLL void Abc_NtkTimeInitialize ( Abc_Ntk_t * pNtk,
Abc_Ntk_t * pNtkOld )
extern

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

Synopsis [Finalizes the timing manager after setting arr/req times.]

Description []

SideEffects []

SeeAlso []

Definition at line 343 of file abcTiming.c.

344{
345 Abc_Obj_t * pObj;
346 Abc_Time_t ** ppTimes;
347 int i;
348 assert( pNtkOld == NULL || pNtkOld->pManTime != NULL );
349 assert( pNtkOld == NULL || Abc_NtkCiNum(pNtk) == Abc_NtkCiNum(pNtkOld) );
350 assert( pNtkOld == NULL || Abc_NtkCoNum(pNtk) == Abc_NtkCoNum(pNtkOld) );
351 if ( pNtk->pManTime == NULL )
352 return;
353 // create timing manager with default values
354 Abc_ManTimeExpand( pNtk->pManTime, Abc_NtkObjNumMax(pNtk), 0 );
355 // set global defaults from pNtkOld
356 if ( pNtkOld )
357 {
358 pNtk->pManTime->tArrDef = pNtkOld->pManTime->tArrDef;
359 pNtk->pManTime->tReqDef = pNtkOld->pManTime->tReqDef;
360 pNtk->AndGateDelay = pNtkOld->AndGateDelay;
361 }
362 // set the default timing for CI and COs
363 ppTimes = (Abc_Time_t **)pNtk->pManTime->vArrs->pArray;
364 Abc_NtkForEachCi( pNtk, pObj, i )
365 *ppTimes[pObj->Id] = pNtkOld ? *Abc_NodeReadArrival(Abc_NtkCi(pNtkOld, i)) : pNtk->pManTime->tArrDef;
366 ppTimes = (Abc_Time_t **)pNtk->pManTime->vReqs->pArray;
367 Abc_NtkForEachCo( pNtk, pObj, i )
368 *ppTimes[pObj->Id] = pNtkOld ? *Abc_NodeReadRequired(Abc_NtkCo(pNtkOld, i)) : pNtk->pManTime->tReqDef;
369}
Abc_Time_t * Abc_NodeReadArrival(Abc_Obj_t *pNode)
Definition abcTiming.c:85
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkTimeSetArrival()

ABC_DLL void Abc_NtkTimeSetArrival ( Abc_Ntk_t * pNtk,
int ObjId,
float Rise,
float Fall )
extern

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

Synopsis [Sets the arrival time for an object.]

Description []

SideEffects []

SeeAlso []

Definition at line 208 of file abcTiming.c.

209{
210 Vec_Ptr_t * vTimes;
211 Abc_Time_t * pTime;
212
213 if ( pNtk->pManTime == NULL )
214 pNtk->pManTime = Abc_ManTimeStart(pNtk);
215 Abc_ManTimeExpand( pNtk->pManTime, ObjId + 1, 1 );
216 // set the arrival time
217 vTimes = pNtk->pManTime->vArrs;
218 pTime = (Abc_Time_t *)vTimes->pArray[ObjId];
219 pTime->Rise = Rise;
220 pTime->Fall = Fall;
221
222
223}
Here is the caller graph for this function:

◆ Abc_NtkTimeSetDefaultArrival()

ABC_DLL void Abc_NtkTimeSetDefaultArrival ( Abc_Ntk_t * pNtk,
float Rise,
float Fall )
extern

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

Synopsis [Sets the default arrival time for the network.]

Description [Please note that .default_input_arrival and .default_output_required should precede .input_arrival and .output required. Otherwise, an overwrite may happen.]

SideEffects []

SeeAlso []

Definition at line 173 of file abcTiming.c.

174{
175 Abc_Obj_t * pObj; int i;
176 if ( pNtk->pManTime == NULL )
177 pNtk->pManTime = Abc_ManTimeStart(pNtk);
178 pNtk->pManTime->tArrDef.Rise = Rise;
179 pNtk->pManTime->tArrDef.Fall = Fall;
180 // set the arrival times for each input
181 Abc_NtkForEachCi( pNtk, pObj, i )
182 Abc_NtkTimeSetArrival( pNtk, Abc_ObjId(pObj), Rise, Fall );
183}
void Abc_NtkTimeSetArrival(Abc_Ntk_t *pNtk, int ObjId, float Rise, float Fall)
Definition abcTiming.c:208
Here is the call graph for this function:

◆ Abc_NtkTimeSetDefaultInputDrive()

ABC_DLL void Abc_NtkTimeSetDefaultInputDrive ( Abc_Ntk_t * pNtk,
float Rise,
float Fall )
extern

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

Synopsis [Sets the default arrival time for the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 249 of file abcTiming.c.

250{
251// if ( Rise == 0.0 && Fall == 0.0 )
252// return;
253 if ( pNtk->pManTime == NULL )
254 pNtk->pManTime = Abc_ManTimeStart(pNtk);
255 pNtk->pManTime->tInDriveDef.Rise = Rise;
256 pNtk->pManTime->tInDriveDef.Fall = Fall;
257 if ( pNtk->pManTime->tInDrive != NULL )
258 {
259 int i;
260 for ( i = 0; i < Abc_NtkCiNum(pNtk); i++ )
261 if ( pNtk->pManTime->tInDrive[i].Rise == 0 && pNtk->pManTime->tInDrive[i].Fall == 0 )
262 pNtk->pManTime->tInDrive[i] = pNtk->pManTime->tInDriveDef;
263 }
264}

◆ Abc_NtkTimeSetDefaultOutputLoad()

ABC_DLL void Abc_NtkTimeSetDefaultOutputLoad ( Abc_Ntk_t * pNtk,
float Rise,
float Fall )
extern

Definition at line 265 of file abcTiming.c.

266{
267// if ( Rise == 0.0 && Fall == 0.0 )
268// return;
269 if ( pNtk->pManTime == NULL )
270 pNtk->pManTime = Abc_ManTimeStart(pNtk);
271 pNtk->pManTime->tOutLoadDef.Rise = Rise;
272 pNtk->pManTime->tOutLoadDef.Fall = Fall;
273 if ( pNtk->pManTime->tOutLoad != NULL )
274 {
275 int i;
276 for ( i = 0; i < Abc_NtkCoNum(pNtk); i++ )
277 if ( pNtk->pManTime->tOutLoad[i].Rise == 0 && pNtk->pManTime->tOutLoad[i].Fall == 0 )
278 pNtk->pManTime->tOutLoad[i] = pNtk->pManTime->tOutLoadDef;
279 }
280}

◆ Abc_NtkTimeSetDefaultRequired()

ABC_DLL void Abc_NtkTimeSetDefaultRequired ( Abc_Ntk_t * pNtk,
float Rise,
float Fall )
extern

Definition at line 184 of file abcTiming.c.

185{
186 Abc_Obj_t * pObj; int i;
187 if ( pNtk->pManTime == NULL )
188 pNtk->pManTime = Abc_ManTimeStart(pNtk);
189 pNtk->pManTime->tReqDef.Rise = Rise;
190 pNtk->pManTime->tReqDef.Fall = Fall;
191 // set the required times for each output
192 Abc_NtkForEachCo( pNtk, pObj, i ){
193 Abc_NtkTimeSetRequired( pNtk, Abc_ObjId(pObj), Rise, Fall );
194 }
195}
void Abc_NtkTimeSetRequired(Abc_Ntk_t *pNtk, int ObjId, float Rise, float Fall)
Definition abcTiming.c:224
Here is the call graph for this function:

◆ Abc_NtkTimeSetInputDrive()

ABC_DLL void Abc_NtkTimeSetInputDrive ( Abc_Ntk_t * pNtk,
int PiNum,
float Rise,
float Fall )
extern

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

Synopsis [Sets the arrival time for an object.]

Description []

SideEffects []

SeeAlso []

Definition at line 293 of file abcTiming.c.

294{
295 Abc_Time_t * pTime;
296 assert( PiNum >= 0 && PiNum < Abc_NtkCiNum(pNtk) );
297 if ( pNtk->pManTime == NULL )
298 pNtk->pManTime = Abc_ManTimeStart(pNtk);
299 if ( pNtk->pManTime->tInDriveDef.Rise == Rise && pNtk->pManTime->tInDriveDef.Fall == Fall )
300 return;
301 if ( pNtk->pManTime->tInDrive == NULL )
302 {
303 int i;
304 pNtk->pManTime->tInDrive = ABC_CALLOC( Abc_Time_t, Abc_NtkCiNum(pNtk) );
305 for ( i = 0; i < Abc_NtkCiNum(pNtk); i++ )
306 pNtk->pManTime->tInDrive[i] = pNtk->pManTime->tInDriveDef;
307 }
308 pTime = pNtk->pManTime->tInDrive + PiNum;
309 pTime->Rise = Rise;
310 pTime->Fall = Fall;
311}

◆ Abc_NtkTimeSetOutputLoad()

ABC_DLL void Abc_NtkTimeSetOutputLoad ( Abc_Ntk_t * pNtk,
int PoNum,
float Rise,
float Fall )
extern

Definition at line 312 of file abcTiming.c.

313{
314 Abc_Time_t * pTime;
315 assert( PoNum >= 0 && PoNum < Abc_NtkCoNum(pNtk) );
316 if ( pNtk->pManTime == NULL )
317 pNtk->pManTime = Abc_ManTimeStart(pNtk);
318 if ( pNtk->pManTime->tOutLoadDef.Rise == Rise && pNtk->pManTime->tOutLoadDef.Fall == Fall )
319 return;
320 if ( pNtk->pManTime->tOutLoad == NULL )
321 {
322 int i;
323 pNtk->pManTime->tOutLoad = ABC_CALLOC( Abc_Time_t, Abc_NtkCoNum(pNtk) );
324 for ( i = 0; i < Abc_NtkCoNum(pNtk); i++ )
325 pNtk->pManTime->tOutLoad[i] = pNtk->pManTime->tOutLoadDef;
326 }
327 pTime = pNtk->pManTime->tOutLoad + PoNum;
328 pTime->Rise = Rise;
329 pTime->Fall = Fall;
330}

◆ Abc_NtkTimeSetRequired()

ABC_DLL void Abc_NtkTimeSetRequired ( Abc_Ntk_t * pNtk,
int ObjId,
float Rise,
float Fall )
extern

Definition at line 224 of file abcTiming.c.

225{
226 Vec_Ptr_t * vTimes;
227 Abc_Time_t * pTime;
228 if ( pNtk->pManTime == NULL )
229 pNtk->pManTime = Abc_ManTimeStart(pNtk);
230 Abc_ManTimeExpand( pNtk->pManTime, ObjId + 1, 1 );
231 // set the required time
232 vTimes = pNtk->pManTime->vReqs;
233 pTime = (Abc_Time_t *)vTimes->pArray[ObjId];
234 pTime->Rise = Rise;
235 pTime->Fall = Fall;
236}
Here is the caller graph for this function:

◆ Abc_NtkToAig()

ABC_DLL int Abc_NtkToAig ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Convers logic network to the SOP form.]

Description []

SideEffects []

SeeAlso []

Definition at line 1333 of file abcFunc.c.

1334{
1335 assert( !Abc_NtkIsStrash(pNtk) );
1336 if ( Abc_NtkHasBlackbox(pNtk) )
1337 return 1;
1338 if ( Abc_NtkHasAig(pNtk) )
1339 return 1;
1340 if ( Abc_NtkHasMapping(pNtk) )
1341 {
1342 Abc_NtkMapToSop(pNtk);
1343 return Abc_NtkSopToAig(pNtk);
1344 }
1345 if ( Abc_NtkHasBdd(pNtk) )
1346 {
1347 if ( !Abc_NtkBddToSop(pNtk, -1, ABC_INFINITY, 1) )
1348 return 0;
1349 return Abc_NtkSopToAig(pNtk);
1350 }
1351 if ( Abc_NtkHasSop(pNtk) )
1352 return Abc_NtkSopToAig(pNtk);
1353 assert( 0 );
1354 return 0;
1355}
int Abc_NtkMapToSop(Abc_Ntk_t *pNtk)
Definition abcFunc.c:1228
int Abc_NtkBddToSop(Abc_Ntk_t *pNtk, int fMode, int nCubeLimit, int fCubeSort)
Definition abcFunc.c:866
int Abc_NtkSopToAig(Abc_Ntk_t *pNtk)
Definition abcFunc.c:884
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkToBarBufs()

ABC_DLL Abc_Ntk_t * Abc_NtkToBarBufs ( Abc_Ntk_t * pNtk)
extern

Definition at line 180 of file abcBarBuf.c.

181{
182 char Buffer[1000];
183 Vec_Ptr_t * vLiMaps, * vLoMaps;
184 Abc_Ntk_t * pNtkNew, * pTemp;
185 Abc_Obj_t * pLatch, * pObjLi, * pObjLo;
186 Abc_Obj_t * pObj, * pLiMap, * pLoMap;
187 int i, k, nBoxes;
188 assert( Abc_NtkIsNetlist(pNtk) );
189 if ( !Abc_NtkCheckSingleInstance(pNtk) )
190 return NULL;
191 assert( pNtk->pDesign != NULL );
192 // start the network
193 pNtkNew = Abc_NtkAlloc( ABC_NTK_LOGIC, pNtk->ntkFunc, 1 );
194 pNtkNew->pName = Extra_UtilStrsav(pNtk->pName);
195 pNtkNew->pSpec = Extra_UtilStrsav(pNtk->pSpec);
196 // clone CIs/CIs/boxes
197 Abc_NtkCleanCopy_rec( pNtk );
198 Abc_NtkForEachPi( pNtk, pObj, i )
199 Abc_ObjFanout0(pObj)->pCopy = Abc_NtkDupObj( pNtkNew, pObj, 1 );
200 Abc_NtkForEachPo( pNtk, pObj, i )
201 Abc_NtkDupObj( pNtkNew, pObj, 1 );
202 // create latches and transfer copy labels
203 nBoxes = Abc_NtkCollectPiPos( pNtk, &vLiMaps, &vLoMaps );
204 Vec_PtrForEachEntryTwo( Abc_Obj_t *, vLiMaps, Abc_Obj_t *, vLoMaps, pLiMap, pLoMap, i )
205 {
206 pObjLi = Abc_NtkCreateBi(pNtkNew);
207 pLatch = Abc_NtkCreateLatch(pNtkNew);
208 pObjLo = Abc_NtkCreateBo(pNtkNew);
209 Abc_ObjAddFanin( pLatch, pObjLi );
210 Abc_ObjAddFanin( pObjLo, pLatch );
211 pLatch->pData = (void *)ABC_INIT_ZERO;
212 pTemp = NULL;
213 if ( Abc_ObjFanin0(pLiMap)->pNtk != pNtk )
214 pTemp = Abc_ObjFanin0(pLiMap)->pNtk;
215 else if ( Abc_ObjFanout0(pLoMap)->pNtk != pNtk )
216 pTemp = Abc_ObjFanout0(pLoMap)->pNtk;
217 else assert( 0 );
218 sprintf( Buffer, "_%s_in", Abc_NtkName(pTemp) );
219 Abc_ObjAssignName( pObjLi, Abc_ObjName(Abc_ObjFanin0(pLiMap)), Buffer );
220 sprintf( Buffer, "_%s_out", Abc_NtkName(pTemp) );
221 Abc_ObjAssignName( pObjLo, Abc_ObjName(Abc_ObjFanout0(pLoMap)), Buffer );
222 pLiMap->pCopy = pObjLi;
223 Abc_ObjFanout0(pLoMap)->pCopy = pObjLo;
224 assert( Abc_ObjIsNet(Abc_ObjFanout0(pLoMap)) );
225 }
226 Vec_PtrFree( vLiMaps );
227 Vec_PtrFree( vLoMaps );
228 // rebuild networks
229 Vec_PtrForEachEntry( Abc_Ntk_t *, pNtk->pDesign->vModules, pTemp, i )
230 Abc_NtkForEachCo( pTemp, pObj, k )
231 Abc_ObjAddFanin( pObj->pCopy, Abc_NtkToBarBufs_rec(pNtkNew, Abc_ObjFanin0(pObj)) );
232 pNtkNew->nBarBufs = Abc_NtkLatchNum(pNtkNew);
233 printf( "Hierarchy reader flattened %d instances of logic boxes and introduced %d barbufs.\n", nBoxes, pNtkNew->nBarBufs );
234 return pNtkNew;
235}
int Abc_NtkCheckSingleInstance(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition abcBarBuf.c:47
Abc_Obj_t * Abc_NtkToBarBufs_rec(Abc_Ntk_t *pNtkNew, Abc_Obj_t *pNet)
Definition abcBarBuf.c:166
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkToBdd()

ABC_DLL int Abc_NtkToBdd ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Convers logic network to the SOP form.]

Description []

SideEffects []

SeeAlso []

Definition at line 1299 of file abcFunc.c.

1300{
1301 assert( !Abc_NtkIsStrash(pNtk) );
1302 if ( Abc_NtkHasBlackbox(pNtk) )
1303 return 1;
1304 if ( Abc_NtkHasBdd(pNtk) )
1305 return 1;
1306 if ( Abc_NtkHasMapping(pNtk) )
1307 {
1308 Abc_NtkMapToSop(pNtk);
1309 return Abc_NtkSopToBdd(pNtk);
1310 }
1311 if ( Abc_NtkHasSop(pNtk) )
1312 {
1313 Abc_NtkSopToAig(pNtk);
1314 return Abc_NtkAigToBdd(pNtk);
1315 }
1316 if ( Abc_NtkHasAig(pNtk) )
1317 return Abc_NtkAigToBdd(pNtk);
1318 assert( 0 );
1319 return 0;
1320}
int Abc_NtkSopToBdd(Abc_Ntk_t *pNtk)
Definition abcFunc.c:865
int Abc_NtkAigToBdd(Abc_Ntk_t *pNtk)
Definition abcFunc.c:869
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkToFraig()

ABC_DLL void * Abc_NtkToFraig ( Abc_Ntk_t * pNtk,
void * pParams,
int fAllNodes,
int fExdc )
extern

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

Synopsis [Transforms the strashed network into FRAIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 103 of file abcFraig.c.

104{
105 int fInternal = ((Fraig_Params_t *)pParams)->fInternal;
106 Fraig_Man_t * pMan;
107 ProgressBar * pProgress = NULL;
108 Vec_Ptr_t * vNodes;
109 Abc_Obj_t * pNode;
110 int i;
111
112 assert( Abc_NtkIsStrash(pNtk) );
113
114 // create the FRAIG manager
115 pMan = Fraig_ManCreate( (Fraig_Params_t *)pParams );
116
117 // map the constant node
118 Abc_NtkCleanCopy( pNtk );
120 // create PIs and remember them in the old nodes
121 Abc_NtkForEachCi( pNtk, pNode, i )
122 pNode->pCopy = (Abc_Obj_t *)Fraig_ManReadIthVar(pMan, i);
123
124 // perform strashing
125 vNodes = Abc_AigDfs( pNtk, fAllNodes, 0 );
126 if ( !fInternal )
127 pProgress = Extra_ProgressBarStart( stdout, vNodes->nSize );
128 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
129 {
130 if ( Abc_ObjFaninNum(pNode) == 0 )
131 continue;
132 if ( pProgress )
133 Extra_ProgressBarUpdate( pProgress, i, NULL );
134 pNode->pCopy = (Abc_Obj_t *)Fraig_NodeAnd( pMan,
135 Fraig_NotCond( Abc_ObjFanin0(pNode)->pCopy, (int)Abc_ObjFaninC0(pNode) ),
136 Fraig_NotCond( Abc_ObjFanin1(pNode)->pCopy, (int)Abc_ObjFaninC1(pNode) ) );
137 }
138 if ( pProgress )
139 Extra_ProgressBarStop( pProgress );
140 Vec_PtrFree( vNodes );
141
142 // use EXDC to change the mapping of nodes into FRAIG nodes
143 if ( fExdc )
144 Abc_NtkFraigRemapUsingExdc( pMan, pNtk );
145
146 // set the primary outputs
147 Abc_NtkForEachCo( pNtk, pNode, i )
148 Fraig_ManSetPo( pMan, (Fraig_Node_t *)Abc_ObjNotCond( Abc_ObjFanin0(pNode)->pCopy, Abc_ObjFaninC0(pNode) ) );
149 return pMan;
150}
void Fraig_ManSetPo(Fraig_Man_t *p, Fraig_Node_t *pNode)
Definition fraigApi.c:194
Fraig_Man_t * Fraig_ManCreate(Fraig_Params_t *pParams)
Definition fraigMan.c:184
#define Fraig_NotCond(p, c)
Definition fraig.h:110
Fraig_Node_t * Fraig_ManReadConst1(Fraig_Man_t *p)
Definition fraigApi.c:52
Fraig_Node_t * Fraig_ManReadIthVar(Fraig_Man_t *p, int i)
Definition fraigApi.c:168
struct Fraig_NodeStruct_t_ Fraig_Node_t
Definition fraig.h:41
Fraig_Node_t * Fraig_NodeAnd(Fraig_Man_t *p, Fraig_Node_t *p1, Fraig_Node_t *p2)
Definition fraigApi.c:212
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkToLogic()

ABC_DLL Abc_Ntk_t * Abc_NtkToLogic ( Abc_Ntk_t * pNtk)
extern

FUNCTION DEFINITIONS ///.

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

Synopsis [Transform the netlist into a logic network.]

Description []

SideEffects []

SeeAlso []

Definition at line 52 of file abcNetlist.c.

53{
54 Abc_Ntk_t * pNtkNew;
55 Abc_Obj_t * pObj, * pFanin;
56 int i, k;
57 // consider the case of the AIG
58 if ( Abc_NtkIsStrash(pNtk) )
59 return Abc_NtkAigToLogicSop( pNtk );
60 assert( Abc_NtkIsNetlist(pNtk) );
61 // consider simple case when there is hierarchy
62// assert( pNtk->pDesign == NULL );
63 assert( Abc_NtkWhiteboxNum(pNtk) == 0 );
64 assert( Abc_NtkBlackboxNum(pNtk) == 0 );
65 // start the network
66 pNtkNew = Abc_NtkStartFrom( pNtk, ABC_NTK_LOGIC, pNtk->ntkFunc );
67 // duplicate the nodes
68 Abc_NtkForEachNode( pNtk, pObj, i )
69 {
70 Abc_NtkDupObj(pNtkNew, pObj, 0);
71 Abc_ObjAssignName( pObj->pCopy, Abc_ObjName(Abc_ObjFanout0(pObj)), NULL );
72 }
73 // reconnect the internal nodes in the new network
74 Abc_NtkForEachNode( pNtk, pObj, i )
75 Abc_ObjForEachFanin( pObj, pFanin, k )
76 Abc_ObjAddFanin( pObj->pCopy, Abc_ObjFanin0(pFanin)->pCopy );
77 // collect the CO nodes
78 Abc_NtkFinalize( pNtk, pNtkNew );
79 // fix the problem with CO pointing directly to CIs
80 Abc_NtkLogicMakeSimpleCos( pNtkNew, 0 );
81 // duplicate EXDC
82 if ( pNtk->pExdc )
83 pNtkNew->pExdc = Abc_NtkToLogic( pNtk->pExdc );
84 if ( !Abc_NtkCheck( pNtkNew ) )
85 fprintf( stdout, "Abc_NtkToLogic(): Network check has failed.\n" );
86 return pNtkNew;
87}
Abc_Ntk_t * Abc_NtkToLogic(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition abcNetlist.c:52
ABC_DLL int Abc_NtkLogicMakeSimpleCos(Abc_Ntk_t *pNtk, int fDuplicate)
Definition abcUtil.c:1080
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkToNetlist()

ABC_DLL Abc_Ntk_t * Abc_NtkToNetlist ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Transform the logic network into a netlist.]

Description []

SideEffects []

SeeAlso []

Definition at line 100 of file abcNetlist.c.

101{
102 Abc_Ntk_t * pNtkNew, * pNtkTemp;
103 assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsStrash(pNtk) );
104 if ( Abc_NtkIsStrash(pNtk) )
105 {
106 pNtkTemp = Abc_NtkAigToLogicSop(pNtk);
107 pNtkNew = Abc_NtkLogicToNetlist( pNtkTemp );
108 Abc_NtkDelete( pNtkTemp );
109 return pNtkNew;
110 }
111 return Abc_NtkLogicToNetlist( pNtk );
112}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkToNetlistBench()

ABC_DLL Abc_Ntk_t * Abc_NtkToNetlistBench ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Converts the AIG into the netlist.]

Description [This procedure does not copy the choices.]

SideEffects []

SeeAlso []

Definition at line 125 of file abcNetlist.c.

126{
127 Abc_Ntk_t * pNtkNew, * pNtkTemp;
128 assert( Abc_NtkIsStrash(pNtk) );
129 pNtkTemp = Abc_NtkAigToLogicSopBench( pNtk );
130 pNtkNew = Abc_NtkLogicToNetlist( pNtkTemp );
131 Abc_NtkDelete( pNtkTemp );
132 return pNtkNew;
133}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkTopmost()

ABC_DLL Abc_Ntk_t * Abc_NtkTopmost ( Abc_Ntk_t * pNtk,
int nLevels )
extern

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

◆ Abc_NtkToSop()

ABC_DLL int Abc_NtkToSop ( Abc_Ntk_t * pNtk,
int fMode,
int nCubeLimit )
extern

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

Synopsis [Convers logic network to the SOP form.]

Description []

SideEffects []

SeeAlso []

Definition at line 1261 of file abcFunc.c.

1262{
1263 assert( !Abc_NtkIsStrash(pNtk) );
1264 if ( Abc_NtkHasBlackbox(pNtk) )
1265 return 1;
1266 if ( Abc_NtkHasSop(pNtk) )
1267 {
1268 if ( fMode == -1 )
1269 return 1;
1270 if ( !Abc_NtkSopToBdd(pNtk) )
1271 return 0;
1272 return Abc_NtkBddToSop(pNtk, fMode, nCubeLimit, 1);
1273 }
1274 if ( Abc_NtkHasMapping(pNtk) )
1275 return Abc_NtkMapToSop(pNtk);
1276 if ( Abc_NtkHasBdd(pNtk) )
1277 return Abc_NtkBddToSop(pNtk, fMode, nCubeLimit, 1);
1278 if ( Abc_NtkHasAig(pNtk) )
1279 {
1280 if ( !Abc_NtkAigToBdd(pNtk) )
1281 return 0;
1282 return Abc_NtkBddToSop(pNtk, fMode, nCubeLimit, 1);
1283 }
1284 assert( 0 );
1285 return 0;
1286}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkTransferCopy()

ABC_DLL void Abc_NtkTransferCopy ( Abc_Ntk_t * pNtk)
extern

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

Synopsis [Adjusts the copy pointers.]

Description [This procedure assumes that the network was transformed into another network, which was in turn transformed into yet another network. It makes the pCopy pointers of the original network point to the objects of the yet another network.]

SideEffects []

SeeAlso []

Definition at line 1962 of file abcUtil.c.

1963{
1964 Abc_Obj_t * pObj;
1965 int i;
1966 Abc_NtkForEachObj( pNtk, pObj, i )
1967 if ( !Abc_ObjIsNet(pObj) )
1968 pObj->pCopy = pObj->pCopy? Abc_ObjCopyCond(pObj->pCopy) : NULL;
1969}
Here is the caller graph for this function:

◆ Abc_NtkTransferNameIds()

ABC_DLL void Abc_NtkTransferNameIds ( Abc_Ntk_t * p,
Abc_Ntk_t * pNew )
extern

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

Synopsis [Remaps the AIG from the old manager into the new manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 761 of file abcNames.c.

762{
763 Abc_Obj_t * pObj, * pObjNew;
764 int i;
765 assert( p->vNameIds != NULL );
766 assert( pNew->vNameIds == NULL );
767 pNew->vNameIds = Vec_IntStart( Abc_NtkObjNumMax(pNew) );
768// Abc_NtkForEachCi( p, pObj, i )
769// printf( "%d ", Vec_IntEntry(p->vNameIds, Abc_ObjId(pObj)) );
770// printf( "\n" );
771 Abc_NtkForEachObj( p, pObj, i )
772 if ( pObj->pCopy && i < Vec_IntSize(p->vNameIds) && Vec_IntEntry(p->vNameIds, i) )
773 {
774 pObjNew = Abc_ObjRegular(pObj->pCopy);
775 assert( Abc_ObjNtk(pObjNew) == pNew );
776 if ( Abc_ObjIsCi(pObjNew) && !Abc_ObjIsCi(pObj) ) // do not overwrite CI name by internal node name
777 continue;
778 Vec_IntWriteEntry( pNew->vNameIds, Abc_ObjId(pObjNew), Vec_IntEntry(p->vNameIds, i) ^ Abc_ObjIsComplement(pObj->pCopy) );
779 }
780}
Here is the caller graph for this function:

◆ Abc_NtkTransferPhases()

ABC_DLL void Abc_NtkTransferPhases ( Abc_Ntk_t * pNtkNew,
Abc_Ntk_t * pNtk )
extern

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

Synopsis [Transfers phase information to the new network.]

Description []

SideEffects []

SeeAlso []

Definition at line 2924 of file abcUtil.c.

2925{
2926 Abc_Obj_t * pObj;
2927 int i;
2928 assert( pNtk->vPhases != NULL );
2929 assert( Vec_IntSize(pNtk->vPhases) == Abc_NtkObjNumMax(pNtk) );
2930 assert( pNtkNew->vPhases == NULL );
2931 pNtkNew->vPhases = Vec_IntStart( Abc_NtkObjNumMax(pNtkNew) );
2932 Abc_NtkForEachObj( pNtk, pObj, i )
2933 if ( pObj->pCopy && !Abc_ObjIsNone( (Abc_Obj_t *)pObj->pCopy ) )
2934 Vec_IntWriteEntry( pNtkNew->vPhases, Abc_ObjId( (Abc_Obj_t *)pObj->pCopy ), Vec_IntEntry(pNtk->vPhases, i) );
2935}
Here is the caller graph for this function:

◆ Abc_NtkTrasferNames()

ABC_DLL void Abc_NtkTrasferNames ( Abc_Ntk_t * pNtk,
Abc_Ntk_t * pNtkNew )
extern

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

Synopsis [Tranfers names to the old network.]

Description [Assumes that the new nodes are attached using pObj->pCopy.]

SideEffects []

SeeAlso []

Definition at line 146 of file abcNames.c.

147{
148 Abc_Obj_t * pObj;
149 int i;
150 assert( Abc_NtkPiNum(pNtk) == Abc_NtkPiNum(pNtkNew) );
151 assert( Abc_NtkPoNum(pNtk) == Abc_NtkPoNum(pNtkNew) );
152 assert( Abc_NtkBoxNum(pNtk) == Abc_NtkBoxNum(pNtkNew) );
153 assert( Nm_ManNumEntries(pNtk->pManName) > 0 );
154 assert( Nm_ManNumEntries(pNtkNew->pManName) == 0 );
155 // copy the CI/CO/box names
156 Abc_NtkForEachCi( pNtk, pObj, i )
157 Abc_ObjAssignName( pObj->pCopy, Abc_ObjName(Abc_ObjFanout0Ntk(pObj)), NULL );
158 Abc_NtkForEachCo( pNtk, pObj, i )
159 Abc_ObjAssignName( pObj->pCopy, Abc_ObjName(Abc_ObjFanin0Ntk(pObj)), NULL );
160 Abc_NtkForEachBox( pNtk, pObj, i )
161 Abc_ObjAssignName( pObj->pCopy, Abc_ObjName(pObj), NULL );
162}
int Nm_ManNumEntries(Nm_Man_t *p)
Definition nmApi.c:95
Here is the call graph for this function:

◆ Abc_NtkTrasferNamesNoLatches()

ABC_DLL void Abc_NtkTrasferNamesNoLatches ( Abc_Ntk_t * pNtk,
Abc_Ntk_t * pNtkNew )
extern

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

Synopsis [Tranfers names to the old network.]

Description [Assumes that the new nodes are attached using pObj->pCopy.]

SideEffects []

SeeAlso []

Definition at line 175 of file abcNames.c.

176{
177 Abc_Obj_t * pObj;
178 int i;
179 assert( Abc_NtkPiNum(pNtk) == Abc_NtkPiNum(pNtkNew) );
180 assert( Abc_NtkPoNum(pNtk) == Abc_NtkPoNum(pNtkNew) );
181 assert( Nm_ManNumEntries(pNtk->pManName) > 0 );
182 assert( Nm_ManNumEntries(pNtkNew->pManName) == 0 );
183 // copy the CI/CO/box name and skip latches and theirs inputs/outputs
184 Abc_NtkForEachCi( pNtk, pObj, i )
185 if ( Abc_ObjFaninNum(pObj) == 0 || !Abc_ObjIsLatch(Abc_ObjFanin0(pObj)) )
186 Abc_ObjAssignName( pObj->pCopy, Abc_ObjName(Abc_ObjFanout0Ntk(pObj)), NULL );
187 Abc_NtkForEachCo( pNtk, pObj, i )
188 if ( Abc_ObjFanoutNum(pObj) == 0 || !Abc_ObjIsLatch(Abc_ObjFanout0(pObj)) )
189 Abc_ObjAssignName( pObj->pCopy, Abc_ObjName(Abc_ObjFanin0Ntk(pObj)), NULL );
190 Abc_NtkForEachBox( pNtk, pObj, i )
191 if ( !Abc_ObjIsLatch(pObj) )
192 Abc_ObjAssignName( pObj->pCopy, Abc_ObjName(pObj), NULL );
193}
Here is the call graph for this function:

◆ Abc_NtkUnpermute()

ABC_DLL void Abc_NtkUnpermute ( Abc_Ntk_t * pNtk)
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 2409 of file abcNtk.c.

2410{
2411 Vec_Ptr_t * vTemp, * vTemp2, * vLatch;
2412 int i, * pInputs, * pOutputs, * pFlops;
2413 if ( pNtk->vObjPerm == NULL )
2414 {
2415 printf( "Abc_NtkUnpermute(): Initial permutation is not available.\n" );
2416 return;
2417 }
2418 assert( Abc_NtkBoxNum(pNtk) == Abc_NtkLatchNum(pNtk) );
2419 // get reverve permutation
2420 pInputs = Vec_IntArray( pNtk->vObjPerm );
2421 pOutputs = pInputs + Abc_NtkPiNum(pNtk);
2422 pFlops = pOutputs + Abc_NtkPoNum(pNtk);
2423 // create new PI array
2424 vTemp = Vec_PtrAlloc( Abc_NtkPiNum(pNtk) );
2425 for ( i = 0; i < Abc_NtkPiNum(pNtk); i++ )
2426 Vec_PtrPush( vTemp, Abc_NtkPi(pNtk, pInputs[i]) );
2427 Vec_PtrFreeP( &pNtk->vPis );
2428 pNtk->vPis = vTemp;
2429 // create new PO array
2430 vTemp = Vec_PtrAlloc( Abc_NtkPoNum(pNtk) );
2431 for ( i = 0; i < Abc_NtkPoNum(pNtk); i++ )
2432 Vec_PtrPush( vTemp, Abc_NtkPo(pNtk, pOutputs[i]) );
2433 Vec_PtrFreeP( &pNtk->vPos );
2434 pNtk->vPos = vTemp;
2435 // create new CI/CO arrays
2436 vTemp = Vec_PtrDup( pNtk->vPis );
2437 vTemp2 = Vec_PtrDup( pNtk->vPos );
2438 vLatch = Vec_PtrAlloc( Abc_NtkLatchNum(pNtk) );
2439 for ( i = 0; i < Abc_NtkLatchNum(pNtk); i++ )
2440 {
2441//printf( "Setting flop %d to be %d.\n", i, pFlops[i] );
2442 Vec_PtrPush( vTemp, Abc_NtkCi(pNtk, Abc_NtkPiNum(pNtk) + pFlops[i]) );
2443 Vec_PtrPush( vTemp2, Abc_NtkCo(pNtk, Abc_NtkPoNum(pNtk) + pFlops[i]) );
2444 Vec_PtrPush( vLatch, Abc_NtkBox(pNtk, pFlops[i]) );
2445 }
2446 Vec_PtrFreeP( &pNtk->vCis );
2447 Vec_PtrFreeP( &pNtk->vCos );
2448 Vec_PtrFreeP( &pNtk->vBoxes );
2449 pNtk->vCis = vTemp;
2450 pNtk->vCos = vTemp2;
2451 pNtk->vBoxes = vLatch;
2452 // cleanup
2453 Vec_IntFreeP( &pNtk->vObjPerm );
2454}

◆ Abc_NtkUpdate()

ABC_DLL void Abc_NtkUpdate ( Abc_Obj_t * pObj,
Abc_Obj_t * pObjNew,
Vec_Vec_t * vLevels )
extern

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

Synopsis [Replaces the node and incrementally updates levels.]

Description []

SideEffects []

SeeAlso []

Definition at line 1423 of file abcTiming.c.

1424{
1425 // replace the old node by the new node
1426 pObjNew->Level = pObj->Level;
1427 Abc_ObjReplace( pObj, pObjNew );
1428 // update the level of the node
1429 Abc_NtkUpdateLevel( pObjNew, vLevels );
1430 Abc_ObjSetReverseLevel( pObjNew, 0 );
1431 Abc_NtkUpdateReverseLevel( pObjNew, vLevels );
1432}
void Abc_NtkUpdateLevel(Abc_Obj_t *pObjNew, Vec_Vec_t *vLevels)
Definition abcTiming.c:1322
void Abc_NtkUpdateReverseLevel(Abc_Obj_t *pObjNew, Vec_Vec_t *vLevels)
Definition abcTiming.c:1374
ABC_DLL void Abc_ObjReplace(Abc_Obj_t *pObjOld, Abc_Obj_t *pObjNew)
Definition abcFanio.c:325
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkUpdateLevel()

ABC_DLL void Abc_NtkUpdateLevel ( Abc_Obj_t * pObjNew,
Vec_Vec_t * vLevels )
extern

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

Synopsis [Incrementally updates level of the nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 1322 of file abcTiming.c.

1323{
1324 Abc_Obj_t * pFanout, * pTemp;
1325 int LevelOld, Lev, k, m;
1326// int Counter = 0, CounterMax = 0;
1327 // check if level has changed
1328 LevelOld = Abc_ObjLevel(pObjNew);
1329 if ( LevelOld == Abc_ObjLevelNew(pObjNew) )
1330 return;
1331 // start the data structure for level update
1332 // we cannot fail to visit a node when using this structure because the
1333 // nodes are stored by their _old_ levels, which are assumed to be correct
1334 Vec_VecClear( vLevels );
1335 Vec_VecPush( vLevels, LevelOld, pObjNew );
1336 pObjNew->fMarkA = 1;
1337 // recursively update level
1338 Vec_VecForEachEntryStart( Abc_Obj_t *, vLevels, pTemp, Lev, k, LevelOld )
1339 {
1340// Counter--;
1341 pTemp->fMarkA = 0;
1342 assert( Abc_ObjLevel(pTemp) == Lev );
1343 Abc_ObjSetLevel( pTemp, Abc_ObjLevelNew(pTemp) );
1344 // if the level did not change, no need to check the fanout levels
1345 if ( Abc_ObjLevel(pTemp) == Lev )
1346 continue;
1347 // schedule fanout for level update
1348 Abc_ObjForEachFanout( pTemp, pFanout, m )
1349 {
1350 if ( !Abc_ObjIsCo(pFanout) && !pFanout->fMarkA )
1351 {
1352 assert( Abc_ObjLevel(pFanout) >= Lev );
1353 Vec_VecPush( vLevels, Abc_ObjLevel(pFanout), pFanout );
1354// Counter++;
1355// CounterMax = Abc_MaxFloat( CounterMax, Counter );
1356 pFanout->fMarkA = 1;
1357 }
1358 }
1359 }
1360// printf( "%d ", CounterMax );
1361}
int Abc_ObjLevelNew(Abc_Obj_t *pObj)
Definition abcTiming.c:1170
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkUpdateNameIds()

ABC_DLL void Abc_NtkUpdateNameIds ( Abc_Ntk_t * p)
extern

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

Synopsis [Updates file with name IDs.]

Description []

SideEffects []

SeeAlso []

Definition at line 793 of file abcNames.c.

794{
795 char pFileName[1000];
796 Vec_Int_t * vStarts;
797 Abc_Obj_t * pObj;
798 FILE * pFile;
799 int i, c, iVar, fCompl, fSeenSpace, Counter = 0;
800 assert( !Abc_NtkIsNetlist(p) );
801 assert( strlen(p->pSpec) < 1000 );
802 assert( p->vNameIds != NULL );
803 sprintf( pFileName, "%s_%s_names.txt", Extra_FileNameGenericAppend(p->pSpec,""), Extra_FileNameExtension(p->pSpec) );
804 pFile = fopen( pFileName, "r+" );
805 // collect info about lines
806 fSeenSpace = 0;
807 vStarts = Vec_IntAlloc( 1000 );
808 Vec_IntPush( vStarts, -1 );
809 while ( (c = fgetc(pFile)) != EOF && ++Counter )
810 if ( c == ' ' && !fSeenSpace )
811 Vec_IntPush(vStarts, Counter), fSeenSpace = 1;
812 else if ( c == '\n' )
813 fSeenSpace = 0;
814 // add info about names
815 Abc_NtkForEachObj( p, pObj, i )
816 {
817 if ( i == 0 || i >= Vec_IntSize(p->vNameIds) || !Vec_IntEntry(p->vNameIds, i) )
818 continue;
819 iVar = Abc_Lit2Var( Vec_IntEntry(p->vNameIds, i) );
820 fCompl = Abc_LitIsCompl( Vec_IntEntry(p->vNameIds, i) );
821 assert( iVar < Vec_IntSize(vStarts) );
822 fseek( pFile, Vec_IntEntry(vStarts, iVar), SEEK_SET );
823 fprintf( pFile, "%s%d", fCompl? "-":"", i );
824 }
825 printf( "Saved %d names into file \"%s\".\n", Vec_IntSize(vStarts)-1, pFileName );
826 fclose( pFile );
827 Vec_IntFree( vStarts );
828 Vec_IntFreeP( &p->vNameIds );
829// Abc_NtkForEachObj( p, pObj, i )
830// Abc_ObjPrint( stdout, pObj );
831}
#define SEEK_SET
Definition zconf.h:390
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkUpdateReverseLevel()

ABC_DLL void Abc_NtkUpdateReverseLevel ( Abc_Obj_t * pObjNew,
Vec_Vec_t * vLevels )
extern

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

Synopsis [Incrementally updates level of the nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 1374 of file abcTiming.c.

1375{
1376 Abc_Obj_t * pFanin, * pTemp;
1377 int LevelOld, LevFanin, Lev, k, m;
1378 // check if level has changed
1379 LevelOld = Abc_ObjReverseLevel(pObjNew);
1380 if ( LevelOld == Abc_ObjReverseLevelNew(pObjNew) )
1381 return;
1382 // start the data structure for level update
1383 // we cannot fail to visit a node when using this structure because the
1384 // nodes are stored by their _old_ levels, which are assumed to be correct
1385 Vec_VecClear( vLevels );
1386 Vec_VecPush( vLevels, LevelOld, pObjNew );
1387 pObjNew->fMarkA = 1;
1388 // recursively update level
1389 Vec_VecForEachEntryStart( Abc_Obj_t *, vLevels, pTemp, Lev, k, LevelOld )
1390 {
1391 pTemp->fMarkA = 0;
1392 LevelOld = Abc_ObjReverseLevel(pTemp);
1393 assert( LevelOld == Lev );
1395 // if the level did not change, no need to check the fanout levels
1396 if ( Abc_ObjReverseLevel(pTemp) == Lev )
1397 continue;
1398 // schedule fanins for level update
1399 Abc_ObjForEachFanin( pTemp, pFanin, m )
1400 {
1401 if ( !Abc_ObjIsCi(pFanin) && !pFanin->fMarkA )
1402 {
1403 LevFanin = Abc_ObjReverseLevel( pFanin );
1404 assert( LevFanin >= Lev );
1405 Vec_VecPush( vLevels, LevFanin, pFanin );
1406 pFanin->fMarkA = 1;
1407 }
1408 }
1409 }
1410}
int Abc_ObjReverseLevel(Abc_Obj_t *pObj)
Definition abcTiming.c:1233
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkVerifyGetCleanModel()

ABC_DLL int * Abc_NtkVerifyGetCleanModel ( Abc_Ntk_t * pNtk,
int nFrames )
extern

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

Synopsis [Returns a dummy pattern full of zeros.]

Description []

SideEffects []

SeeAlso []

Definition at line 678 of file abcVerify.c.

679{
680 int * pModel = ABC_ALLOC( int, Abc_NtkCiNum(pNtk) * nFrames );
681 memset( pModel, 0, sizeof(int) * Abc_NtkCiNum(pNtk) * nFrames );
682 return pModel;
683}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkVerifySimulatePattern()

ABC_DLL int * Abc_NtkVerifySimulatePattern ( Abc_Ntk_t * pNtk,
int * pModel )
extern

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

Synopsis [Returns the PO values under the given input pattern.]

Description []

SideEffects []

SeeAlso []

Definition at line 696 of file abcVerify.c.

697{
698 Abc_Obj_t * pNode;
699 int * pValues, Value0, Value1, i;
700 int fStrashed = 0;
701 if ( !Abc_NtkIsStrash(pNtk) )
702 {
703 pNtk = Abc_NtkStrash(pNtk, 0, 0, 0);
704 fStrashed = 1;
705 }
706/*
707 printf( "Counter example: " );
708 Abc_NtkForEachCi( pNtk, pNode, i )
709 printf( " %d", pModel[i] );
710 printf( "\n" );
711*/
712 // increment the trav ID
713 Abc_NtkIncrementTravId( pNtk );
714 // set the CI values
715 Abc_AigConst1(pNtk)->pCopy = (Abc_Obj_t *)1;
716 Abc_NtkForEachCi( pNtk, pNode, i )
717 pNode->pCopy = (Abc_Obj_t *)(ABC_PTRINT_T)pModel[i];
718 // simulate in the topological order
719 Abc_NtkForEachNode( pNtk, pNode, i )
720 {
721 Value0 = ((int)(ABC_PTRINT_T)Abc_ObjFanin0(pNode)->pCopy) ^ (int)Abc_ObjFaninC0(pNode);
722 Value1 = ((int)(ABC_PTRINT_T)Abc_ObjFanin1(pNode)->pCopy) ^ (int)Abc_ObjFaninC1(pNode);
723 pNode->pCopy = (Abc_Obj_t *)(ABC_PTRINT_T)(Value0 & Value1);
724 }
725 // fill the output values
726 pValues = ABC_ALLOC( int, Abc_NtkCoNum(pNtk) );
727 Abc_NtkForEachCo( pNtk, pNode, i )
728 pValues[i] = ((int)(ABC_PTRINT_T)Abc_ObjFanin0(pNode)->pCopy) ^ (int)Abc_ObjFaninC0(pNode);
729 if ( fStrashed )
730 Abc_NtkDelete( pNtk );
731 return pValues;
732}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkWriteLogFile()

ABC_DLL void Abc_NtkWriteLogFile ( char * pFileName,
Abc_Cex_t * pCex,
int Status,
int nFrames,
char * pCommand )
extern

DECLARATIONS ///.

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

FileName [abcLog.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Network and node package.]

Synopsis [Log file printing.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

] FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 68 of file abcLog.c.

69{
70 FILE * pFile;
71 int i;
72 pFile = fopen( pFileName, "w" );
73 if ( pFile == NULL )
74 {
75 printf( "Cannot open log file for writing \"%s\".\n" , pFileName );
76 return;
77 }
78 // write <result>
79 if ( Status == 1 )
80 fprintf( pFile, "snl_UNSAT" );
81 else if ( Status == 0 )
82 fprintf( pFile, "snl_SAT" );
83 else if ( Status == -1 )
84 fprintf( pFile, "snl_UNK" );
85 else
86 printf( "Abc_NtkWriteLogFile(): Cannot recognize solving status.\n" );
87 fprintf( pFile, " " );
88 // write <bug_free_depth>
89 fprintf( pFile, "%d", nFrames );
90 fprintf( pFile, " " );
91 // write <engine_name>
92 fprintf( pFile, "%s", pCommand ? pCommand : "unknown" );
93 if ( pCex && Status == 0 )
94 fprintf( pFile, " %d", pCex->iPo );
95 // write <cyc>
96 if ( pCex && pCex->iFrame != nFrames )
97 fprintf( pFile, " %d", pCex->iFrame );
98 fprintf( pFile, "\n" );
99 // write <INIT_STATE>
100 if ( pCex == NULL )
101 fprintf( pFile, "NULL" );
102 else
103 {
104 for ( i = 0; i < pCex->nRegs; i++ )
105 fprintf( pFile, "%d", Abc_InfoHasBit(pCex->pData,i) );
106 }
107 fprintf( pFile, "\n" );
108 // write <TRACE>
109 if ( pCex == NULL )
110 fprintf( pFile, "NULL" );
111 else
112 {
113 assert( pCex->nBits - pCex->nRegs == pCex->nPis * (pCex->iFrame + 1) );
114 for ( i = pCex->nRegs; i < pCex->nBits; i++ )
115 fprintf( pFile, "%d", Abc_InfoHasBit(pCex->pData,i) );
116 }
117 fprintf( pFile, "\n" );
118 fclose( pFile );
119}

◆ Abc_ObjAddFanin()

ABC_DLL void Abc_ObjAddFanin ( Abc_Obj_t * pObj,
Abc_Obj_t * pFanin )
extern

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

Synopsis [Creates fanout/fanin relationship between the nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 84 of file abcFanio.c.

85{
86 Abc_Obj_t * pFaninR = Abc_ObjRegular(pFanin);
87 assert( !Abc_ObjIsComplement(pObj) );
88 assert( pObj->pNtk == pFaninR->pNtk );
89 assert( pObj->Id >= 0 && pFaninR->Id >= 0 );
90 assert( !Abc_ObjIsPi(pObj) && !Abc_ObjIsPo(pFaninR) ); // fanin of PI or fanout of PO
91 assert( !Abc_ObjIsCo(pObj) || !Abc_ObjFaninNum(pObj) ); // CO with two fanins
92 assert( !Abc_ObjIsNet(pObj) || !Abc_ObjFaninNum(pObj) ); // net with two fanins
93 Vec_IntPushMem( pObj->pNtk->pMmStep, &pObj->vFanins, pFaninR->Id );
94 Vec_IntPushMem( pObj->pNtk->pMmStep, &pFaninR->vFanouts, pObj->Id );
95 if ( Abc_ObjIsComplement(pFanin) )
96 Abc_ObjSetFaninC( pObj, Abc_ObjFaninNum(pObj)-1 );
97}

◆ Abc_ObjAlloc()

ABC_DLL Abc_Obj_t * Abc_ObjAlloc ( Abc_Ntk_t * pNtk,
Abc_ObjType_t Type )
extern

DECLARATIONS ///.

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

FileName [abcObj.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Network and node package.]

Synopsis [Object creation/duplication/deletion procedures.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

] FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis [Creates a new object.]

Description []

SideEffects []

SeeAlso []

Definition at line 52 of file abcObj.c.

53{
54 Abc_Obj_t * pObj;
55 if ( pNtk->pMmObj )
56 pObj = (Abc_Obj_t *)Mem_FixedEntryFetch( pNtk->pMmObj );
57 else
58 pObj = (Abc_Obj_t *)ABC_ALLOC( Abc_Obj_t, 1 );
59 memset( pObj, 0, sizeof(Abc_Obj_t) );
60 pObj->pNtk = pNtk;
61 pObj->Type = Type;
62 pObj->Id = -1;
63 return pObj;
64}
char * Mem_FixedEntryFetch(Mem_Fixed_t *p)
Definition mem.c:184
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_ObjAssignName()

ABC_DLL char * Abc_ObjAssignName ( Abc_Obj_t * pObj,
char * pName,
char * pSuffix )
extern

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

Synopsis [Assigns the given name to the object.]

Description [The object should not have a name assigned. The same name may be used for several objects, which they share the same net in the original netlist. (For example, latch output and primary output may have the same name.) This procedure returns the pointer to the internally stored representation of the given name.]

SideEffects []

SeeAlso []

Definition at line 69 of file abcNames.c.

70{
71 assert( pName != NULL );
72 return Nm_ManStoreIdName( pObj->pNtk->pManName, pObj->Id, pObj->Type, pName, pSuffix );
73}
Here is the call graph for this function:

◆ Abc_ObjDeleteFanin()

ABC_DLL void Abc_ObjDeleteFanin ( Abc_Obj_t * pObj,
Abc_Obj_t * pFanin )
extern

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

Synopsis [Destroys fanout/fanin relationship between the nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 111 of file abcFanio.c.

112{
113 assert( !Abc_ObjIsComplement(pObj) );
114 assert( !Abc_ObjIsComplement(pFanin) );
115 assert( pObj->pNtk == pFanin->pNtk );
116 assert( pObj->Id >= 0 && pFanin->Id >= 0 );
117 if ( !Vec_IntRemove( &pObj->vFanins, pFanin->Id ) )
118 {
119 printf( "The obj %d is not found among the fanins of obj %d ...\n", pFanin->Id, pObj->Id );
120 return;
121 }
122 if ( !Vec_IntRemove( &pFanin->vFanouts, pObj->Id ) )
123 {
124 printf( "The obj %d is not found among the fanouts of obj %d ...\n", pObj->Id, pFanin->Id );
125 return;
126 }
127}
Here is the caller graph for this function:

◆ Abc_ObjFanoutFaninNum()

ABC_DLL int Abc_ObjFanoutFaninNum ( Abc_Obj_t * pFanout,
Abc_Obj_t * pFanin )
extern

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

Synopsis [Returns the index of the fanin in the fanin list of the fanout.]

Description []

SideEffects []

SeeAlso []

Definition at line 373 of file abcFanio.c.

374{
375 Abc_Obj_t * pObj;
376 int i;
377 Abc_ObjForEachFanin( pFanout, pObj, i )
378 if ( pObj == pFanin )
379 return i;
380 return -1;
381}
Here is the caller graph for this function:

◆ Abc_ObjInsertBetween()

ABC_DLL Abc_Obj_t * Abc_ObjInsertBetween ( Abc_Obj_t * pNodeIn,
Abc_Obj_t * pNodeOut,
Abc_ObjType_t Type )
extern

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

Synopsis [Inserts one-input node of the type specified between the nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 251 of file abcFanio.c.

252{
253 Abc_Obj_t * pNodeNew;
254 int iFanoutIndex, iFaninIndex;
255 // find pNodeOut among the fanouts of pNodeIn
256 if ( (iFanoutIndex = Vec_IntFind( &pNodeIn->vFanouts, pNodeOut->Id )) == -1 )
257 {
258 printf( "Node %s is not among", Abc_ObjName(pNodeOut) );
259 printf( " the fanouts of node %s...\n", Abc_ObjName(pNodeIn) );
260 return NULL;
261 }
262 // find pNodeIn among the fanins of pNodeOut
263 if ( (iFaninIndex = Vec_IntFind( &pNodeOut->vFanins, pNodeIn->Id )) == -1 )
264 {
265 printf( "Node %s is not among", Abc_ObjName(pNodeIn) );
266 printf( " the fanins of node %s...\n", Abc_ObjName(pNodeOut) );
267 return NULL;
268 }
269 // create the new node
270 pNodeNew = Abc_NtkCreateObj( pNodeIn->pNtk, Type );
271 // add pNodeIn as fanin and pNodeOut as fanout
272 Vec_IntPushMem( pNodeNew->pNtk->pMmStep, &pNodeNew->vFanins, pNodeIn->Id );
273 Vec_IntPushMem( pNodeNew->pNtk->pMmStep, &pNodeNew->vFanouts, pNodeOut->Id );
274 // update the fanout of pNodeIn
275 Vec_IntWriteEntry( &pNodeIn->vFanouts, iFanoutIndex, pNodeNew->Id );
276 // update the fanin of pNodeOut
277 Vec_IntWriteEntry( &pNodeOut->vFanins, iFaninIndex, pNodeNew->Id );
278 return pNodeNew;
279}
Here is the call graph for this function:

◆ Abc_ObjLevelNew()

ABC_DLL int Abc_ObjLevelNew ( Abc_Obj_t * pObj)
extern

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

Synopsis [Computes the level of the node using its fanin levels.]

Description []

SideEffects []

SeeAlso []

Definition at line 1170 of file abcTiming.c.

1171{
1172 Abc_Obj_t * pFanin;
1173 int i, Level = 0;
1174 Abc_ObjForEachFanin( pObj, pFanin, i )
1175 Level = Abc_MaxFloat( Level, Abc_ObjLevel(pFanin) );
1176 return Level + (int)(Abc_ObjFaninNum(pObj) > 0);
1177}
Here is the caller graph for this function:

◆ Abc_ObjName()

ABC_DLL char * Abc_ObjName ( Abc_Obj_t * pObj)
extern

DECLARATIONS ///.

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

FileName [abcNames.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Network and node package.]

Synopsis [Procedures working with net and node names.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

] FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis [Returns the unique name for the object.]

Description [If the name previously did not exist, creates a new unique name but does not assign this name to the object. The temporary unique name is stored in a static buffer inside this procedure. It is important that the name is used before the function is called again!]

SideEffects []

SeeAlso []

Definition at line 49 of file abcNames.c.

50{
51 return Nm_ManCreateUniqueName( pObj->pNtk->pManName, pObj->Id );
52}
char * Nm_ManCreateUniqueName(Nm_Man_t *p, int ObjId)
Definition nmApi.c:175
Here is the call graph for this function:

◆ Abc_ObjNameDummy()

ABC_DLL char * Abc_ObjNameDummy ( char * pPrefix,
int Num,
int nDigits )
extern

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

Synopsis [Returns the dummy PI name.]

Description []

SideEffects []

SeeAlso []

Definition at line 122 of file abcNames.c.

123{
124 static char Buffer[2000];
125 sprintf( Buffer, "%s%0*d", pPrefix, nDigits, Num );
126 return Buffer;
127}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_ObjNamePrefix()

ABC_DLL char * Abc_ObjNamePrefix ( Abc_Obj_t * pObj,
char * pPrefix )
extern

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

Synopsis [Appends name to the prefix]

Description []

SideEffects []

SeeAlso []

Definition at line 86 of file abcNames.c.

87{
88 static char Buffer[2000];
89 sprintf( Buffer, "%s%s", pPrefix, Abc_ObjName(pObj) );
90 return Buffer;
91}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_ObjNameSuffix()

ABC_DLL char * Abc_ObjNameSuffix ( Abc_Obj_t * pObj,
char * pSuffix )
extern

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

Synopsis [Appends suffic to the name.]

Description []

SideEffects []

SeeAlso []

Definition at line 104 of file abcNames.c.

105{
106 static char Buffer[2000];
107 sprintf( Buffer, "%s%s", Abc_ObjName(pObj), pSuffix );
108 return Buffer;
109}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_ObjPatchFanin()

ABC_DLL void Abc_ObjPatchFanin ( Abc_Obj_t * pObj,
Abc_Obj_t * pFaninOld,
Abc_Obj_t * pFaninNew )
extern

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

Synopsis [Replaces a fanin of the node.]

Description [The node is pObj. An old fanin of this node (pFaninOld) has to be replaced by a new fanin (pFaninNew). Assumes that the node and the old fanin are not complemented. The new fanin can be complemented. In this case, the polarity of the new fanin will change, compared to the polarity of the old fanin.]

SideEffects []

SeeAlso []

Definition at line 172 of file abcFanio.c.

173{
174 Abc_Obj_t * pFaninNewR = Abc_ObjRegular(pFaninNew);
175 int iFanin;//, nLats;//, fCompl;
176 assert( !Abc_ObjIsComplement(pObj) );
177 assert( !Abc_ObjIsComplement(pFaninOld) );
178 assert( pFaninOld != pFaninNewR );
179// assert( pObj != pFaninOld );
180// assert( pObj != pFaninNewR );
181 assert( pObj->pNtk == pFaninOld->pNtk );
182 assert( pObj->pNtk == pFaninNewR->pNtk );
183 if ( (iFanin = Vec_IntFind( &pObj->vFanins, pFaninOld->Id )) == -1 )
184 {
185 printf( "Node %s is not among", Abc_ObjName(pFaninOld) );
186 printf( " the fanins of node %s...\n", Abc_ObjName(pObj) );
187 return;
188 }
189
190 // remember the attributes of the old fanin
191// fCompl = Abc_ObjFaninC(pObj, iFanin);
192 // replace the old fanin entry by the new fanin entry (removes attributes)
193 Vec_IntWriteEntry( &pObj->vFanins, iFanin, pFaninNewR->Id );
194 // set the attributes of the new fanin
195// if ( fCompl ^ Abc_ObjIsComplement(pFaninNew) )
196// Abc_ObjSetFaninC( pObj, iFanin );
197 if ( Abc_ObjIsComplement(pFaninNew) )
198 Abc_ObjXorFaninC( pObj, iFanin );
199
200// if ( Abc_NtkIsSeq(pObj->pNtk) && (nLats = Seq_ObjFaninL(pObj, iFanin)) )
201// Seq_ObjSetFaninL( pObj, iFanin, nLats );
202 // update the fanout of the fanin
203 if ( !Vec_IntRemove( &pFaninOld->vFanouts, pObj->Id ) )
204 {
205 printf( "Node %s is not among", Abc_ObjName(pObj) );
206 printf( " the fanouts of its old fanin %s...\n", Abc_ObjName(pFaninOld) );
207// return;
208 }
209 Vec_IntPushMem( pObj->pNtk->pMmStep, &pFaninNewR->vFanouts, pObj->Id );
210}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_ObjPatchFanoutFanin()

ABC_DLL void Abc_ObjPatchFanoutFanin ( Abc_Obj_t * pObj,
int iObjNew )
extern

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

Synopsis [Replaces pObj by iObjNew in the fanin arrays of the fanouts.]

Description []

SideEffects []

SeeAlso []

Definition at line 223 of file abcFanio.c.

224{
225 Abc_Obj_t * pFanout;
226 int i, k, Entry;
227 // update fanouts of the node to point to this one
228 Abc_ObjForEachFanout( pObj, pFanout, i )
229 {
230 Vec_IntForEachEntry( &pFanout->vFanins, Entry, k )
231 if ( Entry == (int)Abc_ObjId(pObj) )
232 {
233 Vec_IntWriteEntry( &pFanout->vFanins, k, iObjNew );
234 break;
235 }
236 assert( k < Vec_IntSize(&pFanout->vFanins) );
237 }
238}

◆ Abc_ObjPointerCompare()

ABC_DLL int Abc_ObjPointerCompare ( void ** pp1,
void ** pp2 )
extern

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

Synopsis [Compares the pointers.]

Description []

SideEffects []

SeeAlso []

Definition at line 1939 of file abcUtil.c.

1940{
1941 if ( *pp1 < *pp2 )
1942 return -1;
1943 if ( *pp1 > *pp2 )
1944 return 1;
1945 return 0;
1946}
Here is the caller graph for this function:

◆ Abc_ObjPrint()

ABC_DLL void Abc_ObjPrint ( FILE * pFile,
Abc_Obj_t * pObj )
extern

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

Synopsis [Prints information about the object.]

Description []

SideEffects []

SeeAlso []

Definition at line 1674 of file abcPrint.c.

1675{
1676 Abc_Obj_t * pFanin;
1677 int i;
1678 fprintf( pFile, "Object %5d : ", pObj->Id );
1679 switch ( pObj->Type )
1680 {
1681 case ABC_OBJ_NONE:
1682 fprintf( pFile, "NONE " );
1683 break;
1684 case ABC_OBJ_CONST1:
1685 fprintf( pFile, "Const1 " );
1686 break;
1687 case ABC_OBJ_PI:
1688 fprintf( pFile, "PI " );
1689 break;
1690 case ABC_OBJ_PO:
1691 fprintf( pFile, "PO " );
1692 break;
1693 case ABC_OBJ_BI:
1694 fprintf( pFile, "BI " );
1695 break;
1696 case ABC_OBJ_BO:
1697 fprintf( pFile, "BO " );
1698 break;
1699 case ABC_OBJ_NET:
1700 fprintf( pFile, "Net " );
1701 break;
1702 case ABC_OBJ_NODE:
1703 fprintf( pFile, "Node " );
1704 break;
1705 case ABC_OBJ_LATCH:
1706 fprintf( pFile, "Latch " );
1707 break;
1708 case ABC_OBJ_WHITEBOX:
1709 fprintf( pFile, "Whitebox" );
1710 break;
1711 case ABC_OBJ_BLACKBOX:
1712 fprintf( pFile, "Blackbox" );
1713 break;
1714 default:
1715 assert(0);
1716 break;
1717 }
1718 // print the fanins
1719 fprintf( pFile, " Fanins ( " );
1720 Abc_ObjForEachFanin( pObj, pFanin, i )
1721 fprintf( pFile, "%d ", pFanin->Id );
1722 fprintf( pFile, ") " );
1723/*
1724 fprintf( pFile, " Fanouts ( " );
1725 Abc_ObjForEachFanout( pObj, pFanin, i )
1726 fprintf( pFile, "%d(%c) ", pFanin->Id, Abc_NodeIsTravIdCurrent(pFanin)? '+' : '-' );
1727 fprintf( pFile, ") " );
1728*/
1729 // print the logic function
1730 if ( Abc_ObjIsNode(pObj) && Abc_NtkIsSopLogic(pObj->pNtk) )
1731 fprintf( pFile, " %s", (char*)pObj->pData );
1732 else if ( Abc_ObjIsNode(pObj) && Abc_NtkIsMappedLogic(pObj->pNtk) )
1733 fprintf( pFile, " %s\n", Mio_GateReadName((Mio_Gate_t *)pObj->pData) );
1734 else
1735 fprintf( pFile, "\n" );
1736}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_ObjRecycle()

ABC_DLL void Abc_ObjRecycle ( Abc_Obj_t * pObj)
extern

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

Synopsis [Recycles the object.]

Description []

SideEffects []

SeeAlso []

Definition at line 77 of file abcObj.c.

78{
79 Abc_Ntk_t * pNtk = pObj->pNtk;
80// int LargePiece = (4 << ABC_NUM_STEPS);
81 // free large fanout arrays
82// if ( pNtk->pMmStep && pObj->vFanouts.nCap * 4 > LargePiece )
83// free( pObj->vFanouts.pArray );
84 if ( pNtk->pMmStep == NULL )
85 {
86 ABC_FREE( pObj->vFanouts.pArray );
87 ABC_FREE( pObj->vFanins.pArray );
88 }
89 // clean the memory to make deleted object distinct from the live one
90 memset( pObj, 0, sizeof(Abc_Obj_t) );
91 // recycle the object
92 if ( pNtk->pMmObj )
93 Mem_FixedEntryRecycle( pNtk->pMmObj, (char *)pObj );
94 else
95 ABC_FREE( pObj );
96}
void Mem_FixedEntryRecycle(Mem_Fixed_t *p, char *pEntry)
Definition mem.c:235
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_ObjRemoveFanins()

ABC_DLL void Abc_ObjRemoveFanins ( Abc_Obj_t * pObj)
extern

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

Synopsis [Destroys fanout/fanin relationship between the nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 141 of file abcFanio.c.

142{
143 Vec_Int_t * vFaninsOld;
144 Abc_Obj_t * pFanin;
145 int k;
146 // remove old fanins
147 vFaninsOld = &pObj->vFanins;
148 for ( k = vFaninsOld->nSize - 1; k >= 0; k-- )
149 {
150 pFanin = Abc_NtkObj( pObj->pNtk, vFaninsOld->pArray[k] );
151 Abc_ObjDeleteFanin( pObj, pFanin );
152 }
153 pObj->fCompl0 = 0;
154 pObj->fCompl1 = 0;
155 assert( vFaninsOld->nSize == 0 );
156}
void Abc_ObjDeleteFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
Definition abcFanio.c:111
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_ObjReplace()

ABC_DLL void Abc_ObjReplace ( Abc_Obj_t * pNodeOld,
Abc_Obj_t * pNodeNew )
extern

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

Synopsis [Replaces the node by a new node.]

Description []

SideEffects []

SeeAlso []

Definition at line 325 of file abcFanio.c.

326{
327 assert( !Abc_ObjIsComplement(pNodeOld) );
328 assert( !Abc_ObjIsComplement(pNodeNew) );
329 assert( pNodeOld->pNtk == pNodeNew->pNtk );
330 assert( pNodeOld != pNodeNew );
331 assert( Abc_ObjFanoutNum(pNodeOld) > 0 );
332 // transfer the fanouts to the old node
333 Abc_ObjTransferFanout( pNodeOld, pNodeNew );
334 // remove the old node
335 Abc_NtkDeleteObj_rec( pNodeOld, 1 );
336}
void Abc_ObjTransferFanout(Abc_Obj_t *pNodeFrom, Abc_Obj_t *pNodeTo)
Definition abcFanio.c:292
ABC_DLL void Abc_NtkDeleteObj_rec(Abc_Obj_t *pObj, int fOnlyNodes)
Definition abcObj.c:278
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_ObjReplaceByConstant()

ABC_DLL void Abc_ObjReplaceByConstant ( Abc_Obj_t * pNode,
int fConst1 )
extern

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

Synopsis [Replaces a node by a constant.]

Description []

SideEffects []

SeeAlso []

Definition at line 349 of file abcFanio.c.

350{
351 Abc_Obj_t * pNodeNew;
352 assert( Abc_NtkIsLogic(pNode->pNtk) );
353 assert( !Abc_ObjIsCo(pNode) );
354 pNodeNew = fConst1 ? Abc_NtkCreateNodeConst1(pNode->pNtk) : Abc_NtkCreateNodeConst0(pNode->pNtk);
355 // transfer the fanouts to the old node
356 Abc_ObjTransferFanout( pNode, pNodeNew );
357 // remove the old node
358 if ( Abc_ObjIsNode(pNode) )
359 Abc_NtkDeleteObj_rec( pNode, 1 );
360}
Here is the call graph for this function:

◆ Abc_ObjRequiredLevel()

ABC_DLL int Abc_ObjRequiredLevel ( Abc_Obj_t * pObj)
extern

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

Synopsis [Returns required level of the node.]

Description [Converts the reverse levels of the node into its required level as follows: ReqLevel(Node) = MaxLevels(Ntk) + 1 - LevelR(Node).]

SideEffects []

SeeAlso []

Definition at line 1214 of file abcTiming.c.

1215{
1216 Abc_Ntk_t * pNtk = pObj->pNtk;
1217 assert( pNtk->vLevelsR );
1218 return pNtk->LevelMax + 1 - Abc_ObjReverseLevel(pObj);
1219}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_ObjReverseLevel()

ABC_DLL int Abc_ObjReverseLevel ( Abc_Obj_t * pObj)
extern

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

Synopsis [Returns the reverse level of the node.]

Description [The reverse level is the level of the node in reverse topological order, starting from the COs.]

SideEffects []

SeeAlso []

Definition at line 1233 of file abcTiming.c.

1234{
1235 Abc_Ntk_t * pNtk = pObj->pNtk;
1236 assert( pNtk->vLevelsR );
1237 Vec_IntFillExtra( pNtk->vLevelsR, pObj->Id + 1, 0 );
1238 return Vec_IntEntry(pNtk->vLevelsR, pObj->Id);
1239}
Here is the caller graph for this function:

◆ Abc_ObjReverseLevelNew()

ABC_DLL int Abc_ObjReverseLevelNew ( Abc_Obj_t * pObj)
extern

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

Synopsis [Computes the reverse level of the node using its fanout levels.]

Description []

SideEffects []

SeeAlso []

Definition at line 1190 of file abcTiming.c.

1191{
1192 Abc_Obj_t * pFanout;
1193 int i, LevelCur, Level = 0;
1194 Abc_ObjForEachFanout( pObj, pFanout, i )
1195 {
1196 LevelCur = Abc_ObjReverseLevel( pFanout );
1197 Level = Abc_MaxFloat( Level, LevelCur );
1198 }
1199 return Level + 1;
1200}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_ObjSetReverseLevel()

ABC_DLL void Abc_ObjSetReverseLevel ( Abc_Obj_t * pObj,
int LevelR )
extern

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

Synopsis [Sets the reverse level of the node.]

Description [The reverse level is the level of the node in reverse topological order, starting from the COs.]

SideEffects []

SeeAlso []

Definition at line 1253 of file abcTiming.c.

1254{
1255 Abc_Ntk_t * pNtk = pObj->pNtk;
1256 assert( pNtk->vLevelsR );
1257 Vec_IntFillExtra( pNtk->vLevelsR, pObj->Id + 1, 0 );
1258 Vec_IntWriteEntry( pNtk->vLevelsR, pObj->Id, LevelR );
1259}
Here is the caller graph for this function:

◆ Abc_ObjTransferFanout()

ABC_DLL void Abc_ObjTransferFanout ( Abc_Obj_t * pNodeFrom,
Abc_Obj_t * pNodeTo )
extern

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

Synopsis [Transfers fanout from the old node to the new node.]

Description []

SideEffects []

SeeAlso []

Definition at line 292 of file abcFanio.c.

293{
294 Vec_Ptr_t * vFanouts;
295 int nFanoutsOld, i;
296 assert( !Abc_ObjIsComplement(pNodeFrom) );
297 assert( !Abc_ObjIsComplement(pNodeTo) );
298 assert( !Abc_ObjIsPo(pNodeFrom) && !Abc_ObjIsPo(pNodeTo) );
299 assert( pNodeFrom->pNtk == pNodeTo->pNtk );
300 assert( pNodeFrom != pNodeTo );
301 assert( !Abc_ObjIsNode(pNodeFrom) || Abc_ObjFanoutNum(pNodeFrom) > 0 );
302 // get the fanouts of the old node
303 nFanoutsOld = Abc_ObjFanoutNum(pNodeTo);
304 vFanouts = Vec_PtrAlloc( nFanoutsOld );
305 Abc_NodeCollectFanouts( pNodeFrom, vFanouts );
306 // patch the fanin of each of them
307 for ( i = 0; i < vFanouts->nSize; i++ )
308 Abc_ObjPatchFanin( (Abc_Obj_t *)vFanouts->pArray[i], pNodeFrom, pNodeTo );
309 assert( Abc_ObjFanoutNum(pNodeFrom) == 0 );
310 assert( Abc_ObjFanoutNum(pNodeTo) == nFanoutsOld + vFanouts->nSize );
311 Vec_PtrFree( vFanouts );
312}
void Abc_ObjPatchFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFaninOld, Abc_Obj_t *pFaninNew)
Definition abcFanio.c:172
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SopCheck()

ABC_DLL int Abc_SopCheck ( char * pSop,
int nFanins )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 871 of file abcSop.c.

872{
873 char * pCubes, * pCubesOld;
874 int fFound0 = 0, fFound1 = 0;
875
876 // check the logic function of the node
877 for ( pCubes = pSop; *pCubes; pCubes++ )
878 {
879 // get the end of the next cube
880 for ( pCubesOld = pCubes; *pCubes != ' '; pCubes++ );
881 // compare the distance
882 if ( pCubes - pCubesOld != nFanins )
883 {
884 fprintf( stdout, "Abc_SopCheck: SOP has a mismatch between its cover size (%d) and its fanin number (%d).\n",
885 (int)(ABC_PTRDIFF_T)(pCubes - pCubesOld), nFanins );
886 return 0;
887 }
888 // check the output values for this cube
889 pCubes++;
890 if ( *pCubes == '0' )
891 fFound0 = 1;
892 else if ( *pCubes == '1' )
893 fFound1 = 1;
894 else if ( *pCubes != 'x' && *pCubes != 'n' )
895 {
896 fprintf( stdout, "Abc_SopCheck: SOP has a strange character (%c) in the output part of its cube.\n", *pCubes );
897 return 0;
898 }
899 // check the last symbol (new line)
900 pCubes++;
901 if ( *pCubes != '\n' )
902 {
903 fprintf( stdout, "Abc_SopCheck: SOP has a cube without new line in the end.\n" );
904 return 0;
905 }
906 }
907 if ( fFound0 && fFound1 )
908 {
909 fprintf( stdout, "Abc_SopCheck: SOP has cubes in both phases.\n" );
910 return 0;
911 }
912 return 1;
913}

◆ Abc_SopComplement()

ABC_DLL void Abc_SopComplement ( char * pSop)
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 648 of file abcSop.c.

649{
650 char * pCur;
651 for ( pCur = pSop; *pCur; pCur++ )
652 if ( *pCur == '\n' )
653 {
654 if ( *(pCur - 1) == '0' )
655 *(pCur - 1) = '1';
656 else if ( *(pCur - 1) == '1' )
657 *(pCur - 1) = '0';
658 else if ( *(pCur - 1) == 'x' )
659 *(pCur - 1) = 'n';
660 else if ( *(pCur - 1) == 'n' )
661 *(pCur - 1) = 'x';
662 else
663 assert( 0 );
664 }
665}
Here is the caller graph for this function:

◆ Abc_SopComplementVar()

ABC_DLL void Abc_SopComplementVar ( char * pSop,
int iVar )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 678 of file abcSop.c.

679{
680 char * pCube;
681 int nVars = Abc_SopGetVarNum(pSop);
682 assert( iVar < nVars );
683 Abc_SopForEachCube( pSop, nVars, pCube )
684 {
685 if ( pCube[iVar] == '0' )
686 pCube[iVar] = '1';
687 else if ( pCube[iVar] == '1' )
688 pCube[iVar] = '0';
689 }
690}
int Abc_SopGetVarNum(char *pSop)
Definition abcSop.c:584
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SopCreateAnd()

ABC_DLL char * Abc_SopCreateAnd ( Mem_Flex_t * pMan,
int nVars,
int * pfCompl )
extern

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

Synopsis [Creates the multi-input AND cover.]

Description []

SideEffects []

SeeAlso []

Definition at line 168 of file abcSop.c.

169{
170 char * pSop;
171 int i;
172 pSop = Abc_SopStart( pMan, 1, nVars );
173 for ( i = 0; i < nVars; i++ )
174 pSop[i] = '1' - (pfCompl? pfCompl[i] : 0);
175 pSop[nVars + 1] = '1';
176 return pSop;
177}
char * Abc_SopStart(Mem_Flex_t *pMan, int nCubes, int nVars)
Definition abcSop.c:82
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SopCreateAnd2()

ABC_DLL char * Abc_SopCreateAnd2 ( Mem_Flex_t * pMan,
int fCompl0,
int fCompl1 )
extern

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

Synopsis [Creates the AND2 cover.]

Description []

SideEffects []

SeeAlso []

Definition at line 145 of file abcSop.c.

146{
147 char Buffer[6];
148 Buffer[0] = '1' - fCompl0;
149 Buffer[1] = '1' - fCompl1;
150 Buffer[2] = ' ';
151 Buffer[3] = '1';
152 Buffer[4] = '\n';
153 Buffer[5] = 0;
154 return Abc_SopRegister( pMan, Buffer );
155}
ABC_NAMESPACE_IMPL_START char * Abc_SopRegister(Mem_Flex_t *pMan, const char *pName)
DECLARATIONS ///.
Definition abcSop.c:62
Here is the call graph for this function:

◆ Abc_SopCreateBuf()

ABC_DLL char * Abc_SopCreateBuf ( Mem_Flex_t * pMan)
extern

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

Synopsis [Creates the buf cover.]

Description []

SideEffects []

SeeAlso []

Definition at line 367 of file abcSop.c.

368{
369 return Abc_SopRegister(pMan, "1 1\n");
370}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SopCreateConst0()

ABC_DLL char * Abc_SopCreateConst0 ( Mem_Flex_t * pMan)
extern

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

Synopsis [Creates the constant 1 cover with 0 variables.]

Description []

SideEffects []

SeeAlso []

Definition at line 129 of file abcSop.c.

130{
131 return Abc_SopRegister( pMan, " 0\n" );
132}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SopCreateConst1()

ABC_DLL char * Abc_SopCreateConst1 ( Mem_Flex_t * pMan)
extern

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

Synopsis [Creates the constant 1 cover with 0 variables.]

Description []

SideEffects []

SeeAlso []

Definition at line 113 of file abcSop.c.

114{
115 return Abc_SopRegister( pMan, " 1\n" );
116}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SopCreateFromIsop()

ABC_DLL char * Abc_SopCreateFromIsop ( Mem_Flex_t * pMan,
int nVars,
Vec_Int_t * vCover )
extern

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

Synopsis [Creates the cover from the ISOP computed from TT.]

Description []

SideEffects []

SeeAlso []

Definition at line 424 of file abcSop.c.

425{
426 char * pSop, * pCube;
427 int i, k, Entry, Literal;
428 assert( Vec_IntSize(vCover) > 0 );
429 if ( Vec_IntSize(vCover) == 0 )
430 return NULL;
431 // start the cover
432 pSop = Abc_SopStart( pMan, Vec_IntSize(vCover), nVars );
433 // create cubes
434 Vec_IntForEachEntry( vCover, Entry, i )
435 {
436 pCube = pSop + i * (nVars + 3);
437 for ( k = 0; k < nVars; k++ )
438 {
439 Literal = 3 & (Entry >> (k << 1));
440 if ( Literal == 1 )
441 pCube[k] = '0';
442 else if ( Literal == 2 )
443 pCube[k] = '1';
444 else if ( Literal != 0 )
445 assert( 0 );
446 }
447 }
448 return pSop;
449}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SopCreateFromTruth()

ABC_DLL char * Abc_SopCreateFromTruth ( Mem_Flex_t * pMan,
int nVars,
unsigned * pTruth )
extern

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

Synopsis [Creates the arbitrary cover from the truth table.]

Description []

SideEffects []

SeeAlso []

Definition at line 383 of file abcSop.c.

384{
385 char * pSop, * pCube;
386 int nMints, Counter, i, k;
387 if ( nVars == 0 )
388 return pTruth[0] ? Abc_SopCreateConst1(pMan) : Abc_SopCreateConst0(pMan);
389 // count the number of true minterms
390 Counter = 0;
391 nMints = (1 << nVars);
392 for ( i = 0; i < nMints; i++ )
393 Counter += ((pTruth[i>>5] & (1 << (i&31))) > 0);
394 // SOP is not well-defined if the truth table is constant 0
395 assert( Counter > 0 );
396 if ( Counter == 0 )
397 return NULL;
398 // start the cover
399 pSop = Abc_SopStart( pMan, Counter, nVars );
400 // create true minterms
401 Counter = 0;
402 for ( i = 0; i < nMints; i++ )
403 if ( (pTruth[i>>5] & (1 << (i&31))) > 0 )
404 {
405 pCube = pSop + Counter * (nVars + 3);
406 for ( k = 0; k < nVars; k++ )
407 pCube[k] = '0' + ((i & (1 << k)) > 0);
408 Counter++;
409 }
410 return pSop;
411}
char * Abc_SopCreateConst1(Mem_Flex_t *pMan)
Definition abcSop.c:113
ABC_DLL char * Abc_SopCreateConst0(Mem_Flex_t *pMan)
Definition abcSop.c:129
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SopCreateFromTruthIsop()

ABC_DLL char * Abc_SopCreateFromTruthIsop ( Mem_Flex_t * pMan,
int nVars,
word * pTruth,
Vec_Int_t * vCover )
extern

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

Synopsis [Creates the cover from the ISOP computed from TT.]

Description []

SideEffects []

SeeAlso []

Definition at line 462 of file abcSop.c.

463{
464 char * pSop = NULL;
465 int w, nWords = Abc_Truth6WordNum( nVars );
466 assert( nVars < 16 );
467
468 for ( w = 0; w < nWords; w++ )
469 if ( pTruth[w] )
470 break;
471 if ( w == nWords )
472 return Abc_SopRegister( pMan, " 0\n" );
473
474 for ( w = 0; w < nWords; w++ )
475 if ( ~pTruth[w] )
476 break;
477 if ( w == nWords )
478 return Abc_SopRegister( pMan, " 1\n" );
479
480 {
481 int RetValue = Kit_TruthIsop( (unsigned *)pTruth, nVars, vCover, 1 );
482 assert( nVars > 0 );
483 assert( RetValue == 0 || RetValue == 1 );
484 pSop = Abc_SopCreateFromIsop( pMan, nVars, vCover );
485 if ( RetValue )
486 Abc_SopComplement( pSop );
487 }
488 return pSop;
489}
int nWords
Definition abcNpn.c:127
void Abc_SopComplement(char *pSop)
Definition abcSop.c:648
char * Abc_SopCreateFromIsop(Mem_Flex_t *pMan, int nVars, Vec_Int_t *vCover)
Definition abcSop.c:424
int Kit_TruthIsop(unsigned *puTruth, int nVars, Vec_Int_t *vMemory, int fTryBoth)
Definition kitIsop.c:134
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SopCreateInv()

ABC_DLL char * Abc_SopCreateInv ( Mem_Flex_t * pMan)
extern

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

Synopsis [Creates the inv cover.]

Description []

SideEffects []

SeeAlso []

Definition at line 351 of file abcSop.c.

352{
353 return Abc_SopRegister(pMan, "0 1\n");
354}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SopCreateMux()

ABC_DLL char * Abc_SopCreateMux ( Mem_Flex_t * pMan)
extern

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

Synopsis [Creates the MUX cover.]

Description [The first input of MUX is the control. The second input is DATA1. The third input is DATA0.]

SideEffects []

SeeAlso []

Definition at line 335 of file abcSop.c.

336{
337 return Abc_SopRegister(pMan, "11- 1\n0-1 1\n");
338}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SopCreateNand()

ABC_DLL char * Abc_SopCreateNand ( Mem_Flex_t * pMan,
int nVars )
extern

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

Synopsis [Creates the multi-input NAND cover.]

Description []

SideEffects []

SeeAlso []

Definition at line 190 of file abcSop.c.

191{
192 char * pSop;
193 int i;
194 pSop = Abc_SopStart( pMan, 1, nVars );
195 for ( i = 0; i < nVars; i++ )
196 pSop[i] = '1';
197 pSop[nVars + 1] = '0';
198 return pSop;
199}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SopCreateNor()

ABC_DLL char * Abc_SopCreateNor ( Mem_Flex_t * pMan,
int nVars )
extern

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

Synopsis [Creates the multi-input NOR cover.]

Description []

SideEffects []

SeeAlso []

Definition at line 259 of file abcSop.c.

260{
261 char * pSop;
262 int i;
263 pSop = Abc_SopStart( pMan, 1, nVars );
264 for ( i = 0; i < nVars; i++ )
265 pSop[i] = '0';
266 return pSop;
267}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SopCreateNxor()

ABC_DLL char * Abc_SopCreateNxor ( Mem_Flex_t * pMan,
int nVars )
extern

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

Synopsis [Creates the multi-input XNOR cover.]

Description []

SideEffects []

SeeAlso []

Definition at line 317 of file abcSop.c.

318{
319 assert( nVars == 2 );
320 return Abc_SopRegister(pMan, "11 1\n00 1\n");
321}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SopCreateOr()

ABC_DLL char * Abc_SopCreateOr ( Mem_Flex_t * pMan,
int nVars,
int * pfCompl )
extern

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

Synopsis [Creates the multi-input OR cover.]

Description []

SideEffects []

SeeAlso []

Definition at line 212 of file abcSop.c.

213{
214 char * pSop;
215 int i;
216 pSop = Abc_SopStart( pMan, 1, nVars );
217 for ( i = 0; i < nVars; i++ )
218 pSop[i] = '0' + (pfCompl? pfCompl[i] : 0);
219 pSop[nVars + 1] = '0';
220 return pSop;
221}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SopCreateOrMultiCube()

ABC_DLL char * Abc_SopCreateOrMultiCube ( Mem_Flex_t * pMan,
int nVars,
int * pfCompl )
extern

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

Synopsis [Creates the multi-input OR cover.]

Description []

SideEffects []

SeeAlso []

Definition at line 234 of file abcSop.c.

235{
236 char * pSop, * pCube;
237 int i;
238 pSop = Abc_SopStart( pMan, nVars, nVars );
239 i = 0;
240 Abc_SopForEachCube( pSop, nVars, pCube )
241 {
242 pCube[i] = '1' - (pfCompl? pfCompl[i] : 0);
243 i++;
244 }
245 return pSop;
246}
Here is the call graph for this function:

◆ Abc_SopCreateXor()

ABC_DLL char * Abc_SopCreateXor ( Mem_Flex_t * pMan,
int nVars )
extern

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

Synopsis [Creates the multi-input XOR cover.]

Description []

SideEffects []

SeeAlso []

Definition at line 280 of file abcSop.c.

281{
282 assert( nVars == 2 );
283 return Abc_SopRegister(pMan, "01 1\n10 1\n");
284}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SopCreateXorSpecial()

ABC_DLL char * Abc_SopCreateXorSpecial ( Mem_Flex_t * pMan,
int nVars )
extern

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

Synopsis [Creates the multi-input XOR cover (special case).]

Description []

SideEffects []

SeeAlso []

Definition at line 297 of file abcSop.c.

298{
299 char * pSop;
300 pSop = Abc_SopCreateAnd( pMan, nVars, NULL );
301 pSop[nVars+1] = 'x';
302 assert( pSop[nVars+2] == '\n' );
303 return pSop;
304}
char * Abc_SopCreateAnd(Mem_Flex_t *pMan, int nVars, int *pfCompl)
Definition abcSop.c:168
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SopDecoderLog()

ABC_DLL char * Abc_SopDecoderLog ( Mem_Flex_t * pMan,
int nValues )
extern

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

Synopsis [Creates the decover node.]

Description [Produces MV-SOP for BLIF-MV representation.]

SideEffects []

SeeAlso []

Definition at line 1280 of file abcSop.c.

1281{
1282 char * pResult;
1283 Vec_Str_t * vSop;
1284 int i, b, nBits = Abc_Base2Log(nValues);
1285 assert( nValues > 1 && nValues <= (1<<nBits) );
1286 vSop = Vec_StrAlloc( 100 );
1287 for ( i = 0; i < nValues; i++ )
1288 {
1289 for ( b = 0; b < nBits; b++ )
1290 {
1291 Vec_StrPrintNum( vSop, (int)((i & (1 << b)) > 0) );
1292 Vec_StrPush( vSop, ' ' );
1293 }
1294 Vec_StrPrintNum( vSop, i );
1295 Vec_StrPush( vSop, '\n' );
1296 }
1297 Vec_StrPush( vSop, 0 );
1298 pResult = Abc_SopRegister( pMan, Vec_StrArray(vSop) );
1299 Vec_StrFree( vSop );
1300 return pResult;
1301}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SopDecoderPos()

ABC_DLL char * Abc_SopDecoderPos ( Mem_Flex_t * pMan,
int nValues )
extern

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

Synopsis [Creates the decoder node.]

Description [Produces MV-SOP for BLIF-MV representation.]

SideEffects []

SeeAlso []

Definition at line 1244 of file abcSop.c.

1245{
1246 char * pResult;
1247 Vec_Str_t * vSop;
1248 int i, k;
1249 assert( nValues > 1 );
1250 vSop = Vec_StrAlloc( 100 );
1251 for ( i = 0; i < nValues; i++ )
1252 {
1253 for ( k = 0; k < nValues; k++ )
1254 {
1255 if ( k == i )
1256 Vec_StrPrintStr( vSop, "1 " );
1257 else
1258 Vec_StrPrintStr( vSop, "- " );
1259 }
1260 Vec_StrPrintNum( vSop, i );
1261 Vec_StrPush( vSop, '\n' );
1262 }
1263 Vec_StrPush( vSop, 0 );
1264 pResult = Abc_SopRegister( pMan, Vec_StrArray(vSop) );
1265 Vec_StrFree( vSop );
1266 return pResult;
1267}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SopEncoderLog()

ABC_DLL char * Abc_SopEncoderLog ( Mem_Flex_t * pMan,
int iBit,
int nValues )
extern

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

Synopsis [Creates one encoder node.]

Description [Produces MV-SOP for BLIF-MV representation.]

SideEffects []

SeeAlso []

Definition at line 1200 of file abcSop.c.

1201{
1202 char * pResult;
1203 Vec_Str_t * vSop;
1204 int v, Counter, fFirst = 1, nBits = Abc_Base2Log(nValues);
1205 assert( iBit < nBits );
1206 // count the number of literals
1207 Counter = 0;
1208 for ( v = 0; v < nValues; v++ )
1209 Counter += ( (v & (1 << iBit)) > 0 );
1210 // create the cover
1211 vSop = Vec_StrAlloc( 100 );
1212 Vec_StrPrintStr( vSop, "d0\n" );
1213 if ( Counter > 1 )
1214 Vec_StrPrintStr( vSop, "(" );
1215 for ( v = 0; v < nValues; v++ )
1216 if ( v & (1 << iBit) )
1217 {
1218 if ( fFirst )
1219 fFirst = 0;
1220 else
1221 Vec_StrPush( vSop, ',' );
1222 Vec_StrPrintNum( vSop, v );
1223 }
1224 if ( Counter > 1 )
1225 Vec_StrPrintStr( vSop, ")" );
1226 Vec_StrPrintStr( vSop, " 1\n" );
1227 Vec_StrPush( vSop, 0 );
1228 pResult = Abc_SopRegister( pMan, Vec_StrArray(vSop) );
1229 Vec_StrFree( vSop );
1230 return pResult;
1231}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SopEncoderPos()

ABC_DLL char * Abc_SopEncoderPos ( Mem_Flex_t * pMan,
int iValue,
int nValues )
extern

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

Synopsis [Creates one encoder node.]

Description [Produces MV-SOP for BLIF-MV representation.]

SideEffects []

SeeAlso []

Definition at line 1181 of file abcSop.c.

1182{
1183 char Buffer[32];
1184 assert( iValue < nValues );
1185 sprintf( Buffer, "d0\n%d 1\n", iValue );
1186 return Abc_SopRegister( pMan, Buffer );
1187}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SopFromTruthBin()

ABC_DLL char * Abc_SopFromTruthBin ( char * pTruth)
extern

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

Synopsis [Derives SOP from the truth table representation.]

Description [Truth table is expected to be in the hexadecimal notation.]

SideEffects []

SeeAlso []

Definition at line 964 of file abcSop.c.

965{
966 char * pSopCover, * pCube;
967 int nTruthSize, nVars, Digit, Length, Mint, i, b;
968 Vec_Int_t * vMints;
969
970 // get the number of variables
971 nTruthSize = strlen(pTruth);
972 nVars = Abc_Base2Log( nTruthSize );
973 if ( nTruthSize != (1 << (nVars)) )
974 {
975 printf( "String %s does not look like a truth table of a %d-variable function.\n", pTruth, nVars );
976 return NULL;
977 }
978
979 // collect the on-set minterms
980 vMints = Vec_IntAlloc( 100 );
981 for ( i = 0; i < nTruthSize; i++ )
982 {
983 if ( pTruth[i] >= '0' && pTruth[i] <= '1' )
984 Digit = pTruth[i] - '0';
985 else
986 {
987 Vec_IntFree( vMints );
988 printf( "String %s does not look like a binary representation of the truth table.\n", pTruth );
989 return NULL;
990 }
991 if ( Digit == 1 )
992 Vec_IntPush( vMints, nTruthSize - 1 - i );
993 }
994/*
995 if ( Vec_IntSize( vMints ) == 0 || Vec_IntSize( vMints ) == nTruthSize )
996 {
997 Vec_IntFree( vMints );
998 printf( "Cannot create constant function.\n" );
999 return NULL;
1000 }
1001*/
1002 if ( Vec_IntSize(vMints) == 0 || Vec_IntSize(vMints) == (1 << nVars) )
1003 {
1004 pSopCover = ABC_ALLOC( char, 4 );
1005 pSopCover[0] = ' ';
1006 pSopCover[1] = '0' + (Vec_IntSize(vMints) > 0);
1007 pSopCover[2] = '\n';
1008 pSopCover[3] = 0;
1009 }
1010 else
1011 {
1012 // create the SOP representation of the minterms
1013 Length = Vec_IntSize(vMints) * (nVars + 3);
1014 pSopCover = ABC_ALLOC( char, Length + 1 );
1015 pSopCover[Length] = 0;
1016 Vec_IntForEachEntry( vMints, Mint, i )
1017 {
1018 pCube = pSopCover + i * (nVars + 3);
1019 for ( b = 0; b < nVars; b++ )
1020 // if ( Mint & (1 << (nVars-1-b)) )
1021 if ( Mint & (1 << b) )
1022 pCube[b] = '1';
1023 else
1024 pCube[b] = '0';
1025 pCube[nVars + 0] = ' ';
1026 pCube[nVars + 1] = '1';
1027 pCube[nVars + 2] = '\n';
1028 }
1029 }
1030 Vec_IntFree( vMints );
1031 return pSopCover;
1032}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SopFromTruthHex()

ABC_DLL char * Abc_SopFromTruthHex ( char * pTruth)
extern

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

Synopsis [Derives SOP from the truth table representation.]

Description [Truth table is expected to be in the hexadecimal notation.]

SideEffects []

SeeAlso []

Definition at line 1060 of file abcSop.c.

1061{
1062 char * pSopCover, * pCube;
1063 int nTruthSize, nVars, Digit, Length, Mint, i, b;
1064 Vec_Int_t * vMints;
1065
1066 // get the number of variables
1067 nTruthSize = strlen(pTruth);
1068 nVars = (nTruthSize < 2) ? 2 : Abc_Base2Log(nTruthSize) + 2;
1069 if ( nTruthSize != (1 << (nVars-2)) )
1070 {
1071 printf( "String %s does not look like a truth table of a %d-variable function.\n", pTruth, nVars );
1072 return NULL;
1073 }
1074
1075 // collect the on-set minterms
1076 vMints = Vec_IntAlloc( 100 );
1077 for ( i = 0; i < nTruthSize; i++ )
1078 {
1079 if ( pTruth[i] >= '0' && pTruth[i] <= '9' )
1080 Digit = pTruth[i] - '0';
1081 else if ( pTruth[i] >= 'a' && pTruth[i] <= 'f' )
1082 Digit = 10 + pTruth[i] - 'a';
1083 else if ( pTruth[i] >= 'A' && pTruth[i] <= 'F' )
1084 Digit = 10 + pTruth[i] - 'A';
1085 else
1086 {
1087 printf( "String %s does not look like a hexadecimal representation of the truth table.\n", pTruth );
1088 return NULL;
1089 }
1090 for ( b = 0; b < 4; b++ )
1091 if ( Digit & (1 << b) )
1092 Vec_IntPush( vMints, 4*(nTruthSize-1-i)+b );
1093 }
1094
1095 // create the SOP representation of the minterms
1096 if ( Vec_IntSize(vMints) == 0 || Vec_IntSize(vMints) == (1 << nVars) )
1097 {
1098 pSopCover = ABC_ALLOC( char, 4 );
1099 pSopCover[0] = ' ';
1100 pSopCover[1] = '0' + (Vec_IntSize(vMints) > 0);
1101 pSopCover[2] = '\n';
1102 pSopCover[3] = 0;
1103 }
1104 else
1105 {
1106 Length = Vec_IntSize(vMints) * (nVars + 3);
1107 pSopCover = ABC_ALLOC( char, Length + 1 );
1108 pSopCover[Length] = 0;
1109 Vec_IntForEachEntry( vMints, Mint, i )
1110 {
1111 pCube = pSopCover + i * (nVars + 3);
1112 for ( b = 0; b < nVars; b++ )
1113 // if ( Mint & (1 << (nVars-1-b)) )
1114 if ( Mint & (1 << b) )
1115 pCube[b] = '1';
1116 else
1117 pCube[b] = '0';
1118 pCube[nVars + 0] = ' ';
1119 pCube[nVars + 1] = '1';
1120 pCube[nVars + 2] = '\n';
1121 }
1122 }
1123
1124 Vec_IntFree( vMints );
1125 return pSopCover;
1126}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SopFromTruthsBin()

ABC_DLL Vec_Ptr_t * Abc_SopFromTruthsBin ( char * pTruth)
extern

Definition at line 1033 of file abcSop.c.

1034{
1035 Vec_Ptr_t * vRes = Vec_PtrAlloc( 10 );
1036 char * pCopy = Abc_UtilStrsav(pTruth);
1037 char * pToken = strtok( pCopy, " \r\n\t|" );
1038 while ( pToken )
1039 {
1040 if ( !Abc_SopCheckReadTruth( vRes, pToken, 0 ) )
1041 break;
1042 Vec_PtrPush( vRes, Abc_SopFromTruthBin(pToken) );
1043 pToken = strtok( NULL, " \r\n\t|" );
1044 }
1045 ABC_FREE( pCopy );
1046 return vRes;
1047}
int Abc_SopCheckReadTruth(Vec_Ptr_t *vRes, char *pToken, int fHex)
Definition abcSop.c:926
char * Abc_SopFromTruthBin(char *pTruth)
Definition abcSop.c:964
char * strtok()
Here is the call graph for this function:

◆ Abc_SopFromTruthsHex()

ABC_DLL Vec_Ptr_t * Abc_SopFromTruthsHex ( char * pTruth)
extern

Definition at line 1127 of file abcSop.c.

1128{
1129 Vec_Ptr_t * vRes = Vec_PtrAlloc( 10 );
1130 char * pCopy = Abc_UtilStrsav(pTruth);
1131 char * pToken = strtok( pCopy, " \r\n\t|" );
1132 while ( pToken )
1133 {
1134 if ( pToken[0] == '0' && pToken[1] == 'x' )
1135 pToken += 2;
1136 if ( !Abc_SopCheckReadTruth( vRes, pToken, 1 ) )
1137 break;
1138 Vec_PtrPush( vRes, Abc_SopFromTruthHex(pToken) );
1139 pToken = strtok( NULL, " \r\n\t|" );
1140 }
1141 ABC_FREE( pCopy );
1142 return vRes;
1143}
char * Abc_SopFromTruthHex(char *pTruth)
Definition abcSop.c:1060
Here is the call graph for this function:

◆ Abc_SopGetCubeNum()

ABC_DLL int Abc_SopGetCubeNum ( char * pSop)
extern

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

Synopsis [Reads the number of cubes in the cover.]

Description []

SideEffects []

SeeAlso []

Definition at line 537 of file abcSop.c.

538{
539 char * pCur;
540 int nCubes = 0;
541 if ( pSop == NULL )
542 return 0;
543 for ( pCur = pSop; *pCur; pCur++ )
544 nCubes += (*pCur == '\n');
545 return nCubes;
546}
Here is the caller graph for this function:

◆ Abc_SopGetIthCareLit()

ABC_DLL int Abc_SopGetIthCareLit ( char * pSop,
int i )
extern

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

Synopsis [Returns the i-th literal of the cover.]

Description []

SideEffects []

SeeAlso []

Definition at line 626 of file abcSop.c.

627{
628 char * pCube;
629 int nVars;
630 nVars = Abc_SopGetVarNum( pSop );
631 Abc_SopForEachCube( pSop, nVars, pCube )
632 if ( pCube[i] != '-' )
633 return pCube[i] - '0';
634 return -1;
635}
Here is the call graph for this function:

◆ Abc_SopGetLitNum()

ABC_DLL int Abc_SopGetLitNum ( char * pSop)
extern

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

Synopsis [Reads the number of SOP literals in the cover.]

Description []

SideEffects []

SeeAlso []

Definition at line 559 of file abcSop.c.

560{
561 char * pCur;
562 int nLits = 0;
563 if ( pSop == NULL )
564 return 0;
565 for ( pCur = pSop; *pCur; pCur++ )
566 {
567 nLits -= (*pCur == '\n');
568 nLits += (*pCur == '0' || *pCur == '1');
569 }
570 return nLits;
571}
Here is the caller graph for this function:

◆ Abc_SopGetPhase()

ABC_DLL int Abc_SopGetPhase ( char * pSop)
extern

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

Synopsis [Reads the phase of the cover.]

Description []

SideEffects []

SeeAlso []

Definition at line 604 of file abcSop.c.

605{
606 int nVars = Abc_SopGetVarNum( pSop );
607 if ( pSop[nVars+1] == '0' || pSop[nVars+1] == 'n' )
608 return 0;
609 if ( pSop[nVars+1] == '1' || pSop[nVars+1] == 'x' )
610 return 1;
611 assert( 0 );
612 return -1;
613}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SopGetVarNum()

ABC_DLL int Abc_SopGetVarNum ( char * pSop)
extern

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

Synopsis [Reads the number of variables in the cover.]

Description []

SideEffects []

SeeAlso []

Definition at line 584 of file abcSop.c.

585{
586 char * pCur;
587 for ( pCur = pSop; *pCur != '\n'; pCur++ )
588 if ( *pCur == 0 )
589 return -1;
590 return pCur - pSop - 2;
591}
Here is the caller graph for this function:

◆ Abc_SopIsAndType()

ABC_DLL int Abc_SopIsAndType ( char * pSop)
extern

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

Synopsis [Checks if the cover is AND with possibly complemented inputs.]

Description []

SideEffects []

SeeAlso []

Definition at line 796 of file abcSop.c.

797{
798 char * pCur;
799 if ( Abc_SopGetCubeNum(pSop) != 1 )
800 return 0;
801 for ( pCur = pSop; *pCur != ' '; pCur++ )
802 if ( *pCur == '-' )
803 return 0;
804 if ( pCur[1] != '1' )
805 return 0;
806 return 1;
807}
int Abc_SopGetCubeNum(char *pSop)
Definition abcSop.c:537
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SopIsBuf()

ABC_DLL int Abc_SopIsBuf ( char * pSop)
extern

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

Synopsis [Checks if the cover is constant 1.]

Description []

SideEffects []

SeeAlso []

Definition at line 756 of file abcSop.c.

757{
758 if ( pSop[4] != 0 )
759 return 0;
760 if ( (pSop[0] == '1' && pSop[2] == '1') || (pSop[0] == '0' && pSop[2] == '0') )
761 return 1;
762 return 0;
763}
Here is the caller graph for this function:

◆ Abc_SopIsComplement()

ABC_DLL int Abc_SopIsComplement ( char * pSop)
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 703 of file abcSop.c.

704{
705 char * pCur;
706 for ( pCur = pSop; *pCur; pCur++ )
707 if ( *pCur == '\n' )
708 return (int)(*(pCur - 1) == '0' || *(pCur - 1) == 'n');
709 assert( 0 );
710 return 0;
711}
Here is the caller graph for this function:

◆ Abc_SopIsConst0()

ABC_DLL int Abc_SopIsConst0 ( char * pSop)
extern

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

Synopsis [Checks if the cover is constant 0.]

Description []

SideEffects []

SeeAlso []

Definition at line 724 of file abcSop.c.

725{
726 return pSop[0] == ' ' && pSop[1] == '0';
727}
Here is the caller graph for this function:

◆ Abc_SopIsConst1()

ABC_DLL int Abc_SopIsConst1 ( char * pSop)
extern

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

Synopsis [Checks if the cover is constant 1.]

Description []

SideEffects []

SeeAlso []

Definition at line 740 of file abcSop.c.

741{
742 return pSop[0] == ' ' && pSop[1] == '1';
743}
Here is the caller graph for this function:

◆ Abc_SopIsExorType()

ABC_DLL int Abc_SopIsExorType ( char * pSop)
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 850 of file abcSop.c.

851{
852 char * pCur;
853 for ( pCur = pSop; *pCur; pCur++ )
854 if ( *pCur == '\n' )
855 return (int)(*(pCur - 1) == 'x' || *(pCur - 1) == 'n');
856 assert( 0 );
857 return 0;
858}
Here is the caller graph for this function:

◆ Abc_SopIsInv()

ABC_DLL int Abc_SopIsInv ( char * pSop)
extern

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

Synopsis [Checks if the cover is constant 1.]

Description []

SideEffects []

SeeAlso []

Definition at line 776 of file abcSop.c.

777{
778 if ( pSop[4] != 0 )
779 return 0;
780 if ( (pSop[0] == '0' && pSop[2] == '1') || (pSop[0] == '1' && pSop[2] == '0') )
781 return 1;
782 return 0;
783}
Here is the caller graph for this function:

◆ Abc_SopIsOrType()

ABC_DLL int Abc_SopIsOrType ( char * pSop)
extern

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

Synopsis [Checks if the cover is OR with possibly complemented inputs.]

Description []

SideEffects []

SeeAlso []

Definition at line 820 of file abcSop.c.

821{
822 char * pCube, * pCur;
823 int nVars, nLits;
824 nVars = Abc_SopGetVarNum( pSop );
825 if ( nVars != Abc_SopGetCubeNum(pSop) )
826 return 0;
827 Abc_SopForEachCube( pSop, nVars, pCube )
828 {
829 // count the number of literals in the cube
830 nLits = 0;
831 for ( pCur = pCube; *pCur != ' '; pCur++ )
832 nLits += ( *pCur != '-' );
833 if ( nLits != 1 )
834 return 0;
835 }
836 return 1;
837}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SopRegister()

ABC_DLL char * Abc_SopRegister ( Mem_Flex_t * pMan,
const char * pName )
extern

DECLARATIONS ///.

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

FileName [abcSop.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Network and node package.]

Synopsis [Implementation of a simple SOP representation of nodes.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

] FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis [Registers the cube string with the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 62 of file abcSop.c.

63{
64 char * pRegName;
65 if ( pName == NULL ) return NULL;
66 pRegName = Mem_FlexEntryFetch( pMan, strlen(pName) + 1 );
67 strcpy( pRegName, pName );
68 return pRegName;
69}
char * strcpy()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SopStart()

ABC_DLL char * Abc_SopStart ( Mem_Flex_t * pMan,
int nCubes,
int nVars )
extern

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

Synopsis [Creates the constant 1 cover with the given number of variables and cubes.]

Description []

SideEffects []

SeeAlso []

Definition at line 82 of file abcSop.c.

83{
84 char * pSopCover, * pCube;
85 int i, Length;
86
87 Length = nCubes * (nVars + 3);
88 pSopCover = Mem_FlexEntryFetch( pMan, Length + 1 );
89 memset( pSopCover, '-', (size_t)Length );
90 pSopCover[Length] = 0;
91
92 for ( i = 0; i < nCubes; i++ )
93 {
94 pCube = pSopCover + i * (nVars + 3);
95 pCube[nVars + 0] = ' ';
96 pCube[nVars + 1] = '1';
97 pCube[nVars + 2] = '\n';
98 }
99 return pSopCover;
100}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SopSynthesizeOne()

ABC_DLL Gia_Man_t * Abc_SopSynthesizeOne ( char * pSop,
int fClp )
extern

Definition at line 3244 of file abcUtil.c.

3245{
3246 Abc_Ntk_t * pNtkNew, * pNtk;
3247 Vec_Ptr_t * vSops;
3248 if ( strlen(pSop) == 3 )
3249 {
3250 Gia_Man_t * pNew = Gia_ManStart( 1 );
3251 pNew->pName = Abc_UtilStrsav( "top" );
3252 //Gia_ManAppendCi( pNew );
3253 assert( pSop[1] == '0' || pSop[1] == '1' );
3254 Gia_ManAppendCo( pNew, pSop[1] == '1' );
3255 return pNew;
3256 }
3257 vSops = Vec_PtrAlloc( 1 );
3258 Vec_PtrPush( vSops, pSop );
3259 pNtk = Abc_NtkCreateFromSops( "top", vSops );
3260 Vec_PtrFree( vSops );
3263 if ( fClp )
3265 Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "fx; strash; balance; dc2" );
3268 return Abc_NtkStrashToGia( pNtkNew );
3269}
Gia_Man_t * Abc_NtkStrashToGia(Abc_Ntk_t *pNtk)
Definition abcUtil.c:3214
ABC_DLL Abc_Ntk_t * Abc_NtkCreateFromSops(char *pName, Vec_Ptr_t *vSops)
Definition abcNtk.c:2512
ABC_DLL Abc_Frame_t * Abc_FrameGetGlobalFrame()
Definition mainFrame.c:643
ABC_DLL Abc_Frame_t * Abc_FrameReadGlobalFrame()
Definition mainFrame.c:666
ABC_DLL void Abc_FrameSetBatchMode(int Mode)
Definition mainFrame.c:111
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition mainFrame.c:327
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition mainFrame.c:538
ABC_DLL int Cmd_CommandExecute(Abc_Frame_t *pAbc, const char *sCommand)
Definition cmdApi.c:193
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SopToTruth()

ABC_DLL word Abc_SopToTruth ( char * pSop,
int nInputs )
extern

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

Synopsis [Computes truth table of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 1314 of file abcSop.c.

1315{
1316 static word Truth[8] = {
1317 ABC_CONST(0xAAAAAAAAAAAAAAAA),
1318 ABC_CONST(0xCCCCCCCCCCCCCCCC),
1319 ABC_CONST(0xF0F0F0F0F0F0F0F0),
1320 ABC_CONST(0xFF00FF00FF00FF00),
1321 ABC_CONST(0xFFFF0000FFFF0000),
1322 ABC_CONST(0xFFFFFFFF00000000),
1323 ABC_CONST(0x0000000000000000),
1324 ABC_CONST(0xFFFFFFFFFFFFFFFF)
1325 };
1326 word Cube, Result = 0;
1327 int v, lit = 0;
1328 int nVars = Abc_SopGetVarNum(pSop);
1329 assert( nVars >= 0 && nVars <= 6 );
1330 assert( nVars == nInputs );
1331 do {
1332 Cube = Truth[7];
1333 for ( v = 0; v < nVars; v++, lit++ )
1334 {
1335 if ( pSop[lit] == '1' )
1336 Cube &= Truth[v];
1337 else if ( pSop[lit] == '0' )
1338 Cube &= ~Truth[v];
1339 else if ( pSop[lit] != '-' )
1340 assert( 0 );
1341 }
1342 Result |= Cube;
1343 assert( pSop[lit] == ' ' );
1344 lit++;
1345 lit++;
1346 assert( pSop[lit] == '\n' );
1347 lit++;
1348 } while ( pSop[lit] );
1349 if ( Abc_SopIsComplement(pSop) )
1350 Result = ~Result;
1351 return Result;
1352}
int Abc_SopIsComplement(char *pSop)
Definition abcSop.c:703
#define ABC_CONST(number)
PARAMETERS ///.
Definition abc_global.h:240
struct cube Cube
int lit
Definition satVec.h:130
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SopToTruth7()

ABC_DLL void Abc_SopToTruth7 ( char * pSop,
int nInputs,
word r[2] )
extern

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

Synopsis [Computes truth table of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 1365 of file abcSop.c.

1366{
1367 static word Truth[7][2] = {
1368 {ABC_CONST(0xAAAAAAAAAAAAAAAA),ABC_CONST(0xAAAAAAAAAAAAAAAA)},
1369 {ABC_CONST(0xCCCCCCCCCCCCCCCC),ABC_CONST(0xCCCCCCCCCCCCCCCC)},
1370 {ABC_CONST(0xF0F0F0F0F0F0F0F0),ABC_CONST(0xF0F0F0F0F0F0F0F0)},
1371 {ABC_CONST(0xFF00FF00FF00FF00),ABC_CONST(0xFF00FF00FF00FF00)},
1372 {ABC_CONST(0xFFFF0000FFFF0000),ABC_CONST(0xFFFF0000FFFF0000)},
1373 {ABC_CONST(0xFFFFFFFF00000000),ABC_CONST(0xFFFFFFFF00000000)},
1374 {ABC_CONST(0x0000000000000000),ABC_CONST(0xFFFFFFFFFFFFFFFF)},
1375 };
1376 word Cube[2];
1377 int v, lit = 0;
1378 int nVars = Abc_SopGetVarNum(pSop);
1379 assert( nVars >= 0 && nVars <= 7 );
1380 assert( nVars == nInputs );
1381 r[0] = r[1] = 0;
1382 do {
1383 Cube[0] = Cube[1] = ~(word)0;
1384 for ( v = 0; v < nVars; v++, lit++ )
1385 {
1386 if ( pSop[lit] == '1' )
1387 {
1388 Cube[0] &= Truth[v][0];
1389 Cube[1] &= Truth[v][1];
1390 }
1391 else if ( pSop[lit] == '0' )
1392 {
1393 Cube[0] &= ~Truth[v][0];
1394 Cube[1] &= ~Truth[v][1];
1395 }
1396 else if ( pSop[lit] != '-' )
1397 assert( 0 );
1398 }
1399 r[0] |= Cube[0];
1400 r[1] |= Cube[1];
1401 assert( pSop[lit] == ' ' );
1402 lit++;
1403 lit++;
1404 assert( pSop[lit] == '\n' );
1405 lit++;
1406 } while ( pSop[lit] );
1407 if ( Abc_SopIsComplement(pSop) )
1408 {
1409 r[0] = ~r[0];
1410 r[1] = ~r[1];
1411 }
1412}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SopToTruthBig()

ABC_DLL void Abc_SopToTruthBig ( char * pSop,
int nInputs,
word ** pVars,
word * pCube,
word * pRes )
extern

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

Synopsis [Computes truth table of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 1425 of file abcSop.c.

1426{
1427 int nVars = Abc_SopGetVarNum(pSop);
1428 int nWords = nVars <= 6 ? 1 : 1 << (nVars-6);
1429 int v, i, lit = 0;
1430 assert( nVars >= 0 && nVars <= 16 );
1431 assert( nVars == nInputs );
1432 for ( i = 0; i < nWords; i++ )
1433 pRes[i] = 0;
1434 do {
1435 for ( i = 0; i < nWords; i++ )
1436 pCube[i] = ~(word)0;
1437 for ( v = 0; v < nVars; v++, lit++ )
1438 {
1439 if ( pSop[lit] == '1' )
1440 {
1441 for ( i = 0; i < nWords; i++ )
1442 pCube[i] &= pVars[v][i];
1443 }
1444 else if ( pSop[lit] == '0' )
1445 {
1446 for ( i = 0; i < nWords; i++ )
1447 pCube[i] &= ~pVars[v][i];
1448 }
1449 else if ( pSop[lit] != '-' )
1450 assert( 0 );
1451 }
1452 for ( i = 0; i < nWords; i++ )
1453 pRes[i] |= pCube[i];
1454 assert( pSop[lit] == ' ' );
1455 lit++;
1456 lit++;
1457 assert( pSop[lit] == '\n' );
1458 lit++;
1459 } while ( pSop[lit] );
1460 if ( Abc_SopIsComplement(pSop) )
1461 {
1462 for ( i = 0; i < nWords; i++ )
1463 pRes[i] = ~pRes[i];
1464 }
1465}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_VecObjPushUniqueOrderByLevel()

ABC_DLL void Abc_VecObjPushUniqueOrderByLevel ( Vec_Ptr_t * p,
Abc_Obj_t * pNode )
extern

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

Synopsis [Inserts a new node in the order by levels.]

Description []

SideEffects []

SeeAlso []

Definition at line 1269 of file abcUtil.c.

1270{
1271 Abc_Obj_t * pNode1, * pNode2;
1272 int i;
1273 if ( Vec_PtrPushUnique(p, pNode) )
1274 return;
1275 // find the p of the node
1276 for ( i = p->nSize-1; i > 0; i-- )
1277 {
1278 pNode1 = (Abc_Obj_t *)p->pArray[i ];
1279 pNode2 = (Abc_Obj_t *)p->pArray[i-1];
1280 if ( Abc_ObjRegular(pNode1)->Level <= Abc_ObjRegular(pNode2)->Level )
1281 break;
1282 p->pArray[i ] = pNode2;
1283 p->pArray[i-1] = pNode1;
1284 }
1285}