rogue
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
rogue::protocols::srp::SrpV3 Class Reference

SRP v3 bridge between Rogue memory transactions and stream frames. More...

#include <SrpV3.h>

Inheritance diagram for rogue::protocols::srp::SrpV3:
rogue::interfaces::stream::Master rogue::interfaces::stream::Slave rogue::interfaces::memory::Slave rogue::EnableSharedFromThis< rogue::interfaces::stream::Master > rogue::interfaces::stream::Pool rogue::EnableSharedFromThis< rogue::interfaces::stream::Slave > rogue::EnableSharedFromThis< rogue::interfaces::memory::Slave > rogue::EnableSharedFromThisBase rogue::EnableSharedFromThis< rogue::interfaces::stream::Pool > rogue::EnableSharedFromThisBase rogue::EnableSharedFromThisBase rogue::EnableSharedFromThisBase

Public Member Functions

 SrpV3 ()
 Constructs an SRP v3 interface instance.
 
 ~SrpV3 ()
 Destroys the SRP v3 interface instance.
 
void doTransaction (std::shared_ptr< rogue::interfaces::memory::Transaction > tran)
 Processes a memory transaction and emits SRP v3 request frame(s).
 
void acceptFrame (std::shared_ptr< rogue::interfaces::stream::Frame > frame)
 Accepts an incoming SRP v3 response frame.
 
void setHardwareTimeout (uint8_t val)
 Sets SRP hardware timeout field used in outgoing requests.
 
- Public Member Functions inherited from rogue::interfaces::stream::Master
 Master ()
 Constructs a stream master.
 
virtual ~Master ()
 Destroys the stream master.
 
uint32_t slaveCount ()
 Returns the number of attached slaves.
 
void addSlave (std::shared_ptr< rogue::interfaces::stream::Slave > slave)
 Attaches a downstream slave.
 
std::shared_ptr< rogue::interfaces::stream::FramereqFrame (uint32_t size, bool zeroCopyEn)
 Requests allocation of a new frame from the primary slave.
 
void sendFrame (std::shared_ptr< rogue::interfaces::stream::Frame > frame)
 Sends a frame to all attached slaves.
 
bool ensureSingleBuffer (std::shared_ptr< rogue::interfaces::stream::Frame > &frame, bool reqEn)
 Ensures a frame is represented by a single buffer.
 
virtual void stop ()
 Stops frame generation and shuts down associated threads.
 
void equalsPy (boost::python::object p)
 Supports == operator usage from Python.
 
boost::python::object rshiftPy (boost::python::object p)
 Supports >> operator usage from Python.
 
void operator== (std::shared_ptr< rogue::interfaces::stream::Slave > &other)
 Supports == operator usage in C++.
 
std::shared_ptr< rogue::interfaces::stream::Slave > & operator>> (std::shared_ptr< rogue::interfaces::stream::Slave > &other)
 Connects this master to a slave via stream chaining operator.
 
- Public Member Functions inherited from rogue::EnableSharedFromThis< rogue::interfaces::stream::Master >
std::shared_ptr< rogue::interfaces::stream::Mastershared_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.
 
- Public Member Functions inherited from rogue::interfaces::stream::Slave
 Slave ()
 Constructs a stream slave.
 
virtual ~Slave ()
 Destroys the stream slave.
 
virtual void stop ()
 Shuts down threads associated with this object.
 
void setDebug (uint32_t debug, std::string name)
 Sets debug message verbosity and logger name.
 
uint64_t getFrameCount ()
 Returns frame counter.
 
uint64_t getByteCount ()
 Returns byte counter.
 
bool ensureSingleBuffer (std::shared_ptr< rogue::interfaces::stream::Frame > &frame, bool reqEn)
 Ensures frame is backed by a single buffer.
 
std::shared_ptr< rogue::interfaces::stream::FramereqLocalFrame (uint32_t size, bool zeroCopyEn)
 Services a local frame allocation request through this object's pool interface.
 
boost::python::object lshiftPy (boost::python::object p)
 Supports << operator usage from Python.
 
std::shared_ptr< rogue::interfaces::stream::Master > & operator<< (std::shared_ptr< rogue::interfaces::stream::Master > &other)
 Connects this slave to a master via stream chaining operator.
 
- Public Member Functions inherited from rogue::interfaces::stream::Pool
 Pool ()
 Constructs a pool with default allocation behavior enabled.
 
virtual ~Pool ()
 Destroys the pool and releases any cached buffer storage.
 
uint32_t getAllocBytes ()
 Returns total currently allocated bytes.
 
uint32_t getAllocCount ()
 Returns total currently allocated buffer count.
 
virtual std::shared_ptr< rogue::interfaces::stream::FrameacceptReq (uint32_t size, bool zeroCopyEn)
 Services a frame allocation request from a master.
 
virtual void retBuffer (uint8_t *data, uint32_t meta, uint32_t size)
 Returns buffer data to the allocator.
 
void setFixedSize (uint32_t size)
 Sets fixed-size mode.
 
uint32_t getFixedSize ()
 Returns fixed-size allocation setting.
 
