Class simtix::mem::MemoryInterface
ClassList > simtix > mem > MemoryInterface
An abstract class for all objects that have a read/write memory interface. More...
#include <mem.h>
Inherits the following classes: simtix::sim::Clocked
Inherited by the following classes: simtix::mem::BankedMemory, simtix::mem::CacheInterface, simtix::mem::SimpleMemory, simtix::mem::XBar
Classes
Type | Name |
---|---|
struct | Payload |
Public Types
Type | Name |
---|---|
typedef std::function< bool(RespStatus)> | OnResp |
enum uint8_t | RespStatus |
Public Functions
Type | Name |
---|---|
MemoryInterface (const std::string & name, sim::TickPri pri=sim::kMemTickPri) |
|
virtual bool | Read (Payload payload, OnResp on_resp) Enqueue a read request to the request queue. |
virtual bool | Write (Payload payload, OnResp on_resp) Enqueue a write request to the request queue. |
virtual uint8_t & | operator[] (const uint64_t addr) = 0 The operator[] is used by the simulator to read or modify memory directly. |
virtual | ~MemoryInterface () = default |
Public Functions inherited from simtix::sim::Clocked
Type | Name |
---|---|
Clocked (const std::string & name, TickPri pri=kDefaultPri) Constructor for clocled. |
|
const std::string & | name () const Get the name of the clocked object. |
virtual | ~Clocked () |
Protected Attributes inherited from simtix::sim::Clocked
Type | Name |
---|---|
std::string | name_ |
TickPri | pri_ |
Protected Static Attributes inherited from simtix::sim::Clocked
Type | Name |
---|---|
bool | busy_ = true |
std::map< TickPri, std::vector< Clocked * > > | clocked_objs_map_ |
uint64_t | cur_tick_ = 0 |
Protected Functions inherited from simtix::sim::Clocked
Type | Name |
---|---|
virtual bool | HasPendingTasks () = 0 Checks if any registered clocked objects have pending tasks at the current tick. |
virtual void | Tick () = 0 Global tick function that advances the simulation by one cycle. |
Protected Static Functions inherited from simtix::sim::Clocked
Type | Name |
---|---|
void | Register (Clocked * c) Register a clocked object to participate in tick-driven simulation. |
void | Unregister (Clocked * c) Unregister a clocked object from tick-driven simulation. |
Detailed Description
This class inherits <sim::Clocked>, so the child class must implement Tick
function.
Public Types Documentation
typedef OnResp
enum RespStatus
Public Functions Documentation
function MemoryInterface
inline explicit simtix::mem::MemoryInterface::MemoryInterface (
const std::string & name,
sim::TickPri pri=sim::kMemTickPri
)
function Read
Enqueue a read request to the request queue.
Parameters:
payload
Payload for the read operation.on_resp
Callback for the response.
Returns:
True if enqueued successfully.
function Write
Enqueue a write request to the request queue.
Parameters:
payload
Payload for the write operation.on_resp
Callback for the response.
Returns:
True if enqueued successfully.
function operator[]
The operator[] is used by the simulator to read or modify memory directly.
function ~MemoryInterface
The documentation for this class was generated from the following file projects/simtix/include/simtix/mem.h