|
rogue
|
Memory slave device. More...
#include <Slave.h>
Public Member Functions | |
| Slave (uint32_t min, uint32_t max) | |
| Constructs a memory slave. | |
| virtual | ~Slave () |
| Destroys the memory slave instance. | |
| virtual void | stop () |
| Stops the memory slave interface. | |
| void | addTransaction (std::shared_ptr< rogue::interfaces::memory::Transaction > transaction) |
| Adds a transaction to the internal tracking map. | |
| std::shared_ptr< rogue::interfaces::memory::Transaction > | getTransaction (uint32_t index) |
| Gets a transaction from the internal tracking map. | |
| uint32_t | min () |
| Returns configured minimum transaction size. | |
| uint32_t | max () |
| Returns configured maximum transaction size. | |
| uint32_t | id () |
| Returns unique slave ID. | |
| void | setName (std::string name) |
| Sets slave name. | |
| std::string | name () |
| Returns slave name. | |
| virtual uint32_t | doSlaveId () |
Services SlaveId request from a master. | |
| virtual std::string | doSlaveName () |
Services SlaveName request from a master. | |
| virtual uint32_t | doMinAccess () |
Services getMinAccess request from an attached master. | |
| virtual uint32_t | doMaxAccess () |
Services getMaxAccess request from an attached master. | |
| virtual uint64_t | doAddress () |
Services getAddress request from an attached master. | |
| virtual void | doTransaction (std::shared_ptr< rogue::interfaces::memory::Transaction > transaction) |
| Services a transaction request from an attached master. | |
| void | lshiftPy (boost::python::object p) |
Supports << operator usage from Python. | |
| std::shared_ptr< rogue::interfaces::memory::Master > & | operator<< (std::shared_ptr< rogue::interfaces::memory::Master > &other) |
| Connects this slave to a master via chaining operator. | |
Public Member Functions inherited from rogue::EnableSharedFromThis< rogue::interfaces::memory::Slave > | |
| std::shared_ptr< rogue::interfaces::memory::Slave > | shared_from_this () |
Returns a shared_ptr<T> for this instance. | |
Public Member Functions inherited from rogue::EnableSharedFromThisBase | |
| virtual | ~EnableSharedFromThisBase () |
| Virtual destructor for polymorphic base usage. | |
Static Public Member Functions | |
| static std::shared_ptr< rogue::interfaces::memory::Slave > | create (uint32_t min, uint32_t max) |
| Creates a memory slave. | |
| static void | setup_python () |
| Registers this type with Python bindings. | |
Memory slave device.
The memory Slave device accepts and services transactions from one or more Master devices. The Slave device is normally sub-classed in either C++ or Python to provide an interfaces to hardware or the next level memory transaction protocol, such as SrpV0 or SrpV3. Examples of Slave sub-class implementations are included elsewhere in this document.
The Slave object provides mechanisms for tracking current transactions.
| rogue::interfaces::memory::Slave::Slave | ( | uint32_t | min, |
| uint32_t | max | ||
| ) |
Constructs a memory slave.
Create object.
This constructor is a low-level C++ allocation path. Prefer create() when shared ownership or Python exposure is required.
min and max are stored as the local access-size contract and returned by default doMinAccess()/doMaxAccess() implementations.
| min | Minimum transaction size this slave can accept, in bytes. |
| max | Maximum transaction size this slave can accept, in bytes. |
|
virtual |
| void rogue::interfaces::memory::Slave::addTransaction | ( | std::shared_ptr< rogue::interfaces::memory::Transaction > | transaction | ) |
Adds a transaction to the internal tracking map.
Register a master.
This method is called by the sub-class to add a transaction into the local tracking map for later retrieval. This is used when the transaction will be completed later as the result of protocol data being returned to the Slave.
Exposed to Python as _addTransaction().
| transaction | Pointer to transaction as TransactionPtr. |
|
static |
Creates a memory slave.
Create a slave container.
Exposed as rogue.interfaces.memory.Slave() to Python. This static factory is the preferred construction path when the object is shared across Rogue graph connections or exposed to Python. It returns std::shared_ptr ownership compatible with Rogue pointer typedefs.
min and max define the default access-size contract (in bytes) reported by doMinAccess() and doMaxAccess(). The base Slave class stores and returns these values as provided; higher-level classes may layer additional semantics on top of them.
| min | Minimum transaction size this slave can accept, in bytes. |
| max | Maximum transaction size this slave can accept, in bytes. |
|
virtual |
Services getAddress request from an attached master.
Return offset.
Base implementation returns 0. Subclasses may override to contribute an address offset. Exposed as _doAddress() to Python.
Reimplemented in rogue::interfaces::memory::Hub, and rogue::interfaces::memory::SlaveWrap.
|
virtual |
Services getMaxAccess request from an attached master.
Return max access size to requesting master.
Base implementation returns local max() value. Subclasses may override. Exposed as _doMaxAccess() to Python.
Reimplemented in rogue::interfaces::memory::Hub, and rogue::interfaces::memory::SlaveWrap.
|
virtual |
Services getMinAccess request from an attached master.
Return min access size to requesting master.
Base implementation returns local min() value. Subclasses may override. Exposed as _doMinAccess() to Python.
Reimplemented in rogue::interfaces::memory::Hub, and rogue::interfaces::memory::SlaveWrap.
|
virtual |
Services SlaveId request from a master.
Return id to requesting master.
Called by memory Master. Subclasses may override. Base implementation returns local slave ID. Not exposed to Python.
Reimplemented in rogue::interfaces::memory::Hub.
|
virtual |
Services SlaveName request from a master.
Return name to requesting master.
Called by memory Master. Subclasses may override. Base implementation returns local slave name. Not exposed to Python.
Reimplemented in rogue::interfaces::memory::Hub.
|
virtual |
Services a transaction request from an attached master.
Post a transaction.
It is possible for this method to be overridden in either a Python or C++ subclass. Examples of sub-classing a Slave is included elsewhere in this document.
Base implementation reports an unsupported-transaction error. Exposed to Python as _doTransaction().
| transaction | Transaction pointer as TransactionPtr. |
Reimplemented in rogue::hardware::axi::AxiMemMap, rogue::hardware::MemMap, rogue::interfaces::memory::TcpClient, rogue::protocols::srp::SrpV0, rogue::protocols::srp::SrpV3, rogue::interfaces::memory::Emulate, rogue::interfaces::memory::Hub, rogue::interfaces::memory::HubWrap, and rogue::interfaces::memory::SlaveWrap.
| rogue::interfaces::memory::TransactionPtr rogue::interfaces::memory::Slave::getTransaction | ( | uint32_t | index | ) |
Gets a transaction from the internal tracking map.
Get transaction with index, called by sub classes.
This method is called by the sub-class to retrieve an existing transaction using the unique transaction ID. If the transaction exists in the list the pointer to that transaction will be returned. If not a NULL pointer will be returned. When getTransaction() is called the map will also be checked for stale transactions which will be removed from the map.
Exposed to Python as _getTransaction().
| index | ID of transaction to lookup. |
| uint32_t rogue::interfaces::memory::Slave::id | ( | ) |
| void rogue::interfaces::memory::Slave::lshiftPy | ( | boost::python::object | p | ) |
| uint32_t rogue::interfaces::memory::Slave::max | ( | ) |
| uint32_t rogue::interfaces::memory::Slave::min | ( | ) |
| std::string rogue::interfaces::memory::Slave::name | ( | ) |
| std::shared_ptr< rogue::interfaces::memory::Master > & rogue::interfaces::memory::Slave::operator<< | ( | std::shared_ptr< rogue::interfaces::memory::Master > & | other | ) |
Connects this slave to a master via chaining operator.
Equivalent to other->setSlave(this) semantics.
| other | Memory master to connect. |
| void rogue::interfaces::memory::Slave::setName | ( | std::string | name | ) |
|
static |
|
virtual |
Stops the memory slave interface.
Stop the interface.
Base implementation is a no-op. Subclasses may override to stop worker threads or transport links.
Reimplemented in rogue::hardware::axi::AxiMemMap, rogue::hardware::MemMap, and rogue::interfaces::memory::TcpClient.