The Sparta Modeling Framework
Loading...
Searching...
No Matches
sparta::memory::StoreData Class Reference

Public Member Functions

 StoreData (uint64_t write_id, addr_t paddr, size_t size, const uint8_t *data, const void *in_supplement, void *out_supplement)
 Construct a StoreData object.
 
uint64_t getWriteID () const
 Get the write ID, unique to each write performed.
 
addr_t getPAddr () const
 Get the physical address this write corresponds to.
 
size_t getSize () const
 Get the size of the write data (in bytes)
 
uint8_t * getStoreDataPtr ()
 Get the stored data.
 
uint8_t * getPrevDataPtr ()
 Get the previous data at the address (for restore)
 
const uint8_t * getStoreDataPtr () const
 Const methods of above methods.
 
const uint8_t * getPrevDataPtr () const
 Const methods of above methods.
 

Detailed Description

for CachedMemory

This class is the default helper class for CachedMemory, but is not required to be used.

However, the API it provides must be implemented:

// Expected construction
MemoryAccessWrite(uint64_t write_id,
addr_t paddr,
size_t size,
const uint8_t * data,
const void * in_supplement,
void * out_supplement);
uint64_t getWriteID() const;
addr_t getPAddr() const;
size_t getSize() const;
uint8_t * getStoreDataPtr();
uint8_t * getPrevDataPtr();
const uint8_t * getStoreDataPtr() const;
const uint8_t * getPrevDataPtr() const;
size_t getSize() const
Get the size of the write data (in bytes)
uint8_t * getPrevDataPtr()
Get the previous data at the address (for restore)
uint64_t getWriteID() const
Get the write ID, unique to each write performed.
addr_t getPAddr() const
Get the physical address this write corresponds to.
uint8_t * getStoreDataPtr()
Get the stored data.
uint64_t addr_t
Type for generic address representation in generic interfaces, errors and printouts within SPARTA.

This class is the default helper class for CachedMemory. Specifically, when a write occurs in CachedMemory, an instance of this class is created to hold the data to be written as well as the previous data at the physical location.

When a write is committed, downsteam memory is updated using this class to write the data (and not the data from the cache).

Definition at line 48 of file CachedMemory.hpp.

Constructor & Destructor Documentation

◆ StoreData()

sparta::memory::StoreData::StoreData ( uint64_t write_id,
addr_t paddr,
size_t size,
const uint8_t * data,
const void * in_supplement,
void * out_supplement )
inline

Construct a StoreData object.

Parameters
write_idThe unique ID for this StoreData
paddrThe physical address of the data it contains
sizeThe size of the data contained
dataThe data to be copied into this class
in_supplement(ignored)
out_supplement(ignored)

Definition at line 61 of file CachedMemory.hpp.

Member Function Documentation

◆ getPAddr()

addr_t sparta::memory::StoreData::getPAddr ( ) const
inline

Get the physical address this write corresponds to.

Definition at line 84 of file CachedMemory.hpp.

◆ getPrevDataPtr() [1/2]

uint8_t * sparta::memory::StoreData::getPrevDataPtr ( )
inline

Get the previous data at the address (for restore)

Definition at line 93 of file CachedMemory.hpp.

◆ getPrevDataPtr() [2/2]

const uint8_t * sparta::memory::StoreData::getPrevDataPtr ( ) const
inline

Const methods of above methods.

Definition at line 99 of file CachedMemory.hpp.

◆ getSize()

size_t sparta::memory::StoreData::getSize ( ) const
inline

Get the size of the write data (in bytes)

Definition at line 87 of file CachedMemory.hpp.

◆ getStoreDataPtr() [1/2]

uint8_t * sparta::memory::StoreData::getStoreDataPtr ( )
inline

Get the stored data.

Definition at line 90 of file CachedMemory.hpp.

◆ getStoreDataPtr() [2/2]

const uint8_t * sparta::memory::StoreData::getStoreDataPtr ( ) const
inline

Const methods of above methods.

Definition at line 96 of file CachedMemory.hpp.

◆ getWriteID()

uint64_t sparta::memory::StoreData::getWriteID ( ) const
inline

Get the write ID, unique to each write performed.

Definition at line 81 of file CachedMemory.hpp.


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