gem5  v22.1.0.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
gem5::memory::CfiMemory::BlockData Struct Reference

Metadata about the erase blocks in flash. More...

Inheritance diagram for gem5::memory::CfiMemory::BlockData:
gem5::Serializable

Public Member Functions

 BlockData (const CfiMemory &_parent, ssize_t number, ssize_t size)
 
bool isLocked (Addr block_address) const
 Return true if the block pointed by the block_address parameter is locked. More...
 
void lock (Addr block_address)
 Lock the block pointed by the block_address parameter. More...
 
void unlock (Addr block_address)
 Unlock the block pointed by the block_address parameter. More...
 
void erase (PacketPtr pkt)
 Erase a single block. More...
 
ssize_t number () const
 Number of erase blocks in flash memory. More...
 
ssize_t size () const
 Size in bytes of a single erase block. 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 Member Functions

void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
uint32_t blockIdx (Addr block_address) const
 

Private Attributes

std::vector< bool > locked
 
const ssize_t blockSize
 
const CfiMemoryparent
 

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

Metadata about the erase blocks in flash.

Definition at line 104 of file cfi_mem.hh.

Constructor & Destructor Documentation

◆ BlockData()

gem5::memory::CfiMemory::BlockData::BlockData ( const CfiMemory _parent,
ssize_t  number,
ssize_t  size 
)
inline

Definition at line 106 of file cfi_mem.hh.

Member Function Documentation

◆ blockIdx()

uint32_t gem5::memory::CfiMemory::BlockData::blockIdx ( Addr  block_address) const
private

Definition at line 88 of file cfi_mem.cc.

Referenced by isLocked().

◆ erase()

void gem5::memory::CfiMemory::BlockData::erase ( PacketPtr  pkt)

Erase a single block.

The address of the block is supplied by the packet address.

@params pkt memory packet targeting the erase block

Definition at line 740 of file cfi_mem.cc.

References gem5::Packet::getAddr().

Referenced by gem5::memory::CfiMemory::write().

◆ isLocked()

bool gem5::memory::CfiMemory::BlockData::isLocked ( Addr  block_address) const

Return true if the block pointed by the block_address parameter is locked.

@params block_address address of the erase block in flash memory: first block starts ad address 0x0

Returns
true if block is locked

Definition at line 58 of file cfi_mem.cc.

References blockIdx(), and locked.

Referenced by gem5::memory::CfiMemory::readDeviceID(), and gem5::memory::CfiMemory::write().

◆ lock()

void gem5::memory::CfiMemory::BlockData::lock ( Addr  block_address)

Lock the block pointed by the block_address parameter.

@params block_address address of the erase block in flash memory: first block starts ad address 0x0

Definition at line 64 of file cfi_mem.cc.

Referenced by gem5::memory::CfiMemory::write().

◆ number()

ssize_t gem5::memory::CfiMemory::BlockData::number ( ) const
inline

Number of erase blocks in flash memory.

Definition at line 147 of file cfi_mem.hh.

References locked.

◆ serialize()

void gem5::memory::CfiMemory::BlockData::serialize ( CheckpointOut cp) const
overrideprivatevirtual

Serialize an object.

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

Parameters
cpCheckpoint state

Implements gem5::Serializable.

Definition at line 76 of file cfi_mem.cc.

References SERIALIZE_CONTAINER.

◆ size()

ssize_t gem5::memory::CfiMemory::BlockData::size ( ) const
inline

Size in bytes of a single erase block.

Definition at line 150 of file cfi_mem.hh.

References blockSize.

◆ unlock()

void gem5::memory::CfiMemory::BlockData::unlock ( Addr  block_address)

Unlock the block pointed by the block_address parameter.

@params block_address address of the erase block in flash memory: first block starts ad address 0x0

Definition at line 70 of file cfi_mem.cc.

Referenced by gem5::memory::CfiMemory::write().

◆ unserialize()

void gem5::memory::CfiMemory::BlockData::unserialize ( CheckpointIn cp)
overrideprivatevirtual

Unserialize an object.

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

Parameters
cpCheckpoint state

Implements gem5::Serializable.

Definition at line 82 of file cfi_mem.cc.

References UNSERIALIZE_CONTAINER.

Member Data Documentation

◆ blockSize

const ssize_t gem5::memory::CfiMemory::BlockData::blockSize
private

Definition at line 164 of file cfi_mem.hh.

Referenced by size().

◆ locked

std::vector<bool> gem5::memory::CfiMemory::BlockData::locked
private

Definition at line 161 of file cfi_mem.hh.

Referenced by isLocked(), and number().

◆ parent

const CfiMemory& gem5::memory::CfiMemory::BlockData::parent
private

Definition at line 166 of file cfi_mem.hh.


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

Generated on Wed Dec 21 2022 10:24:15 for gem5 by doxygen 1.9.1