#include "hop.h"
Go to the source code of this file.
Functions | |
Hop_Man_t * | Hop_ManStart () |
void | Hop_ManStop (Hop_Man_t *p) |
int | Hop_ManCleanup (Hop_Man_t *p) |
void | Hop_ManPrintStats (Hop_Man_t *p) |
int Hop_ManCleanup | ( | Hop_Man_t * | p | ) |
Function*************************************************************
Synopsis [Returns the number of dangling nodes removed.]
Description []
SideEffects []
SeeAlso []
Definition at line 117 of file hopMan.c.
00118 { 00119 Vec_Ptr_t * vObjs; 00120 Hop_Obj_t * pNode; 00121 int i, nNodesOld; 00122 assert( p->fRefCount ); 00123 nNodesOld = Hop_ManNodeNum(p); 00124 // collect roots of dangling nodes 00125 vObjs = Vec_PtrAlloc( 100 ); 00126 Hop_ManForEachNode( p, pNode, i ) 00127 if ( Hop_ObjRefs(pNode) == 0 ) 00128 Vec_PtrPush( vObjs, pNode ); 00129 // recursively remove dangling nodes 00130 Vec_PtrForEachEntry( vObjs, pNode, i ) 00131 Hop_ObjDelete_rec( p, pNode ); 00132 Vec_PtrFree( vObjs ); 00133 return nNodesOld - Hop_ManNodeNum(p); 00134 }
void Hop_ManPrintStats | ( | Hop_Man_t * | p | ) |
Function*************************************************************
Synopsis [Stops the AIG manager.]
Description []
SideEffects []
SeeAlso []
Definition at line 147 of file hopMan.c.
00148 { 00149 printf( "PI/PO = %d/%d. ", Hop_ManPiNum(p), Hop_ManPoNum(p) ); 00150 printf( "A = %7d. ", Hop_ManAndNum(p) ); 00151 printf( "X = %5d. ", Hop_ManExorNum(p) ); 00152 printf( "Cre = %7d. ", p->nCreated ); 00153 printf( "Del = %7d. ", p->nDeleted ); 00154 printf( "Lev = %3d. ", Hop_ManCountLevels(p) ); 00155 printf( "\n" ); 00156 }
Hop_Man_t* Hop_ManStart | ( | ) |
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 [
] DECLARATIONS /// FUNCTION DEFINITIONS ///Function*************************************************************
Synopsis [Starts the AIG manager.]
Description []
SideEffects []
SeeAlso []
Definition at line 42 of file hopMan.c.
00043 { 00044 Hop_Man_t * p; 00045 // start the manager 00046 p = ALLOC( Hop_Man_t, 1 ); 00047 memset( p, 0, sizeof(Hop_Man_t) ); 00048 // perform initializations 00049 p->nTravIds = 1; 00050 p->fRefCount = 1; 00051 p->fCatchExor = 0; 00052 // allocate arrays for nodes 00053 p->vPis = Vec_PtrAlloc( 100 ); 00054 p->vPos = Vec_PtrAlloc( 100 ); 00055 // prepare the internal memory manager 00056 Hop_ManStartMemory( p ); 00057 // create the constant node 00058 p->pConst1 = Hop_ManFetchMemory( p ); 00059 p->pConst1->Type = AIG_CONST1; 00060 p->pConst1->fPhase = 1; 00061 p->nCreated = 1; 00062 // start the table 00063 // p->nTableSize = 107; 00064 p->nTableSize = 10007; 00065 p->pTable = ALLOC( Hop_Obj_t *, p->nTableSize ); 00066 memset( p->pTable, 0, sizeof(Hop_Obj_t *) * p->nTableSize ); 00067 return p; 00068 }
void Hop_ManStop | ( | Hop_Man_t * | p | ) |
Function*************************************************************
Synopsis [Stops the AIG manager.]
Description []
SideEffects []
SeeAlso []
Definition at line 81 of file hopMan.c.
00082 { 00083 Hop_Obj_t * pObj; 00084 int i; 00085 // make sure the nodes have clean marks 00086 pObj = Hop_ManConst1(p); 00087 assert( !pObj->fMarkA && !pObj->fMarkB ); 00088 Hop_ManForEachPi( p, pObj, i ) 00089 assert( !pObj->fMarkA && !pObj->fMarkB ); 00090 Hop_ManForEachPo( p, pObj, i ) 00091 assert( !pObj->fMarkA && !pObj->fMarkB ); 00092 Hop_ManForEachNode( p, pObj, i ) 00093 assert( !pObj->fMarkA && !pObj->fMarkB ); 00094 // print time 00095 if ( p->time1 ) { PRT( "time1", p->time1 ); } 00096 if ( p->time2 ) { PRT( "time2", p->time2 ); } 00097 // Hop_TableProfile( p ); 00098 if ( p->vChunks ) Hop_ManStopMemory( p ); 00099 if ( p->vPis ) Vec_PtrFree( p->vPis ); 00100 if ( p->vPos ) Vec_PtrFree( p->vPos ); 00101 if ( p->vObjs ) Vec_PtrFree( p->vObjs ); 00102 free( p->pTable ); 00103 free( p ); 00104 }