ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
nwkObj.c File Reference
#include "nwk.h"
Include dependency graph for nwkObj.c:

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START Nwk_Obj_tNwk_ManCreateObj (Nwk_Man_t *p, int nFanins, int nFanouts)
 DECLARATIONS ///.
 
Nwk_Obj_tNwk_ManCreateCi (Nwk_Man_t *p, int nFanouts)
 
Nwk_Obj_tNwk_ManCreateCo (Nwk_Man_t *p)
 
Nwk_Obj_tNwk_ManCreateLatch (Nwk_Man_t *p)
 
Nwk_Obj_tNwk_ManCreateNode (Nwk_Man_t *p, int nFanins, int nFanouts)
 
void Nwk_ManDeleteNode (Nwk_Obj_t *pObj)
 
void Nwk_ManDeleteNode_rec (Nwk_Obj_t *pObj)
 

Function Documentation

◆ Nwk_ManCreateCi()

Nwk_Obj_t * Nwk_ManCreateCi ( Nwk_Man_t * p,
int nFanouts )

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

Synopsis [Creates a primary input.]

Description []

SideEffects []

SeeAlso []

Definition at line 70 of file nwkObj.c.

71{
72 Nwk_Obj_t * pObj;
73 pObj = Nwk_ManCreateObj( p, 1, nFanouts );
74 pObj->PioId = Vec_PtrSize( p->vCis );
75 Vec_PtrPush( p->vCis, pObj );
76 pObj->Type = NWK_OBJ_CI;
77 p->nObjs[NWK_OBJ_CI]++;
78 return pObj;
79}
Cube * p
Definition exorList.c:222
ABC_NAMESPACE_IMPL_START Nwk_Obj_t * Nwk_ManCreateObj(Nwk_Man_t *p, int nFanins, int nFanouts)
DECLARATIONS ///.
Definition nwkObj.c:45
typedefABC_NAMESPACE_HEADER_START struct Nwk_Obj_t_ Nwk_Obj_t
INCLUDES ///.
Definition nwk.h:49
@ NWK_OBJ_CI
Definition nwk.h:54
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Nwk_ManCreateCo()

Nwk_Obj_t * Nwk_ManCreateCo ( Nwk_Man_t * p)

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

Synopsis [Creates a primary output.]

Description []

SideEffects []

SeeAlso []

Definition at line 92 of file nwkObj.c.

93{
94 Nwk_Obj_t * pObj;
95 pObj = Nwk_ManCreateObj( p, 1, 1 );
96 pObj->PioId = Vec_PtrSize( p->vCos );
97 Vec_PtrPush( p->vCos, pObj );
98 pObj->Type = NWK_OBJ_CO;
99 p->nObjs[NWK_OBJ_CO]++;
100 return pObj;
101}
@ NWK_OBJ_CO
Definition nwk.h:55
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Nwk_ManCreateLatch()

Nwk_Obj_t * Nwk_ManCreateLatch ( Nwk_Man_t * p)

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

Synopsis [Creates a latch.]

Description []

SideEffects []

SeeAlso []

Definition at line 114 of file nwkObj.c.

115{
116 Nwk_Obj_t * pObj;
117 pObj = Nwk_ManCreateObj( p, 1, 1 );
118 pObj->Type = NWK_OBJ_LATCH;
119 p->nObjs[NWK_OBJ_LATCH]++;
120 return pObj;
121}
@ NWK_OBJ_LATCH
Definition nwk.h:57
Here is the call graph for this function:

◆ Nwk_ManCreateNode()

Nwk_Obj_t * Nwk_ManCreateNode ( Nwk_Man_t * p,
int nFanins,
int nFanouts )

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

Synopsis [Creates a node.]

Description []

SideEffects []

SeeAlso []

Definition at line 134 of file nwkObj.c.

135{
136 Nwk_Obj_t * pObj;
137 pObj = Nwk_ManCreateObj( p, nFanins, nFanouts );
138 pObj->Type = NWK_OBJ_NODE;
139 p->nObjs[NWK_OBJ_NODE]++;
140 return pObj;
141}
@ NWK_OBJ_NODE
Definition nwk.h:56
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Nwk_ManCreateObj()

ABC_NAMESPACE_IMPL_START Nwk_Obj_t * Nwk_ManCreateObj ( Nwk_Man_t * p,
int nFanins,
int nFanouts )

DECLARATIONS ///.

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

FileName [nwkObj.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Logic network representation.]

Synopsis [Manipulation of objects.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

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

Synopsis [Creates an object.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file nwkObj.c.

46{
47 Nwk_Obj_t * pObj;
48 pObj = (Nwk_Obj_t *)Aig_MmFlexEntryFetch( p->pMemObjs, sizeof(Nwk_Obj_t) + (nFanins + nFanouts + p->nFanioPlus) * sizeof(Nwk_Obj_t *) );
49 memset( pObj, 0, sizeof(Nwk_Obj_t) );
50 pObj->pFanio = (Nwk_Obj_t **)((char *)pObj + sizeof(Nwk_Obj_t));
51 pObj->Id = Vec_PtrSize( p->vObjs );
52 Vec_PtrPush( p->vObjs, pObj );
53 pObj->pMan = p;
54 pObj->nFanioAlloc = nFanins + nFanouts + p->nFanioPlus;
55 return pObj;
56}
char * Aig_MmFlexEntryFetch(Aig_MmFlex_t *p, int nBytes)
Definition aigMem.c:366
char * memset()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Nwk_ManDeleteNode()

void Nwk_ManDeleteNode ( Nwk_Obj_t * pObj)

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

Synopsis [Deletes the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 155 of file nwkObj.c.

156{
157 Vec_Ptr_t * vNodes = pObj->pMan->vTemp;
158 Nwk_Obj_t * pTemp;
159 int i;
160 assert( Nwk_ObjFanoutNum(pObj) == 0 );
161 // delete fanins
162 Nwk_ObjCollectFanins( pObj, vNodes );
163 Vec_PtrForEachEntry( Nwk_Obj_t *, vNodes, pTemp, i )
164 Nwk_ObjDeleteFanin( pObj, pTemp );
165 // remove from the list of objects
166 Vec_PtrWriteEntry( pObj->pMan->vObjs, pObj->Id, NULL );
167 pObj->pMan->nObjs[pObj->Type]--;
168 memset( pObj, 0, sizeof(Nwk_Obj_t) );
169 pObj->Id = -1;
170}
ABC_DLL void Nwk_ObjDeleteFanin(Nwk_Obj_t *pObj, Nwk_Obj_t *pFanin)
Definition nwkFanio.c:192
ABC_DLL void Nwk_ObjCollectFanins(Nwk_Obj_t *pNode, Vec_Ptr_t *vNodes)
DECLARATIONS ///.
Definition nwkFanio.c:45
#define assert(ex)
Definition util_old.h:213
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:

◆ Nwk_ManDeleteNode_rec()

void Nwk_ManDeleteNode_rec ( Nwk_Obj_t * pObj)

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

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

Description []

SideEffects []

SeeAlso []

Definition at line 183 of file nwkObj.c.

184{
185 Vec_Ptr_t * vNodes;
186 int i;
187 assert( !Nwk_ObjIsCi(pObj) );
188 assert( Nwk_ObjFanoutNum(pObj) == 0 );
189 vNodes = Vec_PtrAlloc( 100 );
190 Nwk_ObjCollectFanins( pObj, vNodes );
191 Nwk_ManDeleteNode( pObj );
192 Vec_PtrForEachEntry( Nwk_Obj_t *, vNodes, pObj, i )
193 if ( Nwk_ObjIsNode(pObj) && Nwk_ObjFanoutNum(pObj) == 0 )
194 Nwk_ManDeleteNode_rec( pObj );
195 Vec_PtrFree( vNodes );
196}
void Nwk_ManDeleteNode(Nwk_Obj_t *pObj)
Definition nwkObj.c:155
void Nwk_ManDeleteNode_rec(Nwk_Obj_t *pObj)
Definition nwkObj.c:183
Here is the call graph for this function:
Here is the caller graph for this function: