gem5 v24.0.0.0
Loading...
Searching...
No Matches
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.
 
void lock (Addr block_address)
 Lock the block pointed by the block_address parameter.
 
void unlock (Addr block_address)
 Unlock the block pointed by the block_address parameter.
 
void erase (PacketPtr pkt)
 Erase a single block.
 
ssize_t number () const
 Number of erase blocks in flash memory.
 
ssize_t size () const
 Size in bytes of a single erase block.
 
- 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 Member Functions

void serialize (CheckpointOut &cp) const override
 Serialize an object.
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object.
 
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.
 
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

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 755 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 Tue Jun 18 2024 16:24:19 for gem5 by doxygen 1.11.0