Class simtix::mem::XBar
ClassList > simtix > mem > XBar
Crossbar for connecting multiple memory interfaces.
#include <mem.h>
Inherits the following classes: simtix::mem::MemoryInterface
Classes
Type | Name |
---|---|
class | Impl |
Public Types inherited from simtix::mem::MemoryInterface
See simtix::mem::MemoryInterface
Type | Name |
---|---|
typedef std::function< bool(RespStatus)> | OnResp |
enum uint8_t | RespStatus |
Public Functions
Type | Name |
---|---|
bool | AddSlave (MemoryInterface *, uint64_t addr, size_t size) Add a slave memory interface to the crossbar. |
virtual bool | Read (Payload payload, OnResp on_resp) override Enqueue a read request to the request queue. |
std::optional< MemoryInterface * > | Route (uint64_t addr, size_t size) Route a memory request to the appropriate slave. |
bool | Valid (uint64_t addr, size_t size) Validate if a memory address and size are within a valid range. |
virtual bool | Write (Payload payload, OnResp on_resp) override Enqueue a write request to the request queue. |
XBar (const std::string & name, uint32_t bandwidth) Constructor of XBar . |
|
virtual uint8_t & | operator[] (const uint64_t addr) override The operator[] is used by the simulator to read or modify memory directly. |
~XBar () |
Public Functions inherited from simtix::mem::MemoryInterface
See simtix::mem::MemoryInterface
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. |
Public Functions Documentation
function AddSlave
Add a slave memory interface to the crossbar.
Parameters:
slave
Pointer to the slave memory interface.addr
Base address of the slave memory.size
Size of the memory region for the slave.
Returns:
True if the slave is added successfully, false otherwise.
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.
Implements simtix::mem::MemoryInterface::Read
function Route
Route a memory request to the appropriate slave.
Parameters:
addr
Memory address.size
Size of the memory region.
Returns:
Pointer to the routed memory interface.
function Valid
Validate if a memory address and size are within a valid range.
Parameters:
addr
Memory address.size
Size of the memory region.
Returns:
True if the address and size are valid, false otherwise.
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.
Implements simtix::mem::MemoryInterface::Write
function XBar
Constructor of XBar .
Parameters:
name
Name of the crossbar.bandwidth
Bandwidth of the crossbar in bytes per cycle.
function operator[]
The operator[] is used by the simulator to read or modify memory directly.
Implements simtix::mem::MemoryInterface::operator[]
function ~XBar
The documentation for this class was generated from the following file projects/simtix/include/simtix/mem.h