void setPoolSize (uint32_t size)
 Sets buffer pool size.
 
uint32_t getPoolSize ()
 Returns configured maximum number of cached pool entries.
 
- Public Member Functions inherited from rogue::EnableSharedFromThis< rogue::interfaces::stream::Pool >
std::shared_ptr< rogue::interfaces::stream::Poolshared_from_this ()
 Returns a shared_ptr<T> for this instance.
 
- Public Member Functions inherited from rogue::EnableSharedFromThis< rogue::interfaces::stream::Slave >
std::shared_ptr< rogue::interfaces::stream::Slaveshared_from_this ()
 Returns a shared_ptr<T> for this instance.
 
- Public Member Functions inherited from rogue::interfaces::memory::Slave
 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::TransactiongetTransaction (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.
 
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::Slaveshared_from_this ()
 Returns a shared_ptr<T> for this instance.
 

Static Public Member Functions

static std::shared_ptr< rogue::protocols::srp::SrpV3create ()
 Creates an SRP v3 interface instance.
 
static void setup_python ()
 Registers Python bindings for this class.
 
- Static Public Member Functions inherited from rogue::interfaces::stream::Master
static std::shared_ptr< rogue::interfaces::stream::Mastercreate ()
 Creates a stream master.
 
static void setup_python ()
 Registers this type with Python bindings.
 
- Static Public Member Functions inherited from rogue::interfaces::stream::Slave
static std::shared_ptr< rogue::interfaces::stream::Slavecreate ()
 Creates a new stream slave.
 
static void setup_python ()
 Registers this type with Python bindings.
 
- Static Public Member Functions inherited from rogue::interfaces::stream::Pool
static void setup_python ()
 Registers this type with Python bindings.
 
- Static Public Member Functions inherited from rogue::interfaces::memory::Slave
static std::shared_ptr< rogue::interfaces::memory::Slavecreate (uint32_t min, uint32_t max)
 Creates a memory slave.
 
static void setup_python ()
 Registers this type with Python bindings.
 

Additional Inherited Members

- Protected Member Functions inherited from rogue::interfaces::stream::Pool
std::shared_ptr< rogue::interfaces::stream::BufferallocBuffer (uint32_t size, uint32_t *total)
 Allocate a buffer passed size.
 
std::shared_ptr< rogue::interfaces::stream::BuffercreateBuffer (void *data, uint32_t meta, uint32_t size, uint32_t alloc)
 Creates a Buffer with a pre-allocated data block.
 
void decCounter (uint32_t alloc)
 Decrements allocation counter.
 

Detailed Description

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:

Threading/locking model:

Missing, late, or invalid responses:

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

Definition at line 85 of file SrpV3.h.

Constructor & Destructor Documentation

◆ SrpV3()

rogue::protocols::srp::SrpV3::SrpV3 ( )

Constructs an SRP v3 interface instance.

Creator with version constant.

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

Definition at line 69 of file SrpV3.cpp.

◆ ~SrpV3()

rogue::protocols::srp::SrpV3::~SrpV3 ( )

Destroys the SRP v3 interface instance.

Deconstructor.

Definition at line 74 of file SrpV3.cpp.

Member Function Documentation

◆ acceptFrame()

void rogue::protocols::srp::SrpV3::acceptFrame ( std::shared_ptr< rogue::interfaces::stream::Frame frame)
virtual

Accepts an incoming SRP v3 response frame.

Accept a frame from master.

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

Parameters
frameReceived SRP stream frame.

Reimplemented from rogue::interfaces::stream::Slave.

Definition at line 200 of file SrpV3.cpp.

◆ create()

rogue::protocols::srp::SrpV3Ptr rogue::protocols::srp::SrpV3::create ( )
static

Creates an SRP v3 interface instance.

Class creation.

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.

Company : SLAC National Accelerator Laboratory

Description :

SRP protocol bridge, Version 3

This file is part of the rogue software platform. It is subject to the license terms in the LICENSE.txt file found in the top-level directory of this distribution and at: https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. No part of the rogue software platform, including this file, may be copied, modified, propagated, or distributed except according to the terms

contained in the LICENSE.txt file.

Definition at line 50 of file SrpV3.cpp.

◆ doTransaction()

void rogue::protocols::srp::SrpV3::doTransaction ( std::shared_ptr< rogue::interfaces::memory::Transaction tran)
virtual

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

Post a transaction.

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

Parameters
tranTransaction to execute over SRP.

Reimplemented from rogue::interfaces::memory::Slave.

Definition at line 133 of file SrpV3.cpp.

◆ setHardwareTimeout()

void rogue::protocols::srp::SrpV3::setHardwareTimeout ( uint8_t  val)

Sets SRP hardware timeout field used in outgoing requests.

Set the hardware timeout.

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

Parameters
valTimeout field value to encode into request header(s).

Definition at line 77 of file SrpV3.cpp.

◆ setup_python()

void rogue::protocols::srp::SrpV3::setup_python ( )
static

Registers Python bindings for this class.

Setup class in python.

Definition at line 56 of file SrpV3.cpp.


The documentation for this class was generated from the following files: