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

Go to the source code of this file.

Macros

#define IVY_PAGE_SIZE   12
 DECLARATIONS ///.
 
#define IVY_PAGE_MASK   4095
 

Functions

void Hop_ManStartMemory (Hop_Man_t *p)
 FUNCTION DEFINITIONS ///.
 
void Hop_ManStopMemory (Hop_Man_t *p)
 
void Hop_ManAddMemory (Hop_Man_t *p)
 MACRO DEFINITIONS ///.
 

Macro Definition Documentation

◆ IVY_PAGE_MASK

#define IVY_PAGE_MASK   4095

Definition at line 32 of file hopMem.c.

◆ IVY_PAGE_SIZE

#define IVY_PAGE_SIZE   12

DECLARATIONS ///.

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

FileName [hopMem.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Minimalistic And-Inverter Graph package.]

Synopsis [Memory management for the AIG nodes.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

]

Definition at line 31 of file hopMem.c.

Function Documentation

◆ Hop_ManAddMemory()

void Hop_ManAddMemory ( Hop_Man_t * p)

MACRO DEFINITIONS ///.

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

Synopsis [Allocates additional memory for the nodes.]

Description [Allocates IVY_PAGE_SIZE nodes. Aligns memory by 32 bytes. Records the pointer to the AIG manager in the -1 entry.]

SideEffects []

SeeAlso []

Definition at line 89 of file hopMem.c.

90{
91 char * pMemory;
92 int i, nBytes;
93 assert( sizeof(Hop_Obj_t) <= 64 );
94 assert( p->pListFree == NULL );
95// assert( (Hop_ManObjNum(p) & IVY_PAGE_MASK) == 0 );
96 // allocate new memory page
97 nBytes = sizeof(Hop_Obj_t) * (1<<IVY_PAGE_SIZE) + 64;
98 pMemory = ABC_ALLOC( char, nBytes );
99 Vec_PtrPush( p->vChunks, pMemory );
100 // align memory at the 32-byte boundary
101 pMemory = pMemory + 64 - (((int)(ABC_PTRUINT_T)pMemory) & 63);
102 // remember the manager in the first entry
103 Vec_PtrPush( p->vPages, pMemory );
104 // break the memory down into nodes
105 p->pListFree = (Hop_Obj_t *)pMemory;
106 for ( i = 1; i <= IVY_PAGE_MASK; i++ )
107 {
108 *((char **)pMemory) = pMemory + sizeof(Hop_Obj_t);
109 pMemory += sizeof(Hop_Obj_t);
110 }
111 *((char **)pMemory) = NULL;
112}
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
Cube * p
Definition exorList.c:222
#define IVY_PAGE_SIZE
DECLARATIONS ///.
Definition hopMem.c:31
#define IVY_PAGE_MASK
Definition hopMem.c:32
struct Hop_Obj_t_ Hop_Obj_t
Definition hop.h:50
#define assert(ex)
Definition util_old.h:213

◆ Hop_ManStartMemory()

void Hop_ManStartMemory ( Hop_Man_t * p)

FUNCTION DEFINITIONS ///.

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

Synopsis [Starts the internal memory manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 49 of file hopMem.c.

50{
51 p->vChunks = Vec_PtrAlloc( 128 );
52 p->vPages = Vec_PtrAlloc( 128 );
53}
Here is the caller graph for this function:

◆ Hop_ManStopMemory()

void Hop_ManStopMemory ( Hop_Man_t * p)

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

Synopsis [Stops the internal memory manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 66 of file hopMem.c.

67{
68 void * pMemory;
69 int i;
70 Vec_PtrForEachEntry( void *, p->vChunks, pMemory, i )
71 ABC_FREE( pMemory );
72 Vec_PtrFree( p->vChunks );
73 Vec_PtrFree( p->vPages );
74 p->pListFree = NULL;
75}
#define ABC_FREE(obj)
Definition abc_global.h:267
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55
Here is the caller graph for this function: