Slave

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

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

Alias for using shared pointer as SlavePtr.

The class description is shown below:

class Slave : public rogue::interfaces::stream::Pool, public rogue::EnableSharedFromThis<rogue::interfaces::stream::Slave>

Stream slave class.

The stream slave accepts stream data from a master. It also can accept frame allocation requests through its Pool base class. A Slave object can be attached to multiple Master objects.

Subclassed by rogue::hardware::axi::AxiStreamDma, rogue::interfaces::stream::Fifo, rogue::interfaces::stream::Filter, rogue::interfaces::stream::RateDrop, rogue::interfaces::stream::SlaveWrap, rogue::interfaces::stream::TcpCore, rogue::protocols::batcher::InverterV1, rogue::protocols::batcher::SplitterV1, rogue::protocols::packetizer::Application, rogue::protocols::packetizer::Transport, rogue::protocols::rssi::Application, rogue::protocols::rssi::Transport, rogue::protocols::srp::SrpV0, rogue::protocols::srp::SrpV3, rogue::protocols::udp::Client, rogue::protocols::udp::Server, rogue::protocols::xilinx::Xvc, rogue::utilities::fileio::StreamWriterChannel, rogue::utilities::Prbs, rogue::utilities::StreamUnZip, rogue::utilities::StreamZip

Public Functions

virtual void stop()

Shut down any threads associated with this object.

This method is called to stop any frames from being generated by this Master and shut down any threads, allowing for a clean program exit

Exposed as stop() to Python Subclasses should override this method

void setDebug(uint32_t debug, std::string name)

Set debug message size.

This method enables debug messages when using the base Slave class attached as a primary or secondary Slave on a Master. Typically used when attaching a base Slave object for debug purposes.

Exposed as setDebug() to Python

Parameters:
  • debug – Maximum number of bytes to print in debug message.

  • name – Name to included in the debug messages.

virtual void acceptFrame(std::shared_ptr<rogue::interfaces::stream::Frame> frame)

Accept a frame from master.

This method is called by the Master object to which this Slave is attached when passing a Frame. By default this method will print debug information if enabled and is typically re-implemented by a Slave sub-class.

Re-implemented as _acceptFrame() in a Python subclass

Parameters:

frameFrame pointer (FramePtr)

uint64_t getFrameCount()

Get frame counter.

Returns the total frames received. Only valid if acceptFrame is not re-implemented as a sub-class. Typically used when attaching a base Slave object for debug purposes.

Exposed as getFrameCount() to Python

Returns:

Total number of Frame objects received.

uint64_t getByteCount()

Get byte counter.

Returns the total bytes received. Only valid if acceptFrame is not re-implemented as a sub-class. Typically used when attaching a base Slave object for debug purposes.

Exposed as getByteCount() to Python

Returns:

Total number of bytes received.

bool ensureSingleBuffer(std::shared_ptr<rogue::interfaces::stream::Frame> &frame, bool reqEn)

Ensure frame is a single buffer.

This method makes sure the passed frame is composed of a single buffer. If the reqNew flag is true and the passed frame is not a single buffer, a new frame will be requested and the frame data will be copied, with the passed frame pointer being updated. The return value will indicate if the frame is a single buffer at the end of the process. A frame lock must be held when this method is called.

Not exposed to Python

Parameters:
  • frame – Reference to frame pointer (FramePtr)

  • rewEn – Flag to determine if a new frame should be requested

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

Support << operator in python.

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

Support << operator in C++.

Public Static Functions

static std::shared_ptr<rogue::interfaces::stream::Slave> create()

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

Create a new Slave

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