SrpV3

rogue::protocols::srp::SrpV3 bridges Rogue memory transactions to SRPv3 stream frames that are transported to hardware SRP endpoints.

For SRPv3 packet-level protocol details, see:

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

typedef std::shared_ptr<rogue::protocols::srp::SrpV3> rogue::protocols::srp::SrpV3Ptr

The class description is shown below:

class SrpV3 : public rogue::interfaces::stream::Master, public rogue::interfaces::stream::Slave, public rogue::interfaces::memory::Slave

SRP v3 bridge between Rogue memory transactions and stream frames.

SrpV3 sits between the memory interface (memory::Slave) and stream transport (stream::Master/stream::Slave). It serializes memory read/write transactions into SRP v3 request frames and decodes incoming SRP responses to complete transactions.

SRP frames are stream transactions carried over a physical/link transport (for example DMA, TCP, or other Rogue stream backends) before arriving at an FPGA or ASIC endpoint that implements the SRP protocol for register access.

Implementation behavior:

  • doTransaction() serializes each memory request into one SRPv3 frame and transmits it immediately.

  • Non-posted transactions are registered in the base memory::Slave in-flight transaction map (addTransaction()), keyed by transaction ID.

  • Multiple requests may be transmitted before any responses arrive, so multiple transactions can be in flight concurrently.

  • acceptFrame() extracts the response ID and resolves it with getTransaction(id), so responses are matched by ID and may arrive out of order without violating correctness.

Threading/locking model:

  • In-flight map access is protected by the memory::Slave mutex.

  • Per-transaction payload/state access is protected by TransactionLock.

  • doTransaction() and acceptFrame() can be called from different runtime contexts provided by the connected stream transport stack.

Missing, late, or invalid responses:

  • Software wait timeout is enforced by the initiating memory::Master transaction timeout (Master::setTimeout() in microseconds).

  • If no valid response arrives before timeout, the waiting side completes with a timeout error.

  • If a late response arrives after timeout, it is treated as expired and ignored.

  • If a response has unknown ID, malformed header/size, or hardware error status in tail bits, the response is rejected. For matched transactions, protocol/tail/size errors are reported immediately; unknown-ID responses are dropped and do not complete any in-flight transaction.

Compared with earlier protocol versions, v3 has a different header format and supports a configurable protocol timeout field through setHardwareTimeout(). This hardware timeout field is encoded into outgoing SRPv3 requests and is separate from Rogue software-side wait timeout behavior.

Protocol reference: https://confluence.slac.stanford.edu/x/cRmVD

Public Functions

SrpV3()

Constructs an SRP v3 interface instance.

This constructor is a low-level C++ allocation path. Prefer create() when shared ownership or Python exposure is required.

~SrpV3()

Destroys the SRP v3 interface instance.

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

Processes a memory transaction and emits SRP v3 request frame(s).

Called by upstream memory masters. Transaction fields are encoded in SRP v3 format and transmitted through the stream master connection.

Parameters:

tran – Transaction to execute over SRP.

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

Accepts an incoming SRP v3 response frame.

Decodes the frame, associates it with the corresponding pending transaction, and propagates status/data completion.

Parameters:

frame – Received SRP stream frame.

void setHardwareTimeout(uint8_t val)

Sets SRP hardware timeout field used in outgoing requests.

The encoded timeout value is protocol-specific and interpreted by the remote SRP endpoint.

Parameters:

val – Timeout field value to encode into request header(s).

Public Static Functions

static std::shared_ptr<rogue::protocols::srp::SrpV3> create()

Creates an SRP v3 interface instance.

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.

Returns:

Shared pointer to the created SrpV3.

static void setup_python()

Registers Python bindings for this class.