42#ifndef _DUNEDAQ_UHALLIBS_PROTOCOLFLX_V0_HPP_
43#define _DUNEDAQ_UHALLIBS_PROTOCOLFLX_V0_HPP_
56#include "uhal/ClientInterface.hpp"
57#include "uhal/log/exception.hpp"
58#include "uhal/ProtocolIPbus.hpp"
60#include "flxcard/FlxCard.h"
83 uhal::exception::ClientTimeout,
84 "Exception class to handle the case in which the Felix device is invalid."
90 "Exception class to handle the case in which the Felix connection timed out."
94 FlxInitialisationError ,
96 "Exception class to handle a failure to read from the specified device files during initialisation."
100 FlxCommunicationError ,
102 "Exception class to handle a low-level seek/read/write error after initialisation."
112 Card(
const std::string& aPath, u_int aLockMask);
115 const std::string&
getPath()
const;
123 void read(
const uint32_t aAddr,
const uint32_t aNrWords, std::vector<uint32_t>& aValues);
125 void write(
const uint32_t aAddr,
const std::vector<std::pair<const uint8_t*, size_t> >& aData);
135 static regmap_register_t*
find_reg(
const std::string& aName );
151 template <
typename T>
157 in >> std::hex >> out.value;
172 Flx (
const std::string& aId,
const uhal::URI& aUri );
189 virtual void Flush( );
223 void write(
const std::shared_ptr<uhal::Buffers>& aBuffers);
const std::string & getPath() const
Card(const std::string &aPath, u_int aLockMask)
void write(const uint32_t aAddr, const std::vector< std::pair< const uint8_t *, size_t > > &aData)
static regmap_register_t * find_reg(const std::string &aName)
void read(const uint32_t aAddr, const uint32_t aNrWords, std::vector< uint32_t > &aValues)
virtual void dispatchExceptionHandler()
Function which tidies up this protocol layer in the event of an exception.
uint32_t getMaxReplySize()
static std::string getSharedMemName(const std::string &aPath)
uint32_t mPublishedReplyPageCount
void connect()
Set up the connection to the device.
void write(const std::shared_ptr< uhal::Buffers > &aBuffers)
Write request packet to next page in host-to-FPGA device file.
void implementDispatch(std::shared_ptr< uhal::Buffers > aBuffers)
std::deque< std::shared_ptr< uhal::Buffers > > mReplyQueue
The list of buffers still awaiting a reply.
uint32_t getMaxSendSize()
std::chrono::microseconds mSleepDuration
virtual void Flush()
Concrete implementation of the synchronization function to block until all buffers have been sent,...
ipc::RobustMutex IPCMutex_t
bool mIPCExternalSessionActive
ipc::SharedMemObject< IPCMutex_t > mIPCMutex
uint32_t mReadReplyPageCount
void read()
Read next pending reply packet from appropriate page of FPGA-to-host device file, and validate conten...
IPbus< 2, 0 > InnerProtocol
void disconnect()
Close the connection to the device.
uhal::exception::exception * mAsynchronousException
std::chrono::steady_clock SteadyClock_t
uint64_t mIPCSessionCount
std::unique_lock< IPCMutex_t > IPCScopedLock_t
caught dunedaq::conffwk::Exception exception
UHAL_DEFINE_DERIVED_EXCEPTION_CLASS(Axi4LiteTimeout, uhal::exception::ClientTimeout, "Exception class to handle the case in " "which the Axi4Lite connection timed out.") UHAL_DEFINE_DERIVED_EXCEPTION_CLASS(Axi4LiteInitialisationError
friend std::istream & operator>>(std::istream &in, HexTo &out)