DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
MasterDesign.hpp
Go to the documentation of this file.
1
12#ifndef TIMING_INCLUDE_TIMING_MASTERDESIGN_HPP_
13#define TIMING_INCLUDE_TIMING_MASTERDESIGN_HPP_
14
15// PDT Headers
16#include "timing/TopDesign.hpp"
18
19// uHal Headers
20#include "uhal/DerivedNode.hpp"
21
22// C++ Headers
23#include <chrono>
24#include <sstream>
25#include <string>
26
27namespace dunedaq {
28namespace timing {
29
33class MasterDesign : public TopDesign, virtual public MasterDesignInterface
34{
35 UHAL_DERIVEDNODE(MasterDesign)
36public:
37 explicit MasterDesign(const uhal::Node& node);
38 virtual ~MasterDesign();
39
43 std::string get_status(bool print_out = false) const override;
44
49 void configure(ClockSource clock_source, TimestampSource ts_source) const override;
50
56 uint64_t read_master_timestamp() const override; // NOLINT(build/unsigned)
57
62 void sync_timestamp(TimestampSource source) const override;
63
69 uint32_t measure_endpoint_rtt(uint32_t address, // NOLINT(build/unsigned)
70 bool control_sfp = true,
71 int sfp_mux = -1) const override;
75 void apply_endpoint_delay(uint32_t address, // NOLINT(build/unsigned)
76 uint32_t coarse_delay, // NOLINT(build/unsigned)
77 uint32_t fine_delay, // NOLINT(build/unsigned)
78 uint32_t phase_delay, // NOLINT(build/unsigned)
79 bool measure_rtt = false,
80 bool control_sfp = true,
81 int sfp_mux = -1) const override;
85 void enable_periodic_fl_cmd(uint32_t channel, double rate, bool poisson = false) const override; // NOLINT(build/unsigned)
86
90 void enable_periodic_fl_cmd(uint32_t command, uint32_t channel, double rate, bool poisson = false) const override; // NOLINT(build/unsigned)
91
95 const MasterNodeInterface* get_master_node_plain() const override { return dynamic_cast<const MasterNodeInterface*>(&uhal::Node::getNode("master")); }
96
102 uint32_t read_firmware_version() const override; // NOLINT(build/unsigned)
103
108 void validate_firmware_version() const override;
109
113 void get_info(timingfirmwareinfo::TimingDeviceInfo& mon_data) const override;
114
118 void get_info(timingfirmwareinfo::MasterMonitorData& mon_data) const override
119 {
120 get_master_node_plain()->get_info(mon_data);
121 }
122};
123
124} // namespace timing
125} // namespace dunedaq
126
127#endif // TIMING_INCLUDE_TIMING_MASTERDESIGN_HPP_
Base class for timing master designs.
Base class for timing master designs.
void get_info(timingfirmwareinfo::TimingDeviceInfo &mon_data) const override
Give info to collector.
std::string get_status(bool print_out=false) const override
Get status string, optionally print.
const MasterNodeInterface * get_master_node_plain() const override
Get master node pointer.
void apply_endpoint_delay(uint32_t address, uint32_t coarse_delay, uint32_t fine_delay, uint32_t phase_delay, bool measure_rtt=false, bool control_sfp=true, int sfp_mux=-1) const override
Apply delay to endpoint.
uint32_t measure_endpoint_rtt(uint32_t address, bool control_sfp=true, int sfp_mux=-1) const override
Measure the endpoint round trip time.
void sync_timestamp(TimestampSource source) const override
Sync timestamp to current machine value.
void validate_firmware_version() const override
Validate master firmware version.
void enable_periodic_fl_cmd(uint32_t channel, double rate, bool poisson=false) const override
Configure fake trigger generator.
uint32_t read_firmware_version() const override
Read master firmware version.
void configure(ClockSource clock_source, TimestampSource ts_source) const override
Prepare the timing master for data taking.
void get_info(timingfirmwareinfo::MasterMonitorData &mon_data) const override
Give info to collector.
uint64_t read_master_timestamp() const override
Read the current timestamp.
MasterDesign(const uhal::Node &node)
Base class for timing IO nodes.
virtual void get_info(timingfirmwareinfo::MasterMonitorData &mon_data) const =0
Give info to collector.
Base class for timing top design nodes with IO class.
Definition TopDesign.hpp:39
Including Qt Headers.