API Reference: hxcomm

template<typename ConnectionParameter>
class hxcomm::ARQConnection
#include <arqconnection.h>

HostARQ connection class.

Establish and hold HostARQ connection to FPGA. Provide convenience functions for sending and receiving UT messages.

Template Parameters

ConnectionParameter – UT message parameter for connection

Public Types

using init_parameters_type = typename std::tuple<ip_t>
using message_types = MessageTypes<ConnectionParameter>
using receive_message_type = typename message_types::receive_type
typedef std::vector<receive_message_type> receive_queue_type
using send_halt_message_type = typename message_types::send_halt_type
using send_message_type = typename message_types::send_type

Public Functions

ARQConnection()

Create connection to FPGA with IP address found in environment.

Throws

std::runtime_error – On no or more than one FPGA IP address available in environment

ARQConnection(ARQConnection &&other)

Move constructor.

ARQConnection(ARQConnection const&) = delete

Copy constructor (deleted because no two instances with the same hardware allocation can coexist).

ARQConnection(ip_t ip)

Create connection to FPGA.

Parameters

ip – IP-address of FPGA

~ARQConnection()

Destruct connection to FPGA joining all receive threads.

std::string get_bitfile_info() const

Get bitfile information.

Returns

Bitfile info

std::string get_remote_repo_state() const

Get server-side remote repository state information.

Only non-empty for QuiggeldyConnection.

Returns

Repository state

ConnectionTimeInfo get_time_info() const

Get time information.

Returns

Time information

std::string get_unique_identifier(std::optional<std::string> hwdb_path = std::nullopt) const

Get unique identifier from hwdb.

Parameters

hwdb_path – Optional path to hwdb

Returns

Unique identifier

ARQConnection &operator=(ARQConnection &&other)

Assignment operator.

ARQConnection &operator=(ARQConnection const&) = delete

Assignment operator (deleted because no two instances with the same hardware allocation can coexist).

Public Static Attributes

static constexpr char name[] = "ARQConnection"
static constexpr auto supported_targets = {Target::hardware}

Private Types

typedef sctrltp::ARQStream<sctrltp::ParametersFcpBss2Cube> arq_stream_type
typedef Decoder<typename ConnectionParameter::Receive, receive_queue_type, listener_halt_type> decoder_type
typedef std::atomic<std::chrono::nanoseconds::rep> duration_type
typedef Encoder<typename ConnectionParameter::Send, send_queue_type> encoder_type
typedef ListenerHalt<UTMessage<ConnectionParameter::Receive::HeaderAlignment, typename ConnectionParameter::Receive::SubwordType, typename ConnectionParameter::Receive::PhywordType, typename ConnectionParameter::Receive::Dictionary, typename ConnectionParameter::ReceiveHalt>> listener_halt_type
typedef ConnectionRegistry<ARQConnection> Registry

Registry of open ARQConnections.

typedef SendQueue send_queue_type
typedef sctrltp::packet<sctrltp::ParametersFcpBss2Cube>::entry_t subpacket_type

Private Functions

template<typename InputIterator>
void add(InputIterator const &begin, InputIterator const &end)

Add multiple UT messages to the send queue.

Messages may be sent to the hardware as part of this call if the send queue is full.

Template Parameters

InputIterator – Iterator type to sequence of messages to add

Parameters
  • begin – Iterator to beginning of sequence

  • end – Iterator to end of sequence

void add(send_message_type const &message)

Add a single UT message to the send queue.

Messages may be sent to the hardware as part of this call if the send queue is full.

Parameters

message – Message to add

void check_compatibility() const

Check for bitfile version compatibility.

void commit()

Send messages in send queue.

All messages in the send queue are guaranteed to be transfered.

std::mutex &get_mutex()

Get internal mutex to use for mutual exclusion.

Returns

Mutable reference to mutex

receive_queue_type receive_all()

Receive all UT messages currently in the receive queue.

Returns

Received messages

bool receive_empty() const

Get whether the connection has no UT messages available to receive.

Returns

Boolean value

void run_until_halt()

Start execution and wait until halt instruction is received from FPGA.

void work_receive()

Private Members

std::unique_ptr<arq_stream_type> m_arq_stream
duration_type m_commit_duration = {}
duration_type m_decode_duration = {}
decoder_type m_decoder
duration_type m_encode_duration = {}
encoder_type m_encoder
duration_type m_execution_duration = {}
listener_halt_type m_listener_halt
log4cxx::LoggerPtr m_logger
std::mutex m_mutex
receive_queue_type m_receive_queue
mutable std::mutex m_receive_queue_mutex
std::unique_ptr<Registry> m_registry
std::atomic<bool> m_run_receive
send_queue_type m_send_queue
std::thread m_worker_receive
friend Stream< ARQConnection >

Private Static Attributes

static constexpr size_t newest_supported_compatible_until = bss_hw_params::cube_ethernet::bitfile_compatible_until
static constexpr size_t oldest_supported_version = 0

Numbers to compare against bitfile protocol version.

There are 5 scenarios (newer covers new changes as well as outdated partners) 1: Software is newer than biftile and still compatible 2: Software is newer than biftile but incompatible 3: FPGA bitfile is newer than software and still compatible 4: FPGA bitfile is newer than software but incompatible 5: Both are head

The FPGA returns two numbers

  • version: Integer automatically incrementing with each change to the bitfile

  • compatible_until: Integer manually incrementing when bitfile introduces breaking feature

We can now cover all 5 cases by comparing these two numbers as follows

  • oldest_supported_version: manually set to last known bitfile version with breaking change

  • newest_supported_compatible_until: identical to current head bitfile compatible_until

oldest_supported_version needs to be lesser or equal to version and newest_supported_compatible_until needs to be greater or equal to compatible_until Cases 1, 3 and 5 fulfill these conditions whereas 2 and 4 do not

static constexpr uint16_t pid = 0x0010
struct hxcomm::ARQConnection::SendQueue

Public Functions

SendQueue(arq_stream_type &arq_stream)
void flush()
void push(subpacket_type const &subpacket)

Private Members

arq_stream_type &m_arq_stream
sctrltp::packet<sctrltp::ParametersFcpBss2Cube> m_packet
template<typename Connection>
struct hxcomm::ConnectionConcept
#include <connection.h>

Base concept for all connections (ARQ, CoSim, QuiggeldyConnection, …).

Public Static Attributes

template<typename C>
static constexpr bool has_get_time_info_v = has_get_time_info<C>::value
template<typename C>
static constexpr bool has_receive_message_type_v = has_receive_message_type<C>::value
template<typename C>
static constexpr bool has_send_halt_message_type_v = has_send_halt_message_type<C>::value
template<typename C>
static constexpr bool has_send_message_type_v = has_send_message_type<C>::value
template<typename C>
static constexpr bool has_supported_targets_v = has_supported_targets<C>::value
template<typename C, typename = void>
struct has_get_time_info : public std::false_type
#include <connection.h>
template<typename C>
struct hxcomm::ConnectionConcept::has_get_time_info<C, std::void_t<decltype(&C::get_time_info)>>
#include <connection.h>

Public Static Attributes

static constexpr bool value = std::is_same_v<decltype(&C::get_time_info), ConnectionTimeInfo (C::*)() const>
template<typename C, typename = void>
struct has_receive_message_type : public std::false_type
#include <connection.h>
template<typename C>
struct has_receive_message_type<C, std::void_t<typename C::receive_message_type>> : public std::true_type
#include <connection.h>
template<typename C, typename = void>
struct has_send_halt_message_type : public std::false_type
#include <connection.h>
template<typename C>
struct has_send_halt_message_type<C, std::void_t<typename C::send_halt_message_type>> : public std::true_type
#include <connection.h>
template<typename C, typename = void>
struct has_send_message_type : public std::false_type
#include <connection.h>
template<typename C>
struct has_send_message_type<C, std::void_t<typename C::send_message_type>> : public std::true_type
#include <connection.h>
template<typename C, typename = void>
struct has_supported_targets : public std::false_type
#include <connection.h>
template<typename C>
struct hxcomm::ConnectionConcept::has_supported_targets<C, std::void_t<decltype(C::supported_targets)>>
#include <connection.h>

Public Static Attributes

static constexpr bool value = std::is_same_v<decltype(Connection::supported_targets), std::initializer_list<Target>>
template<typename Connection>
struct ConnectionIsPlain : public std::true_type
#include <visit_connection.h>

Helper struct that is used to differentiate between plain connections and connections wrapped up in second order types (e.g.

variant, Handles).

Used in stadls::run and ConnectionIs{Plain,Wrapped}Guard below.

template<typename Connection>
struct ConnectionIsPlain<std::shared_ptr<Connection>> : public std::false_type
#include <visit_connection.h>
template<typename ...Connections>
struct ConnectionIsPlain<std::variant<Connections...>> : public std::false_type
#include <visit_connection.h>
template<size_t SendHeaderAlignment, typename SendSubwordType, typename SendPhywordType, typename SendDictionary, typename SendHaltInstructionType, size_t ReceiveHeaderAlignment, typename ReceiveSubwordType, typename ReceivePhywordType, typename ReceiveDictionary, typename ReceiveHaltInstructionType, typename ReceiveTimeoutInstructionType, typename QuiggeldyScheduleOutToInTransformType>
struct hxcomm::ConnectionParameter

Set of template parameters of a connection with different UTMessage sets for sending and receiving direction.

Template Parameters
  • SendHeaderAlignment – Alignment of header of send UTMessage set

  • SendSubwordType – Type of subword of send UTMessage set

  • SendPhywordType – Type of PHY-word of send UTMessage set

  • SendDictionary – Dictionary of instructions of sent UTMessages

  • SendHaltInstructionType – Instruction type of Halt message in sent diciontary

  • ReceiveHeaderAlignment – Alignment of header of receive UTMessage set

  • ReceiveSubwordType – Type of subword of receive UTMessage set

  • ReceivePhywordType – Type of PHY-word of receive UTMessage set

  • ReceiveDictionary – Dictionary of instructions of received UTMessages

  • ReceiveHaltInstructionType – Instruction type of Halt message in receive dictionary

  • QuiggeldyScheduleOutToInTransformType – Functor to transform a schedule-out result to schedule-in instructions in quiggeldy

template<typename Connection>
struct hxcomm::ConnectionRegistry

Registry of open connections.

Template Parameters

Connection – Connection type of registry

Public Types

typedef Connection::init_parameters_type Parameters

Public Functions

ConnectionRegistry(Parameters const &parameters)
~ConnectionRegistry()

Public Members

Parameters m_parameters

Public Static Functions

static std::set<Parameters> &registry()
static std::mutex &registry_mutex()
struct hxcomm::ConnectionTimeInfo

Time information of a connection’s history of usage.

Public Functions

bool operator!=(ConnectionTimeInfo const &other) const
ConnectionTimeInfo operator+(ConnectionTimeInfo const &other) const
ConnectionTimeInfo &operator+=(ConnectionTimeInfo const &other)
ConnectionTimeInfo operator-(ConnectionTimeInfo const &other) const
ConnectionTimeInfo &operator-=(ConnectionTimeInfo const &other)
bool operator==(ConnectionTimeInfo const &other) const

Public Members

std::chrono::nanoseconds commit_duration = {}

Time spent sending streams of words to backend since construction.

std::chrono::nanoseconds decode_duration = {}

Time spent decoding UT messages from a stream of words since construction.

std::chrono::nanoseconds encode_duration = {}

Time spent encoding UT messages to a stream of words since construction.

std::chrono::nanoseconds execution_duration = {}

Time spent waiting for end of execution on backend.

For hardware execution this duration includes the commit time, since control flow for delayed begin of execution is not implemented currently.

Private Functions

template<typename Archive>
void serialize(Archive &ar, std::uint32_t version)

Friends

friend std::ostream &operator<<(std::ostream &os, ConnectionTimeInfo const &data)
template<typename UTMessageParameter, typename MessageQueueType, typename ...Listener>
class hxcomm::Decoder
#include <decoder.h>

Decoder sequentially decoding a stream of words into a UT message queue.

The queue is expected to provide a push function.

Template Parameters
  • UTMessageParameter – UT message parameter

  • MessageQueueType – Queue type used for storing decoded UT messages in

  • Listener – An arbitrary number of message listeners to be invoked for each decoded message using their operator()

Public Types

typedef MessageQueueType message_queue_type
typedef ToUTMessageVariant<UTMessageParameter::HeaderAlignment, typenameUTMessageParameter::SubwordType, typenameUTMessageParameter::PhywordType, typenameUTMessageParameter::Dictionary>::type receive_message_type
typedef UTMessageParameter::PhywordType word_type

Public Functions

Decoder(Decoder &other, message_queue_type &message_queue, Listener&... listener)

Initialize decoder with a reference to a message queue to push decoded messages to, references to message listeners to invoke on decoded messages and a reference decoder from which to take existing state.

Parameters
  • other – Reference decoder

  • message_queue – Reference to message queue

  • listener – List of references to message listeners

Decoder(Decoder const&) = delete

Copy constructor.

Decoder(message_queue_type &message_queue, Listener&... listener)

Initialize decoder with a reference to a message queue to push decoded messages to and references to message listeners to invoke on decoded messages.

Parameters
  • message_queue – Reference to message queue

  • listener – List of references to message listeners

template<typename InputIterator>
void operator()(InputIterator const &begin, InputIterator const &end)

Decode a ensemble of words from an iterable.

During the process multiple messages might be decoded and pushed to the message queue. The iterable has to define a cbegin and cend function for iteration.

Template Parameters

InputIterator – Iterator to word sequence

Parameters
  • begin – Iterator to beginning of word sequence

  • end – Iterator to end of word sequence

void operator()(word_type word)

Decode a word.

During the process multiple messages might be decoded and pushed to the message queue.

Parameters

word – Word to decode

Decoder &operator=(Decoder const&) = delete

Assignment operator.

Private Types

typedef hate::bitset<buffer_size, word_type> buffer_type
enum class State

Values:

enumerator dropping_leading_comma
enumerator filling_until_header_size
enumerator filling_until_message_size

Private Functions

size_t decode_header() const

Decode UT message header.

Returns

Header

template<size_t Header>
void decode_message()
void decode_message(size_t header)

Decode UT message corresponding to header from buffer and push into message queue.

Parameters

header – Header to decode UT message for

template<size_t... Header>
void decode_message_table_generator(size_t header, std::index_sequence<Header...>)
constexpr size_t get_message_size(size_t header)

Get UT message size for specified header.

Parameters

header – Header to lookup UT message size for

void shift_in_buffer(word_type word)

Shift word into buffer.

Parameters

word – Word to shift in

Private Members

