DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
top_designs.cpp
Go to the documentation of this file.
1
16#include "timing/GaiaDesign.hpp"
18
19#include <pybind11/pybind11.h>
20#include <pybind11/stl.h>
21
22namespace py = pybind11;
23
24namespace dunedaq {
25namespace timing {
26namespace python {
27
28void
30{
31 // Boreas
32 py::class_<timing::BoreasDesign, uhal::Node>(m, "BoreasDesign")
33 .def("read_firmware_version", &timing::BoreasDesign::read_firmware_version)
34 .def("validate_firmware_version", &timing::BoreasDesign::validate_firmware_version)
35 .def("sync_timestamp", &timing::BoreasDesign::sync_timestamp)
36 .def("get_status", &timing::BoreasDesign::get_status)
37 .def<void (timing::BoreasDesign::*)(uint32_t, double, bool) const>("enable_periodic_fl_cmd",
39 py::arg("channel"),
40 py::arg("rate"),
41 py::arg("poisson"))
42 .def<void (timing::BoreasDesign::*)(uint32_t, uint32_t, double, bool) const>("enable_periodic_fl_cmd",
44 py::arg("command"),
45 py::arg("channel"),
46 py::arg("rate"),
47 py::arg("poisson"))
48 .def("apply_endpoint_delay",
50 py::arg("address"),
51 py::arg("coarse_delay"),
52 py::arg("fine_delay"),
53 py::arg("phase_delay"),
54 py::arg("measure_rtt") = false,
55 py::arg("control_sfp") = true,
56 py::arg("sfp_mux") = -1)
57 .def("measure_endpoint_rtt",
59 py::arg("address"),
60 py::arg("control_sfp") = true,
61 py::arg("sfp_mux") = -1)
62 .def("get_hsi_node", &timing::BoreasDesign::get_hsi_node)
63 .def("configure_hsi",
65 py::arg("src"),
66 py::arg("re_mask"),
67 py::arg("fe_mask"),
68 py::arg("inv_mask"),
69 py::arg("rate"),
70 py::arg("dispatch") = true)
71 .def("configure", &timing::BoreasDesign::configure, py::arg("clock_source"), py::arg("ts_source"))
72 ;
73
74 // Fanout
75 py::class_<timing::FanoutDesign, uhal::Node>(m, "FanoutDesign")
76 .def("read_firmware_version", &timing::FanoutDesign::read_firmware_version)
77 .def("validate_firmware_version", &timing::FanoutDesign::validate_firmware_version)
78 .def("switch_mux", &timing::FanoutDesign::switch_mux, py::arg("mux"), py::arg("resync_cdr") = false)
79 .def("read_active_mux", &timing::FanoutDesign::read_active_mux)
80 .def("configure", &timing::FanoutDesign::configure, py::arg("clock_source"))
81 ;
82
83 // Ouroboros mux
84 py::class_<timing::OuroborosMuxDesign, uhal::Node>(m, "OuroborosMuxDesign")
85 .def("read_firmware_version", &timing::OuroborosMuxDesign::read_firmware_version)
86 .def("validate_firmware_version", &timing::OuroborosMuxDesign::validate_firmware_version)
87 .def("sync_timestamp", &timing::OuroborosMuxDesign::sync_timestamp)
88 .def<void (timing::OuroborosMuxDesign::*)(uint32_t, double, bool) const>("enable_periodic_fl_cmd",
90 py::arg("channel"),
91 py::arg("rate"),
92 py::arg("poisson"))
93 .def<void (timing::OuroborosMuxDesign::*)(uint32_t, uint32_t, double, bool) const>("enable_periodic_fl_cmd",
95 py::arg("command"),
96 py::arg("channel"),
97 py::arg("rate"),
98 py::arg("poisson"))
99 .def("switch_mux", &timing::OuroborosMuxDesign::switch_mux, py::arg("mux"), py::arg("resync_cdr") = false)
100 .def("read_active_mux", &timing::OuroborosMuxDesign::read_active_mux)
101 .def("apply_endpoint_delay",
103 py::arg("address"),
104 py::arg("coarse_delay"),
105 py::arg("fine_delay"),
106 py::arg("phase_delay"),
107 py::arg("measure_rtt") = false,
108 py::arg("control_sfp") = true,
109 py::arg("sfp_mux") = -1)
110 .def("measure_endpoint_rtt",
112 py::arg("address"),
113 py::arg("control_sfp") = true,
114 py::arg("sfp_mux") = -1)
115 .def("scan_sfp_mux", &timing::OuroborosMuxDesign::scan_sfp_mux)
116 .def("configure", &timing::OuroborosMuxDesign::configure, py::arg("clock_source"), py::arg("ts_source"))
117 ;
118
119 // Master mux
120 py::class_<timing::MasterMuxDesign, uhal::Node>(m, "MasterMuxDesign")
121 .def("read_firmware_version", &timing::MasterMuxDesign::read_firmware_version)
122 .def("validate_firmware_version", &timing::MasterMuxDesign::validate_firmware_version)
123 .def("sync_timestamp", &timing::MasterMuxDesign::sync_timestamp)
124 .def<void (timing::MasterMuxDesign::*)(uint32_t, double, bool) const>("enable_periodic_fl_cmd",
126 py::arg("channel"),
127 py::arg("rate"),
128 py::arg("poisson"))
129 .def<void (timing::MasterMuxDesign::*)(uint32_t, uint32_t, double, bool) const>("enable_periodic_fl_cmd",
131 py::arg("command"),
132 py::arg("channel"),
133 py::arg("rate"),
134 py::arg("poisson"))
135 .def("switch_mux", &timing::MasterMuxDesign::switch_mux, py::arg("mux"), py::arg("resync_cdr") = false)
136 .def("read_active_mux", &timing::MasterMuxDesign::read_active_mux)
137 .def("apply_endpoint_delay",
139 py::arg("address"),
140 py::arg("coarse_delay"),
141 py::arg("fine_delay"),
142 py::arg("phase_delay"),
143 py::arg("measure_rtt") = false,
144 py::arg("control_sfp") = true,
145 py::arg("sfp_mux") = -1)
146 .def("measure_endpoint_rtt",
148 py::arg("address"),
149 py::arg("control_sfp") = true,
150 py::arg("sfp_mux") = -1)
151 .def("scan_sfp_mux", &timing::MasterMuxDesign::scan_sfp_mux)
152 .def("configure", &timing::MasterMuxDesign::configure, py::arg("clock_source"), py::arg("ts_source"))
153 ;
154
155 // Master
156 py::class_<timing::MasterDesign, uhal::Node>(m, "MasterDesign")
157 .def("read_firmware_version", &timing::MasterDesign::read_firmware_version)
158 .def("validate_firmware_version", &timing::MasterDesign::validate_firmware_version)
159 .def("sync_timestamp", &timing::MasterDesign::sync_timestamp)
160 .def("get_status", &timing::MasterDesign::get_status)
161 .def<void (timing::MasterDesign::*)(uint32_t, double, bool) const>("enable_periodic_fl_cmd",
163 py::arg("channel"),
164 py::arg("rate"),
165 py::arg("poisson"))
166 .def<void (timing::MasterDesign::*)(uint32_t, uint32_t, double, bool) const>("enable_periodic_fl_cmd",
168 py::arg("command"),
169 py::arg("channel"),
170 py::arg("rate"),
171 py::arg("poisson"))
172 .def("apply_endpoint_delay",
174 py::arg("address"),
175 py::arg("coarse_delay"),
176 py::arg("fine_delay"),
177 py::arg("phase_delay"),
178 py::arg("measure_rtt") = false,
179 py::arg("control_sfp") = true,
180 py::arg("sfp_mux") = -1)
181 .def("measure_endpoint_rtt",
183 py::arg("address"),
184 py::arg("control_sfp") = true,
185 py::arg("sfp_mux") = -1)
186 .def("configure", &timing::MasterDesign::configure, py::arg("clock_source"), py::arg("ts_source"))
187 ;
188
189 // Ouroboros
190 py::class_<timing::OuroborosDesign, uhal::Node>(m, "OuroborosDesign")
191 .def("read_firmware_version", &timing::OuroborosDesign::read_firmware_version)
192 .def("validate_firmware_version", &timing::OuroborosDesign::validate_firmware_version)
193 .def("sync_timestamp", &timing::OuroborosDesign::sync_timestamp)
194 .def("get_status", &timing::OuroborosDesign::get_status)
195 .def<void (timing::OuroborosDesign::*)(uint32_t, double, bool) const>("enable_periodic_fl_cmd",
197 py::arg("channel"),
198 py::arg("rate"),
199 py::arg("poisson"))
200 .def<void (timing::OuroborosDesign::*)(uint32_t, uint32_t, double, bool) const>("enable_periodic_fl_cmd",
202 py::arg("command"),
203 py::arg("channel"),
204 py::arg("rate"),
205 py::arg("poisson"))
206 .def("apply_endpoint_delay",
208 py::arg("address"),
209 py::arg("coarse_delay"),
210 py::arg("fine_delay"),
211 py::arg("phase_delay"),
212 py::arg("measure_rtt") = false,
213 py::arg("control_sfp") = true,
214 py::arg("sfp_mux") = -1)
215 .def("measure_endpoint_rtt",
217 py::arg("address"),
218 py::arg("control_sfp") = true,
219 py::arg("sfp_mux") = -1)
220 .def("configure", &timing::OuroborosDesign::configure, py::arg("clock_source"), py::arg("ts_source"))
221 ;
222
223 // Endpoint
224 py::class_<timing::EndpointDesign, uhal::Node>(m, "EndpointDesign")
225 .def("read_firmware_version", &timing::EndpointDesign::read_firmware_version)
226 .def("validate_firmware_version", &timing::EndpointDesign::validate_firmware_version)
227 .def("get_status", &timing::EndpointDesign::get_status)
228 .def("configure", &timing::EndpointDesign::configure, py::arg("clock_source"))
229 ;
230
231 // Chronos
232 py::class_<timing::ChronosDesign, uhal::Node>(m, "ChronosDesign")
233 .def("read_firmware_version", &timing::ChronosDesign::read_firmware_version)
234 .def("validate_firmware_version", &timing::ChronosDesign::validate_firmware_version)
235 .def("get_status", &timing::ChronosDesign::get_status)
236 .def("get_hsi_node", &timing::ChronosDesign::get_hsi_node)
237 .def("configure_hsi",
239 py::arg("src"),
240 py::arg("re_mask"),
241 py::arg("fe_mask"),
242 py::arg("inv_mask"),
243 py::arg("rate"),
244 py::arg("dispatch") = true)
245 .def("configure", &timing::ChronosDesign::configure, py::arg("clock_source"))
246 ;
247
248 // Hades
249 py::class_<timing::HadesDesign, uhal::Node>(m, "HadesDesign")
250 .def("read_firmware_version", &timing::HadesDesign::read_firmware_version)
251 .def("validate_firmware_version", &timing::HadesDesign::validate_firmware_version)
252 .def("get_status", &timing::HadesDesign::get_status)
253 .def("get_hsi_node", &timing::HadesDesign::get_hsi_node)
254 .def("configure_hsi",
256 py::arg("src"),
257 py::arg("re_mask"),
258 py::arg("fe_mask"),
259 py::arg("inv_mask"),
260 py::arg("rate"),
261 py::arg("dispatch") = true)
262 .def("configure", &timing::HadesDesign::configure, py::arg("clock_source"))
263 ;
264
265 // Kerberos
266 py::class_<timing::KerberosDesign, uhal::Node>(m, "KerberosDesign")
267 .def("read_firmware_version", &timing::KerberosDesign::read_firmware_version)
268 .def("validate_firmware_version", &timing::KerberosDesign::validate_firmware_version)
269 .def("sync_timestamp", &timing::KerberosDesign::sync_timestamp)
270 .def<void (timing::KerberosDesign::*)(uint32_t, double, bool) const>("enable_periodic_fl_cmd",
272 py::arg("channel"),
273 py::arg("rate"),
274 py::arg("poisson"))
275 .def<void (timing::KerberosDesign::*)(uint32_t, uint32_t, double, bool) const>("enable_periodic_fl_cmd",
277 py::arg("command"),
278 py::arg("channel"),
279 py::arg("rate"),
280 py::arg("poisson"))
281 .def("apply_endpoint_delay",
283 py::arg("address"),
284 py::arg("coarse_delay"),
285 py::arg("fine_delay"),
286 py::arg("phase_delay"),
287 py::arg("measure_rtt") = false,
288 py::arg("control_sfp") = true,
289 py::arg("sfp_mux") = -1)
290 .def("measure_endpoint_rtt",
292 py::arg("address"),
293 py::arg("control_sfp") = true,
294 py::arg("sfp_mux") = -1)
295 .def("switch_mux", &timing::KerberosDesign::switch_mux, py::arg("mux"), py::arg("resync_cdr") = false)
296 .def("read_active_mux", &timing::KerberosDesign::read_active_mux)
297 .def("configure", &timing::KerberosDesign::configure, py::arg("clock_source"), py::arg("ts_source"))
298 ;
299
300 // Gaia
301 py::class_<timing::GaiaDesign, uhal::Node>(m, "GaiaDesign")
302 .def("read_firmware_version", &timing::GaiaDesign::read_firmware_version)
303 .def("validate_firmware_version", &timing::GaiaDesign::validate_firmware_version)
304 .def("sync_timestamp", &timing::GaiaDesign::sync_timestamp)
305 .def<void (timing::GaiaDesign::*)(uint32_t, double, bool) const>("enable_periodic_fl_cmd",
307 py::arg("channel"),
308 py::arg("rate"),
309 py::arg("poisson"))
310 .def<void (timing::GaiaDesign::*)(uint32_t, uint32_t, double, bool) const>("enable_periodic_fl_cmd",
312 py::arg("command"),
313 py::arg("channel"),
314 py::arg("rate"),
315 py::arg("poisson"))
316 .def("apply_endpoint_delay",
318 py::arg("address"),
319 py::arg("coarse_delay"),
320 py::arg("fine_delay"),
321 py::arg("phase_delay"),
322 py::arg("measure_rtt") = false,
323 py::arg("control_sfp") = true,
324 py::arg("sfp_mux") = -1)
325 .def("measure_endpoint_rtt",
327 py::arg("address"),
328 py::arg("control_sfp") = true,
329 py::arg("sfp_mux") = -1)
330 .def("switch_mux", &timing::GaiaDesign::switch_mux, py::arg("mux"), py::arg("resync_cdr") = false)
331 .def("read_active_mux", &timing::GaiaDesign::read_active_mux)
332 .def<void (timing::GaiaDesign::*)(ClockSource, TimestampSource, IRIGEpoch) const>("configure", &timing::GaiaDesign::configure, py::arg("clock_source"), py::arg("ts_source"), py::arg("epoch"))
333 ;
334} // NOLINT
335
336} // namespace python
337} // namespace timing
338} // namespace dunedaq
Class for timing master with integrated HSI designs.
std::string get_status(bool print_out=false) const override
Get status string, optionally print.
void configure(ClockSource clock_source, TimestampSource ts_source) const override
Prepare the timing master for data taking.
uint8_t read_active_mux() const override
Read cdr mux.
void switch_mux(uint8_t mux_channel, bool resync_cdr=false) const override
Switch cdr mux.
uint32_t read_firmware_version() const override
Read endpoint firmware version.
std::string get_status(bool print_out=false) const override
Get status string, optionally print.
void configure(ClockSource clock_source) const override
Prepare the timing endpoint for data taking.
void validate_firmware_version() const override
Validate endpoint firmware version.
uint32_t read_firmware_version() const override
Give info to collector.
void configure(ClockSource clock_source) const override
Prepare the timing endpoint for data taking.
std::string get_status(bool print_out=false) const override
Get status string, optionally print.
void validate_firmware_version() const override
Validate endpoint firmware version.
void configure(ClockSource clock_source) const override
Give info to collector.
uint32_t read_firmware_version() const override
Read firmware version.
void validate_firmware_version() const override
Validate endpoint firmware version.
Class for timing fanout designs.
void configure(ClockSource clock_source, TimestampSource ts_source, IRIGEpoch epoch) const
Give info to collector.
virtual void configure_hsi(uint32_t src, uint32_t re_mask, uint32_t fe_mask, uint32_t inv_mask, double rate, bool dispatch=true) const
Configure the HSI node.
virtual const HSINode & get_hsi_node() const
Get the HSI node.
Class for timing fanout designs.
void configure(ClockSource clock_source, TimestampSource ts_source) const override
Give info to collector.
Base class for timing master designs.
std::string get_status(bool print_out=false) const override
Get status string, optionally print.
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.
Class for PDI timing master design on mux board.
std::vector< uint32_t > scan_sfp_mux() const override
Scan SFP for alive timing transmitters.
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 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.
virtual uint8_t read_active_mux() const =0
Read cdr mux.
virtual void switch_mux(uint8_t mux_channel, bool resync_cdr=false) const =0
Switch cdr mux.
Class for PDI timing master design (known as overlord).
void configure(ClockSource clock_source, TimestampSource ts_source) const override
Prepare the timing master for data taking.
std::string get_status(bool print_out=false) const override
Get status string, optionally print.
Class for PDI ouroboros timing master design.
void register_top_designs(py::module &)
Including Qt Headers.