rogue
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
rogue::protocols::xilinx::Xvc Class Reference

Rogue XVC bridge between TCP XVC clients and Rogue stream transport. More...

#include <Xvc.h>

Inheritance diagram for rogue::protocols::xilinx::Xvc:
rogue::interfaces::stream::Master rogue::interfaces::stream::Slave rogue::protocols::xilinx::JtagDriver rogue::EnableSharedFromThis< rogue::interfaces::stream::Master > rogue::interfaces::stream::Pool rogue::EnableSharedFromThis< rogue::interfaces::stream::Slave > rogue::EnableSharedFromThisBase rogue::EnableSharedFromThis< rogue::interfaces::stream::Pool > rogue::EnableSharedFromThisBase rogue::EnableSharedFromThisBase

Public Member Functions

 Xvc (uint16_t port)
 Constructs an XVC bridge instance.
 
 ~Xvc ()
 Destroys the XVC bridge instance.
 
void start ()
 Starts XVC server thread and enables bridge operation.
 
void stop ()
 Stops XVC server thread and drains frame queue.
 
void acceptFrame (std::shared_ptr< rogue::interfaces::stream::Frame > frame)
 Receives reply frame from downstream Rogue transport.
 
uint64_t getMaxVectorSize () final
 Returns maximum vector size supported by this XVC bridge.
 
int xfer (uint8_t *txBuffer, unsigned txBytes, uint8_t *hdBuffer, unsigned hdBytes, uint8_t *rxBuffer, unsigned rxBytes) final
 Executes one protocol transfer over Rogue frame transport.
 
- 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.
 
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.
 
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::protocols::xilinx::JtagDriver
 JtagDriver (uint16_t port)
 Constructs the JTAG driver base state.
 
virtual void init ()
 Performs post-construction initialization.
 
virtual int xferRel (uint8_t *txb, unsigned txBytes, Header *phdr, uint8_t *rxb, unsigned sizeBytes)
 Executes transfer with retry and protocol validation.
 
virtual uint64_t query ()
 Queries target capabilities and caches protocol parameters.
 
virtual uint32_t setPeriodNs (uint32_t newPeriod)
 Requests update of TCK period.
 
virtual void sendVectors (uint64_t numBits, uint8_t *tms, uint8_t *tdi, uint8_t *tdo)
 Sends JTAG TMS/TDI vectors and receives TDO.
 
virtual void dumpInfo (FILE *f=stdout)
 Dumps cached driver/target information.
 
bool isDone ()
 Returns completion/shutdown flag.
 

Static Public Member Functions

static std::shared_ptr< rogue::protocols::xilinx::Xvccreate (uint16_t port)
 Creates an XVC bridge 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::protocols::xilinx::JtagDriver
static std::shared_ptr< rogue::protocols::xilinx::JtagDrivercreate (uint16_t port)
 Creates a JTAG driver instance.
 
static void setup_python ()
 Registers Python bindings for this class.
 

Protected Member Functions

void runThread ()
 Run driver initialization and XVC thread.
 
- 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.
 
- Protected Member Functions inherited from rogue::protocols::xilinx::JtagDriver
unsigned wordSize (Header reply)
 
unsigned memDepth (Header reply)
 
uint32_t cvtPerNs (Header reply)
 
virtual unsigned getWordSize ()
 
virtual unsigned getMemDepth ()
 
virtual uint32_t getPeriodNs ()
 

Protected Attributes

unsigned mtu_
 
rogue::Queue< std::shared_ptr< rogue::interfaces::stream::Frame > > queue_
 
std::shared_ptr< rogue::Logginglog_
 
std::thread * thread_
 
bool threadEn_
 
std::mutex mtx_
 
- Protected Attributes inherited from rogue::protocols::xilinx::JtagDriver
uint16_t port_
 
bool drEn_
 
bool done_
 
unsigned drop_
 
std::shared_ptr< rogue::Logginglog_
 

Additional Inherited Members

- Protected Types inherited from rogue::protocols::xilinx::JtagDriver
typedef uint32_t Header
 
typedef uint8_t Xid
 
- Static Protected Member Functions inherited from rogue::protocols::xilinx::JtagDriver
static Header getHdr (uint8_t *buf)
 
static Xid getXid (Header x)
 
static uint32_t getCmd (Header x)
 
static unsigned getErr (Header x)
 
static uint64_t getLen (Header x)
 
static const char * getMsg (unsigned error)
 
static int isLE ()
 
static double REF_FREQ_HZ ()
 
- Static Protected Attributes inherited from rogue::protocols::xilinx::JtagDriver
static const Xid XID_ANY = 0
 
static const Header PVERS = 0x00000000
 
static const Header CMD_Q = 0x00000000
 
static const Header CMD_S = 0x10000000
 
static const Header CMD_E = 0x20000000
 
static const Header CMD_MASK = 0x30000000
 
static const unsigned ERR_SHIFT = 0
 
static const Header ERR_MASK = 0x000000ff
 
static const unsigned XID_SHIFT = 20
 
static const unsigned LEN_SHIFT = 0
 
static const Header LEN_MASK = 0x000fffff
 
static const unsigned ERR_BAD_VERSION = 1
 
static const unsigned ERR_BAD_COMMAND = 2
 
static const unsigned ERR_TRUNCATED = 3
 
static const unsigned ERR_NOT_PRESENT = 4
 
static const uint32_t UNKNOWN_PERIOD = 0
 

Detailed Description

Rogue XVC bridge between TCP XVC clients and Rogue stream transport.

Xvc combines:

A background thread runs an XvcServer TCP listener for Vivado XVC clients. Incoming XVC operations are translated to driver transfers (xfer()), which exchange Rogue frames with downstream transport endpoints.

Definition at line 58 of file Xvc.h.

Constructor & Destructor Documentation

◆ Xvc()

rogue::protocols::xilinx::Xvc::Xvc ( uint16_t  port)
explicit

Constructs an XVC bridge instance.

Creator.

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

Parameters
portTCP port used for local XVC server listener.

Definition at line 52 of file Xvc.cpp.

◆ ~Xvc()

rogue::protocols::xilinx::Xvc::~Xvc ( )

Destroys the XVC bridge instance.

Destructor.

Definition at line 61 of file Xvc.cpp.

Member Function Documentation

◆ acceptFrame()

void rogue::protocols::xilinx::Xvc::acceptFrame ( std::shared_ptr< rogue::interfaces::stream::Frame frame)
virtual

Receives reply frame from downstream Rogue transport.

Accept a frame.

Frames are queued for synchronous consumption by the active XVC transfer.

Parameters
frameIncoming frame from downstream transport.

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

Definition at line 111 of file Xvc.cpp.

◆ create()

rogue::protocols::xilinx::XvcPtr rogue::protocols::xilinx::Xvc::create ( uint16_t  port)
static

Creates an XVC bridge instance.

Class creation.

Parameter semantics are identical to the constructor; see Xvc() for bridge-construction details. 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.

Parameters
portTCP port used for local XVC server listener.
Returns
Shared pointer to the created XVC instance.

Company : SLAC National Accelerator Laboratory

Description:

XVC Server Wrapper Class

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 46 of file Xvc.cpp.

◆ getMaxVectorSize()

uint64_t rogue::protocols::xilinx::Xvc::getMaxVectorSize ( )
finalvirtual

Returns maximum vector size supported by this XVC bridge.

Computed from configured MTU and current protocol word size.

Returns
Maximum vector size in bytes.

Reimplemented from rogue::protocols::xilinx::JtagDriver.

Definition at line 121 of file Xvc.cpp.

◆ runThread()

void rogue::protocols::xilinx::Xvc::runThread ( )
protected

Run driver initialization and XVC thread.

Definition at line 98 of file Xvc.cpp.

◆ setup_python()

void rogue::protocols::xilinx::Xvc::setup_python ( )
static

Registers Python bindings for this class.

Definition at line 184 of file Xvc.cpp.

◆ start()

void rogue::protocols::xilinx::Xvc::start ( )

Starts XVC server thread and enables bridge operation.

Start the interface.

Definition at line 66 of file Xvc.cpp.

◆ stop()

void rogue::protocols::xilinx::Xvc::stop ( )
virtual

Stops XVC server thread and drains frame queue.

Stop the interface.

Reimplemented from rogue::interfaces::stream::Master.

Definition at line 76 of file Xvc.cpp.

◆ xfer()

int rogue::protocols::xilinx::Xvc::xfer ( uint8_t *  txBuffer,
unsigned  txBytes,
uint8_t *  hdBuffer,
unsigned  hdBytes,
uint8_t *  rxBuffer,
unsigned  rxBytes 
)
finalvirtual

Executes one protocol transfer over Rogue frame transport.

Sends txBuffer as a Rogue frame, waits for a queued reply frame, then copies header/payload data into caller buffers.

Parameters
txBufferRequest transmit buffer.
txBytesNumber of request bytes.
hdBufferReply header destination buffer.
hdBytesNumber of header bytes to copy.
rxBufferReply payload destination buffer.
rxBytesMaximum reply payload bytes accepted.
Returns
Number of payload bytes received (implementation currently returns 0).

Reimplemented from rogue::protocols::xilinx::JtagDriver.

Definition at line 128 of file Xvc.cpp.

Member Data Documentation

◆ log_

std::shared_ptr<rogue::Logging> rogue::protocols::xilinx::Xvc::log_
protected

Definition at line 68 of file Xvc.h.

◆ mtu_

unsigned rogue::protocols::xilinx::Xvc::mtu_
protected

Definition at line 62 of file Xvc.h.

◆ mtx_

std::mutex rogue::protocols::xilinx::Xvc::mtx_
protected

Definition at line 75 of file Xvc.h.

◆ queue_

rogue::Queue<std::shared_ptr<rogue::interfaces::stream::Frame> > rogue::protocols::xilinx::Xvc::queue_
protected

Definition at line 65 of file Xvc.h.

◆ thread_

std::thread* rogue::protocols::xilinx::Xvc::thread_
protected

Definition at line 71 of file Xvc.h.

◆ threadEn_

bool rogue::protocols::xilinx::Xvc::threadEn_
protected

Definition at line 72 of file Xvc.h.


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