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

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START Hop_Man_tHop_ManStart ()
 DECLARATIONS ///.
 
void Hop_ManStop (Hop_Man_t *p)
 
int Hop_ManCleanup (Hop_Man_t *p)
 
void Hop_ManPrintStats (Hop_Man_t *p)
 

Function Documentation

◆ Hop_ManCleanup()

int Hop_ManCleanup ( Hop_Man_t * p)

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

Synopsis [Returns the number of dangling nodes removed.]

Description []

SideEffects []

SeeAlso []

Definition at line 120 of file hopMan.c.

121{
122 Vec_Ptr_t * vObjs;
123 Hop_Obj_t * pNode;
124 int i, nNodesOld;
125 assert( p->fRefCount );
126 nNodesOld = Hop_ManNodeNum(p);
127 // collect roots of dangling nodes
128 vObjs = Vec_PtrAlloc( 100 );
129 Hop_ManForEachNode( p, pNode, i )
130 if ( Hop_ObjRefs(pNode) == 0 )
131 Vec_PtrPush( vObjs, pNode );
132 // recursively remove dangling nodes
133 Vec_PtrForEachEntry( Hop_Obj_t *, vObjs, pNode, i )
134 Hop_ObjDelete_rec( p, pNode );
135 Vec_PtrFree( vObjs );
136 return nNodesOld - Hop_ManNodeNum(p);
137}
Cube * p
Definition exorList.c:222
void Hop_ObjDelete_rec(Hop_Man_t *p, Hop_Obj_t *pObj)
Definition hopObj.c:214
#define Hop_ManForEachNode(p, pObj, i)
Definition hop.h:265
struct Hop_Obj_t_ Hop_Obj_t
Definition hop.h:50
#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:

◆ Hop_ManPrintStats()

void Hop_ManPrintStats ( Hop_Man_t * p)

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

Synopsis [Stops the AIG manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 150 of file hopMan.c.

151{
152 printf( "PI/PO = %d/%d. ", Hop_ManPiNum(p), Hop_ManPoNum(p) );
153 printf( "A = %7d. ", Hop_ManAndNum(p) );
154 printf( "X = %5d. ", Hop_ManExorNum(p) );
155 printf( "Cre = %7d. ", p->nCreated );
156 printf( "Del = %7d. ", p->nDeleted );
157 printf( "Lev = %3d. ", Hop_ManCountLevels(p) );
158 printf( "\n" );
159}
int Hop_ManCountLevels(Hop_Man_t *p)
Definition hopDfs.c:116
Here is the call graph for this function:

◆ Hop_ManStart()

ABC_NAMESPACE_IMPL_START Hop_Man_t * Hop_ManStart ( )

DECLARATIONS ///.

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

FileName [hopMan.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Minimalistic And-Inverter Graph package.]

Synopsis [AIG manager.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

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

Synopsis [Starts the AIG manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file hopMan.c.

46{
47 Hop_Man_t * p;
48 // start the manager
49 p = ABC_ALLOC( Hop_Man_t, 1 );
50 memset( p, 0, sizeof(Hop_Man_t) );
51 // perform initializations
52 p->nTravIds = 1;
53 p->fRefCount = 1;
54 p->fCatchExor = 0;
55 // allocate arrays for nodes
56 p->vPis = Vec_PtrAlloc( 100 );
57 p->vPos = Vec_PtrAlloc( 100 );
58 // prepare the internal memory manager
60 // create the constant node
61 p->pConst1 = Hop_ManFetchMemory( p );
62 p->pConst1->Type = AIG_CONST1;
63 p->pConst1->fPhase = 1;
64 p->nCreated = 1;
65 // start the table
66// p->nTableSize = 107;
67 p->nTableSize = 10007;
68 p->pTable = ABC_ALLOC( Hop_Obj_t *, p->nTableSize );
69 memset( p->pTable, 0, sizeof(Hop_Obj_t *) * p->nTableSize );
70 return p;
71}
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
typedefABC_NAMESPACE_HEADER_START struct Hop_Man_t_ Hop_Man_t
INCLUDES ///.
Definition hop.h:49
void Hop_ManStartMemory(Hop_Man_t *p)
FUNCTION DEFINITIONS ///.
Definition hopMem.c:49
@ AIG_CONST1
Definition hop.h:56
char * memset()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Hop_ManStop()

void Hop_ManStop ( Hop_Man_t * p)

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

Synopsis [Stops the AIG manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 84 of file hopMan.c.

85{
86 Hop_Obj_t * pObj;
87 int i;
88 // make sure the nodes have clean marks
89 pObj = Hop_ManConst1(p);
90 assert( !pObj->fMarkA && !pObj->fMarkB );
91 Hop_ManForEachPi( p, pObj, i )
92 assert( !pObj->fMarkA && !pObj->fMarkB );
93 Hop_ManForEachPo( p, pObj, i )
94 assert( !pObj->fMarkA && !pObj->fMarkB );
95 Hop_ManForEachNode( p, pObj, i )
96 assert( !pObj->fMarkA && !pObj->fMarkB );
97 // print time
98 if ( p->time1 ) { ABC_PRT( "time1", p->time1 ); }
99 if ( p->time2 ) { ABC_PRT( "time2", p->time2 ); }
100// Hop_TableProfile( p );
101 if ( p->vChunks ) Hop_ManStopMemory( p );
102 if ( p->vPis ) Vec_PtrFree( p->vPis );
103 if ( p->vPos ) Vec_PtrFree( p->vPos );
104 if ( p->vObjs ) Vec_PtrFree( p->vObjs );
105 ABC_FREE( p->pTable );
106 ABC_FREE( p );
107}
#define ABC_PRT(a, t)
Definition abc_global.h:255
#define ABC_FREE(obj)
Definition abc_global.h:267
#define Hop_ManForEachPi(p, pObj, i)
ITERATORS ///.
Definition hop.h:259
#define Hop_ManForEachPo(p, pObj, i)
Definition hop.h:262
void Hop_ManStopMemory(Hop_Man_t *p)
Definition hopMem.c:66
unsigned int fMarkA
Definition hop.h:77
unsigned int fMarkB
Definition hop.h:78
Here is the call graph for this function:
Here is the caller graph for this function: