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

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START Hop_Obj_tHop_ObjCreatePi (Hop_Man_t *p)
 DECLARATIONS ///.
 
Hop_Obj_tHop_ObjCreatePo (Hop_Man_t *p, Hop_Obj_t *pDriver)
 
Hop_Obj_tHop_ObjCreate (Hop_Man_t *p, Hop_Obj_t *pGhost)
 
void Hop_ObjConnect (Hop_Man_t *p, Hop_Obj_t *pObj, Hop_Obj_t *pFan0, Hop_Obj_t *pFan1)
 
void Hop_ObjDisconnect (Hop_Man_t *p, Hop_Obj_t *pObj)
 
void Hop_ObjDelete (Hop_Man_t *p, Hop_Obj_t *pObj)
 
void Hop_ObjDelete_rec (Hop_Man_t *p, Hop_Obj_t *pObj)
 
Hop_Obj_tHop_ObjRepr (Hop_Obj_t *pObj)
 
void Hop_ObjCreateChoice (Hop_Obj_t *pOld, Hop_Obj_t *pNew)
 

Function Documentation

◆ Hop_ObjConnect()

void Hop_ObjConnect ( Hop_Man_t * p,
Hop_Obj_t * pObj,
Hop_Obj_t * pFan0,
Hop_Obj_t * pFan1 )

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

Synopsis [Connect the object to the fanin.]

Description []

SideEffects []

SeeAlso []

Definition at line 125 of file hopObj.c.

126{
127 assert( !Hop_IsComplement(pObj) );
128 assert( Hop_ObjIsNode(pObj) );
129 // add the first fanin
130 pObj->pFanin0 = pFan0;
131 pObj->pFanin1 = pFan1;
132 // increment references of the fanins and add their fanouts
133 if ( p->fRefCount )
134 {
135 if ( pFan0 != NULL )
136 Hop_ObjRef( Hop_ObjFanin0(pObj) );
137 if ( pFan1 != NULL )
138 Hop_ObjRef( Hop_ObjFanin1(pObj) );
139 }
140 else
141 pObj->nRefs = Hop_ObjLevelNew( pObj );
142 // set the phase
143 pObj->fPhase = Hop_ObjPhaseCompl(pFan0) & Hop_ObjPhaseCompl(pFan1);
144 // add the node to the structural hash table
145 Hop_TableInsert( p, pObj );
146}
Cube * p
Definition exorList.c:222
void Hop_TableInsert(Hop_Man_t *p, Hop_Obj_t *pObj)
Definition hopTable.c:100
unsigned int nRefs
Definition hop.h:79
unsigned int fPhase
Definition hop.h:76
Hop_Obj_t * pFanin1
Definition hop.h:74
Hop_Obj_t * pFanin0
Definition hop.h:73
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Hop_ObjCreate()

Hop_Obj_t * Hop_ObjCreate ( Hop_Man_t * p,
Hop_Obj_t * pGhost )

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

Synopsis [Create the new node assuming it does not exist.]

Description []

SideEffects []

SeeAlso []

Definition at line 97 of file hopObj.c.

98{
99 Hop_Obj_t * pObj;
100 assert( !Hop_IsComplement(pGhost) );
101 assert( Hop_ObjIsNode(pGhost) );
102 assert( pGhost == &p->Ghost );
103 // get memory for the new object
104 pObj = Hop_ManFetchMemory( p );
105 pObj->Type = pGhost->Type;
106 // add connections
107 Hop_ObjConnect( p, pObj, pGhost->pFanin0, pGhost->pFanin1 );
108 // update node counters of the manager
109 p->nObjs[Hop_ObjType(pObj)]++;
110 assert( pObj->pData == NULL );
111 return pObj;
112}
void Hop_ObjConnect(Hop_Man_t *p, Hop_Obj_t *pObj, Hop_Obj_t *pFan0, Hop_Obj_t *pFan1)
Definition hopObj.c:125
struct Hop_Obj_t_ Hop_Obj_t
Definition hop.h:50
unsigned int Type
Definition hop.h:75
void * pData
Definition hop.h:68
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Hop_ObjCreateChoice()

void Hop_ObjCreateChoice ( Hop_Obj_t * pOld,
Hop_Obj_t * pNew )

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

Synopsis [Sets an equivalence relation between the nodes.]

Description [Makes the representative of pNew point to the representaive of pOld.]

SideEffects []

SeeAlso []

Definition at line 260 of file hopObj.c.

261{
262 Hop_Obj_t * pOldRepr;
263 Hop_Obj_t * pNewRepr;
264 assert( pOld != NULL && pNew != NULL );
265 pOldRepr = Hop_ObjRepr(pOld);
266 pNewRepr = Hop_ObjRepr(pNew);
267 if ( pNewRepr != pOldRepr )
268 pNewRepr->pData = pOldRepr;
269}
Hop_Obj_t * Hop_ObjRepr(Hop_Obj_t *pObj)
Definition hopObj.c:241
Here is the call graph for this function:

◆ Hop_ObjCreatePi()

ABC_NAMESPACE_IMPL_START Hop_Obj_t * Hop_ObjCreatePi ( Hop_Man_t * p)

DECLARATIONS ///.

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

FileName [hopObj.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Minimalistic And-Inverter Graph package.]

Synopsis [Adding/removing objects.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - May 11, 2006.]

Revision [

Id
hopObj.c,v 1.00 2006/05/11 00:00:00 alanmi Exp

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

Synopsis [Creates primary input.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file hopObj.c.

46{
47 Hop_Obj_t * pObj;
48 pObj = Hop_ManFetchMemory( p );
49 pObj->Type = AIG_PI;
50 pObj->PioNum = Vec_PtrSize( p->vPis );
51 Vec_PtrPush( p->vPis, pObj );
52 p->nObjs[AIG_PI]++;
53 return pObj;
54}
@ AIG_PI
Definition hop.h:57
int PioNum
Definition hop.h:72
Here is the caller graph for this function:

◆ Hop_ObjCreatePo()

Hop_Obj_t * Hop_ObjCreatePo ( Hop_Man_t * p,
Hop_Obj_t * pDriver )

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

Synopsis [Creates primary output with the given driver.]

Description []

SideEffects []

SeeAlso []

Definition at line 67 of file hopObj.c.

68{
69 Hop_Obj_t * pObj;
70 pObj = Hop_ManFetchMemory( p );
71 pObj->Type = AIG_PO;
72 Vec_PtrPush( p->vPos, pObj );
73 // add connections
74 pObj->pFanin0 = pDriver;
75 if ( p->fRefCount )
76 Hop_ObjRef( Hop_Regular(pDriver) );
77 else
78 pObj->nRefs = Hop_ObjLevel( Hop_Regular(pDriver) );
79 // set the phase
80 pObj->fPhase = Hop_ObjPhaseCompl(pDriver);
81 // update node counters of the manager
82 p->nObjs[AIG_PO]++;
83 return pObj;
84}
@ AIG_PO
Definition hop.h:58
Here is the caller graph for this function:

◆ Hop_ObjDelete()

void Hop_ObjDelete ( Hop_Man_t * p,
Hop_Obj_t * pObj )

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

Synopsis [Deletes the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 186 of file hopObj.c.

187{
188 assert( !Hop_IsComplement(pObj) );
189 assert( !Hop_ObjIsTerm(pObj) );
190 assert( Hop_ObjRefs(pObj) == 0 );
191 // update node counters of the manager
192 p->nObjs[pObj->Type]--;
193 p->nDeleted++;
194 // remove connections
195 Hop_ObjDisconnect( p, pObj );
196 // remove PIs/POs from the arrays
197 if ( Hop_ObjIsPi(pObj) )
198 Vec_PtrRemove( p->vPis, pObj );
199 // free the node
200 Hop_ManRecycleMemory( p, pObj );
201}
void Hop_ObjDisconnect(Hop_Man_t *p, Hop_Obj_t *pObj)
Definition hopObj.c:159
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Hop_ObjDelete_rec()

void Hop_ObjDelete_rec ( Hop_Man_t * p,
Hop_Obj_t * pObj )

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

Synopsis [Deletes the MFFC of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 214 of file hopObj.c.

215{
216 Hop_Obj_t * pFanin0, * pFanin1;
217 assert( !Hop_IsComplement(pObj) );
218 if ( Hop_ObjIsConst1(pObj) || Hop_ObjIsPi(pObj) )
219 return;
220 assert( Hop_ObjIsNode(pObj) );
221 pFanin0 = Hop_ObjFanin0(pObj);
222 pFanin1 = Hop_ObjFanin1(pObj);
223 Hop_ObjDelete( p, pObj );
224 if ( pFanin0 && !Hop_ObjIsNone(pFanin0) && Hop_ObjRefs(pFanin0) == 0 )
225 Hop_ObjDelete_rec( p, pFanin0 );
226 if ( pFanin1 && !Hop_ObjIsNone(pFanin1) && Hop_ObjRefs(pFanin1) == 0 )
227 Hop_ObjDelete_rec( p, pFanin1 );
228}
void Hop_ObjDelete_rec(Hop_Man_t *p, Hop_Obj_t *pObj)
Definition hopObj.c:214
void Hop_ObjDelete(Hop_Man_t *p, Hop_Obj_t *pObj)
Definition hopObj.c:186
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Hop_ObjDisconnect()

void Hop_ObjDisconnect ( Hop_Man_t * p,
Hop_Obj_t * pObj )

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

Synopsis [Connect the object to the fanin.]

Description []

SideEffects []

SeeAlso []

Definition at line 159 of file hopObj.c.

160{
161 assert( !Hop_IsComplement(pObj) );
162 assert( Hop_ObjIsNode(pObj) );
163 // remove connections
164 if ( pObj->pFanin0 != NULL )
165 Hop_ObjDeref(Hop_ObjFanin0(pObj));
166 if ( pObj->pFanin1 != NULL )
167 Hop_ObjDeref(Hop_ObjFanin1(pObj));
168 // remove the node from the structural hash table
169 Hop_TableDelete( p, pObj );
170 // add the first fanin
171 pObj->pFanin0 = NULL;
172 pObj->pFanin1 = NULL;
173}
void Hop_TableDelete(Hop_Man_t *p, Hop_Obj_t *pObj)
Definition hopTable.c:123
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Hop_ObjRepr()

Hop_Obj_t * Hop_ObjRepr ( Hop_Obj_t * pObj)

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

Synopsis [Returns the representative of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 241 of file hopObj.c.

242{
243 assert( !Hop_IsComplement(pObj) );
244 if ( pObj->pData == NULL || pObj->pData == pObj )
245 return pObj;
246 return Hop_ObjRepr( (Hop_Obj_t *)pObj->pData );
247}
Here is the call graph for this function:
Here is the caller graph for this function: