21 #ifndef ABC__aig__mem__mem2_h
22 #define ABC__aig__mem__mem2_h
87 p->nPageBase = nPageBase;
88 p->PageMask = (1 << nPageBase) - 1;
89 p->iNext = (1 << nPageBase);
97 printf(
"Using %3d pages of %6d words each with %6d entries (max = %6d). Total memory = %5.2f MB.\n",
98 Vec_PtrSize(&p->vPages), p->nPageBase ? 1 << p->nPageBase : 0, p->nEntries, p->nEntriesMax,
99 1.0 *
Vec_PtrSize(&p->vPages) * (1 << p->nPageBase) * 8 / (1 << 20) );
107 assert( h > 0 && h < p->iNext );
108 return (
word *)
Vec_PtrEntry(&p->vPages, (h >> p->nPageBase)) + (h & p->PageMask);
113 assert( nWords > 0 && nWords < p->PageMask );
114 if ( p->iNext + nWords >= p->PageMask )
119 hEntry = ((
Vec_PtrSize(&p->vPages) - 1) << p->nPageBase) | p->iNext;
122 p->nEntriesMax =
Abc_MaxInt( p->nEntriesMax, p->nEntries );
127 assert( h > 0 && h < p->iNext );
128 if ( (h >> p->nPageBase) &&
Vec_PtrEntry(&p->vPages, (h >> p->nPageBase) - 1) )
150 assert( nEntryWords > 0 && nEntryWords < (1 << nPageBase) );
166 printf(
"Using %3d pages of %6d words each with %6d entries (max = %6d) of size %d. Total memory = %5.2f MB.\n",
223 p->
nBits = nWordBase;
224 p->
uMask = (1 << nWordBase) - 1;
225 for ( i = 1; i <= p->
uMask; i++ )
232 for ( i = 0; i <= p->
uMask; i++ )
243 assert( nWords > 0 && nWords <= p->uMask );
257 for ( i = 1; i <= p->
uMask; i++ )
static void Mmr_FixedStop(Mmr_Fixed_t *p, int fFreeLast)
static Mmr_Flex_t * Mmr_FlexStart(int nPageBase)
FUNCTION DEFINITIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
static int Mmr_StepMemory(Mmr_Step_t *p)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static Mmr_Step_t * Mmr_StepStart(int nPageBase, int nWordBase)
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
static int Abc_MaxInt(int a, int b)
static word * Mmr_FlexEntry(Mmr_Flex_t *p, int h)
static int Vec_PtrSize(Vec_Ptr_t *p)
static void Vec_IntReverseOrder(Vec_Int_t *p)
static void Mmr_FlexRelease(Mmr_Flex_t *p, int h)
static void Mmr_FixedCreate(Mmr_Fixed_t *p, int nPageBase, int nEntryWords)
static word * Mmr_FixedEntry(Mmr_Fixed_t *p, int h)
static int Mmr_StepFetch(Mmr_Step_t *p, int nWords)
unsigned __int64 word
DECLARATIONS ///.
static int Mmr_FixedMemory(Mmr_Fixed_t *p)
static word * Mmr_StepEntry(Mmr_Step_t *p, int h)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
static void Mmr_FlexStop(Mmr_Flex_t *p)
static int Mmr_FixedFetch(Mmr_Fixed_t *p)
#define ABC_NAMESPACE_HEADER_END
static void Mmr_StepRecycle(Mmr_Step_t *p, int h)
static void Vec_PtrWriteEntry(Vec_Ptr_t *p, int i, void *Entry)
typedefABC_NAMESPACE_HEADER_START struct Mmr_Flex_t_ Mmr_Flex_t
DECLARATIONS ///.
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
static Mmr_Fixed_t * Mmr_FixedStart(int nPageBase, int nEntryWords)
static int Vec_IntSize(Vec_Int_t *p)
static int Mmr_FlexFetch(Mmr_Flex_t *p, int nWords)
#define ABC_CALLOC(type, num)
static void Mmr_StepStop(Mmr_Step_t *p)
static void Mmr_FixedRecycle(Mmr_Fixed_t *p, int h)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
#define ABC_FALLOC(type, num)