Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ri/tech-hub/apps/brainscales/nhtl-extoll
1 result
Show changes
Commits on Source (2)
#pragma once #pragma once
#include "hate/visibility.h"
#include <cstdint>
#include <vector>
#include "nhtl-extoll/notification_poller.h" #include "nhtl-extoll/notification_poller.h"
#include "rma2.h" #include "rma2.h"
#include <cstdint>
#include <vector>
namespace nhtl_extoll { namespace nhtl_extoll {
...@@ -42,7 +41,7 @@ private: ...@@ -42,7 +41,7 @@ private:
uint64_t m_physical_address; uint64_t m_physical_address;
public: public:
explicit PhysicalBuffer(); explicit PhysicalBuffer() SYMBOL_VISIBLE;
/// This class is moveable as the underlying registered memory /// This class is moveable as the underlying registered memory
/// region is stable address-wise /// region is stable address-wise
PhysicalBuffer(PhysicalBuffer&&) = default; PhysicalBuffer(PhysicalBuffer&&) = default;
...@@ -50,24 +49,24 @@ public: ...@@ -50,24 +49,24 @@ public:
PhysicalBuffer(PhysicalBuffer const&) = delete; PhysicalBuffer(PhysicalBuffer const&) = delete;
/// This class is not copy-assignable /// This class is not copy-assignable
PhysicalBuffer& operator=(PhysicalBuffer const&) = delete; PhysicalBuffer& operator=(PhysicalBuffer const&) = delete;
~PhysicalBuffer(); ~PhysicalBuffer() SYMBOL_VISIBLE;
/// Returns the Network Logical Address (NLA) of the buffer. /// Returns the Network Logical Address (NLA) of the buffer.
/// Note that this uses physical addresses. /// Note that this uses physical addresses.
RMA2_NLA response_address() const; RMA2_NLA response_address() const SYMBOL_VISIBLE;
/// Returns the Network Logical Address (NLA) of the send buffer /// Returns the Network Logical Address (NLA) of the send buffer
/// This is offset by 1 page from the start of the PhysicalBuffer /// This is offset by 1 page from the start of the PhysicalBuffer
RMA2_NLA send_address() const; RMA2_NLA send_address() const SYMBOL_VISIBLE;
/// Returns the size of the send buffer in quad words /// Returns the size of the send buffer in quad words
size_t send_buffer_size_qw() const; size_t send_buffer_size_qw() const SYMBOL_VISIBLE;
/// Return the quad word written at the start of the RRA response buffer /// Return the quad word written at the start of the RRA response buffer
uint64_t read_response() const; uint64_t read_response() const SYMBOL_VISIBLE;
/// Return the quad word at the given index of the send buffer /// Return the quad word at the given index of the send buffer
/// This is offset by 1 page from the start of the PhysicalBuffer /// This is offset by 1 page from the start of the PhysicalBuffer
uint64_t read_send(size_t index) const; uint64_t read_send(size_t index) const SYMBOL_VISIBLE;
/// Write a quad word to the given index of the send buffer /// Write a quad word to the given index of the send buffer
/// This is offset by 1 page from the start of the PhysicalBuffer /// This is offset by 1 page from the start of the PhysicalBuffer
void write_send(size_t index, uint64_t data); void write_send(size_t index, uint64_t data) SYMBOL_VISIBLE;
friend class RingBuffer; friend class RingBuffer;
}; };
...@@ -99,9 +98,10 @@ public: ...@@ -99,9 +98,10 @@ public:
/// Creates a ringbuffer from an RMA network port and handle, /// Creates a ringbuffer from an RMA network port and handle,
/// an associated NotificationPoller, and the buffer size in pages /// an associated NotificationPoller, and the buffer size in pages
RingBuffer(RMA2_Port port, RMA2_Handle handle, NotificationPoller& p, size_t pages); RingBuffer(RMA2_Port port, RMA2_Handle handle, NotificationPoller& p, size_t pages)
SYMBOL_VISIBLE;
/// Frees all resources and does a last sync with the remote Fpga /// Frees all resources and does a last sync with the remote Fpga
~RingBuffer(); ~RingBuffer() SYMBOL_VISIBLE;
/// This class is moveable as the underlying registered memory /// This class is moveable as the underlying registered memory
/// region is stable address-wise /// region is stable address-wise
RingBuffer(RingBuffer&&) = default; RingBuffer(RingBuffer&&) = default;
...@@ -111,13 +111,13 @@ public: ...@@ -111,13 +111,13 @@ public:
RingBuffer& operator=(RingBuffer const&) = delete; RingBuffer& operator=(RingBuffer const&) = delete;
/// Blocks and reads all quad words from the buffer /// Blocks and reads all quad words from the buffer
std::vector<uint64_t> receive(); std::vector<uint64_t> receive() SYMBOL_VISIBLE;
/// Does a hard reset without notifying the hardware /// Does a hard reset without notifying the hardware
void reset(); void reset() SYMBOL_VISIBLE;
/// Accessor for the memory region /// Accessor for the memory region
RMA2_Region* region() const; RMA2_Region* region() const SYMBOL_VISIBLE;
/// The NLA of the mapped memory region with an optional offset in bytes /// The NLA of the mapped memory region with an optional offset in bytes
RMA2_NLA address(size_t offset) const; RMA2_NLA address(size_t offset) const SYMBOL_VISIBLE;
private: private:
/// The network port /// The network port
......
#pragma once #pragma once
#include "hate/visibility.h"
#include <cstdint>
#include "nhtl-extoll/connection.h" #include "nhtl-extoll/connection.h"
#include "rma2.h" #include "rma2.h"
#include <cstdint>
namespace nhtl_extoll { namespace nhtl_extoll {
...@@ -58,8 +57,8 @@ struct PartnerHostConfiguration ...@@ -58,8 +57,8 @@ struct PartnerHostConfiguration
uint32_t hicann_trace_pkt_closure; uint32_t hicann_trace_pkt_closure;
}; };
void configure_fpga(Endpoint& connection, PartnerHostConfiguration config); void SYMBOL_VISIBLE configure_fpga(Endpoint& connection, PartnerHostConfiguration config);
void configure_fpga(Endpoint& connection); void SYMBOL_VISIBLE configure_fpga(Endpoint& connection);
/** /**
* Read-write register file HostEndpoint. * Read-write register file HostEndpoint.
...@@ -86,26 +85,27 @@ struct HostEndpoint ...@@ -86,26 +85,27 @@ struct HostEndpoint
HostEndpoint() = default; HostEndpoint() = default;
/// Initialize all fields with a specific value /// Initialize all fields with a specific value
HostEndpoint(uint32_t node_id_, uint32_t protection_domain_, uint32_t vpid_, uint32_t mode_); HostEndpoint(uint32_t node_id_, uint32_t protection_domain_, uint32_t vpid_, uint32_t mode_)
SYMBOL_VISIBLE;
/// Read the `node_id` field /// Read the `node_id` field
uint32_t node_id() const; uint32_t node_id() const SYMBOL_VISIBLE;
/// Read the `protection_domain` field /// Read the `protection_domain` field
uint32_t protection_domain() const; uint32_t protection_domain() const SYMBOL_VISIBLE;
/// Read the `vpid` field /// Read the `vpid` field
uint32_t vpid() const; uint32_t vpid() const SYMBOL_VISIBLE;
/// Read the `mode` field /// Read the `mode` field
uint32_t mode() const; uint32_t mode() const SYMBOL_VISIBLE;
/// Set the `node_id` field /// Set the `node_id` field
void node_id(uint32_t value); void node_id(uint32_t value) SYMBOL_VISIBLE;
/// Set the `protection_domain` field /// Set the `protection_domain` field
void protection_domain(uint32_t value); void protection_domain(uint32_t value) SYMBOL_VISIBLE;
/// Set the `vpid` field /// Set the `vpid` field
void vpid(uint32_t value); void vpid(uint32_t value) SYMBOL_VISIBLE;
/// Set the `mode` field /// Set the `mode` field
void mode(uint32_t value); void mode(uint32_t value) SYMBOL_VISIBLE;
/// The hardware address of the register file on the remote Fpga /// The hardware address of the register file on the remote Fpga
constexpr static RMA2_NLA rf_address = 0x5298; constexpr static RMA2_NLA rf_address = 0x5298;
...@@ -135,9 +135,9 @@ struct ConfigResponse ...@@ -135,9 +135,9 @@ struct ConfigResponse
ConfigResponse(uint64_t value) : raw(value) {} ConfigResponse(uint64_t value) : raw(value) {}
/// Read the single field /// Read the single field
uint64_t address() const; uint64_t address() const SYMBOL_VISIBLE;
/// Set the single field /// Set the single field
void address(uint64_t value); void address(uint64_t value) SYMBOL_VISIBLE;
/// The hardware address of the register file on the remote Fpga /// The hardware address of the register file on the remote Fpga
constexpr static RMA2_NLA rf_address = 0x52a0; constexpr static RMA2_NLA rf_address = 0x52a0;
...@@ -169,9 +169,9 @@ struct HicannBufferStart ...@@ -169,9 +169,9 @@ struct HicannBufferStart
HicannBufferStart(uint64_t value) : raw(value) {} HicannBufferStart(uint64_t value) : raw(value) {}
/// Read the single field /// Read the single field
uint64_t data() const; uint64_t data() const SYMBOL_VISIBLE;
/// Set the single field /// Set the single field
void data(uint64_t value); void data(uint64_t value) SYMBOL_VISIBLE;
/// The hardware address of the register file on the remote Fpga /// The hardware address of the register file on the remote Fpga
constexpr static RMA2_NLA rf_address = 0x5080; constexpr static RMA2_NLA rf_address = 0x5080;
...@@ -198,12 +198,12 @@ struct HicannBufferSize ...@@ -198,12 +198,12 @@ struct HicannBufferSize
HicannBufferSize() = default; HicannBufferSize() = default;
/// Initialize all fields with a specific value /// Initialize all fields with a specific value
HicannBufferSize(uint32_t data_); HicannBufferSize(uint32_t data_) SYMBOL_VISIBLE;
/// Read the `data` field /// Read the `data` field
uint32_t data() const; uint32_t data() const SYMBOL_VISIBLE;
/// Set the `data` field /// Set the `data` field
void data(uint32_t value); void data(uint32_t value) SYMBOL_VISIBLE;
/// The hardware address of the register file on the remote Fpga /// The hardware address of the register file on the remote Fpga
constexpr static RMA2_NLA rf_address = 0x5088; constexpr static RMA2_NLA rf_address = 0x5088;
...@@ -230,13 +230,13 @@ struct HicannBufferFullThreshold ...@@ -230,13 +230,13 @@ struct HicannBufferFullThreshold
HicannBufferFullThreshold() = default; HicannBufferFullThreshold() = default;
/// Initialize all fields with a specific value /// Initialize all fields with a specific value
HicannBufferFullThreshold(uint32_t data_); HicannBufferFullThreshold(uint32_t data_) SYMBOL_VISIBLE;
/// Read the `data` field /// Read the `data` field
uint32_t data() const; uint32_t data() const SYMBOL_VISIBLE;
/// Set the `data` field /// Set the `data` field
void data(uint32_t value); void data(uint32_t value) SYMBOL_VISIBLE;
/// The hardware address of the register file on the remote Fpga /// The hardware address of the register file on the remote Fpga
constexpr static RMA2_NLA rf_address = 0x5090; constexpr static RMA2_NLA rf_address = 0x5090;
...@@ -266,17 +266,17 @@ struct HicannNotificationBehaviour ...@@ -266,17 +266,17 @@ struct HicannNotificationBehaviour
HicannNotificationBehaviour() = default; HicannNotificationBehaviour() = default;
/// Initialize all fields with a specific value /// Initialize all fields with a specific value
HicannNotificationBehaviour(uint32_t timeout_, uint32_t frequency_); HicannNotificationBehaviour(uint32_t timeout_, uint32_t frequency_) SYMBOL_VISIBLE;
/// Read the `timeout` field /// Read the `timeout` field
uint32_t timeout() const; uint32_t timeout() const SYMBOL_VISIBLE;
/// Read the `frequency` field /// Read the `frequency` field
uint32_t frequency() const; uint32_t frequency() const SYMBOL_VISIBLE;
/// Set the `timeout` field /// Set the `timeout` field
void timeout(uint32_t value); void timeout(uint32_t value) SYMBOL_VISIBLE;
/// Set the `frequency` field /// Set the `frequency` field
void frequency(uint32_t value); void frequency(uint32_t value) SYMBOL_VISIBLE;
/// The hardware address of the register file on the remote Fpga /// The hardware address of the register file on the remote Fpga
constexpr static RMA2_NLA rf_address = 0x52b0; constexpr static RMA2_NLA rf_address = 0x52b0;
...@@ -303,13 +303,13 @@ struct HicannTracePktClosure ...@@ -303,13 +303,13 @@ struct HicannTracePktClosure
HicannTracePktClosure() = default; HicannTracePktClosure() = default;
/// Initialize all fields with a specific value /// Initialize all fields with a specific value
HicannTracePktClosure(uint32_t timeout_); HicannTracePktClosure(uint32_t timeout_) SYMBOL_VISIBLE;
/// Read the `timeout` field /// Read the `timeout` field
uint32_t timeout() const; uint32_t timeout() const SYMBOL_VISIBLE;
/// Set the `timeout` field /// Set the `timeout` field
void timeout(uint32_t value); void timeout(uint32_t value) SYMBOL_VISIBLE;
/// The hardware address of the register file on the remote Fpga /// The hardware address of the register file on the remote Fpga
constexpr static RMA2_NLA rf_address = 0x52b8; constexpr static RMA2_NLA rf_address = 0x52b8;
...@@ -337,13 +337,13 @@ struct HicannBufferInit ...@@ -337,13 +337,13 @@ struct HicannBufferInit
HicannBufferInit() = default; HicannBufferInit() = default;
/// Initialize all fields with a specific value /// Initialize all fields with a specific value
HicannBufferInit(bool start_); HicannBufferInit(bool start_) SYMBOL_VISIBLE;
/// Read the `start` field /// Read the `start` field
bool start() const; bool start() const SYMBOL_VISIBLE;
/// Set the `start` field /// Set the `start` field
void start(bool value); void start(bool value) SYMBOL_VISIBLE;
/// The hardware address of the register file on the remote Fpga /// The hardware address of the register file on the remote Fpga
constexpr static RMA2_NLA rf_address = 0x50c0; constexpr static RMA2_NLA rf_address = 0x50c0;
...@@ -370,13 +370,13 @@ struct HicannBufferCounterReset ...@@ -370,13 +370,13 @@ struct HicannBufferCounterReset
HicannBufferCounterReset() = default; HicannBufferCounterReset() = default;
/// Initialize all fields with a specific value /// Initialize all fields with a specific value
HicannBufferCounterReset(bool reset_); HicannBufferCounterReset(bool reset_) SYMBOL_VISIBLE;
/// Read the `reset` field /// Read the `reset` field
bool reset() const; bool reset() const SYMBOL_VISIBLE;
/// Set the `reset` field /// Set the `reset` field
void reset(bool value); void reset(bool value) SYMBOL_VISIBLE;
/// The hardware address of the register file on the remote Fpga /// The hardware address of the register file on the remote Fpga
constexpr static RMA2_NLA rf_address = 0x50a0; constexpr static RMA2_NLA rf_address = 0x50a0;
...@@ -409,9 +409,9 @@ struct TraceBufferStart ...@@ -409,9 +409,9 @@ struct TraceBufferStart
/// Initialize the single field with a specific value /// Initialize the single field with a specific value
TraceBufferStart(uint64_t value) : raw(value & 0xffffffffffffffff) {} TraceBufferStart(uint64_t value) : raw(value & 0xffffffffffffffff) {}
/// Read the single field /// Read the single field
uint64_t data() const; uint64_t data() const SYMBOL_VISIBLE;
/// Set the single field /// Set the single field
void data(uint64_t value); void data(uint64_t value) SYMBOL_VISIBLE;
/// The hardware address of the register file on the remote Fpga /// The hardware address of the register file on the remote Fpga
constexpr static RMA2_NLA rf_address = 0x5000; constexpr static RMA2_NLA rf_address = 0x5000;
/// Indicates whether this field can be read on the software side /// Indicates whether this field can be read on the software side
...@@ -433,11 +433,11 @@ struct TraceBufferSize ...@@ -433,11 +433,11 @@ struct TraceBufferSize
/// Initialize all fields with zero /// Initialize all fields with zero
TraceBufferSize() = default; TraceBufferSize() = default;
/// Initialize all fields with a specific value /// Initialize all fields with a specific value
TraceBufferSize(uint32_t data_); TraceBufferSize(uint32_t data_) SYMBOL_VISIBLE;
/// Read the `data` field /// Read the `data` field
uint32_t data() const; uint32_t data() const SYMBOL_VISIBLE;
/// Set the `data` field /// Set the `data` field
void data(uint32_t value); void data(uint32_t value) SYMBOL_VISIBLE;
/// The hardware address of the register file on the remote Fpga /// The hardware address of the register file on the remote Fpga
constexpr static RMA2_NLA rf_address = 0x5008; constexpr static RMA2_NLA rf_address = 0x5008;
/// Indicates whether this field can be read on the software side /// Indicates whether this field can be read on the software side
...@@ -459,11 +459,11 @@ struct TraceBufferFullThreshold ...@@ -459,11 +459,11 @@ struct TraceBufferFullThreshold
/// Initialize all fields with zero /// Initialize all fields with zero
TraceBufferFullThreshold() = default; TraceBufferFullThreshold() = default;
/// Initialize all fields with a specific value /// Initialize all fields with a specific value
TraceBufferFullThreshold(uint32_t data_); TraceBufferFullThreshold(uint32_t data_) SYMBOL_VISIBLE;
/// Read the `data` field /// Read the `data` field
uint32_t data() const; uint32_t data() const SYMBOL_VISIBLE;
/// Set the `data` field /// Set the `data` field
void data(uint32_t value); void data(uint32_t value) SYMBOL_VISIBLE;
/// The hardware address of the register file on the remote Fpga /// The hardware address of the register file on the remote Fpga
constexpr static RMA2_NLA rf_address = 0x5010; constexpr static RMA2_NLA rf_address = 0x5010;
/// Indicates whether this field can be read on the software side /// Indicates whether this field can be read on the software side
...@@ -487,23 +487,24 @@ struct TraceBufferCounter ...@@ -487,23 +487,24 @@ struct TraceBufferCounter
TraceBufferCounter() = default; TraceBufferCounter() = default;
/// Initialize all fields with a specific value /// Initialize all fields with a specific value
TraceBufferCounter( TraceBufferCounter(
uint32_t start_address_, uint32_t size_, uint32_t threshold_, uint32_t wraps_); uint32_t start_address_, uint32_t size_, uint32_t threshold_, uint32_t wraps_)
SYMBOL_VISIBLE;
/// Read the `start_address` field /// Read the `start_address` field
uint32_t start_address() const; uint32_t start_address() const SYMBOL_VISIBLE;
/// Read the `size` field /// Read the `size` field
uint32_t size() const; uint32_t size() const SYMBOL_VISIBLE;
/// Read the `threshold` field /// Read the `threshold` field
uint32_t threshold() const; uint32_t threshold() const SYMBOL_VISIBLE;
/// Read the `wraps` field /// Read the `wraps` field
uint32_t wraps() const; uint32_t wraps() const SYMBOL_VISIBLE;
/// Set the `start_address` field /// Set the `start_address` field
void start_address(uint32_t value); void start_address(uint32_t value) SYMBOL_VISIBLE;
/// Set the `size` field /// Set the `size` field
void size(uint32_t value); void size(uint32_t value) SYMBOL_VISIBLE;
/// Set the `threshold` field /// Set the `threshold` field
void threshold(uint32_t value); void threshold(uint32_t value) SYMBOL_VISIBLE;
/// Set the `wraps` field /// Set the `wraps` field
void wraps(uint32_t value); void wraps(uint32_t value) SYMBOL_VISIBLE;
/// The hardware address of the register file on the remote Fpga /// The hardware address of the register file on the remote Fpga
constexpr static RMA2_NLA rf_address = 0x5018; constexpr static RMA2_NLA rf_address = 0x5018;
/// Indicates whether this field can be read on the software side /// Indicates whether this field can be read on the software side
...@@ -525,11 +526,11 @@ struct TraceBufferCounterReset ...@@ -525,11 +526,11 @@ struct TraceBufferCounterReset
/// Initialize all fields with zero /// Initialize all fields with zero
TraceBufferCounterReset() = default; TraceBufferCounterReset() = default;
/// Initialize all fields with a specific value /// Initialize all fields with a specific value
TraceBufferCounterReset(bool reset_); TraceBufferCounterReset(bool reset_) SYMBOL_VISIBLE;
/// Read the `reset` field /// Read the `reset` field
bool reset() const; bool reset() const SYMBOL_VISIBLE;
/// Set the `reset` field /// Set the `reset` field
void reset(bool value); void reset(bool value) SYMBOL_VISIBLE;
/// The hardware address of the register file on the remote Fpga /// The hardware address of the register file on the remote Fpga
constexpr static RMA2_NLA rf_address = 0x5020; constexpr static RMA2_NLA rf_address = 0x5020;
/// Indicates whether this field can be read on the software side /// Indicates whether this field can be read on the software side
...@@ -552,11 +553,11 @@ struct TraceBufferInit ...@@ -552,11 +553,11 @@ struct TraceBufferInit
/// Initialize all fields with zero /// Initialize all fields with zero
TraceBufferInit() = default; TraceBufferInit() = default;
/// Initialize all fields with a specific value /// Initialize all fields with a specific value
TraceBufferInit(bool start_); TraceBufferInit(bool start_) SYMBOL_VISIBLE;
/// Read the `start` field /// Read the `start` field
bool start() const; bool start() const SYMBOL_VISIBLE;
/// Set the `start` field /// Set the `start` field
void start(bool value); void start(bool value) SYMBOL_VISIBLE;
/// The hardware address of the register file on the remote Fpga /// The hardware address of the register file on the remote Fpga
constexpr static RMA2_NLA rf_address = 0x5040; constexpr static RMA2_NLA rf_address = 0x5040;
/// Indicates whether this field can be read on the software side /// Indicates whether this field can be read on the software side
...@@ -581,15 +582,15 @@ struct TraceNotificationBehaviour ...@@ -581,15 +582,15 @@ struct TraceNotificationBehaviour
/// Initialize all fields with zero /// Initialize all fields with zero
TraceNotificationBehaviour() = default; TraceNotificationBehaviour() = default;
/// Initialize all fields with a specific value /// Initialize all fields with a specific value
TraceNotificationBehaviour(uint32_t timeout_, uint32_t frequency_); TraceNotificationBehaviour(uint32_t timeout_, uint32_t frequency_) SYMBOL_VISIBLE;
/// Read the `timeout` field /// Read the `timeout` field
uint32_t timeout() const; uint32_t timeout() const SYMBOL_VISIBLE;
/// Read the `frequency` field /// Read the `frequency` field
uint32_t frequency() const; uint32_t frequency() const SYMBOL_VISIBLE;
/// Set the `timeout` field /// Set the `timeout` field
void timeout(uint32_t value); void timeout(uint32_t value) SYMBOL_VISIBLE;
/// Set the `frequency` field /// Set the `frequency` field
void frequency(uint32_t value); void frequency(uint32_t value) SYMBOL_VISIBLE;
/// The hardware address of the register file on the remote Fpga /// The hardware address of the register file on the remote Fpga
constexpr static RMA2_NLA rf_address = 0x52a8; constexpr static RMA2_NLA rf_address = 0x52a8;
/// Indicates whether this field can be read on the software side /// Indicates whether this field can be read on the software side
...@@ -615,27 +616,28 @@ struct Info ...@@ -615,27 +616,28 @@ struct Info
/// Initialize all fields with zero /// Initialize all fields with zero
Info() = default; Info() = default;
/// Initialize all fields with a specific value /// Initialize all fields with a specific value
Info(uint32_t guid_, uint16_t ndid_, uint8_t waferid_, uint8_t socketid_, uint8_t edgeid_); Info(uint32_t guid_, uint16_t ndid_, uint8_t waferid_, uint8_t socketid_, uint8_t edgeid_)
SYMBOL_VISIBLE;
/// Read the `guid` field /// Read the `guid` field
uint32_t guid() const; uint32_t guid() const SYMBOL_VISIBLE;
/// Read the `ndid` field /// Read the `ndid` field
uint16_t ndid() const; uint16_t ndid() const SYMBOL_VISIBLE;
/// Read the `waferid` field /// Read the `waferid` field
uint8_t waferid() const; uint8_t waferid() const SYMBOL_VISIBLE;
/// Read the `socketid_` field /// Read the `socketid_` field
uint8_t socketid() const; uint8_t socketid() const SYMBOL_VISIBLE;
/// Read the `edgeid` field /// Read the `edgeid` field
uint8_t edgeid() const; uint8_t edgeid() const SYMBOL_VISIBLE;
/// Set the `guid` field /// Set the `guid` field
void guid(uint32_t value); void guid(uint32_t value) SYMBOL_VISIBLE;
/// Set the `ndid` field /// Set the `ndid` field
void ndid(uint16_t value); void ndid(uint16_t value) SYMBOL_VISIBLE;
/// Set the `waferid` field /// Set the `waferid` field
void waferid(uint8_t value); void waferid(uint8_t value) SYMBOL_VISIBLE;
/// Set the `socketid` field /// Set the `socketid` field
void socketid(uint8_t value); void socketid(uint8_t value) SYMBOL_VISIBLE;
/// Set the `edgeid` field /// Set the `edgeid` field
void edgeid(uint8_t value); void edgeid(uint8_t value) SYMBOL_VISIBLE;
/// The hardware address of the register file on the remote Fpga /// The hardware address of the register file on the remote Fpga
constexpr static RMA2_NLA rf_address = 0x8008; constexpr static RMA2_NLA rf_address = 0x8008;
/// Indicates whether this field can be read on the software side /// Indicates whether this field can be read on the software side
......
#pragma once #pragma once
#include "hate/visibility.h"
#include "nhtl-extoll/buffer.h" #include "nhtl-extoll/buffer.h"
#include "nhtl-extoll/notification_poller.h" #include "nhtl-extoll/notification_poller.h"
#include "rma2.h" #include "rma2.h"
...@@ -20,9 +20,9 @@ private: ...@@ -20,9 +20,9 @@ private:
int m_type = 0; int m_type = 0;
public: public:
RMA2_Port get_port() const; RMA2_Port get_port() const SYMBOL_VISIBLE;
RMA2_Handle get_handle() const; RMA2_Handle get_handle() const SYMBOL_VISIBLE;
RMA2_VPID get_vpid() const; RMA2_VPID get_vpid() const SYMBOL_VISIBLE;
/// RMA2_Connection_Options option for RRA connection. /// RMA2_Connection_Options option for RRA connection.
static inline RMA2_Connection_Options const rra_connection = static inline RMA2_Connection_Options const rra_connection =
...@@ -30,7 +30,7 @@ public: ...@@ -30,7 +30,7 @@ public:
/// Open a single connection to the remote node. /// Open a single connection to the remote node.
/// @throws ConnectionFailed if an error happens inside `librma2` /// @throws ConnectionFailed if an error happens inside `librma2`
explicit Connection(RMA2_Nodeid, bool rra); explicit Connection(RMA2_Nodeid, bool rra) SYMBOL_VISIBLE;
/// This class is moveable as the underlying registered memory /// This class is moveable as the underlying registered memory
/// region is stable address-wise /// region is stable address-wise
Connection(Connection&&) = default; Connection(Connection&&) = default;
...@@ -39,7 +39,7 @@ public: ...@@ -39,7 +39,7 @@ public:
/// This class is not copy-assignable /// This class is not copy-assignable
Connection& operator=(Connection const&) = delete; Connection& operator=(Connection const&) = delete;
/// Closes all `librma2` resources /// Closes all `librma2` resources
~Connection(); ~Connection() SYMBOL_VISIBLE;
}; };
/** /**
...@@ -66,15 +66,15 @@ public: ...@@ -66,15 +66,15 @@ public:
constexpr static RMA2_NLA hicann_address = 0x2a1bull << 48; constexpr static RMA2_NLA hicann_address = 0x2a1bull << 48;
constexpr static RMA2_NLA trace_address = 0x0ca5ull << 48; constexpr static RMA2_NLA trace_address = 0x0ca5ull << 48;
RMA2_Nodeid get_node() const; RMA2_Nodeid get_node() const SYMBOL_VISIBLE;
RMA2_Port get_rra_port() const; RMA2_Port get_rra_port() const SYMBOL_VISIBLE;
RMA2_Handle get_rra_handle() const; RMA2_Handle get_rra_handle() const SYMBOL_VISIBLE;
RMA2_VPID get_rra_vpid() const; RMA2_VPID get_rra_vpid() const SYMBOL_VISIBLE;
RMA2_Port get_rma_port() const; RMA2_Port get_rma_port() const SYMBOL_VISIBLE;
RMA2_Handle get_rma_handle() const; RMA2_Handle get_rma_handle() const SYMBOL_VISIBLE;
RMA2_VPID get_rma_vpid() const; RMA2_VPID get_rma_vpid() const SYMBOL_VISIBLE;
NotificationPoller poller; NotificationPoller poller;
...@@ -90,7 +90,7 @@ public: ...@@ -90,7 +90,7 @@ public:
/// Opens a connection to a remote node. /// Opens a connection to a remote node.
/// @throws ConnectionFailed if there is an error inside `librma2` /// @throws ConnectionFailed if there is an error inside `librma2`
explicit Endpoint(RMA2_Nodeid); explicit Endpoint(RMA2_Nodeid) SYMBOL_VISIBLE;
/// This class is moveable as the underlying registered memory /// This class is moveable as the underlying registered memory
/// region is stable address-wise /// region is stable address-wise
Endpoint(Endpoint&&) = default; Endpoint(Endpoint&&) = default;
...@@ -101,7 +101,7 @@ public: ...@@ -101,7 +101,7 @@ public:
/// Attempt to read the FPGA identifier at 0x8000 via RRA /// Attempt to read the FPGA identifier at 0x8000 via RRA
/// Returns true if the FPGA answers within 1ms, false otherwise /// Returns true if the FPGA answers within 1ms, false otherwise
bool ping() const; bool ping() const SYMBOL_VISIBLE;
/** /**
* Read the value of a register file. * Read the value of a register file.
...@@ -152,7 +152,7 @@ public: ...@@ -152,7 +152,7 @@ public:
* location accessed. In particular, it is possible for bitfields in * location accessed. In particular, it is possible for bitfields in
* otherwise readable registers to be non readable and return garbage data. * otherwise readable registers to be non readable and return garbage data.
*/ */
uint64_t rra_read(RMA2_NLA) const; uint64_t rra_read(RMA2_NLA) const SYMBOL_VISIBLE;
/** /**
* A non-template version of the write method. * A non-template version of the write method.
...@@ -160,12 +160,12 @@ public: ...@@ -160,12 +160,12 @@ public:
* This method is untyped and neither checks whether the remote register file * This method is untyped and neither checks whether the remote register file
* is writable nor does it provide a way to pack the fields into a quad word. * is writable nor does it provide a way to pack the fields into a quad word.
*/ */
void rra_write(RMA2_NLA, uint64_t); void rra_write(RMA2_NLA, uint64_t) SYMBOL_VISIBLE;
/** /**
* Send data via the RMA connection. * Send data via the RMA connection.
*/ */
void rma_send(size_t quad_words); void rma_send(size_t quad_words) SYMBOL_VISIBLE;
}; };
} }
#pragma once #pragma once
#include "hate/visibility.h"
#include <stdexcept>
#include "rma2.h" #include "rma2.h"
#include <stdexcept>
namespace nhtl_extoll { namespace nhtl_extoll {
...@@ -13,7 +12,7 @@ struct RmaError : std::runtime_error ...@@ -13,7 +12,7 @@ struct RmaError : std::runtime_error
using runtime_error::runtime_error; using runtime_error::runtime_error;
protected: protected:
RmaError(); RmaError() SYMBOL_VISIBLE;
}; };
/// This exception indicates that a connection to a remote Fpga could not be established. /// This exception indicates that a connection to a remote Fpga could not be established.
...@@ -27,7 +26,7 @@ struct ConnectionFailed : RmaError ...@@ -27,7 +26,7 @@ struct ConnectionFailed : RmaError
struct FailedToRegisterRegion : RmaError struct FailedToRegisterRegion : RmaError
{ {
/// Creates an exception /// Creates an exception
FailedToRegisterRegion(); FailedToRegisterRegion() SYMBOL_VISIBLE;
}; };
/// This exception indicates that a remote register file access has failed. /// This exception indicates that a remote register file access has failed.
...@@ -37,7 +36,7 @@ struct RraError : RmaError ...@@ -37,7 +36,7 @@ struct RraError : RmaError
{ {
protected: protected:
/// Creates an exception from a message, a node id and a network logical address /// Creates an exception from a message, a node id and a network logical address
RraError(std::string const& msg, RMA2_Nodeid n, RMA2_NLA a); RraError(std::string const& msg, RMA2_Nodeid n, RMA2_NLA a) SYMBOL_VISIBLE;
/// The node id of the node that caused the error /// The node id of the node that caused the error
RMA2_Nodeid node; RMA2_Nodeid node;
...@@ -50,7 +49,7 @@ struct FailedToRead : RraError ...@@ -50,7 +49,7 @@ struct FailedToRead : RraError
{ {
using RraError::RraError; using RraError::RraError;
/// Creates an exception from a node id and a network logical address /// Creates an exception from a node id and a network logical address
FailedToRead(RMA2_Nodeid node, RMA2_NLA address); FailedToRead(RMA2_Nodeid node, RMA2_NLA address) SYMBOL_VISIBLE;
}; };
/// This exception indicates that a remote register file access write command failed /// This exception indicates that a remote register file access write command failed
...@@ -58,7 +57,7 @@ struct FailedToWrite : RraError ...@@ -58,7 +57,7 @@ struct FailedToWrite : RraError
{ {
using RraError::RraError; using RraError::RraError;
/// Creates an exception from a node id and a network logical address /// Creates an exception from a node id and a network logical address
FailedToWrite(RMA2_Nodeid node, RMA2_NLA address); FailedToWrite(RMA2_Nodeid node, RMA2_NLA address) SYMBOL_VISIBLE;
}; };
/// This exception occurs when the user tries to connect to a remote node that is not an /// This exception occurs when the user tries to connect to a remote node that is not an
...@@ -66,7 +65,7 @@ struct FailedToWrite : RraError ...@@ -66,7 +65,7 @@ struct FailedToWrite : RraError
struct NodeIsNoFpga : ConnectionFailed struct NodeIsNoFpga : ConnectionFailed
{ {
/// Creates an exception from a node id and an incorrect observed driver version /// Creates an exception from a node id and an incorrect observed driver version
NodeIsNoFpga(RMA2_Nodeid node, uint32_t driver); NodeIsNoFpga(RMA2_Nodeid node, uint32_t driver) SYMBOL_VISIBLE;
/// The node id of the node that couldn't be connected /// The node id of the node that couldn't be connected
RMA2_Nodeid const node; RMA2_Nodeid const node;
......
#pragma once
#include "hate/visibility.h"
#include "rma2.h"
#include <cstdint> #include <cstdint>
#include <vector> #include <vector>
#include "rma2.h"
namespace nhtl_extoll { namespace nhtl_extoll {
/** /**
* Get list of all Node IDs available in the network. * Get list of all Node IDs available in the network.
* @return Vector of Node IDs as uint16_t (RMA2_Nodeid) * @return Vector of Node IDs as uint16_t (RMA2_Nodeid)
*/ */
std::vector<RMA2_Nodeid> get_all_node_ids(); std::vector<RMA2_Nodeid> SYMBOL_VISIBLE get_all_node_ids();
/** /**
* Check whether the link of a given Node ID belongs to a running FPGA. * Check whether the link of a given Node ID belongs to a running FPGA.
* @param node_id Node ID to be checked. * @param node_id Node ID to be checked.
* @return True if link is up and node_id belongs to a known FPGA. * @return True if link is up and node_id belongs to a known FPGA.
*/ */
bool check_is_fpga(RMA2_Nodeid node_id); bool SYMBOL_VISIBLE check_is_fpga(RMA2_Nodeid node_id);
/** /**
* Get list of Node IDs of FPGAs available in the network. * Get list of Node IDs of FPGAs available in the network.
* @return Vector of FPGA Node IDs as uint16_t (RMA2_Nodeid) * @return Vector of FPGA Node IDs as uint16_t (RMA2_Nodeid)
*/ */
std::vector<RMA2_Nodeid> get_fpga_node_ids(); std::vector<RMA2_Nodeid> SYMBOL_VISIBLE get_fpga_node_ids();
/** /**
* Get Node ID of FPGA available in the network. * Get Node ID of FPGA available in the network.
* @return FPGA Node ID as uint16_t (RMA2_Nodeid) * @return FPGA Node ID as uint16_t (RMA2_Nodeid)
*/ */
RMA2_Nodeid get_fpga_node_id(); RMA2_Nodeid SYMBOL_VISIBLE get_fpga_node_id();
} // namespace nhtl_extoll } // namespace nhtl_extoll
#pragma once #pragma once
#include "hate/visibility.h"
#include "rma2.h"
#include <atomic> #include <atomic>
#include <chrono> #include <chrono>
#include <condition_variable> #include <condition_variable>
...@@ -7,8 +8,6 @@ ...@@ -7,8 +8,6 @@
#include <sched.h> #include <sched.h>
#include <thread> #include <thread>
#include "rma2.h"
namespace nhtl_extoll { namespace nhtl_extoll {
class NotificationPoller class NotificationPoller
...@@ -26,11 +25,11 @@ private: ...@@ -26,11 +25,11 @@ private:
void poll_notifications(); void poll_notifications();
public: public:
NotificationPoller(RMA2_Port p); NotificationPoller(RMA2_Port p) SYMBOL_VISIBLE;
~NotificationPoller(); ~NotificationPoller() SYMBOL_VISIBLE;
bool consume_response(std::chrono::milliseconds); bool consume_response(std::chrono::milliseconds) SYMBOL_VISIBLE;
uint64_t consume_packets(std::chrono::milliseconds); uint64_t consume_packets(std::chrono::milliseconds) SYMBOL_VISIBLE;
// Used to restrict process to single CPU to avoid notification latency issues. // Used to restrict process to single CPU to avoid notification latency issues.
cpu_set_t cpu; cpu_set_t cpu;
......
...@@ -46,6 +46,7 @@ def build(bld): ...@@ -46,6 +46,7 @@ def build(bld):
source = bld.path.ant_glob('src/nhtl-extoll/*.cpp'), source = bld.path.ant_glob('src/nhtl-extoll/*.cpp'),
use = ['rma2rc', 'rma2', 'nhtl_extoll_inc', 'hate_inc'], use = ['rma2rc', 'rma2', 'nhtl_extoll_inc', 'hate_inc'],
install_path = '${PREFIX}/lib', install_path = '${PREFIX}/lib',
uselib = 'NHTL_EXTOLL',
) )
bld( bld(
......