Transport protocol to transfer an IPbus buffer via PCIe. More...
#include <uhal/ProtocolPCIe.hpp>
Classes | |
| class | File |
| class | PacketFmt |
Public Member Functions | |
| PCIe (const PCIe &aPCIe) | |
| PCIe & | operator= (const PCIe &aPCIe) |
| PCIe (const std::string &aId, const URI &aUri) | |
| Constructor. More... | |
| virtual | ~PCIe () |
| Destructor. More... | |
Private Types | |
| typedef IPbus< 2, 0 > | InnerProtocol |
| typedef boost::chrono::steady_clock | SteadyClock_t |
Private Member Functions | |
| void | implementDispatch (boost::shared_ptr< Buffers > aBuffers) |
| Send the IPbus buffer to the target, read back the response and call the packing-protocol's validate function. More... | |
| virtual void | Flush () |
| Concrete implementation of the synchronization function to block until all buffers have been sent, all replies received and all data validated. More... | |
| virtual void | dispatchExceptionHandler () |
| Function which tidies up this protocol layer in the event of an exception. More... | |
| uint32_t | getMaxSendSize () |
| Return the maximum size to be sent based on the buffer size in the target. More... | |
| uint32_t | getMaxReplySize () |
| Return the maximum size of reply packet based on the buffer size in the target. More... | |
| void | connect () |
| Set up the connection to the device. More... | |
| void | disconnect () |
| Close the connection to the device. More... | |
| void | write (const boost::shared_ptr< Buffers > &aBuffers) |
| Write request packet to next page in host-to-FPGA device file. More... | |
| void | read () |
| Read next pending reply packet from appropriate page of FPGA-to-host device file, and validate contents. More... | |
Private Attributes | |
| bool | mConnected |
| File | mDeviceFileHostToFPGA |
| Host-to-FPGA device file. More... | |
| File | mDeviceFileFPGAToHost |
| FPGA-to-host device file. More... | |
| File | mDeviceFileFPGAEvent |
| FPGA-to-host interrupt (event) file. More... | |
| bool | mXdma7seriesWorkaround |
| bool | mUseInterrupt |
| boost::chrono::microseconds | mSleepDuration |
| uint32_t | mNumberOfPages |
| uint32_t | mMaxInFlight |
| uint32_t | mPageSize |
| uint32_t | mMaxPacketSize |
| uint32_t | mIndexNextPage |
| uint32_t | mPublishedReplyPageCount |
| uint32_t | mReadReplyPageCount |
| std::deque< boost::shared_ptr< Buffers > > | mReplyQueue |
| The list of buffers still awaiting a reply. More... | |
| uhal::exception::exception * | mAsynchronousException |
| A pointer to an exception object for passing exceptions from the worker thread to the main thread. More... | |
Transport protocol to transfer an IPbus buffer via PCIe.
Definition at line 81 of file ProtocolPCIe.hpp.
|
private |
Definition at line 157 of file ProtocolPCIe.hpp.
|
private |
Definition at line 159 of file ProtocolPCIe.hpp.
| uhal::PCIe::PCIe | ( | const PCIe & | aPCIe | ) |
| uhal::PCIe::PCIe | ( | const std::string & | aId, |
| const URI & | aUri | ||
| ) |
Constructor.
| aId | the uinique identifier that the client will be given. |
| aUri | a struct containing the full URI of the target. |
Definition at line 301 of file ProtocolPCIe.cpp.
References connect(), uhal::Debug, disconnect(), dispatchExceptionHandler(), Flush(), implementDispatch(), uhal::Info, uhal::URI::mArguments, mConnected, mDeviceFileFPGAEvent, uhal::URI::mHostname, mMaxInFlight, mMaxPacketSize, mReplyQueue, mSleepDuration, mUseInterrupt, mXdma7seriesWorkaround, uhal::Notice, uhal::Quote(), read(), uhal::ClientInterface::returnBufferToPool(), uhal::PCIe::File::setPath(), uhal::tests::uri, uhal::Warning, write(), and ~PCIe().
|
virtual |
|
private |
Set up the connection to the device.
Definition at line 422 of file ProtocolPCIe.cpp.
References uhal::PCIe::File::createBuffer(), uhal::Debug, uhal::PCIe::File::getPath(), uhal::Info, uhal::Integer(), mConnected, mDeviceFileFPGAEvent, mDeviceFileFPGAToHost, mDeviceFileHostToFPGA, mIndexNextPage, mMaxInFlight, mMaxPacketSize, mNumberOfPages, mPageSize, mPublishedReplyPageCount, mReadReplyPageCount, mUseInterrupt, uhal::PCIe::File::open(), uhal::Quote(), and uhal::PCIe::File::read().
Referenced by getMaxReplySize(), getMaxSendSize(), and PCIe().
|
private |
Close the connection to the device.
Definition at line 465 of file ProtocolPCIe.cpp.
References uhal::PCIe::File::close(), uhal::Debug, uhal::PCIe::File::getPath(), uhal::Info, uhal::Integer(), mAsynchronousException, mConnected, mDeviceFileFPGAEvent, mDeviceFileFPGAToHost, mDeviceFileHostToFPGA, uhal::min, mIndexNextPage, mNumberOfPages, mPageSize, mPublishedReplyPageCount, mReadReplyPageCount, mReplyQueue, mSleepDuration, mUseInterrupt, mXdma7seriesWorkaround, uhal::Quote(), uhal::PCIe::File::read(), read(), uhal::tests::uri, uhal::ClientInterface::validate(), uhal::Warning, uhal::exception::exception::what(), uhal::PCIe::File::write(), and write().
Referenced by PCIe().
|
privatevirtual |
Function which tidies up this protocol layer in the event of an exception.
Definition at line 132 of file ProtocolPCIe.hxx.
Referenced by PCIe().
|
privatevirtual |
Concrete implementation of the synchronization function to block until all buffers have been sent, all replies received and all data validated.
Definition at line 127 of file ProtocolPCIe.hxx.
Referenced by PCIe().
|
private |
Return the maximum size of reply packet based on the buffer size in the target.
Definition at line 413 of file ProtocolPCIe.cpp.
References connect(), mConnected, and mMaxPacketSize.
|
private |
Return the maximum size to be sent based on the buffer size in the target.
Definition at line 404 of file ProtocolPCIe.cpp.
References connect(), mConnected, and mMaxPacketSize.
|
private |
Send the IPbus buffer to the target, read back the response and call the packing-protocol's validate function.
| aBuffers | the buffer object wrapping the send and recieve buffers that are to be transported If multithreaded, adds buffer to the dispatch queue and returns. If single-threaded, calls the dispatch-worker dispatch function directly and blocks until the response is validated. |
Definition at line 75 of file ProtocolPCIe.hxx.
References uhal::Node::write().
Referenced by PCIe().
| PCIe< InnerProtocol > & uhal::PCIe::operator= | ( | const PCIe & | aPCIe | ) |
Definition at line 65 of file ProtocolPCIe.hxx.
|
private |
Read next pending reply packet from appropriate page of FPGA-to-host device file, and validate contents.
Definition at line 107 of file ProtocolPCIe.hxx.
References uhal::Error, and uhal::ClientInterface::validate().
Referenced by disconnect(), and PCIe().
|
private |
Write request packet to next page in host-to-FPGA device file.
Definition at line 87 of file ProtocolPCIe.hxx.
References uhal::Error, and uhal::Node::read().
Referenced by disconnect(), and PCIe().
|
private |
A pointer to an exception object for passing exceptions from the worker thread to the main thread.
Exceptions must always be created on the heap (i.e. using new) and deletion will be handled in the main thread
Definition at line 209 of file ProtocolPCIe.hpp.
Referenced by disconnect().
|
private |
Definition at line 185 of file ProtocolPCIe.hpp.
Referenced by connect(), disconnect(), getMaxReplySize(), getMaxSendSize(), and PCIe().
|
private |
FPGA-to-host interrupt (event) file.
Definition at line 192 of file ProtocolPCIe.hpp.
Referenced by connect(), disconnect(), and PCIe().
|
private |
FPGA-to-host device file.
Definition at line 190 of file ProtocolPCIe.hpp.
Referenced by connect(), and disconnect().
|
private |
Host-to-FPGA device file.
Definition at line 188 of file ProtocolPCIe.hpp.
Referenced by connect(), and disconnect().
|
private |
Definition at line 200 of file ProtocolPCIe.hpp.
Referenced by connect(), and disconnect().
|
private |
Definition at line 200 of file ProtocolPCIe.hpp.
|
private |
Definition at line 200 of file ProtocolPCIe.hpp.
Referenced by connect(), getMaxReplySize(), getMaxSendSize(), and PCIe().
|
private |
Definition at line 200 of file ProtocolPCIe.hpp.
Referenced by connect(), and disconnect().
|
private |
Definition at line 200 of file ProtocolPCIe.hpp.
Referenced by connect(), and disconnect().
|
private |
Definition at line 200 of file ProtocolPCIe.hpp.
Referenced by connect(), and disconnect().
|
private |
Definition at line 200 of file ProtocolPCIe.hpp.
Referenced by connect(), and disconnect().
|
private |
The list of buffers still awaiting a reply.
Definition at line 203 of file ProtocolPCIe.hpp.
Referenced by disconnect(), and PCIe().
|
private |
Definition at line 198 of file ProtocolPCIe.hpp.
Referenced by disconnect(), and PCIe().
|
private |
Definition at line 196 of file ProtocolPCIe.hpp.
Referenced by connect(), disconnect(), and PCIe().
|
private |
Definition at line 194 of file ProtocolPCIe.hpp.
Referenced by disconnect(), and PCIe().
1.8.13