Slave

Slave objects in C++ are referenced by the following shared pointer typedef:

typedef std::shared_ptr<rogue::interfaces::memory::Slave> rogue::interfaces::memory::SlavePtr

Alias for using shared pointer as SlavePtr.

The class description is shown below:

class Slave : public rogue::EnableSharedFromThis<rogue::interfaces::memory::Slave>

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.

Subclassed by rogue::hardware::axi::AxiMemMap, rogue::hardware::MemMap, rogue::interfaces::memory::Emulate, rogue::interfaces::memory::Hub, rogue::interfaces::memory::SlaveWrap, rogue::interfaces::memory::TcpClient, rogue::protocols::srp::SrpV0, rogue::protocols::srp::SrpV3

Public Functions

virtual void stop()

Stop the interface.

void addTransaction(std::shared_ptr<rogue::interfaces::memory::Transaction> transaction)

Add a transaction to the internal tracking map.

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()

Parameters:

transaction – Pointer to transaction as TransactionPtr

std::shared_ptr<rogue::interfaces::memory::Transaction> getTransaction(uint32_t index)

Get a transaction from the internal tracking map.

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()

Parameters:

index – ID of transaction to lookup

Returns:

Pointer to transaction as TransactionPtr or NULL if not found

uint32_t min()

Get min size from slave.

Not exposed to Python

Returns:

Minimum transaction size

uint32_t max()

Get max size from slave.

Not exposed to Python

Returns:

Maximum transaction size

uint32_t id()

Get unique slave ID.

Not exposed to Python

Returns:

Unique slave ID

void setName(std::string)

Set slave Name.

Sxposed to Python as setName

std::string name()

Get slave Name.

Not exposed to Python

Returns:

Slave Name

virtual uint32_t doSlaveId()

Interface to service SlaveId request from Master.

Called by memory Master. May be overridden by Slave sub-class. By default returns the local Slave ID

Not exposed to Python

Returns:

Unique Slave ID

virtual std::string doSlaveName()

Interface to service SlaveName request from Master.

Called by memory Master. May be overridden by Slave sub-class. By default returns the local Slave Name

Not exposed to Python

Returns:

Unique Slave Name

virtual uint32_t doMinAccess()

Interface to service the getMinAccess request from an attached master.

By default the local min access value will be returned. A Slave sub-class is allowed to override this method.

Exposed as _doMinAccess() to Python

Returns:

Min transaction access size

virtual uint32_t doMaxAccess()

Interface to service the getMaxAccess request from an attached master.

By default the local max access value will be returned. A Slave sub-class is allowed to override this method.

Exposed as _doMaxAccess() to Python

Returns:

Max transaction access size

virtual uint64_t doAddress()

Interface to service the getAddress request from an attached master.

This Slave will return 0 byte default. A Slave sub-class is allowed to override this method.

Exposed as _doAddress() to Python

Returns:

Address

virtual void doTransaction(std::shared_ptr<rogue::interfaces::memory::Transaction> transaction)

Interface to service the transaction request from an attached master.

By default the Slave class will return an Unsupported error.

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.

Exposed to Python as _doTransaction()

Parameters:

transactionTransaction pointer as TransactionPtr

void lshiftPy(boost::python::object p)

Support << operator in python.

std::shared_ptr<rogue::interfaces::memory::Master> &operator<<(std::shared_ptr<rogue::interfaces::memory::Master> &other)

Support << operator in C++.

Public Static Functions

static std::shared_ptr<rogue::interfaces::memory::Slave> create(uint32_t min, uint32_t max)

Class factory which returns a pointer to a Slave (SlavePtr)

Exposed as rogue.interfaces.memory.Slave() to Python

Parameters:
  • min – Minimum transaction this Slave can accept.

  • max – Maximum transaction this Slave can accept.