buffer_type m_buffer
size_t m_buffer_filling_level
size_t m_current_header
size_t m_current_message_size
boost::fusion::tuple<Listener&...> m_listener
log4cxx::LoggerPtr m_logger
message_queue_type &m_message_queue
State m_state

Private Static Functions

static bool has_leading_comma(word_type word)

Test, if word has a leading comma, i.e.

the highest bit is set to true.

Parameters

word – Word to test

Returns

Boolean test result

Private Static Attributes

static constexpr size_t buffer_size = hate::math::round_up_to_multiple(LargestUTMessageSize<UTMessageParameter::HeaderAlignment, typenameUTMessageParameter::SubwordType, typenameUTMessageParameter::PhywordType, typenameUTMessageParameter::Dictionary>::value, num_bits_word) + num_bits_word
static constexpr size_t header_size = UTMessageHeaderWidth<UTMessageParameter::HeaderAlignment, typenameUTMessageParameter::Dictionary>::value
static constexpr size_t num_bits_word = sizeof(word_type) * CHAR_BIT
template<typename...>
struct all_char_const_ptr

Check whether are not all supplied types can be converted to char const*;.

template<typename Connection>
struct hxcomm::detail::ExecuteMessagesArgumentType

Public Types

using type = std::vector<typename GetMessageTypes<std::remove_cvref_t<Connection>>::type::send_type>
template<typename Connection>
struct hxcomm::detail::ExecuteMessagesReturnType

Public Types

using type = std::pair<std::vector<typename GetMessageTypes<std::remove_cvref_t<Connection>>::type::receive_type>, ConnectionTimeInfo>
template<typename Connection>
struct hxcomm::detail::ExecutorMessages
#include <execute_messages.h>

Helper for partial specialization over templated connection-types.

operator()-contains the implementation of execute_messages defined below.

TODO: Validate interface via concepts once gcc 10 is ready.

Public Types

using connection_type = Connection
using messages_type = execute_messages_argument_t<Connection>
using receive_message_type = typename connection_type::receive_message_type
using response_type = typename return_type::first_type
using return_type = execute_messages_return_t<Connection>
using send_halt_message_type = typename connection_type::send_halt_message_type
using send_message_type = typename connection_type::send_message_type

Public Functions

inline return_type operator()(connection_type &conn, messages_type const &messages, bool const keep_responses)
template<typename ...T>
struct IsUTMessage : public std::false_type
#include <encoder.h>
template<size_t HeaderAlignment, typename SubwordType, typename PhywordType, typename Dictionary, typename Instruction>
struct IsUTMessage<UTMessage<HeaderAlignment, SubwordType, PhywordType, Dictionary, Instruction>> : public std::true_type
#include <encoder.h>
template<typename ConnectionParameter>
struct hxcomm::detail::ReinitEntryType

Public Types

using request_type = detail::execute_messages_argument_t<ConnectionParameter>
typedef ConnectionParameter::QuiggeldyScheduleOutToInTransform transform_type

Public Members

bool reinit_pending = true
request_type request
std::optional<request_type> snapshot
template<typename Connection, typename = void>
struct supports_full_stream_interface : public std::true_type
#include <stream.h>
template<typename ConnectionParameter, typename RcfClient>
struct supports_full_stream_interface<QuiggeldyConnection<ConnectionParameter, RcfClient>> : public std::false_type
template<typename T>
struct variant_to_ref
template<typename ...T>
struct hxcomm::detail::variant_to_ref<std::variant<T...>>

Public Types

using type = std::variant<std::reference_wrapper<T>...>
template<typename Visitor, typename Connection>
struct hxcomm::detail::VisitConnection
#include <visit_connection.h>

Public Types

using return_type = decltype(std::declval<Visitor>()(std::declval<Connection>()))

Public Functions

inline return_type operator()(Visitor &&visitor, Connection &&connection)
template<typename Visitor, typename Connection>
struct hxcomm::detail::VisitConnection<Visitor, std::shared_ptr<Connection>&>
#include <visit_connection.h>

Public Types

using return_type = decltype(std::declval<Visitor>()(std::declval<Connection&>()))

Public Functions

inline return_type operator()(Visitor &&visitor, std::shared_ptr<Connection> const &connection)
template<typename Visitor, typename ...Connections>
struct hxcomm::detail::VisitConnection<Visitor, std::variant<Connections...>&>
#include <visit_connection.h>

Public Types

using return_type = typename std::common_type<typename VisitConnection<Visitor, Connections&>::return_type...>::type
using variant_type = std::variant<Connections...>

Public Functions

inline return_type operator()(Visitor &&visitor, variant_type &variant)
template<typename Visitor, typename ...Connections>
struct hxcomm::detail::VisitConnection<Visitor, std::variant<Connections...> const&>
#include <visit_connection.h>

Public Types

using return_type = typename std::common_type<typename VisitConnection<Visitor, Connections&>::return_type...>::type
using variant_type = std::variant<Connections...> const

Public Functions

inline return_type operator()(Visitor &&visitor, variant_type &variant)
template<typename ConnectionParameter>
struct ZeroMockProcessMessage

Process message implementation used in ZeroMockConnection.

A specialization is necessary for each connection parameter set.

Template Parameters

ConnectionParameter – Connection parameter for which to process messages

template<>
struct hxcomm::detail::ZeroMockProcessMessage<hxcomm::vx::ConnectionParameter>

Public Types

using message_types = MessageTypes<hxcomm::vx::ConnectionParameter>
using receive_message_type = typename message_types::receive_type
typedef std::vector<receive_message_type> receive_queue_type
using send_halt_message_type = typename message_types::send_halt_type
using send_message_type = typename message_types::send_type

Public Functions

ZeroMockProcessMessage(receive_queue_type &receive_queue, bool &halt)
void operator()(send_message_type const &message)

Private Members

bool &m_halt
receive_queue_type &m_receive_queue
template<typename UTMessageParameter, typename WordQueueType>
class hxcomm::Encoder
#include <encoder.h>

Encoder sequentially encoding UT messages to a word queue.

The queue is expected to provide a push function for single words.

Template Parameters
  • UTMessageParameter – UT message parameter

  • WordQueueType – Queue type to push words to

Public Types

typedef ToUTMessageVariant<UTMessageParameter::HeaderAlignment, typenameUTMessageParameter::SubwordType, typenameUTMessageParameter::PhywordType, typenameUTMessageParameter::Dictionary>::type send_message_type
typedef WordQueueType word_queue_type
typedef UTMessageParameter::PhywordType word_type

Public Functions

Encoder(Encoder &other, word_queue_type &word_queue)

Initialize encoder with a reference to a word queue to push encoded words to and a reference encoder from which to take existing buffer state.

Parameters
  • word_queue – Reference to word queue

  • other – Reference encoder

Encoder(word_queue_type &word_queue)

Initialize encoder with a reference to a word queue to push encoded words to.

Parameters

word_queue – Reference to word queue

void flush()

Flush the possibly partially filled head-word of the buffer to the queue.

Appends a comma to the word before pushing.

template<typename InputIterator>
void operator()(InputIterator const &begin, InputIterator const &end)

Encode multiple messages.

During the process multiple words might be produced and pushed to the word queue. The implementation requires messages to have a cbegin and cend function for iteration. The containers’ entries are to be message variants.

Template Parameters

InputIterator – Iterator to UTMessage variant sequence

Parameters
  • begin – Iterator to beginning of message sequence

  • end – Iterator to end of message sequence

template<typename MessageType>
std::enable_if<detail::IsUTMessage<MessageType>::value, void>::type operator()(MessageType const &message)

Encode a message.

During the process multiple words might be produced and pushed to the word queue.

Template Parameters

MessageType – Type of message to encode

Parameters

message – Message to encode

Private Types

typedef hate::bitset<buffer_size, word_type> buffer_type

Private Members

buffer_type m_buffer
size_t m_buffer_filling_level
log4cxx::LoggerPtr m_logger
word_queue_type &m_word_queue

Private Static Attributes

static constexpr size_t buffer_size = hate::math::round_up_to_multiple(LargestUTMessageSize<UTMessageParameter::HeaderAlignment, typenameUTMessageParameter::SubwordType, typenameUTMessageParameter::PhywordType, typenameUTMessageParameter::Dictionary>::value, num_bits_word) + num_bits_word
static constexpr size_t num_bits_word = sizeof(word_type) * CHAR_BIT
template<typename C, typename = void>
struct hxcomm::GetMessageTypes
#include <connection.h>

Helper function to get MessageTypes from a Connection or a variant etc over the same Connection in a streamlined fashion.

If C is a ConnectionParameter instance, the corresponding MessageTypes will be returned.

Public Types

using type = MessageTypes<std::decay_t<C>>
template<typename C>
struct hxcomm::GetMessageTypes<C, std::void_t<typename C::message_types>>
#include <connection.h>

Public Types

using type = typename C::message_types
template<typename C>
struct hxcomm::GetMessageTypes<std::shared_ptr<C>>
#include <connection.h>

Public Types

using type = typename GetMessageTypes<typename std::remove_cv<C>::type>::type
template<typename ...Cs>
struct hxcomm::GetMessageTypes<std::variant<Cs...>>
#include <connection.h>

Public Types

using type = typename std::common_type<typename GetMessageTypes<Cs>::type...>::type
template<typename Tag, size_t N>
class hxcomm::instruction::detail::payload::Bitset : public hate::bitset<N>
#include <payload.h>

Payload for bitset data.

Template Parameters
  • Tag – Type of tag class

  • NNumber of bits of payload

Public Types

typedef hate::bitset<N> value_type

Underlying value type.

Public Functions

template<typename ...Args>
inline explicit constexpr Bitset(Args... args)

Construct a bitset payload.

Template Parameters

Args – Argument types to construct from

Parameters

args – Agruments to construct from

template<typename SubwordType = unsigned long>
inline void decode(hate::bitset<N, SubwordType> const &data)

Decode from a bitset of size N (no-op for Bitset).

Template Parameters

SubwordType – Word type used in bitset representation

Parameters

dataBitset data to decode

template<typename SubwordType = unsigned long>
inline constexpr hate::bitset<N, SubwordType> encode() const

Encode into a bitset of size N (no-op for Bitset).

Template Parameters

SubwordType – Word type used in bitset representation

Returns

Payload encoded as bitset

Friends

inline friend std::ostream &operator<<(std::ostream &os, Bitset const &value)
template<typename Tag, typename T>
class hxcomm::instruction::detail::payload::Number
#include <payload.h>

Payload for number-type data.

Template Parameters
  • Tag – Type of tag class

  • NNumber of bits of payload

  • T – underlying number type

Public Functions

inline explicit constexpr Number(T const value = 0)

Construct a Number payload.

Parameters

value – Value to construct from

template<typename SubwordType = unsigned long>
inline void decode(hate::bitset<size, SubwordType> const &data)

Decode from a bitset of size N.

Template Parameters

SubwordType – Word type used in bitset representation

Parameters

dataBitset data to decode

template<typename SubwordType = unsigned long>
inline constexpr hate::bitset<size, SubwordType> encode() const

Encode into a bitset of size N.

Template Parameters

SubwordType – Word type used in bitset representation

Returns

Payload encoded as bitset

inline operator T() const
inline bool operator!=(Number const &other) const
inline bool operator==(Number const &other) const
inline T value() const

Public Static Attributes

static constexpr size_t size = sizeof(T) * CHAR_BIT

Private Members

T m_value

Friends

inline friend std::ostream &operator<<(std::ostream &os, Number const &value)
template<size_t HeaderAlignment, typename SubwordType, typename PhywordType, typename Dictionary>
struct LargestUTMessageSize

Get the largest UT message size in bits for a given set of UT message parameters.

Template Parameters
  • HeaderAlignment – Alignment of header in bits

  • SubwordType – Type of subword which’s width corresponds to the messages alignment

  • PhywordType – Type of PHY-word which’s width corresponds to the message’s minimal width

  • Dictionary – Dictionary of instructions

template<size_t HeaderAlignment, typename SubwordType, typename PhywordType, typename ...Is>
struct hxcomm::LargestUTMessageSize<HeaderAlignment, SubwordType, PhywordType, hate::type_list<Is...>>

Public Static Attributes

static constexpr size_t value = std::max({UTMessage<HeaderAlignment, SubwordType, PhywordType, hate::type_list<Is...>, Is>::word_width...})
template<typename HaltMessageType>
class hxcomm::ListenerHalt
#include <listener_halt.h>

Listener registering occurence of a halt instruction.

Filtering is done at compile-time for the halt message type and at runtime for the payload comparing with the halt member of the messages instruction type.

Template Parameters

HaltMessageType – Message type of Halt instruction

Public Functions

inline ListenerHalt()

Construct Halt listener.

inline bool get() const

Get whether the listener registered a Halt message.

template<typename MessageType>
inline void operator()(MessageType const &message)

Operator invoked for every decoded message checking whether the message contains a Halt.

Template Parameters

MessageType – Type of UT message to check

Parameters

message – UT message instance to check

inline void reset()

Reset listener state to not having registered a Halt message.

Private Members

std::atomic<bool> m_value
template<typename UTMessageParameter>
class hxcomm::LoopbackConnection

Loopback connection class.

Committed packets are added to a intermediate packet queue in software without alteration. Every committed message can be received in order. The send and receive dictionary are therefore the same.

Template Parameters

UTMessageParameter – UT message parameter

Public Types

typedef UTMessageParameter::Dictionary dictionary_type
typedef UTMessageParameter::PhywordType phyword_type
typedef send_message_type receive_message_type
typedef std::vector<receive_message_type> receive_queue_type
typedef ToUTMessageVariant<UTMessageParameter::HeaderAlignment, typenameUTMessageParameter::SubwordType, typenameUTMessageParameter::PhywordType, typenameUTMessageParameter::Dictionary>::type send_message_type
typedef phyword_type subpacket_type
typedef UTMessageParameter::SubwordType subword_type
typedef UTMessageParameter ut_message_parameter_type

Public Functions

LoopbackConnection()

Default construct loopback connection.

~LoopbackConnection()

Destruct loopback connection joining all receive threads.

template<typename InputIterator>
void add(InputIterator const &begin, InputIterator const &end)

Add multiple UT messages to the send queue.

Template Parameters

InputIterator – Iterator type to sequence of messages to add

Parameters
  • begin – Iterator to beginning of sequence

  • end – Iterator to end of sequence

void add(send_message_type const &message)

Add a single UT message to the send queue.

Parameters

message – Message to add

void commit()

Send messages in send queue by moving to the intermediate queue.

receive_queue_type receive_all()

Receive all UT messages currently in the receive queue.

Returns

Received messages

bool receive_empty() const

Get whether the connection has no UT messages available to receive.

Returns

Boolean value

Public Static Attributes

static constexpr size_t header_alignment = UTMessageParameter::HeaderAlignment

Private Types

typedef std::queue<subpacket_type> send_queue_type

Private Functions

void work_receive()

Private Members

Decoder<UTMessageParameter, receive_queue_type> m_decoder
Encoder<UTMessageParameter, send_queue_type> m_encoder
std::deque<subpacket_type> m_intermediate_queue
std::mutex m_intermediate_queue_mutex
receive_queue_type m_receive_queue
mutable std::mutex m_receive_queue_mutex
std::atomic<bool> m_run_receive
send_queue_type m_send_queue
std::thread m_worker_receive
template<typename ConnectionParameter>
struct hxcomm::MessageTypes
#include <connection.h>

Helper struct that defines message types from ConnectionParameters.

Template Parameters

ConnectionParameter – UT message parameter for connection

Public Types

using connection_parameter_type = ConnectionParameter
typedef hxcomm::ToUTMessageVariant<ConnectionParameter::Receive::HeaderAlignment, typenameConnectionParameter::Receive::SubwordType, typenameConnectionParameter::Receive::PhywordType, typenameConnectionParameter::Receive::Dictionary>::type receive_type
typedef hxcomm::UTMessage<ConnectionParameter::Send::HeaderAlignment, typename ConnectionParameter::Send::SubwordType, typename ConnectionParameter::Send::PhywordType, typename ConnectionParameter::Send::Dictionary, typename ConnectionParameter::SendHalt> send_halt_type
typedef hxcomm::ToUTMessageVariant<ConnectionParameter::Send::HeaderAlignment, typenameConnectionParameter::Send::SubwordType, typenameConnectionParameter::Send::PhywordType, typenameConnectionParameter::Send::Dictionary>::type send_type
template<typename ConnectionParameter>
struct hxcomm::quiggeldy_interface_types

Subclassed by hxcomm::quiggeldy_interface_types< MessageTypes< ConnectionParameter > >

Public Types

using message_types = MessageTypes<ConnectionParameter>
using reinit_entry_type = detail::ReinitEntryType<ConnectionParameter>
using reinit_type = std::vector<reinit_entry_type>
using request_type = detail::execute_messages_argument_t<ConnectionParameter>
using response_type = detail::execute_messages_return_t<ConnectionParameter>
template<typename ConnectionParameter>
struct hxcomm::quiggeldy_interface_types<MessageTypes<ConnectionParameter>> : public hxcomm::quiggeldy_interface_types<ConnectionParameter>

Public Types

using message_types = MessageTypes<ConnectionParameter>
using reinit_entry_type = detail::ReinitEntryType<ConnectionParameter>
using reinit_type = std::vector<reinit_entry_type>
using request_type = detail::execute_messages_argument_t<ConnectionParameter>
using response_type = detail::execute_messages_return_t<ConnectionParameter>
template<typename ConnectionParameter, typename RcfClient>
class hxcomm::QuiggeldyConnection

QuiggeldyConnection class.

Establish and hold connection to a remote quiggeldy instance that itself proxies another connection.

Template Parameters
  • ConnectionParameter – UT message parameter for connection

  • RcfClient – RCF-based client that is needed to connect to quiggeldy instance.

Public Types

using connect_parameters_type = std::tuple<std::string, uint16_t>
using f_create_client_shared_ptr_t = typename reinit_uploader_type::f_create_client_shared_ptr_t
using future_type = QuiggeldyFuture<typename interface_types::response_type, rcf_client_type>
using interface_types = quiggeldy_interface_types<ConnectionParameter>
using message_types = MessageTypes<ConnectionParameter>
using rcf_client_type = RcfClient
using receive_message_type = typename message_types::receive_type
using reinit_stack_type = ReinitStack<ConnectionParameter>
using reinit_uploader_type = rcf_extensions::OnDemandUpload<rcf_client_type, typename interface_types::reinit_type>
using send_halt_message_type = typename message_types::send_halt_type
using send_message_type = typename message_types::send_type

Public Functions

QuiggeldyConnection()

Connects to server while getting IP and port from environment.

QuiggeldyConnection(connect_parameters_type const &params)

Connect via tuple of ip/port.

QuiggeldyConnection(QuiggeldyConnection&&)

Move constructor.

QuiggeldyConnection(QuiggeldyConnection const&) = delete

No copies allowed.

QuiggeldyConnection(std::string ip, uint16_t port)

Connects to server with explicit ip/port.

Parameters
  • ip – Target ip address.

  • port – Target port.

~QuiggeldyConnection()

Destruct connection to FPGA joining all receive threads.

std::string get_bitfile_info() const

Get bitfile information.

Returns

Bitfile info

std::chrono::milliseconds get_connection_attempt_wait_after() const

Get wait duration after every connection attempt number of connection attempts.

Returns

Wait duration after every connection attempt.

size_t get_connection_attempts_max() const

Get maximum number of connection attempts.

Returns

Number of connection attempts.

std::optional<std::string> get_custom_username()

Get custom username to use remotely, if defined.

Returns

Custom username if defined. Otherwise: nullopt.

std::string get_remote_repo_state() const

Get quiggeldy server repository state info.

Returns

Repository state info

ConnectionTimeInfo get_time_info() const

Get time information.

Returns

Time information

std::string get_unique_identifier(std::optional<std::string> hwdb_path = std::nullopt) const

Get unique identifier from hwdb.

Parameters

hwdb_path – Optional path to hwdb

Returns

Unique identifier

bool get_use_munge() const

Get whether or not to encode user information using munge.

This is needed if the remote side is also using munge (i.e., regular operations), but should be disabled in testing environments running without munge.

This option has no effect if fisch was compiled with --without-munge.

Returns

Whether munge should be used (true) or not (false).

std::string get_version_string() const

Get compile time version information in human-readable form from server side.

Returns

Human-readable form of version information.

bool is_out_of_order() const

Return whether this instance submits packages out-of-order, i.e., if submitted asynchronous requests could be executed out of order.

Note: In case of out-of-order execution, single submitted work packages should correspond to a full program.

QuiggeldyConnection &operator=(QuiggeldyConnection&&)

Assignment operator.

QuiggeldyConnection &operator=(QuiggeldyConnection const&) = delete

No copies allowed.

void set_connection_attempt_wait_after(std::chrono::milliseconds ms)

Set wait duration after every connection attempt number of connection attempts.

Parameters

ms – Wait duration after every connection attempt.

void set_connection_attempts_max(size_t num)

Set maximum number of connection attempts.

Parameters

num – Number of connection attempts.

void set_custom_username(std::string custom_user)

Set custom username.

Please note that this setting will only be used if munge authentication is disabled.

Parameters

custom_user – Custom username to use.

void set_out_of_order()

Set the QuiggeldyConnection to set out-of-order work units.

This can speed up execution times if each playback-program does not depend on other playback programs. Plus, it might make learning more robust.

void set_use_munge(bool value)

Set whether or not to encode user information using munge.

This is needed if the remote side is also using munge (i.e., regular operations), but should be disabled in testing environments running without munge.

This option has no effect if compiling with --without-munge.

Parameters

value – If munge should be used (true) or not (false).

Public Static Attributes

static constexpr char name[] = {"QuiggeldyConnection"}
static constexpr std::chrono::hours program_runtime_max = std::chrono::hours(24 * 30)

When running experiments over quiggeldy - if running blocking - RCF needs to keep the connection open for as long as an experiment could theoretically be running.

For now just set it to one month. If needed, this should be set to a more reasonable constant in the future.

static constexpr auto supported_targets = {Target::hardware}

Protected Functions

void accumulate_time_info(ConnectionTimeInfo const &delta)
f_create_client_shared_ptr_t get_create_client_function()

Return function that creates RCF clients with this connection’s info.

std::weak_ptr<reinit_stack_type> get_reinit_stack() const

Get a reference to the reinit stack.

This is only used by ReinitStackEntry to support nested reinit programs and is not really useful otherwise.

std::weak_ptr<reinit_uploader_type> get_reinit_upload() const

Get a reference to the uploader instance so that a possible reinit program can be registered elsewhere.

std::lock_guard<std::mutex> lock_time_info() const

Lock guard for time info.

rcf_extensions::SequenceNumber next_sequence_number()

Get next sequence number for a new request.

void reinit_enforce()

Enforce reinit program to be used on the remote site prior to executing result-producing FPGA word streams.

template<typename Function, typename ...Args>
auto retrying_client_invoke(bool with_user_data, Function &&function, Args&&... args)
template<typename Function, typename ...Args>
auto retrying_client_invoke(bool with_user_data, Function &&function, Args&&... args) const
void set_user_data(std::unique_ptr<rcf_client_type>&) const

Prepare user data in connection to authenticate request on the server side.

Called by setup_client().

Sets up potential munge authentication.

std::unique_ptr<rcf_client_type> setup_client(bool with_user_data = true) const

Set up the RCF-client, i.e., establish a connection to the server.

Takes its parameters from m_connect_parameters.

Parameters

with_user_data – whether or not to set user data in connection (for work submission user data needs to be set).

template<typename Submitter>
auto submit(Submitter const&)
future_type submit_async(typename interface_types::request_type const &req)

Send the given request to the server and block until response is ready.

Parameters

req – Request which is sent to the server.

Returns

Response containing FPGA words from the connection.

interface_types::response_type submit_blocking(typename interface_types::request_type const &req)

Send the given request to the server and block until response is ready.

This function is reentrant.

Parameters

req – Request which is sent to the server.

Returns

Response containing FPGA words from the connection.

Protected Attributes

connect_parameters_type m_connect_parameters
size_t m_connection_attempt_num_max
std::chrono::milliseconds m_connection_attempt_wait_after
std::optional<std::string> m_custom_user
log4cxx::LoggerPtr m_logger
std::mutex m_mutex_sequence_num
mutable std::mutex m_mutex_time_info
RCF::RcfInit m_rcf
std::shared_ptr<reinit_stack_type> m_reinit_stack
std::shared_ptr<reinit_uploader_type> m_reinit_uploader
rcf_extensions::SequenceNumber m_sequence_num
boost::uuids::uuid m_session_uuid
ConnectionTimeInfo m_time_info
bool m_use_munge
friend StreamRC< QuiggeldyConnection >

Protected Static Functions

static connect_parameters_type get_connect_params_from_env()
template<typename ReturnValue, typename RcfClient>
class hxcomm::QuiggeldyFuture
#include <quiggeldy_future.h>

Wrapper class that holds an async-response as well as the corresponding RCF-client because each RCF-client only supports one concurrent asynchronous call.

If forwards needed portions of the RCF::Future-API.

Public Types

using rcf_client_type = RcfClient
using rcf_future_type = RCF::Future<ReturnValue>
using return_value_type = ReturnValue

Public Functions

inline QuiggeldyFuture(std::unique_ptr<rcf_client_type> client, std::unique_ptr<rcf_future_type> future)

Construct QuiggeldyFuture.

Parameters
  • client – Client used to create future.

  • future – RCF::Future value to be wrapped.

inline void cancel()

Cancel the future and clear this instance.

inline return_value_type operator*()

Access the computed value, blocking until the value is ready.

If QuiggeldyFuture was cancel()-ed, will throw.

Should only be called once!

inline bool ready()

Check if the Future holds a value.

inline void wait(std::chrono::milliseconds timeout = 0ms)

Wait for the future optionally with a timeout.

Private Members

std::unique_ptr<rcf_client_type> m_client
std::unique_ptr<RCF::Future<return_value_type>> m_future
template<typename Connection>
class hxcomm::QuiggeldyServer : public rcf_extensions::RoundRobinReinitScheduler<QuiggeldyWorker<Connection>>
#include <quiggeldy_server.h>

Public Types

using parent_t = rcf_extensions::RoundRobinReinitScheduler<QuiggeldyWorker<Connection>>

Public Functions

template<typename RcfInterface>
inline void bind_to_interface()

Bind QuiggeldyServer to the RcfInterface.

Cannot be called on baseclass because then the baseclass would get bound to the RCF-interface.

inline std::string get_bitfile_info()
inline std::string get_remote_repo_state()
inline std::string get_unique_identifier(std::optional<std::string> hwdb_path)
inline bool get_use_munge() const

Get if worker is configured to use munge.

Convenience to automatically disable munge usage on the client.

Returns

if worker is configured to use munge.

inline std::string get_version_string() const

Retrieve version information in human readable string-form.

Returns

currently set version.

inline void set_version(std::string version)

Set version information in human readable string-form.

Parameters

version – Currently set version (typically set during compile).

Private Members

std::string m_version
template<typename Connection>
class hxcomm::QuiggeldyWorker
#include <quiggeldy_worker.h>

Implementation of server-side experiment execution.

Set up and used by quiggeldy and not intended to be used in user-code.

Public Types

using interface_types = quiggeldy_interface_types<typename Connection::message_types>
using reinit_type = typename interface_types::reinit_type
using request_type = typename interface_types::request_type
using response_type = typename interface_types::response_type
using user_session_type = std::pair<std::string, boost::uuids::uuid>

Public Functions

template<typename ...Args>
QuiggeldyWorker(Args&&...)

Set up the Quick Queue Server.

QuiggeldyWorker(QuiggeldyWorker &&other) = default
QuiggeldyWorker(QuiggeldyWorker const &other) = delete
~QuiggeldyWorker()
bool check_for_timeout(typename response_type::first_type const &response)

Check if response contains a timeout response.

Parameters

response – to check for timeouts.

Returns

True if timeout was encountered, false otherwise.

std::string get_bitfile_info() const

Get bitfile information.

Returns

Bitfile info

std::chrono::milliseconds get_delay_after_connection_attempt() const

Get the amount of time to wait, if connecting to the “real” backend fails.

Returns

Number of millisconds between attempts.

std::size_t get_max_num_connection_attemps() const

Get how many connection attempts to the “real” backend are made prior to failing hard.

Returns

Number of attempts

std::string get_remote_repo_state() const

Get repository state info of quiggeldy server side build.

Returns

Repository state info

std::string const &get_slurm_license() const

Get slurm license that is allocated by worker.

Returns

Slurm license to acquire in setup().

std::string get_unique_identifier(std::optional<std::string> hwdb_path = std::nullopt) const

Get unique identifier from hwdb.

Parameters

hwdb_path – Optional path to hwdb

Returns

Unique identifier

bool get_use_munge() const

Get whether worker expects to decode user data via munge.

Returns

Whether worker expects to decode user data via munge.

QuiggeldyWorker &operator=(QuiggeldyWorker &&other) = default
QuiggeldyWorker &operator=(QuiggeldyWorker const &other) = delete
void perform_reinit(reinit_type &reinit_type, bool enforce)

This function is called whenever we had to relinquish control of our hardware resource and the user specified a reinit-program to be loaded prior to the next work-unit being executed.

Parameters
  • reinit_type – reinit stack to be executed

  • enforce – execute all reinit stack entries

void perform_reinit_snapshot(reinit_type&)

This function is called whenever we have to relinquish control of our hardware resource and the user specified a reinit-program to be snapshotted after the previous work-unit was executed.

void set_delay_after_connection_attempt(std::chrono::milliseconds delay)

Set the amount of time to wait, if connecting to the “real” backend fails.

void set_enable_allocate_license(bool enable_license_alloc)

Set or unset if the worker should perform its work with a license allocation.

Parameters

enable_license_allocj – Whether or not to perform work with a license allocation.

void set_enable_mock_mode(bool mode_enable)

Set or unset the worker into mock-mode.

If in mock-mode, no communication with any hardware is attempted and empty results are returned.

Parameters

mode_enable – Whether or not to enable mock mode.

void set_max_num_connection_attemps(std::size_t num)

Set how many connection attempts to the “real” backend are made prior to failing hard.

Parameters

num – Number of attempts to set.

void set_slurm_license(std::string license)

Set slurm license to allocate.

Parameters

license – Slurm license to acquire in setup().

void set_slurm_partition(std::string partition)

Set slurm partition.

(If unset defaults to “cube”.)

Parameters

partition – Which slurm partition to use in allocations.

void set_use_munge(bool use_munge)

Set whether or not to verify user information using munge.

This option has no effect if fisch was compiled with --without-munge.

Parameters

use_munge – If munge should be used (true) or not (false).

void setup()

This function is called by the scheduler whenever there is work to execute (in our case FPGA words that need to be send and then an answer to receive) but the chip is currently not used by us.

The function performs whatever is necessary to run experiments on a locally attach board. This includes getting a license allocation.

NOTE: If the GRES is already allocated in SLURM, this function will block until it becomes available!

void teardown()

This function is run whenever the server releases control (and any associated slurm resources).

std::optional<user_session_type> verify_user(std::string const &user_data)

Verify the authenticity of the given user.

Parameters

user_data – User data supplied via RCF. If munge support is enabled (via USE_MUNGE_AUTH), it should be encoded using munge.

Returns

If user is authenticated, return identifying hash with which fair round-robin scheduling is ensured.

response_type work(request_type const &req)

This function is called by the scheduler to actually evaluate the FPGA words (send data to chip, wait, retrieve response from chip).

Parameters

req – FPGA words to be sent to the chip for this job.

Protected Types

using connection_init_type = typename Connection::init_parameters_type

Protected Functions

template<typename ...Args>
void exec_slurm_binary(char const *binary_name, Args&&... args)

Helper function to execute slurm binaries.

std::string get_slurm_jobname() const
bool has_slurm_allocation()
void setup_connection()

Create a new connection, closing the old one in the process.

void slurm_allocation_acquire()
void slurm_allocation_release()

Protected Attributes

bool m_allocate_license
std::unique_ptr<Connection> m_connection
connection_init_type m_connection_init
std::chrono::milliseconds m_delay_after_connection_attempt
bool m_has_slurm_allocation

Explicit slurm license to use for allocation.

log4cxx::LoggerPtr m_logger

Wrapped connection object.

std::size_t m_max_num_connection_attempts
bool m_mock_mode
std::string m_slurm_license

Which slurm partition to allocate in.

std::string m_slurm_partition

Initial parameters for connection.

bool m_use_munge

Protected Static Attributes

static constexpr char default_slurm_partition[] = {"cube"}
template<typename UTMessageParameter>
struct hxcomm::random::default_ut_message
#include <utmessage_random.h>

Return default-constructed UTMessage of runtime-specifiable header.

Public Types

typedef hxcomm::ToUTMessageVariant<UTMessageParameter::HeaderAlignment, typenameUTMessageParameter::SubwordType, typenameUTMessageParameter::PhywordType, typenameUTMessageParameter::Dictionary>::type message_type

Public Static Functions

static inline message_type get(size_t const header)

Private Static Functions

template<size_t H>
static inline message_type message_recurse(size_t const header, std::index_sequence<H>)
template<size_t H, size_t... Hs>
static inline message_type message_recurse(size_t const header, std::index_sequence<H, Hs...>)
template<typename T>
struct type
#include <payload_random.h>

To-type-proxy to partially specialize function on a non-default-constructible argument type.

Template Parameters

T – Type to proxy for

template<typename ConnectionParameters>
class hxcomm::ReinitStack
#include <reinit_stack.h>

ReinitStack holds the stack of reinit programs that are currently set as a simple wrapper around a vector.

Since ReinitStack resides within the QuiggeldyConnection-handle, ReinitStack needs to be constructable prior to the full definition of QuiggeldyConnection. This is why informing the remote side about changes in the stack is handled by ReinitStackEntry.

Public Types

using interface_types = quiggeldy_interface_types<ConnectionParameters>
using reinit_entry_type = typename interface_types::reinit_entry_type
using reinit_type = typename interface_types::reinit_type

Public Functions

ReinitStack()
ReinitStack(ReinitStack&&) = default
ReinitStack(ReinitStack const&) = delete
void pop_entry(std::size_t idx)

Pop entry with given index.

Throws if the given index is not the topmost entry in the stack.

Parameters

idx – Index to delete.

std::size_t push(reinit_entry_type &&entry)

Push a new entry onto the stack and return its position within the stack.

Parameters

entry – The entry to be pushed on the stack

Returns

Position at which entry resides in stack after pushing.

std::size_t push(reinit_entry_type const &entry)

Push a new entry onto the stack and return its position within the stack.

Parameters

entry – The entry to be pushed on the stack

Returns

Position at which entry resides in stack after pushing.

void set_all_done()

Set all reinit stack entries as done.

bool update_at(std::size_t idx, reinit_entry_type &&entry)

Update entry at given position.

Parameters
  • idx – Position at which to update the entry.

  • entry – New updated entry in the stack.

Returns

if entry was succesfully updated

bool update_at(std::size_t idx, reinit_entry_type const &entry)

Update entry at given position.

Parameters
  • idx – Position at which to update the entry.

  • entry – New updated entry in the stack.

Returns

if entry was succesfully updated

template<typename UploaderT>
void upload(UploaderT&) const

Register the current reinit stack for upload with the provided uploader.

Template Parameters

UploaderT – The uploader to register the current stack to.

Private Members

log4cxx::LoggerPtr m_logger
mutable std::mutex m_mutex
reinit_type m_stack
template<typename QuiggeldyConnection, typename ConnectionVariant>
class hxcomm::ReinitStackEntry

Proxy object that can be used independently from a connection to register a reinit program to be run whenever control of the hardware resources is relinquished for some time.

Note: On direct-access connections this is a no-op since those connections do not support the notion of relinquishing control. Right now, only QuiggeldyConnection makes use of this.

Public Types

using connection_ref_variant_type = detail::variant_to_ref_t<ConnectionVariant>
using interface_types = typename quiggeldy_connection_type::interface_types
using quiggeldy_connection_type = QuiggeldyConnection
using reinit_entry_type = typename interface_types::reinit_entry_type
using reinit_stack_type = typename quiggeldy_connection_type::reinit_stack_type
using reinit_type = typename interface_types::reinit_type
using reinit_uploader_type = typename quiggeldy_connection_type::reinit_uploader_type

Public Functions

ReinitStackEntry() = delete
template<typename Connection>
ReinitStackEntry(Connection&)
ReinitStackEntry(ConnectionVariant&)
ReinitStackEntry(ReinitStackEntry&&) = default
ReinitStackEntry(ReinitStackEntry const&) = default
~ReinitStackEntry()
void enforce()

Enforce reinit program to be used on the remote site.

void pop()

Pop this entry from the stack.

void set(reinit_entry_type &&entry)

Register a reinit program to be used on the remote site.

Takes ownership of the program.

Parameters

entry – What to upload.

void set(reinit_entry_type const &entry)

Register a reinit program to be used on the remote site.

Copies the program.

Parameters

entry – What to upload.

Private Functions

void handle_unsupported_connection(reinit_entry_type const&)
template<typename Connection>
void setup(Connection &connection)

Private Members

connection_ref_variant_type m_connection_ref
bool m_connection_supports_reinit
std::optional<std::size_t> m_idx_in_stack
log4cxx::LoggerPtr m_logger
std::weak_ptr<reinit_stack_type> m_reinit_stack
std::weak_ptr<reinit_uploader_type> m_reinit_uploader

Private Static Attributes

template<typename Connection>
static constexpr bool supports_reinit_v = std::is_same_v<std::remove_cvref_t<Connection>, quiggeldy_connection_type>
class hxcomm::SignalOverrideIntTerm
#include <signal.h>

Class overriding the SIGINT and the SIGTERM signal handler to a exit handler during life-time.

Public Functions

SignalOverrideIntTerm()

Construct signal override for SIGINT and SIGTERM by alteration to a exit handler.

~SignalOverrideIntTerm()

Destruct signal override with cleanup of signal handlers.

Private Types

typedef decltype(signal(SIGINT, SIG_IGN)) signal_handler_type

Private Members

signal_handler_type m_previous_handler_sigint
signal_handler_type m_previous_handler_sigterm
template<typename ConnectionParameter>
class hxcomm::SimConnection
#include <simconnection.h>

Simulation connection class.

Establish and hold Simulation connection to FPGA. Provide convenience functions for sending and receiving UT messages.

Template Parameters

ConnectionParameter – UT message parameter for connection

Public Types

using init_parameters_type = typename std::tuple<ip_t, port_t>
using message_types = MessageTypes<ConnectionParameter>
using receive_message_type = typename message_types::receive_type
typedef std::vector<receive_message_type> receive_queue_type
using send_halt_message_type = typename message_types::send_halt_type
using send_message_type = typename message_types::send_type

Public Functions

SimConnection(bool enable_terminate_on_destruction = false)

Create and start connection to simulation server.

The RCF port is automatically extracted from the enviroment, the simulation server is expected to run on the same host.

Parameters

enable_terminate_on_destruction – Whether or not to terminate the remote simulation upon destruction of the SimConnection.

Throws

std::runtime_error – On no port to simulator found in environment

SimConnection(ip_t ip, port_t port, bool enable_terminate_on_destruction = false)

Create and start connection to simulation server.

Parameters
  • ip – IP-address of simulation server

  • port – Port of simulation server

  • enable_terminate_on_destruction – Whether or not to terminate the remote simulation upon destruction of the SimConnection.

SimConnection(SimConnection&&)

Move constructor.

SimConnection(SimConnection const&) = delete

Copy constructor (deleted because no two instances with the same simulator allocation can coexist).

~SimConnection()

Destruct simulation connection joining all receive threads.

std::string get_bitfile_info() const

Get bitfile information.

Returns “simulation” for SimConnection.

Returns

Bitfile info

bool get_enable_terminate_on_destruction() const

Get enable value to terminate simulator on destruction of connection.

Returns

Boolean value

std::string get_remote_repo_state() const

Get server-side remote repository state information.

Only non-empty for QuiggeldyConnection.

Returns

Repository state

ConnectionTimeInfo get_time_info() const

Get time information.

Returns

Time information

std::string get_unique_identifier(std::optional<std::string> hwdb_path = std::nullopt) const

Get unique identifier from hwdb.

Parameters

hwdb_path – Optional path to hwdb

Returns

Unique identifier

SimConnection &operator=(SimConnection&&)

Assignment operator.

SimConnection &operator=(SimConnection const&) = delete

Assignment operator (deleted because no two instances with the same simulator allocation can coexist).

void set_enable_terminate_on_destruction(bool const value)

Set enable value to terminate simulator on destruction of connection.

Parameters

value – Boolean value

Public Static Attributes

static constexpr char name[] = "SimConnection"
static constexpr auto supported_targets = {Target::simulation}

Private Types

typedef Decoder<typename ConnectionParameter::Receive, receive_queue_type, listener_halt_type> decoder_type
typedef std::atomic<std::chrono::nanoseconds::rep> duration_type
typedef Encoder<typename ConnectionParameter::Send, send_queue_type> encoder_type
typedef ListenerHalt<UTMessage<ConnectionParameter::Receive::HeaderAlignment, typename ConnectionParameter::Receive::SubwordType, typename ConnectionParameter::Receive::PhywordType, typename ConnectionParameter::Receive::Dictionary, typename ConnectionParameter::ReceiveHalt>> listener_halt_type
typedef ConnectionRegistry<SimConnection> Registry

Registry of open SimConnections.

typedef std::queue<subpacket_type> send_queue_type
typedef flange::SimulatorEvent::al_data_t::value_type subpacket_type

Private Functions

template<typename InputIterator>
void add(InputIterator const &begin, InputIterator const &end)

Add multiple UT messages to the send queue.

Template Parameters

InputIterator – Iterator type to sequence of messages to add

Parameters
  • begin – Iterator to beginning of sequence

  • end – Iterator to end of sequence

void add(send_message_type const &message)

Add a single UT message to the send queue.

Parameters

message – Message to add

void commit()

Send messages in send queue.

std::mutex &get_mutex()

Get internal mutex to use for mutual exclusion.

Returns

Mutable reference to mutex

receive_queue_type receive_all()

Receive all UT messages currently in the receive queue.

Returns

Received messages

bool receive_empty() const

Get whether the connection has no UT messages available to receive.

Returns

Boolean value

void run_until_halt()

Start simulation and wait until halt instruction is received from simulation.

Throws

std::runtime_error – Simulation already running

void work_receive(flange::SimulatorClient &sim)

Private Members

duration_type m_commit_duration = {}
duration_type m_decode_duration = {}
decoder_type m_decoder
duration_type m_encode_duration = {}
encoder_type m_encoder
duration_type m_execution_duration = {}
listener_halt_type m_listener_halt
log4cxx::LoggerPtr m_logger
std::mutex m_mutex
receive_queue_type m_receive_queue
mutable std::mutex m_receive_queue_mutex
std::unique_ptr<Registry> m_registry
std::atomic<bool> m_run_receive
std::mutex m_runnable_mutex
send_queue_type m_send_queue
std::unique_ptr<flange::SimulatorClient> m_sim
bool m_terminate_on_destruction
std::thread m_worker_receive

Friends

friend class Stream< SimConnection >
struct hxcomm::SimConnection::ResetHaltListener

Public Functions

inline ResetHaltListener(listener_halt_type &listener)
inline ~ResetHaltListener()

Public Members

listener_halt_type &listener
struct hxcomm::SimConnection::ScopedSimulationRun

Public Functions

inline ScopedSimulationRun(flange::SimulatorClient &client, std::mutex &mutex)
inline ~ScopedSimulationRun()

Public Members

flange::SimulatorClient &client
std::unique_lock<std::mutex> lock
SignalOverrideIntTerm signal_override
template<typename Connection>
class hxcomm::Stream
#include <stream.h>

Interface definition as to how each connection can be interacted with.

The user is supposed to only be able to construct and destroy Connection handles on its own. Interaction is mitigated by the corresponding Stream<Connection>-object which is constructed by execute_messages

Note: The Stream<Connection>-interface is intended for hxcomm and its internal testing routines and not meant to be relied upon in upper layers!

Instead, interaction with upper layers happens via execute_messages(connection, messages). Here the specialized versions of Stream<Connection> that have to be derived from this class are instantiated.

By convention, Stream<Connection> is befriended by Connection and calls private functions of the same signature as its interface.

Template Parameters

Connection – Which connection object to use for operation.

Public Types

using connection_type = Connection
using message_types = typename GetMessageTypes<Connection>::type
using receive_message_type = typename message_types::receive_type
using send_message_type = typename message_types::send_type

Public Functions

inline Stream(connection_type &conn)

Construct a Stream for the given connection handle which it manages.

Lock connection-internal mutex to ensure mutual exclusion.

Stream(Stream const&) = delete

There can only be one Stream per connection.

template<typename InputIterator>
inline void add(InputIterator const begin, InputIterator const end)

Add multiple UT messages to the send queue.

Template Parameters

InputIterator – Iterator type to sequence of messages to add

Parameters
  • begin – Iterator to beginning of sequence

  • end – Iterator to end of sequence

template<typename MessageType>
inline void add(MessageType const &message)

Add a single UT message to the send queue.

Parameters

message – Message to add

inline void commit()

Send messages in send queue.

Stream &operator=(Stream const&) = delete

There can only be one Stream per connection.

inline receive_message_type receive()

Receive a single UT message.

Throws

std::runtime_error – On empty message queue

Returns

Received message

inline auto receive_all()

Receive all UT messages.

Returns

Received message queue

inline bool receive_empty() const

Get whether the connection has no UT messages available to receive.

Returns

Boolean value

inline void run_until_halt()

Start emulation and wait until halt instruction is received from simulation.

inline bool try_receive(receive_message_type &message)

Try to receive a single UT message.

Parameters

message – Message to receive to

Returns

Boolean value whether receive was successful

Protected Attributes

connection_type &m_connection
std::unique_lock<std::mutex> m_connection_lock
template<typename ConnType>
struct hxcomm::Stream::Streamable
#include <stream.h>

Public Types

template<typename InputIteratorT>
using has_add_iterator_method = typename std::is_same<decltype(std::declval<ConnType>().add(std::declval<InputIteratorT const&>(), std::declval<InputIteratorT const&>())), void>::type
template<typename MessageT>
using has_add_method = typename std::is_same<decltype(std::declval<ConnType>().add(std::declval<MessageT const&>())), void>::type
template<typename Connection>
struct hxcomm::StreamRC
#include <stream_rc.h>

StreamRC (pronounced “streamers”), is a class similiar to the Stream-class but with a Reduced and Custom interface for Remote exeCution.

Public Types

using connection_type = Connection
using submit_arg_type = detail::execute_messages_argument_t<connection_type>

Public Functions

inline StreamRC(connection_type &conn)

Construct a Stream for the given connection handle which it manages.

inline auto get_reinit_stack() const
inline auto get_reinit_upload() const
inline void reinit_enforce()
inline auto submit_async(submit_arg_type const &message)
inline auto submit_blocking(submit_arg_type const &message)

Protected Attributes

connection_type &m_connection
struct Check
#include <stream_rc.h>
template<typename C, typename = std::void_t<>>
struct has_method_get_reinit_stack : public std::false_type
#include <stream_rc.h>
template<typename C>
struct has_method_get_reinit_stack<C, std::void_t<decltype(std::declval<C&>().get_reinit_stack())>> : public std::true_type
#include <stream_rc.h>
template<typename C, typename = std::void_t<>>
struct has_method_get_reinit_uploader : public std::false_type
#include <stream_rc.h>
template<typename C>
struct has_method_get_reinit_uploader<C, std::void_t<decltype(std::declval<C&>().get_reinit_upload())>> : public std::true_type
#include <stream_rc.h>
template<typename C, typename = std::void_t<>>
struct has_method_reinit_enforce : public std::false_type
#include <stream_rc.h>
template<typename C>
struct has_method_reinit_enforce<C, std::void_t<decltype(std::declval<C&>().reinit_enforce())>> : public std::true_type
#include <stream_rc.h>
template<typename C, typename = std::void_t<>>
struct has_method_submit_async : public std::false_type
#include <stream_rc.h>
template<typename C>
struct has_method_submit_async<C, std::void_t<typename submit_async_return<C>::type>> : public std::true_type
#include <stream_rc.h>
template<typename, typename = std::void_t<>>
struct has_method_submit_blocking : public std::false_type
#include <stream_rc.h>
template<typename C>
struct has_method_submit_blocking<C, std::void_t<typename submit_blocking_return<C>::type>> : public std::true_type
#include <stream_rc.h>
template<typename C>
struct has_required_interface : public std::conjunction<has_method_submit_async<C>, has_method_submit_blocking<C>>
#include <stream_rc.h>
template<typename C>
struct hxcomm::StreamRC::Check::submit_async_return
#include <stream_rc.h>

Helper for template engine.

Public Types

using type = decltype(std::declval<C&>().submit_async(std::declval<submit_arg_type const&>()))
template<typename C>
struct hxcomm::StreamRC::Check::submit_blocking_return
#include <stream_rc.h>

Helper for template engine.

Public Types

using type = decltype(std::declval<C&>().submit_blocking(std::declval<submit_arg_type const&>()))
template<size_t HeaderAlignment, typename SubwordType, typename PhywordType, typename Dictionary>
struct ToUTMessageVariant

Get UT message variant type corresponding to UT message parameters.

Template Parameters
  • HeaderAlignment – Alignment of header in bits

  • SubwordType – Type of subword which’s width corresponds to the messages alignment

  • PhywordType – Type of PHY-word which’s width corresponds to the message’s minimal width

  • Dictionary – Dictionary of instructions

template<size_t HeaderAlignment, typename SubwordType, typename PhywordType, typename ...Is>
struct hxcomm::ToUTMessageVariant<HeaderAlignment, SubwordType, PhywordType, hate::type_list<Is...>>

Public Types

typedef std::variant<UTMessage<HeaderAlignment, SubwordType, PhywordType, hate::type_list<Is...>, Is>...> type
template<size_t HeaderAlignment, typename SubwordType, typename PhywordType, typename Dictionary, typename Instruction>
class hxcomm::UTMessage
#include <utmessage.h>

Container for a UT message used for host-FPGA communication.

It is aligned to subword width. The header is left-aligned, the payload is right-aligned. The leftmost header bit is reserved for a comma, which for valid UT messages is always set to false. The header is calculated as the instruction’s position in the dictionary.

Template Parameters
  • HeaderAlignment – Alignment of header in bits

  • SubwordType – Type of subword which’s width corresponds to the message’s alignment

  • PhywordType – Type of PHY-word which’s width corresponds to the message’s minimal width

  • Dictionary – Dictionary of instructions

  • Instruction – Instruction to encode in UT message

Public Types

typedef bool comma_type

Type of the valid field.

typedef Dictionary dictionary_type
typedef hate::bitset<header_width, SubwordType> header_type

Type of the header field.

typedef Instruction instruction_type
typedef hate::bitset<payload_width, SubwordType> payload_type

Type of the payload field.

typedef hate::bitset<word_width, SubwordType> word_type

Word-type of a UTMessage.

Public Functions

explicit constexpr UTMessage()

Default construct UTMessage with zeroed payload.

explicit constexpr UTMessage(payload_type const &payload)

Construct UTMessage with header and payload.

Parameters

payload – Payload bitset to fill UTMessage payload field with

explicit constexpr UTMessage(typename Instruction::Payload const &payload)

Construct UTMessage with header and payload.

Parameters

payload – Payload to fill UTMessage payload field with

constexpr Instruction::Payload decode() const

Decode message to its instruction’s payload type.

Returns

Payload of message

constexpr void encode(typename Instruction::Payload const &value)

Encode message from an instruction’s payload type.

Parameters

value – Payload to encode

constexpr payload_type get_payload() const

Get payload.

Returns

Bitset containing payload

constexpr word_type get_raw() const

Get underlying bitset.

Returns

Value of UTMessage as word_type

bool operator!=(UTMessage const &other) const

Inequality operator.

Parameters

otherUTMessage to compare to

Returns

Boolean result of comparison

bool operator==(UTMessage const &other) const

Equality operator.

Parameters

otherUTMessage to compare to

Returns

Boolean result of comparison

constexpr void set_payload(payload_type const &value)

Set payload.

Parameters

value – Bitset containing payload

Public Static Functions

static constexpr header_type get_header()

Get header.

Returns

Bitset containing header

Public Static Attributes

static constexpr size_t comma_width = 1

Number of bits of the comma.

static constexpr size_t header_width = UTMessageHeaderWidth<HeaderAlignment, Dictionary>::value

Number of bits of the header.

The comma sits left-aligned in the header.

static constexpr size_t num_subwords = hate::math::round_up_integer_division(header_width + Instruction::size, sizeof(SubwordType) * CHAR_BIT)

Number of subwords.

static constexpr size_t payload_width = Instruction::size

Number of bits of the payload field.

static constexpr size_t phyword_width = sizeof(PhywordType) * CHAR_BIT

Number of bits of a phyword.

static constexpr size_t subword_width = sizeof(SubwordType) * CHAR_BIT

Number of bits of a subword.

static constexpr size_t word_width   = ((subword_width * num_subwords) < phyword_width)?phyword_width                                          : (subword_width * num_subwords)

Total number of bits of a UTMessage.

If the calculated minimal size aligned to subword_width is smaller than phyword_width, round up to one full phyword_width, because the UT can process at most one UT message per PHY word.

Private Members

payload_type m_data
template<size_t HeaderAlignment, typename Dictionary>
struct hxcomm::UTMessageHeaderWidth

Get the header width corresponding to a given set of UT message parameters.

Template Parameters
  • HeaderAlignment – Alignment of header in bits

  • Dictionary – Dictionary of instructions

Public Static Attributes

static constexpr size_t value = hate::math::round_up_to_multiple(1 + hate::math::num_bits(hate::type_list_size<Dictionary>::value - 1), HeaderAlignment)
template<size_t HeaderAlignmentT, typename SubwordTypeT, typename PhywordTypeT, typename DictionaryT>
struct hxcomm::UTMessageParameter

Set of template parameters common to a UTMessage set.

Template Parameters
  • HeaderAlignmentT – Alignment of header in bits

  • SubwordTypeT – Type of subword which’s width corresponds to the message’s alignment

  • PhywordTypeT – Type of PHY-word which’s width corresponds to the message’s minimal width

  • DictionaryT – Dictionary of instructions

Public Types

typedef DictionaryT Dictionary
typedef PhywordTypeT PhywordType
typedef SubwordTypeT SubwordType

Public Static Attributes

static constexpr size_t HeaderAlignment = HeaderAlignmentT
struct hxcomm::vx::detail::QuiggeldyScheduleOutToInTransform

Public Types

using request_type = std::vector<UTMessageToFPGAVariant>
using response_type = std::vector<UTMessageFromFPGAVariant>

Public Functions

request_type operator()(response_type const &response, request_type const &snapshot)
class hxcomm::vx::EnsureLocalQuiggeldy

RAII-style helper to ensure a local quiggeldy instance is running.

Public Functions

EnsureLocalQuiggeldy()
~EnsureLocalQuiggeldy()

Private Members

pid_t m_quiggeldy_pid
port_t m_quiggeldy_port
template<template<size_t> class PackSpike, template<size_t> class PackMADC, typename IS>
struct GenerateDictionary
template<template<size_t> class PackSpike, template<size_t> class PackMADC, size_t... Is>
struct hxcomm::vx::instruction::event_from_fpga::detail::GenerateDictionary<PackSpike, PackMADC, std::index_sequence<Is...>>
#include <event_from_fpga.h>

Public Types

typedef hate::type_list<PackMADC<Is + 1>..., PackSpike<Is + 1>...> type
class hxcomm::vx::instruction::event_from_fpga::MADCSample
#include <event_from_fpga.h>

Type of one sample event.

Public Types

typedef hate::bitset<timestamp_size> Timestamp
typedef hate::bitset<14> Value
typedef hate::bitset<size> value_type

Public Functions

inline MADCSample()
inline MADCSample(Value const &value, Timestamp const &timestamp)
template<class SubwordType = unsigned long>
inline void decode(hate::bitset<size, SubwordType> const &data)
template<class SubwordType = unsigned long>
inline hate::bitset<size, SubwordType> encode() const
inline Timestamp const &get_timestamp() const
inline Value const &get_value() const
inline bool operator!=(MADCSample const &other) const
inline bool operator==(MADCSample const &other) const
inline void set_timestamp(Timestamp const &timestamp)
inline void set_value(Value const &value)

Public Static Attributes

static constexpr size_t size = value_size + timestamp_size
static constexpr size_t timestamp_size = 8
static constexpr size_t value_size = 16

Private Members

Timestamp m_timestamp
Value m_value

Friends

inline friend std::ostream &operator<<(std::ostream &os, MADCSample const &value)
template<size_t num_samples>
struct hxcomm::vx::instruction::event_from_fpga::MADCSamplePack
#include <event_from_fpga.h>

Public Types

typedef MADCSamplePackPayload<num_samples> Payload

Public Static Attributes

static constexpr size_t size = MADCSamplePackPayload<num_samples>::size
template<size_t num_samples>
class hxcomm::vx::instruction::event_from_fpga::MADCSamplePackPayload
#include <event_from_fpga.h>

Payload of a madc_sample_pack instruction.

Public Types

typedef std::array<MADCSample, num_samples> samples_type
typedef hate::bitset<size> value_type

Public Functions

inline MADCSamplePackPayload()
inline MADCSamplePackPayload(samples_type const &samples)
template<class SubwordType = unsigned long>
inline void decode(hate::bitset<size, SubwordType> const &data)
template<class SubwordType = unsigned long>
inline hate::bitset<size, SubwordType> encode() const
inline samples_type const &get_samples() const
inline bool operator!=(MADCSamplePackPayload const &other) const
inline bool operator==(MADCSamplePackPayload const &other) const
inline void set_samples(samples_type const &samples)

Public Static Attributes

static constexpr size_t size = MADCSample::size * num_samples

Private Members

samples_type m_samples

Friends

inline friend std::ostream &operator<<(std::ostream &os, MADCSamplePackPayload const &value)
class hxcomm::vx::instruction::event_from_fpga::Spike
#include <event_from_fpga.h>

Type of one spike event.

Public Types

typedef hate::bitset<event_constants::spike_size> spike_type
typedef hate::bitset<timestamp_size> Timestamp
typedef hate::bitset<size> value_type

Public Functions

inline Spike()
inline Spike(spike_type const &spike, Timestamp const &timestamp)
template<class SubwordType = unsigned long>
inline void decode(hate::bitset<size, SubwordType> const &data)
template<class SubwordType = unsigned long>
inline hate::bitset<size, SubwordType> encode() const
inline spike_type const &get_spike() const
inline Timestamp const &get_timestamp() const
inline bool operator!=(Spike const &other) const
inline bool operator==(Spike const &other) const
inline void set_spike(spike_type const &spike)
inline void set_timestamp(Timestamp const &timestamp)

Public Static Attributes

static constexpr size_t size = event_constants::spike_size + timestamp_size
static constexpr size_t timestamp_size = 8

Private Members

spike_type m_spike
Timestamp m_timestamp

Friends

inline friend std::ostream &operator<<(std::ostream &os, Spike const &value)
template<size_t num_spikes>
struct hxcomm::vx::instruction::event_from_fpga::SpikePack
#include <event_from_fpga.h>

Public Types

typedef SpikePackPayload<num_spikes> Payload

Public Static Attributes

static constexpr size_t size = SpikePackPayload<num_spikes>::size
template<size_t num_spikes>
class hxcomm::vx::instruction::event_from_fpga::SpikePackPayload
#include <event_from_fpga.h>

Payload of a spike_pack instruction.

Public Types

typedef std::array<Spike, num_spikes> spikes_type
typedef hate::bitset<size> value_type

Public Functions

inline SpikePackPayload()
inline SpikePackPayload(spikes_type const &spikes)
template<class SubwordType = unsigned long>
inline void decode(hate::bitset<size, SubwordType> const &data)
template<class SubwordType = unsigned long>
inline hate::bitset<size, SubwordType> encode() const
inline spikes_type const &get_spikes() const
inline bool operator!=(SpikePackPayload const &other) const
inline bool operator==(SpikePackPayload const &other) const
inline void set_spikes(spikes_type const &spikes)

Public Static Attributes

static constexpr size_t size = Spike::size * num_spikes

Private Members

spikes_type m_spikes

Friends

inline friend std::ostream &operator<<(std::ostream &os, SpikePackPayload const &value)
template<template<size_t> class Pack, typename IS>
struct GenerateDictionary
template<template<size_t> class Pack, size_t... Is>
struct hxcomm::vx::instruction::event_to_fpga::detail::GenerateDictionary<Pack, std::index_sequence<Is...>>
#include <event_to_fpga.h>

Public Types

typedef hate::type_list<Pack<Is + 1>...> type
template<size_t num_spikes>
struct hxcomm::vx::instruction::event_to_fpga::SpikePack
#include <event_to_fpga.h>

Packed spike to FPGA instruction.

Public Types

typedef SpikePackPayload<num_spikes> Payload

Public Static Attributes

static constexpr size_t size = SpikePackPayload<num_spikes>::size
template<size_t num_spikes>
class hxcomm::vx::instruction::event_to_fpga::SpikePackPayload
#include <event_to_fpga.h>

Payload of a SpikePack instruction.

Public Types

typedef std::array<hate::bitset<event_constants::spike_size>, num_spikes> spikes_type
typedef hate::bitset<size> value_type

Public Functions

inline SpikePackPayload()
inline SpikePackPayload(spikes_type const &spikes)
template<class SubwordType = unsigned long>
inline void decode(hate::bitset<size, SubwordType> const &data)
template<class SubwordType = unsigned long>
inline hate::bitset<size, SubwordType> encode() const
inline spikes_type const &get_spikes() const
inline bool operator!=(SpikePackPayload const &other) const
inline bool operator==(SpikePackPayload const &other) const
inline void set_spikes(spikes_type const &spikes)

Public Static Attributes

static constexpr size_t size = event_constants::spike_size * num_spikes

Private Members

spikes_type m_spikes

Friends

inline friend std::ostream &operator<<(std::ostream &os, SpikePackPayload const &value)
struct hxcomm::vx::instruction::from_fpga_system::HighspeedLinkNotification
#include <from_fpga_system.h>

Highspeed-Link notifications.

Public Static Attributes

static constexpr size_t size = 8
struct hxcomm::vx::instruction::from_fpga_system::Loopback
#include <from_fpga_system.h>

Trace-marker response to a system::Loopback packet.

Public Types

typedef hxcomm::instruction::detail::payload::Bitset<Loopback, size> Payload

Public Static Attributes

static constexpr Payload halt = {0}
static constexpr size_t size = 1
static constexpr Payload tick = {1}
struct hxcomm::vx::instruction::from_fpga_system::TimeoutNotification
#include <from_fpga_system.h>

Instruction timeout notification.

Public Types

typedef hxcomm::instruction::detail::payload::Number<TimeoutNotification, value_type> Payload
typedef uint32_t value_type

Public Static Attributes

static constexpr size_t size = sizeof(value_type) * CHAR_BIT
struct hxcomm::vx::instruction::jtag_from_hicann::Data
#include <jtag_from_hicann.h>

Response to a to_fpga_jtag::Data packet, if keep_response is true.

Public Types

typedef hxcomm::instruction::detail::payload::Bitset<Data, size> Payload

Public Static Attributes

static constexpr size_t size = 33
struct hxcomm::vx::instruction::omnibus_from_fpga::Data

Response to a omnibus_to_fpga::Address packet, if is_read is true.

Public Types

typedef hxcomm::instruction::detail::payload::Number<Data, value_type> Payload
typedef uint32_t value_type

Public Static Attributes

static constexpr size_t size = sizeof(value_type) * CHAR_BIT
struct hxcomm::vx::instruction::omnibus_to_fpga::Address
#include <omnibus_to_fpga.h>

Instruction to set Omnibus address for a read or write operation.

On read this instruction leads to a read response. On write, data is to be provided with a following ‘Data’ instruction. To the FPGA, byte enables can be used to select byte transmission.

Public Static Attributes

static constexpr size_t size = 37
class hxcomm::vx::instruction::omnibus_to_fpga::Address::Payload
#include <omnibus_to_fpga.h>

Public Functions

inline explicit Payload(uint32_t const address = 0, bool const is_read = false, hate::bitset<sizeof(uint32_t)> const byte_enables = 0xf)
template<class SubwordType = unsigned long>
inline void decode(hate::bitset<size, SubwordType> const &data)
template<class SubwordType = unsigned long>
inline hate::bitset<size, SubwordType> encode() const
inline bool get_is_read() const
inline bool operator!=(Payload const &other) const
inline bool operator==(Payload const &other) const
inline void set_is_read(bool value)

Private Members

uint32_t m_address
hate::bitset<sizeof(uint32_t)> m_byte_enables
bool m_is_read

Friends

inline friend std::ostream &operator<<(std::ostream &os, Payload const &value)
struct hxcomm::vx::instruction::omnibus_to_fpga::Data
#include <omnibus_to_fpga.h>

Write data to a beforehand specified Omnibus address.

Write response filtering can be disabled by setting the lowest bit of omnibus on FPGA address 0 to false.

Public Types

typedef hxcomm::instruction::detail::payload::Number<Data, uint32_t> Payload

Public Static Attributes

static constexpr size_t size = sizeof(uint32_t) * CHAR_BIT
struct hxcomm::vx::instruction::system::Loopback
#include <system.h>

Instruction generating a Loopback response.

Public Types

typedef hxcomm::instruction::detail::payload::Bitset<Loopback, size> Payload

Public Static Attributes

static constexpr Payload halt = {0}
static constexpr size_t size = 1
static constexpr Payload tick = {1}
struct hxcomm::vx::instruction::system::Reset
#include <system.h>

Instruction to set reset register.

True enables the reset.

Public Types

typedef hxcomm::instruction::detail::payload::Bitset<Reset, size> Payload

Public Static Attributes

static constexpr size_t size = 1
struct hxcomm::vx::instruction::timing::Barrier
#include <timing.h>

Block further execution until specified set of communication channels is idle.

Public Types

typedef hxcomm::instruction::detail::payload::Bitset<Barrier, size> Payload

Public Static Attributes

static constexpr Payload jtag = {0b00010}
static constexpr Payload multi_fpga = {0b01000}
static constexpr Payload omnibus = {0b00001}
static constexpr size_t size = 5
static constexpr Payload systime = {0b00100}
static constexpr Payload systime_correction = {0b10000}
struct hxcomm::vx::instruction::timing::PollingOmnibusBlock
#include <timing.h>

Block further execution until specified Omnibus address has value & mask == target.

Configuration is found in the FPGA Omnibus register file of the executor.

Public Types

typedef hxcomm::instruction::detail::payload::Bitset<PollingOmnibusBlock, size> Payload

Public Static Attributes

static constexpr size_t size = 1
struct hxcomm::vx::instruction::timing::Setup
#include <timing.h>

Initialize timer to 0.

Public Types

typedef hxcomm::instruction::detail::payload::Bitset<Setup, size> Payload

Public Static Attributes

static constexpr size_t size = 0
struct hxcomm::vx::instruction::timing::SystimeInit
#include <timing.h>

Syncronize ASIC time with FPGA time.

Public Types

typedef hxcomm::instruction::detail::payload::Bitset<SystimeInit, size> Payload

Public Static Attributes

static constexpr size_t size = 1
struct hxcomm::vx::instruction::timing::WaitUntil
#include <timing.h>

Block further execution until incrementing timer reaches specified count.

Public Types

typedef hxcomm::instruction::detail::payload::Number<WaitUntil, value_type> Payload
typedef uint32_t value_type

Public Static Attributes

static constexpr size_t size = sizeof(value_type) * CHAR_BIT
struct hxcomm::vx::instruction::timing_from_fpga::Sysdelta
#include <timing_from_fpga.h>

Delta time update.

Public Types

typedef hxcomm::instruction::detail::payload::Bitset<Sysdelta, size> Payload

Public Static Attributes

static constexpr size_t size = 8
struct hxcomm::vx::instruction::timing_from_fpga::Systime
#include <timing_from_fpga.h>

Full systime update.

Public Types

typedef hxcomm::instruction::detail::payload::Bitset<Systime, size> Payload

Public Static Attributes

static constexpr size_t size = 43
struct hxcomm::vx::instruction::to_fpga_jtag::Data
#include <to_fpga_jtag.h>

Data instruction.

Public Static Attributes

static constexpr size_t max_num_bits_payload = 33
static constexpr size_t min_num_bits_payload = 3
static constexpr size_t padded_num_bits_keep_response = hate::math::round_up_to_multiple(1, CHAR_BIT)
static constexpr size_t padded_num_bits_num_bits_payload = hate::math::round_up_to_multiple(hate::math::num_bits(max_num_bits_payload), CHAR_BIT)
static constexpr size_t padded_num_bits_payload = hate::math::round_up_to_multiple(max_num_bits_payload, CHAR_BIT)
static constexpr size_t size = padded_num_bits_payload + padded_num_bits_num_bits_payload + padded_num_bits_keep_response
class hxcomm::vx::instruction::to_fpga_jtag::Data::Payload
#include <to_fpga_jtag.h>

Payload of a data instruction.

Public Types

typedef rant::integral_range<uint_fast8_t, max_num_bits_payload, min_num_bits_payload> NumBits

Select the amount of bits of payload field to be shifted in instruction register previously selected by an ins instruction.

typedef hate::bitset<size> value_type

Public Functions

inline Payload(bool const keep_response = false, NumBits const num_bits = NumBits(max_num_bits_payload), hate::bitset<max_num_bits_payload> const payload = 0u)
template<class SubwordType = unsigned long>
inline void decode(hate::bitset<size, SubwordType> const &data)
template<class SubwordType = unsigned long>
inline hate::bitset<size, SubwordType> encode() const
inline bool get_keep_response() const
inline NumBits get_num_bits() const
inline hate::bitset<max_num_bits_payload> get_payload() const
inline bool operator!=(Payload const &other) const
inline bool operator==(Payload const &other) const
inline void set_keep_response(bool const value)
inline void set_num_bits(NumBits const value)
inline void set_payload(hate::bitset<max_num_bits_payload> const &value)

Private Members

bool m_keep_response

Select whether to keep the JTAG_from_hicann::data response.

NumBits m_num_bits
hate::bitset<max_num_bits_payload> m_payload

Data to be inserted into the previously selected instruction register.

Friends

inline friend std::ostream &operator<<(std::ostream &os, Payload const &value)
struct hxcomm::vx::instruction::to_fpga_jtag::Init
#include <to_fpga_jtag.h>

Reset state machine.

Public Types

typedef hxcomm::instruction::detail::payload::Bitset<Init, size> Payload

Public Static Attributes

static constexpr size_t size = 0
struct hxcomm::vx::instruction::to_fpga_jtag::Ins
#include <to_fpga_jtag.h>

Select instruction register on the Hicann.

Public Types

typedef hxcomm::instruction::detail::payload::Bitset<Ins, size> Payload

Public Static Attributes

static constexpr Payload BYPASS = {127}
static constexpr Payload EXTEST = {0}
static constexpr Payload IDCODE = {1}
static constexpr Payload OMNIBUS_ADDRESS = {5}
static constexpr Payload OMNIBUS_DATA = {6}
static constexpr Payload OMNIBUS_REQUEST = {7}
static constexpr Payload PLL_TARGET_REG = {3}
static constexpr Payload SAMPLE_PRELOAD = {2}
static constexpr Payload SHIFT_PLL = {4}
static constexpr size_t size = 7
struct hxcomm::vx::instruction::to_fpga_jtag::Scaler
#include <to_fpga_jtag.h>

Set slow-down scaling factor of clock of the JTAG communication.

Public Types

typedef hxcomm::instruction::detail::payload::Number<Scaler, value_type> Payload
typedef uint8_t value_type

Public Static Attributes

static constexpr size_t size = sizeof(value_type) * CHAR_BIT
template<typename ConnectionParameter>
class hxcomm::ZeroMockConnection

Connection returning zero’ed data on read requests, discarding all other messages.

We do not model experiment prebuffering, i.e. only message processing contributes to the execution_duration measurement.

Template Parameters

ConnectionParameter – UT message parameter for connection

Public Types

using message_types = MessageTypes<ConnectionParameter>
using receive_message_type = typename message_types::receive_type
typedef std::vector<receive_message_type> receive_queue_type
using send_halt_message_type = typename message_types::send_halt_type
using send_message_type = typename message_types::send_type

Public Functions

ZeroMockConnection(long ns_per_message = 8)

Construct zero mock connection.

The time spent with processing each incoming message can be adjusted to simulate different data communication speeds.

Parameters

ns_per_message – Time goal to spent with processing each incoming message. The specified goal may not be reached as it is only an upper bound to the rate of processed messages and the actually reachable performance depends on the used host computer and its load.

ZeroMockConnection(ZeroMockConnection &&other)
ZeroMockConnection(ZeroMockConnection const&) = delete
~ZeroMockConnection() = default
std::string get_bitfile_info() const

Get bitfile information.

Returns “zeromock” for ZeroMockConnection

Returns

Bitfile info

std::string get_remote_repo_state() const

Get server-side remote repository state information.

Only non-empty for QuiggeldyConnection.

Returns

Repository state

ConnectionTimeInfo get_time_info() const

Get time information.

Returns

Time information

std::string get_unique_identifier(std::optional<std::string> hwdb_path = std::nullopt) const

Get unique identifier from hwdb.

Parameters

hwdb_path – Optional path to hwdb

Returns

Unique identifier

ZeroMockConnection &operator=(ZeroMockConnection &&other)
ZeroMockConnection &operator=(ZeroMockConnection const&) = delete

Public Static Attributes

static constexpr char name[] = "ZeroMockConnection"
static constexpr auto supported_targets = {Target::hardware, Target::simulation}

Private Types

typedef std::vector<send_message_type> send_queue_type

Private Functions

template<typename InputIterator>
void add(InputIterator const &begin, InputIterator const &end)

Add multiple UT messages to the send queue.

Template Parameters

InputIterator – Iterator type to sequence of messages to add

Parameters
  • begin – Iterator to beginning of sequence

  • end – Iterator to end of sequence

void add(send_message_type const &message)

Add a single UT message to the send queue.

Parameters

message – Message to add

void commit()

Send messages in send queue.

std::mutex &get_mutex()

Get internal mutex to use for mutual exclusion.

Returns

Mutable reference to mutex

receive_queue_type receive_all()

Receive all UT messages.

Returns

Received messages

bool receive_empty() const

Get whether the connection has no UT messages available to receive.

Returns

Boolean value

void run_until_halt()

Start execution and wait until halt instruction.

Private Members

bool m_halt
size_t m_last_message_count

Message count since last run_until_halt() invokation used to calculate the amount of time to spend in the current invokation in order to match specified rate of processed UT messages.

ConnectionTimeInfo m_last_time_info
std::mutex m_mutex
long m_ns_per_message
detail::ZeroMockProcessMessage<ConnectionParameter> m_process_message
receive_queue_type m_receive_queue
send_queue_type m_send_queue
ConnectionTimeInfo m_time_info
friend Stream< ZeroMockConnection >
namespace cereal
namespace hate
namespace hxcomm

Typedefs

template<typename ConnectionVariant>
using ConnectionFullStreamInterfaceVariant = hate::type_list_to_t<std::variant, hate::filter_type_list_t<hxcomm::supports_full_stream_interface, hate::type_list_from_t<ConnectionVariant>>>
template<typename Connection>
using ConnectionIsPlainGuard = std::enable_if_t<ConnectionIsPlain<std::remove_cvref_t<Connection>>::value, int>

Indicate whether supplied connection type is a plain Connection object that can be acted upon.

It is intended to be used as a defaulted template argument and needs a default in parameter (e.g. 0).

template<typename Connection>
using ConnectionIsWrappedGuard = std::enable_if_t<!ConnectionIsPlain<std::remove_cvref_t<Connection>>::value, int>

Indicate whether supplied connection type is wrapped up and needs to be unwrapped in some kind (e.g.

in a variant that needs to be visited).

It is intended to be used as a defaulted template argument and needs a default in parameter (e.g. 0).

typedef std::string ip_t
typedef uint64_t largest_ut_message_subword_type

Largest SubwordType supported by the UTMessage implementation.

typedef uint16_t port_t
template<typename Connection>
using supports_full_stream_interface = detail::supports_full_stream_interface<std::decay_t<Connection>>

Helper function to distinguish between connections expected to implement the whole Stream interface as above and those with a custom execute_messages-implementation.

Enums

enum class Target

Target describing that given object which is annotated supports a specified target for e.g.

execution.

Values:

enumerator hardware
enumerator simulation

Functions

template<typename Connection, ConnectionIsWrappedGuard<Connection> = 0>
detail::execute_messages_return_t<Connection> execute_messages(Connection &&connection, detail::execute_messages_argument_t<Connection> const &messages, bool const keep_responses = false)
template<typename Connection, ConnectionIsPlainGuard<Connection> = 0>
detail::execute_messages_return_t<Connection> execute_messages(Connection &connection, detail::execute_messages_argument_t<Connection> const &messages, bool const keep_responses = false)

Execute the given messages on the given connection.

This function is specialized for each architecture in the corresponding hxcomm/<architecture>/execute_messages.h header or - if needed - in the connection-header itself. This function makes use of Stream, which locks the connection by acquiring the mutex via connection.get_mutex() to ensure mutual exclusion of access.

Template Parameters
  • Connection – The connection on which the messages are executed.

  • Sequence – In which sequential container should the messages be stored.

std::string get_fpga_ip()

Get FPGA IP available via the environment.

Returns

FPGA IP as string

std::vector<std::string> get_fpga_ip_list()

Get list of FPGA IPs available via the environment.

Returns

Vector of FPGA IPs as strings

std::optional<std::size_t> get_loglevel_from_env(char const *env_var = "QUIGGELDY_LOGLEVEL")

Get an integer representation of the loglevel variable from environment.

If the environmental variable is defined but contains an invalid value, a notification is printed to stderr.

Parameters

env_var – Name of the environment variable from which to get the loglevel.

Returns

Integer representation of the loglevel in case it is defined and a valid level.

char const *get_munge_socket()

Get the munge socket to connect to.

Returns

Path to munge socket to use. Either the default or the one specified via environment.

std::string get_repo_state()
std::tuple<std::string, uint16_t> get_sim_parameters()

Get simulator IP and port via the environment.

Returns

Parameters

hxcomm::port_t get_unused_port()

Get a free port number to use for tests, on success, return open port.

On error, throw runtime_error.

bool is_munge_available()

Check for availability of munge by checking if the default munge socket (or the one specified by the environment does exist).

bool is_munge_available).

This is useful to disable munge authentication in testing environments where munge is not running.

Returns

whether munge is available or not.

template<class ...Args>
pid_t setup_quiggeldy(char const *binary_name, uint16_t port, Args... args)

Convenience function to setup quiggeldy under the given port with additional arguments.

Parameters
  • binary_name – name of the binary to launch

  • port – The port on which quiggeldy should listen.

  • args – Additional arguments to give to quiggeldy (should be C-strings).

Returns

PID of started subprocess running quiggeldy.

void terminate(pid_t pid)

Terminate given pid.

Parameters

pid – The quiggeldy PID to terminate.

template<typename Visitor, typename Connection>
detail::VisitConnection<Visitor, Connection>::return_type visit_connection(Visitor &&visitor, Connection &&connection)

Vist a connection that might be wrapped inside a variant or proxified.

Parameters
  • visitor – must be a Callable with templated operator() so that it can be applied to the extracted connection underneath.

  • connection – The connection to visit.

Variables

static constexpr size_t quiggeldy_max_message_length = 1280 * 1024 * 1024

Max message length should be at least as long as the FPGA memory filled with results (and then some).

namespace hxcomm::detail

Typedefs

template<typename Connection>
using execute_messages_argument_t = typename ExecuteMessagesArgumentType<Connection>::type
template<typename Connection>
using execute_messages_return_t = typename ExecuteMessagesReturnType<Connection>::type
template<typename T>
using variant_to_ref_t = typename variant_to_ref<T>::type

Variables

template<typename ...Ts>
static constexpr bool all_char_const_ptr_v = all_char_const_ptr<Ts...>::value
namespace instruction
namespace detail
namespace payload

Payload formatting.

Each payload type defines a value_type used for encoding the payload to a bitstream. The encode member function encodes payload data to a bitstream. The decode member fucntion decodes a bitstream to payload data.

namespace hxcomm::random

Functions

template<typename PayloadType>
PayloadType random_payload(std::mt19937 gen = std::mt19937(std::random_device{}()))

Generate a payload type with random value(s).

Template Parameters

PayloadType – Type of payload

Parameters

gen – Random number generator

Returns

Random payload

template<typename Tag, size_t N>
hxcomm::instruction::detail::payload::Bitset<Tag, N> random_payload(type<hxcomm::instruction::detail::payload::Bitset<Tag, N>>, std::mt19937 gen)

Generate a Bitset payload type with random value.

Template Parameters
  • Tag – Tag of instruction for type-safety

  • N – Number of bits of Bitset paylaod

Parameters

gen – Random number generator

Returns

Random payload

template<typename Tag, typename T>
hxcomm::instruction::detail::payload::Number<Tag, T> random_payload(type<hxcomm::instruction::detail::payload::Number<Tag, T>>, std::mt19937 gen)

Generate a Number payload type with random value.

Template Parameters
  • Tag – Tag of instruction for type-safety

  • T – Number base type

Parameters

gen – Random number generator

Returns

Random payload

template<typename PayloadType>
PayloadType random_payload(type<PayloadType> proxy, std::mt19937 gen) = delete

Generate a payload type with random value(s).

Template Parameters

PayloadType – Type of payload

Parameters
  • proxy – Type proxy to payload type

  • gen – Random number generator

Returns

Random payload

template<size_t NumPack>
hxcomm::vx::instruction::event_from_fpga::MADCSamplePackPayload<NumPack> random_payload(type<typename hxcomm::vx::instruction::event_from_fpga::MADCSamplePackPayload<NumPack>>, std::mt19937 gen)
template<size_t NumPack>
hxcomm::vx::instruction::event_from_fpga::SpikePackPayload<NumPack> random_payload(type<typename hxcomm::vx::instruction::event_from_fpga::SpikePackPayload<NumPack>>, std::mt19937 gen)
template<size_t NumPack>
hxcomm::vx::instruction::event_to_fpga::SpikePackPayload<NumPack> random_payload(type<typename hxcomm::vx::instruction::event_to_fpga::SpikePackPayload<NumPack>>, std::mt19937 gen)
hxcomm::vx::instruction::omnibus_to_fpga::Address::Payload random_payload(type<typename hxcomm::vx::instruction::omnibus_to_fpga::Address::Payload>, std::mt19937 gen)
hxcomm::vx::instruction::to_fpga_jtag::Data::Payload random_payload(type<typename hxcomm::vx::instruction::to_fpga_jtag::Data::Payload>, std::mt19937 gen)
template<typename PayloadType>
PayloadType random_payload_non_default(PayloadType const default_payload = PayloadType(), std::mt19937 gen = std::mt19937(std::random_device{}()))

Generate a payload type with random value(s) unequal to provided default value(s).

Template Parameters

PayloadType – Type of payload

Parameters
  • default_payload – Default payload value to exclude from random draw

  • gen – Random number generator

Returns

Random payload

template<typename UTMessageParameter>
auto random_ut_message(std::mt19937 &gen) -> typename default_ut_message<UTMessageParameter>::message_type

Generate a random UTMessage of the provided dictionary with random payload.

Template Parameters

UTMessageParameter – Parameter of UTMessage collection

Parameters

gen – Random number generator

Returns

Random UT message with random payload

namespace hxcomm::vx

Typedefs

using ARQConnection = hxcomm::ARQConnection<ConnectionParameter>
using ConnectionFullStreamInterfaceVariant = hxcomm::ConnectionFullStreamInterfaceVariant<ConnectionVariant>
typedef hxcomm::ConnectionParameter<ut_message_to_fpga_header_alignment, ut_message_to_fpga_subword_type, ut_message_to_fpga_phyword_type, instruction::ToFPGADictionary, instruction::system::Loopback, ut_message_from_fpga_header_alignment, ut_message_from_fpga_subword_type, ut_message_from_fpga_phyword_type, instruction::FromFPGADictionary, instruction::from_fpga_system::Loopback, instruction::from_fpga_system::TimeoutNotification, detail::QuiggeldyScheduleOutToInTransform> ConnectionParameter
using ConnectionVariant = std::variant<hxcomm::vx::SimConnection, hxcomm::vx::QuiggeldyConnection, hxcomm::vx::ZeroMockConnection>
using quiggeldy_interface_types = hxcomm::quiggeldy_interface_types<hxcomm::vx::ConnectionParameter>
using QuiggeldyConnection = hxcomm::QuiggeldyConnection<hxcomm::vx::ConnectionParameter, hxcomm::vx::detail::rcf_client_type>
template<typename Connection>
using QuiggeldyServer = hxcomm::QuiggeldyServer<Connection>
template<typename Connection>
using QuiggeldyWorker = hxcomm::QuiggeldyWorker<Connection>
using ReinitStackEntry = hxcomm::ReinitStackEntry<hxcomm::vx::QuiggeldyConnection, hxcomm::vx::ConnectionVariant>
using SimConnection = hxcomm::SimConnection<ConnectionParameter>
typedef hxcomm::Target Target
typedef uint64_t ut_message_from_fpga_phyword_type
typedef uint8_t ut_message_from_fpga_subword_type
typedef uint64_t ut_message_to_fpga_phyword_type
typedef uint64_t ut_message_to_fpga_subword_type
template<typename I>
using UTMessageFromFPGA = UTMessage<ut_message_from_fpga_header_alignment, ut_message_from_fpga_subword_type, ut_message_from_fpga_phyword_type, instruction::FromFPGADictionary, I>
using UTMessageFromFPGAVariant = ToUTMessageVariant<ut_message_from_fpga_header_alignment, ut_message_from_fpga_subword_type, ut_message_from_fpga_phyword_type, instruction::FromFPGADictionary>::type
template<typename I>
using UTMessageToFPGA = UTMessage<ut_message_to_fpga_header_alignment, ut_message_to_fpga_subword_type, ut_message_to_fpga_phyword_type, instruction::ToFPGADictionary, I>
using UTMessageToFPGAVariant = ToUTMessageVariant<ut_message_to_fpga_header_alignment, ut_message_to_fpga_subword_type, ut_message_to_fpga_phyword_type, instruction::ToFPGADictionary>::type
using ZeroMockConnection = hxcomm::ZeroMockConnection<ConnectionParameter>

Functions

hxcomm::vx::ConnectionVariant get_connection_from_env()

Automatically determine from environment what connection type to use and return the corresponding variant.

Order of precedence is ZeroMockConnection > QuiggeldyConnection > HostARQ-connected hardware > CoSim right now if several are available.

On the Python-side it is wrapped via ManagedConnection.

Returns

An already allocated connection object.

std::optional<hxcomm::vx::ConnectionFullStreamInterfaceVariant> get_connection_full_stream_interface_from_env()

Get the connection from env and check if it supports the full stream interface.

If so, return it wrapped in an optional, otherwise the optional is empty.

Returns

Optional wrapping the connection object with support for the full stream interface, empty otherwise.

std::vector<hxcomm::vx::ConnectionVariant> get_connection_list_from_env(std::optional<size_t> limit = std::nullopt)

Automatically determine from environment what connection type to use and return the corresponding variant list.

Order of precedence is HardwareBackend > CoSim right now if both are available.

Returns

A list of already allocated connection objects.

std::tuple<pid_t, hxcomm::port_t> launch_quiggeldy_locally_from_env()

Launch a local quiggeldy without slurm allocation and debug output based on current env settings.

The environment will be modified so that default constructed QuiggeldyConnection-instances automatically connect to it.

The release idle timeout is set to a day so that for all testing purposes a single connection will be used.

Returns

Tuple of process ID and port of launched quiggeldy process and the port it is listening on.

RRWR_GENERATE_INTERFACE_EXPLICIT_TYPES (I_HXCommQuiggeldyVX, typename quiggeldy_interface_types::response_type, typename quiggeldy_interface_types::request_type, typename quiggeldy_interface_types::reinit_type) namespace detail
void unset_quiggeldy_env()

Unset environment variables of quiggeldy.

Variables

constexpr size_t ut_message_from_fpga_header_alignment = 8
constexpr size_t ut_message_to_fpga_header_alignment = 8
namespace detail
namespace hxcomm::vx::instruction

Typedefs

typedef hate::multi_concat_t<jtag_from_hicann::Dictionary, omnibus_from_fpga::Dictionary, from_fpga_system::Dictionary, timing_from_fpga::Dictionary, event_from_fpga::Dictionary> FromFPGADictionary

Dictionary containing all from_fpga instruction subsets.

typedef hate::multi_concat_t<to_fpga_jtag::Dictionary, timing::Dictionary, system::Dictionary, omnibus_to_fpga::Dictionary, event_to_fpga::Dictionary> ToFPGADictionary

Dictionary containing all to_fpga instruction subsets.

namespace hxcomm::vx::instruction::event_constants

Constants for event instructions to and from the FPGA.

Variables

constexpr size_t max_num_packed = 3
constexpr size_t spike_size = 16
namespace hxcomm::vx::instruction::event_from_fpga

Instructions for events from the FPGA.

Typedefs

typedef detail::GenerateDictionary<SpikePack, MADCSamplePack, std::make_index_sequence<event_constants::max_num_packed>>::type Dictionary

Dictionary of all events from FPGA instructions.

namespace detail
namespace hxcomm::vx::instruction::event_to_fpga

Instructions for events to the FPGA.

Typedefs

typedef detail::GenerateDictionary<SpikePack, std::make_index_sequence<event_constants::max_num_packed>>::type Dictionary

Dictionary of all events to FPGA instructions.

namespace detail
namespace hxcomm::vx::instruction::from_fpga_system

FPGA system responses to the host.

Typedefs

typedef hate::type_list<Loopback, HighspeedLinkNotification, TimeoutNotification> Dictionary

Dictionary of all FPGA system response instructions.

namespace hxcomm::vx::instruction::jtag_from_hicann

JTAG responses transported back to the host.

Typedefs

typedef hate::type_list<Data> Dictionary

Dictionary of all jtag_from_hicann instructions.

namespace hxcomm::vx::instruction::omnibus_from_fpga

Omnibus from FPGA responses transported back to the host.

Typedefs

typedef hate::type_list<Data> Dictionary

Dictionary of all omnibus from FPGA instructions.

namespace hxcomm::vx::instruction::omnibus_to_fpga

Instructions for omnibus communication to the FPGA.

Typedefs

typedef hate::type_list<Address, Data> Dictionary

Dictionary of all Omnibus to FPGA instructions.

namespace hxcomm::vx::instruction::system

Instructions for setting up an experiment.

Typedefs

typedef hate::type_list<Reset, Loopback> Dictionary

Dictionary of all system instructions.

namespace hxcomm::vx::instruction::timing

Instructions controlling the timing of execution of commands.

Typedefs

typedef hate::type_list<Setup, WaitUntil, SystimeInit, Barrier, PollingOmnibusBlock> Dictionary

Dictionary of all timing instructions.

namespace hxcomm::vx::instruction::timing_from_fpga

Timing response instructions from the FPGA.

Typedefs

typedef hate::type_list<Systime, Sysdelta> Dictionary

Dictionary of all timing response instructions from the FPGA.

namespace hxcomm::vx::instruction::to_fpga_jtag

JTAG instructions to the fpga.

Typedefs

typedef hate::type_list<Init, Scaler, Ins, Data> Dictionary

Dictionary of all to_fpga_jtag instructions.

namespace log4cxx

Typedefs

typedef std::shared_ptr<Logger> LoggerPtr
namespace rcf_extensions
namespace SF

Functions

void serialize(Archive &ar, hxcomm::vx::quiggeldy_interface_types::reinit_entry_type &qcr)
void serialize(Archive &ar, hxcomm::vx::quiggeldy_interface_types::request_type &qcr)
void serialize(Archive &ar, hxcomm::vx::quiggeldy_interface_types::response_type &qcr)
template<class T>
void translate_sf_cereal(Archive &ar, T &cerealizable)

Serialize any object that can be serialized by cereal to SF.

namespace std

STL namespace.

namespace chrono_literals
file cerealization.h
#include <>
#include <>
#include <>
#include <>
#include <>
#include “”

Defines

EXPLICIT_INSTANTIATE_CEREAL_SERIALIZE(CLASS_NAME)
file connect_to_remote_parameter_defs.h
#include <>
file connection.h
#include “hxcomm/common/target.h
#include <>
#include <>
#include <>

Defines

HXCOMM_EXPOSE_MESSAGE_TYPES(CONN_PARAMS)

Helper macro that re-exposes all message types from MessageTypes in the current connection.

HXCOMM_HELPER_CHECK_MESSAGE_TYPE(MESSAGE_TYPE)
file connection_full_stream_interface_variant.h
#include “hxcomm/common/stream.h
#include “”
#include <>
file connection_registry.h
#include <>
#include <>
#include <>
file connection_time_info.h
#include “”
#include <>
#include <>
file decoder.h
#include <>
#include <>
#include <>
#include “”
file encoder.h
#include <>
#include <>
#include <>
#include “”
file execute_messages.h
#include “hxcomm/common/logger.h
#include “hxcomm/common/stream.h
#include <>
#include <>
#include <>
#include “”
file execute_messages_types.h
#include “”
#include <>
#include <>
file fpga_ip_list.h
#include “”
#include <>
#include <>
#include <>
file get_repo_state.h
#include “”
#include <>
file largest_utmessage_size.h
#include “”
#include <>
file listener_halt.h
#include <>
file logger.h
#include <>

Defines

HXCOMM_LOG_DEBUG(logger, message)
HXCOMM_LOG_ERROR(logger, message)
HXCOMM_LOG_FATAL(logger, message)
HXCOMM_LOG_INFO(logger, message)
HXCOMM_LOG_TRACE(logger, message)
HXCOMM_LOG_WARN(logger, message)
file loopbackconnection.h
#include “hxcomm/common/decoder.h
#include “hxcomm/common/encoder.h
#include <>
#include <>
#include <>
#include <>
#include <>
#include <>
#include “”
file payload.h
#include “”
#include “”
#include <>
#include <>
file quiggeldy_common.h
#include “”
#include <>
file quiggeldy_future.h
#include <>
#include “”
file reinit_stack.h
#include <>
#include <>
#include “”
file sf_serialization.h
#include <>
#include <>
#include “”
#include “”
#include “”
#include “”
#include “”
#include “hxcomm/common/logger.h
file signal.h
#include “”
#include <>
file sim_parameters.h
#include “”
#include <>
#include <>
#include <>
file stream.h
#include “”
#include <>
#include <>
file stream_rc.h
#include <>
#include <>
file to_utmessage_variant.h
#include “”
#include <>
file utmessage_header_width.h
#include “”
#include “”
file visit_connection.h
#include <>
#include <>
#include <>
#include <>
#include <>
file arqconnection.h
#include “”
#include “”
#include “hxcomm/common/decoder.h
#include “hxcomm/common/encoder.h
#include “hxcomm/common/stream.h
#include “hxcomm/common/target.h
#include “”
#include “”
#include <>
#include <>
#include <>
#include <>
#include <>
#include <>
#include <>
#include <>
#include “”
file arqconnection.h
#include “”
file connection_from_env.h
#include “”
#include <>
#include <>
file connection_parameter.h
#include <>
file connection_parameter.h
#include “hxcomm/vx/utmessage.h
file connection_variant.h
#include <>
file ensure_local_quiggeldy.h
#include “”
#include <>
file event_constants.h
#include <>
file event_from_fpga.h
#include “”
#include “”
#include “”
#include “hxcomm/common/payload.h
#include <>
file event_to_fpga.h
#include “”
#include “”
#include “”
#include “hxcomm/common/payload.h
#include <>
file from_fpga_system.h
#include “”
#include “hxcomm/common/payload.h
#include <>
file instruction.h
file jtag_from_hicann.h
#include “”
#include “hxcomm/common/payload.h
file omnibus_from_fpga.h
#include “”
#include “hxcomm/common/payload.h
#include <>
file omnibus_to_fpga.h
#include “”
#include “”
#include “hxcomm/common/payload.h
#include <>
file system.h
#include “”
#include “hxcomm/common/payload.h
file timing.h
#include “”
#include “hxcomm/common/payload.h
#include <>
file timing_from_fpga.h
#include “”
#include “hxcomm/common/payload.h
#include <>
file to_fpga_jtag.h
#include “”
#include “”
#include “”
#include “hxcomm/common/payload.h
#include “”
#include <>
file payload_random.h
#include “hxcomm/common/payload.h
#include <>
file payload_random.h
#include “”
file quiggeldy_connection.h
#include “”
#include “hxcomm/common/stream.h
#include “hxcomm/common/target.h
#include “”
#include “”
#include “”
#include <>
#include <>
#include <>
#include <>
#include <>
#include “”
file quiggeldy_connection.h
file quiggeldy_interface_types.h
#include <>
#include <>
#include <>
file quiggeldy_interface_types.h
file quiggeldy_rcf.h
#include “”
#include “”
#include “”
#include “”
#include “”
#include “”
#include “”
#include “”
#include <>
#include <>
file quiggeldy_schedule_out_to_in_transform.h
#include “”
#include “hxcomm/vx/utmessage.h
#include <>
file quiggeldy_server.h
#include “”
#include <>
#include <>
#include <>
#include <>
file quiggeldy_server.h
file quiggeldy_utility.h
#include “”
#include <>
#include <>
#include <>
#include “hxcomm/common/logger.h
#include “”
file quiggeldy_utility.h
#include “”
#include “”
file quiggeldy_worker.h
#include <>
#include <>
#include <>
#include <>
#include <>
#include <>
#include <>
#include “”
file quiggeldy_worker.h
file reinit_stack_entry.h
#include “”
#include “”
#include “hxcomm/common/logger.h
#include <>
#include <>
#include <>
#include <>
#include <>
#include “”
file reinit_stack_entry.h
file simconnection.h
#include “”
#include “”
#include “hxcomm/common/decoder.h
#include “hxcomm/common/encoder.h
#include “hxcomm/common/signal.h
#include “hxcomm/common/stream.h
#include “hxcomm/common/target.h
#include <>
#include <>
#include <>
#include <>
#include <>
#include <>
#include <>
#include <>
#include <>
#include <>
#include <>
#include “”
file simconnection.h
#include “”
file target.h
file target.h
#include “hxcomm/common/target.h
file utmessage.h
#include “”
#include “”
#include “”
#include “”
#include “”
file utmessage.h
file utmessage_fwd.h
file utmessage_random.h
file utmessage_random.h
file zeromockconnection.h
#include “”
#include “hxcomm/common/stream.h
#include “hxcomm/common/target.h
#include <>
#include <>
#include <>
#include “”
file zeromockconnection.h
#include “”
dir /jenkins/jenlib_workspaces_f9/doc_gerrit_documentation-brainscales2-dependencies.ZG9jX2dlcnJpdF9kb2N1bWVudGF0aW9uLWJyYWluc2NhbGVzMi1kZXBlbmRlbmNpZXMjMTI4MDc.x/hxcomm/include/hxcomm/common
dir /jenkins/jenlib_workspaces_f9/doc_gerrit_documentation-brainscales2-dependencies.ZG9jX2dlcnJpdF9kb2N1bWVudGF0aW9uLWJyYWluc2NhbGVzMi1kZXBlbmRlbmNpZXMjMTI4MDc.x/hxcomm
dir /jenkins/jenlib_workspaces_f9/doc_gerrit_documentation-brainscales2-dependencies.ZG9jX2dlcnJpdF9kb2N1bWVudGF0aW9uLWJyYWluc2NhbGVzMi1kZXBlbmRlbmNpZXMjMTI4MDc.x/hxcomm/include/hxcomm
dir /jenkins/jenlib_workspaces_f9/doc_gerrit_documentation-brainscales2-dependencies.ZG9jX2dlcnJpdF9kb2N1bWVudGF0aW9uLWJyYWluc2NhbGVzMi1kZXBlbmRlbmNpZXMjMTI4MDc.x/hxcomm/include
dir /jenkins/jenlib_workspaces_f9/doc_gerrit_documentation-brainscales2-dependencies.ZG9jX2dlcnJpdF9kb2N1bWVudGF0aW9uLWJyYWluc2NhbGVzMi1kZXBlbmRlbmNpZXMjMTI4MDc.x/hxcomm/include/hxcomm/vx/instruction
dir /jenkins/jenlib_workspaces_f9/doc_gerrit_documentation-brainscales2-dependencies.ZG9jX2dlcnJpdF9kb2N1bWVudGF0aW9uLWJyYWluc2NhbGVzMi1kZXBlbmRlbmNpZXMjMTI4MDc.x/hxcomm/include/hxcomm/vx