DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
EndpointNode.hpp
Go to the documentation of this file.
1
12#ifndef TIMING_INCLUDE_TIMING_ENDPOINTNODE_HPP_
13#define TIMING_INCLUDE_TIMING_ENDPOINTNODE_HPP_
14
15// PDT Headers
16#include "TimingIssues.hpp"
19
20// uHal Headers
21#include "uhal/DerivedNode.hpp"
22
23#include <nlohmann/json.hpp>
24
25// C++ Headers
26#include <chrono>
27#include <string>
28
29namespace dunedaq {
30namespace timing {
31
36{
37 UHAL_DERIVEDNODE(EndpointNode)
38public:
39 explicit EndpointNode(const uhal::Node& node);
40 virtual ~EndpointNode();
41
45 std::string get_status(bool print_out = false) const override;
46
52 void enable(uint32_t address = 0, uint32_t partition = 0) const override; // NOLINT(build/unsigned)
53
59 void disable() const override;
60
66 void reset(uint32_t address = 0, uint32_t partition = 0) const override; // NOLINT(build/unsigned)
67
73 virtual uint64_t read_timestamp() const; // NOLINT(build/unsigned)
74
80 //virtual double read_clock_frequency() const;
81
86 void get_info(timingendpointinfo::TimingEndpointInfo& mon_data) const override;
87
91 static std::map<uint8_t, std::string> get_endpoint_state_map() { return endpoint_state_map; }
92
93protected:
94 static inline const std::map<uint8_t, std::string> endpoint_state_map
95 {
96 { 0x0, "Standing by (0x0)" }, // 0b0000 when ST_RESET, -- Endpoint in in reset
97 { 0x1, "Waiting for input clock (0x1)" }, // 0b0001 when ST_W_CLK, -- Waiting for input clock
98 { 0x2, "Waiting for good frequency check (0x2)" }, // 0b0010 when ST_W_FREQ, -- Waiting for frequency check
99 { 0x3, "Waiting for internal CDR to lock (0x3)" }, // 0b0011 when ST_W_CDR, -- Waiting for internal CDR to lock
100 { 0x4, "Waiting for rx block to lock (0x4)" }, // 0b0100 when ST_W_RX, -- Waiting for rx block to lock
101 { 0x5, "Waiting for address to be set (0x5)" }, // 0b0101 when ST_W_ADDR, -- Waiting for address to be set
102 { 0x6, "Waiting for deskew to be set (0x6)" }, // 0b0110 when ST_W_DESKEW, -- Waiting for deskew to be set
103 { 0x7, "Waiting for timestamp initialisation (0x7)" }, // 0b0111 when ST_W_TS, -- Waiting for timestamp initialisation
104 { 0x8, "Ready (0x8)" }, // 0b1000 when ST_READY, -- Good to go
105 { 0xc, "Error in physical layer (0xc)" }, // 0b1100 when ST_ERR_P, -- Error in physical layer
106 { 0xd, "Receive error (0xd)" }, // 0b1101 when ST_ERR_R, -- Receive error
107 { 0xe, "Time check error (0xe)" }, // 0b1110 when ST_ERR_T, -- Time check error
108 { 0xf, "Protocol error (0xf)" }, // 0b1111 when ST_ERR_X; -- Protocol error
109 };
110};
111
112} // namespace timing
113} // namespace dunedaq
114
115#endif // TIMING_INCLUDE_TIMING_ENDPOINTNODE_HPP_
Base class for timing IO nodes.
virtual uint64_t read_timestamp() const
Read the current timestamp word.
void reset(uint32_t address=0, uint32_t partition=0) const override
Reset the endpoint.
void get_info(timingendpointinfo::TimingEndpointInfo &mon_data) const override
Read the endpoint clock frequency.
void disable() const override
Disable the endpoint.
EndpointNode(const uhal::Node &node)
static const std::map< uint8_t, std::string > endpoint_state_map
static std::map< uint8_t, std::string > get_endpoint_state_map()
Get the states map.
std::string get_status(bool print_out=false) const override
Print the status of the timing node.
Including Qt Headers.