gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::memory::CfiMemory::ProgramBuffer Struct Reference

Word Buffer used by the BUFFERED PROGRAM command to write (program) chunks of words to flash. More...

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

Public Member Functions

 ProgramBuffer (const CfiMemory &_parent)
 
void setup (ssize_t buffer_size)
 Start buffering.
 
bool write (Addr flash_address, void *data_ptr, ssize_t size)
 Write data into the buffer.
 
bool writeback ()
 
- 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)
 

Static Public Attributes

static const ssize_t MAX_BUFFER_SIZE = 32 * 4
 

Private Member Functions

void serialize (CheckpointOut &cp) const override
 Serialize an object.
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object.
 

Private Attributes

std::vector< uint8_t > buffer
 
ssize_t bytesWritten = 0
 
Addr blockPointer = 0
 
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

Word Buffer used by the BUFFERED PROGRAM command to write (program) chunks of words to flash.

Definition at line 173 of file cfi_mem.hh.

Constructor & Destructor Documentation

◆ ProgramBuffer()

gem5::memory::CfiMemory::ProgramBuffer::ProgramBuffer ( const CfiMemory & _parent)
inline

Definition at line 179 of file cfi_mem.hh.

Member Function Documentation

◆ serialize()

void gem5::memory::CfiMemory::ProgramBuffer::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 141 of file cfi_mem.cc.

References SERIALIZE_CONTAINER, and SERIALIZE_SCALAR.

◆ setup()

void gem5::memory::CfiMemory::ProgramBuffer::setup ( ssize_t buffer_size)

Start buffering.

Parameters
buffer_sizenew size (in bytes) of the program buffer

Clipping the size to its limit

Definition at line 94 of file cfi_mem.cc.

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

◆ unserialize()

void gem5::memory::CfiMemory::ProgramBuffer::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 149 of file cfi_mem.cc.

References UNSERIALIZE_CONTAINER, and UNSERIALIZE_SCALAR.

◆ write()

bool gem5::memory::CfiMemory::ProgramBuffer::write ( Addr flash_address,
void * data_ptr,
ssize_t size )

Write data into the buffer.

If the buffer is full, the method will return true, meaning it's time to write back the buffer into memory

@params flash_address address in flash (relative to the start) @params data_ptr pointer to the data @params size number of bytes to be written to the buffer

Returns
true if buffer needs to be written back to flash

Definition at line 107 of file cfi_mem.cc.

References gem5::ArmISA::offset, and gem5::memory::AbstractMemory::size().

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

◆ writeback()

bool gem5::memory::CfiMemory::ProgramBuffer::writeback ( )

Definition at line 129 of file cfi_mem.cc.

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

Member Data Documentation

◆ blockPointer

Addr gem5::memory::CfiMemory::ProgramBuffer::blockPointer = 0
private

Definition at line 217 of file cfi_mem.hh.

◆ buffer

std::vector<uint8_t> gem5::memory::CfiMemory::ProgramBuffer::buffer
private

Definition at line 211 of file cfi_mem.hh.

◆ bytesWritten

ssize_t gem5::memory::CfiMemory::ProgramBuffer::bytesWritten = 0
private

Definition at line 214 of file cfi_mem.hh.

◆ MAX_BUFFER_SIZE

const ssize_t gem5::memory::CfiMemory::ProgramBuffer::MAX_BUFFER_SIZE = 32 * 4
static

Definition at line 177 of file cfi_mem.hh.

◆ parent

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

Definition at line 219 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