gem5  v22.1.0.0
Public Member Functions | Private Attributes | List of all members
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. More...
 
Addr memSize (int pool_id=0) const
 Amount of physical memory that exists in a pool. More...
 
Addr freeMemSize (int pool_id=0) const
 Amount of physical memory that is still free in a pool. More...
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
- 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. More...
 
void serializeSection (CheckpointOut &cp, const std::string &name) const
 
void unserializeSection (CheckpointIn &cp, const char *name)
 Unserialize an a child object. More...
 
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. More...
 
static void generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream)
 Generate a checkpoint file so that the serialization can be routed to it. More...
 

Detailed Description

Definition at line 86 of file mem_pool.hh.

Constructor & Destructor Documentation

◆ MemPools()

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

Definition at line 94 of file mem_pool.hh.

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 152 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 164 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 158 of file mem_pool.cc.

References pools.

◆ populate()

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

Definition at line 145 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 170 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 181 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 89 of file mem_pool.hh.

Referenced by populate().

◆ pools

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

Definition at line 91 of file mem_pool.hh.

Referenced by allocPhysPages(), freeMemSize(), memSize(), populate(), serialize(), and unserialize().


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

Generated on Wed Dec 21 2022 10:23:30 for gem5 by doxygen 1.9.1