gem5 [DEVELOP-FOR-25.0]
Loading...
Searching...
No Matches
gem5::MemPools Class Reference

#include <mem_pool.hh>

Inheritance diagram for gem5::MemPools:
gem5::Serializable

Public Member Functions

 MemPools (Addr page_shift)
 
void populate (const AddrRangeList &memories)
 
Addr allocPhysPages (int npages, int pool_id=0)
 Allocate npages contiguous unused physical pages.
 
void deallocPhysPages (Addr page_addr, int npages, int pool_id=0)
 Deallocate physical pages.
 
Addr memSize (int pool_id=0) const
 Amount of physical memory that exists in a pool.
 
Addr freeMemSize (int pool_id=0) const
 Amount of physical memory that is still free in a pool.
 
void serialize (CheckpointOut &cp) const override
 Serialize an object.
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object.
 
- Public Member Functions inherited from gem5::Serializable
 Serializable ()
 
virtual ~Serializable ()
 
void serializeSection (CheckpointOut &cp, const char *name) const
 Serialize an object into a new section.
 
void serializeSection (CheckpointOut &cp, const std::string &name) const
 
void unserializeSection (CheckpointIn &cp, const char *name)
 Unserialize an a child object.
 
void unserializeSection (CheckpointIn &cp, const std::string &name)
 

Private Attributes

Addr pageShift
 
std::vector< MemPoolpools
 

Additional Inherited Members

- Static Public Member Functions inherited from gem5::Serializable
static const std::string & currentSection ()
 Gets the fully-qualified name of the active section.
 
static void generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream)
 Generate a checkpoint file so that the serialization can be routed to it.
 

Detailed Description

Definition at line 84 of file mem_pool.hh.

Constructor & Destructor Documentation

◆ MemPools()

gem5::MemPools::MemPools ( Addr page_shift)
inline

Definition at line 92 of file mem_pool.hh.

References pageShift.

Member Function Documentation

◆ allocPhysPages()

Addr gem5::MemPools::allocPhysPages ( int npages,
int pool_id = 0 )

Allocate npages contiguous unused physical pages.

Returns
Starting address of first page

Definition at line 163 of file mem_pool.cc.

References pools.

◆ deallocPhysPages()

void gem5::MemPools::deallocPhysPages ( Addr page_addr,
int npages,
int pool_id = 0 )

Deallocate physical pages.

These may be reallocated by allocPhysPages later on.

Definition at line 169 of file mem_pool.cc.

References pools.

◆ freeMemSize()

Addr gem5::MemPools::freeMemSize ( int pool_id = 0) const

Amount of physical memory that is still free in a pool.

Definition at line 181 of file mem_pool.cc.

References pools.

◆ memSize()

Addr gem5::MemPools::memSize ( int pool_id = 0) const

Amount of physical memory that exists in a pool.

Definition at line 175 of file mem_pool.cc.

References pools.

◆ populate()

void gem5::MemPools::populate ( const AddrRangeList & memories)

Definition at line 156 of file mem_pool.cc.

References mem, pageShift, and pools.

◆ serialize()

void gem5::MemPools::serialize ( CheckpointOut & cp) const
overridevirtual

Serialize an object.

Output an object's state into the current checkpoint section.

Parameters
cpCheckpoint state

Implements gem5::Serializable.

Definition at line 187 of file mem_pool.cc.

References gem5::csprintf(), gem5::ArmISA::i, pools, SERIALIZE_SCALAR, and gem5::Serializable::serializeSection().

◆ unserialize()

void gem5::MemPools::unserialize ( CheckpointIn & cp)
overridevirtual

Unserialize an object.

Read an object's state from the current checkpoint section.

Parameters
cpCheckpoint state

Implements gem5::Serializable.

Definition at line 198 of file mem_pool.cc.

References gem5::csprintf(), gem5::ArmISA::i, pools, UNSERIALIZE_SCALAR, and gem5::Serializable::unserializeSection().

Member Data Documentation

◆ pageShift

Addr gem5::MemPools::pageShift
private

Definition at line 87 of file mem_pool.hh.

Referenced by MemPools(), and populate().

◆ pools

std::vector<MemPool> gem5::MemPools::pools
private

The documentation for this class was generated from the following files:

Generated on Mon May 26 2025 09:19:22 for gem5 by doxygen 1.13.2