DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::timing::python Namespace Reference

Functions

std::map< std::string, FixedLengthCommandTypeswap_commands_map (const std::map< FixedLengthCommandType, std::string > &command_map)
 
void register_definitions (py::module &m)
 
void register_endpoint (py::module &m)
 
void register_i2c (py::module &m)
 
void register_io (py::module &m)
 
void register_master (py::module &m)
 
void register_top_designs (py::module &)
 
void register_toolbox (py::module &)
 
 PYBIND11_MODULE (_daq_timing_py, top_module)
 

Function Documentation

◆ PYBIND11_MODULE()

dunedaq::timing::python::PYBIND11_MODULE ( _daq_timing_py ,
top_module  )

Definition at line 26 of file timing_wrapper.cpp.

26 {
27
28 top_module.doc() = "c++ implementation of timing python modules"; // optional module docstring
29
30 // timing.core
31 py::module_ core_module = top_module.def_submodule("core");
32
33 timing::python::register_i2c(core_module);
34 timing::python::register_endpoint(core_module);
35 timing::python::register_io(core_module);
36 timing::python::register_master(core_module);
37 timing::python::register_top_designs(core_module);
38
39 // timing.common
40 py::module_ common_module = top_module.def_submodule("common");
41
42 // timing.common.definitions
43 py::module_ defs_module = common_module.def_submodule("definitions");
44 timing::python::register_definitions(defs_module);
45
46 // timing.common.toolbox
47 py::module_ toolbox_module = common_module.def_submodule("toolbox");
48 timing::python::register_toolbox(toolbox_module);
49}

◆ register_definitions()

void dunedaq::timing::python::register_definitions ( py::module & m)

Definition at line 38 of file definitions.cpp.

39{
40 py::enum_<BoardType>(m, "BoardType")
41 .value("kBoardFMC", kBoardFMC)
42 .value("kBoardSim", kBoardSim)
43 .value("kBoardPC059", kBoardPC059)
44 .value("kBoardMicrozed", kBoardMicrozed)
45 .value("kBoardTLU", kBoardTLU)
46 .value("kBoardFIB", kBoardFIB)
47 .value("kBoardMIB", kBoardMIB)
48 .value("kBoardPC069", kBoardPC069)
49 .value("kBoardGIB", kBoardGIB)
50 .value("kBoardGIBV3", kBoardGIBV3)
51 .value("kBoardUnknown", kBoardUnknown)
52 .export_values();
53
54 py::enum_<BoardRevision>(m, "BoardRevision")
55 .value("kFMCRev1", kFMCRev1)
56 .value("kFMCRev2", kFMCRev2)
57 .value("kFMCRev3", kFMCRev3)
58 .value("kFMCRev4", kFMCRev4)
59 .value("kPC059Rev1", kPC059Rev1)
60 .value("kTLURev1", kTLURev1)
61 .value("kSIMRev1", kSIMRev1)
62 .value("kFIBRev1", kFIBRev1)
63 .value("kMIBRev1", kMIBRev1)
64 .value("kPC069a", kPC069a)
65 .value("kPC069b", kPC069b)
66 .value("kPC069c", kPC069c)
67 .value("kMIBRev2", kMIBRev2)
68 .value("kGIBRev1", kGIBRev1)
69 .value("kFIBRev2", kFIBRev2)
70 .export_values();
71
72 py::enum_<CarrierType>(m, "CarrierType")
73 .value("kCarrierEnclustraA35", kCarrierEnclustraA35)
74 .value("kCarrierKC705", kCarrierKC705)
75 .value("kCarrierMicrozed", kCarrierMicrozed)
76 .value("kCarrierATFC", kCarrierATFC)
77 .value("kCarrierAFC", kCarrierAFC)
78 .value("kCarrierNexusVideo", kCarrierNexusVideo)
79 .value("kCarrierTrenzTE0712", kCarrierTrenzTE0712)
80 .value("kCarrierUnknown", kCarrierUnknown)
81 .export_values();
82
83 py::enum_<DesignType>(m, "DesignType")
84 .value("kDesignMaster", kDesignMaster)
85 .value("kDesignOuroborosSim", kDesignOuroborosSim)
86 .value("kDesignOuroboros", kDesignOuroboros)
87 .value("kDesignTest", kDesignTest)
88 .value("kDesignEndpoint", kDesignEndpoint)
89 .value("kDesignFanout", kDesignFanout)
90 .value("kDesignOverlord", kDesignOverlord)
91 .value("kDesignEndpoBICRT", kDesignEndpoBICRT)
92 .value("kDesignChronos", kDesignChronos)
93 .value("kDesignBoreas", kDesignBoreas)
94 .value("kDesignKerberos", kDesignKerberos)
95 .value("kDesignGaia", kDesignGaia)
96 .value("kDesignCharon", kDesignCharon)
97 .value("kDesignHades", kDesignHades)
98 .value("kDesignUnknown", kDesignUnknown)
99 .export_values();
100
101 py::enum_<FixedLengthCommandType>(m, "FixedLengthCommandType")
102 .value("TimeSync", TimeSync)
103 .value("Echo", Echo)
104 .value("SpillStart", SpillStart)
105 .value("SpillStop", SpillStop)
106 .value("RunStart", RunStart)
107 .value("RunStop", RunStop)
108 .value("WibCalib", WibCalib)
109 .value("SSPCalib", SSPCalib)
110 .value("FakeTrig0", FakeTrig0)
111 .value("FakeTrig1", FakeTrig1)
112 .value("FakeTrig2", FakeTrig2)
113 .value("FakeTrig3", FakeTrig3)
114 .value("BeamTrig", BeamTrig)
115 .value("NoBeamTrig", NoBeamTrig)
116 .value("ExtFakeTrig", ExtFakeTrig)
117 .export_values();
118
119 py::enum_<ClockSource>(m, "ClockSource")
120 .value("kFreeRun", kFreeRun)
121 .value("kInput0", kInput0)
122 .value("kInput1", kInput1)
123 .value("kInput2", kInput2)
124 .value("kInput3", kInput3)
125 .export_values();
126
127 py::enum_<TimestampSource>(m, "TimestampSource")
128 .value("kUpstream", kUpstream)
129 .value("kSoftware", kSoftware)
130 .value("kMixed", kMixed)
131 .export_values();
132
133 py::enum_<TimestampEpoch>(m, "TimestampEpoch")
134 .value("kUNIX", kUNIX)
135 .value("kCustom", kCustom)
136 .export_values();
137
138 py::enum_<TimestampTimebase>(m, "TimestampTimebase")
139 .value("kTAI", kTAI)
140 .value("kUTC", kUTC)
141 .export_values();
142
143 m.attr("kBoardNameMap") = timing::IONode::get_board_type_map();
144 m.attr("kCarrierNameMap") = timing::IONode::get_carrier_type_map();
145 m.attr("kDesignNameMap") = timing::IONode::get_design_type_map();
146 m.attr("kBoardRevisionMap") = timing::IONode::get_board_revision_map();
147 m.attr("kUIDRevisionMap") = timing::IONode::get_board_uid_revision_map();
148 m.attr("kClockConfigMap") = timing::IONode::get_clock_config_map();
149 m.attr("kEpStates") = EndpointNode::get_endpoint_state_map();
150 m.attr("kLibrarySupportedBoards") = timing::IONode::get_library_supported_boards();
151 m.attr("kLibrarySupportedDesigns") = timing::IONode::get_library_supported_designs();
152 m.attr("kMasterFWMajorRequired") = MasterNode::required_major_firmware_version;
153 m.attr("kHSIWordsNumber") = HSINode::hsi_buffer_event_words_number;
154}

◆ register_endpoint()

void dunedaq::timing::python::register_endpoint ( py::module & m)

Definition at line 22 of file endpoint.cpp.

23{
24
25 py::class_<timing::HSINode, uhal::Node>(m, "HSINode")
26 .def(py::init<const uhal::Node&>())
27 .def("get_status", &timing::HSINode::get_status, py::arg("print_out") = false)
28 .def("configure_hsi",
29 &timing::HSINode::configure_hsi,
30 py::arg("src"),
31 py::arg("re_mask"),
32 py::arg("fe_mask"),
33 py::arg("inv_mask"),
34 py::arg("rate"),
35 py::arg("clock_frequency_hz"),
36 py::arg("dispatch") = true)
37 .def("start_hsi", &timing::HSINode::start_hsi, py::arg("dispatch") = true)
38 .def("stop_hsi", &timing::HSINode::stop_hsi, py::arg("dispatch") = true)
39 .def("reset_hsi", &timing::HSINode::reset_hsi, py::arg("dispatch") = true)
40 .def("get_data_buffer_table",
41 &timing::HSINode::get_data_buffer_table,
42 py::arg("read_all") = false,
43 py::arg("print_out") = false)
44 .def("read_buffer_warning", &timing::HSINode::read_buffer_warning)
45 .def("read_buffer_error", &timing::HSINode::read_buffer_error)
46 .def<uhal::ValVector<uint32_t> (timing::HSINode::*)(uint16_t&, bool, bool) const>("read_data_buffer", &timing::HSINode::read_data_buffer);
47
48 py::class_<timing::EndpointNode, uhal::Node>(m, "EndpointNode")
49 .def(py::init<const uhal::Node&>())
50 .def("disable", &timing::EndpointNode::disable)
51 .def("enable", &timing::EndpointNode::enable, py::arg("address") = 0, py::arg("partition") = 0)
52 .def("reset", &timing::EndpointNode::reset, py::arg("address") = 0, py::arg("partition") = 0)
53 .def("get_status", &timing::EndpointNode::get_status, py::arg("print_out") = false);
54}
Class for HSI nodes.
Definition HSINode.hpp:37

◆ register_i2c()

void dunedaq::timing::python::register_i2c ( py::module & m)

Definition at line 31 of file i2c.cpp.

32{
33 // .def("hardReset", (void ( mp7::CtrlNode::*) (double)) 0, mp7_CTRLNODE_hardReset_overloads())
34
35 // Wrap timing::I2CMasterNode
36 py::class_<timing::I2CMasterNode, uhal::Node>(m, "I2CMasterNode")
37 .def(py::init<const uhal::Node&>())
38 .def("get_i2c_clock_prescale", &timing::I2CMasterNode::get_i2c_clock_prescale)
39 .def("read_i2c",
40 &timing::I2CMasterNode::read_i2c,
41 py::arg("i2c_device_address"),
42 py::arg("i2c_reg_address"),
43 py::arg("atomic") = false
44 )
45 .def("write_i2c",
46 &timing::I2CMasterNode::write_i2c,
47 py::arg("i2c_device_address"),
48 py::arg("i2c_reg_address"),
49 py::arg("data"),
50 py::arg("send_stop") = true)
51 .def("read_i2cArray",
52 &timing::I2CMasterNode::read_i2cArray,
53 py::arg("i2c_device_address"),
54 py::arg("i2c_reg_address"),
55 py::arg("number_of_words"),
56 py::arg("atomic") = false
57 )
58 .def("write_i2cArray",
59 &timing::I2CMasterNode::write_i2cArray,
60 py::arg("i2c_device_address"),
61 py::arg("i2c_reg_address"),
62 py::arg("data"),
63 py::arg("send_stop") = true)
64 .def("read_i2cPrimitive", &timing::I2CMasterNode::read_i2cPrimitive)
65 .def("write_i2cPrimitive",
66 &timing::I2CMasterNode::write_i2cPrimitive,
67 py::arg("i2c_device_address"),
68 py::arg("data"),
69 py::arg("send_stop") = true)
70 .def("get_slaves", &timing::I2CMasterNode::get_slaves)
71 .def("get_slave", &timing::I2CMasterNode::get_slave, py::return_value_policy::reference_internal)
72 .def("get_slave_address", &timing::I2CMasterNode::get_slave_address)
73 .def("ping", &timing::I2CMasterNode::ping)
74 .def("scan", &timing::I2CMasterNode::scan)
75 .def("reset", &timing::I2CMasterNode::reset);
76
77 // Wrap timing::I2CSlave
78 py::class_<timing::I2CSlave>(m, "I2CSlave")
79 .def("get_i2c_address", &timing::I2CSlave::get_i2c_address)
80 .def<uint8_t (timing::I2CSlave::*)(uint32_t) const>("read_i2c", // NOLINT(build/unsigned)
81 &timing::I2CSlave::read_i2c)
82 .def<uint8_t (timing::I2CSlave::*)(uint32_t, uint32_t) const>("read_i2c", // NOLINT(build/unsigned)
83 &timing::I2CSlave::read_i2c)
84 .def<uint8_t (timing::I2CSlave::*)(uint32_t) const>("read_i2c_atomic", // NOLINT(build/unsigned)
85 &timing::I2CSlave::read_i2c_atomic)
86 .def<uint8_t (timing::I2CSlave::*)(uint32_t, uint32_t) const>("read_i2c_atomic", // NOLINT(build/unsigned)
87 &timing::I2CSlave::read_i2c_atomic)
88 .def<void (timing::I2CSlave::*)(uint32_t, uint8_t, bool) const>("write_i2c", // NOLINT(build/unsigned)
89 &timing::I2CSlave::write_i2c,
90 py::arg("i2c_reg_address"),
91 py::arg("data"),
92 py::arg("send_stop") = true)
93 .def<void (timing::I2CSlave::*)(uint32_t, uint32_t, uint8_t, bool) const>("write_i2c", // NOLINT(build/unsigned)
94 &timing::I2CSlave::write_i2c,
95 py::arg("i2c_device_address"),
96 py::arg("i2c_reg_address"),
97 py::arg("data"),
98 py::arg("send_stop") = true)
99 .def<std::vector<uint8_t> (timing::I2CSlave::*)(uint32_t, uint32_t) const>( // NOLINT(build/unsigned)
100 "read_i2cArray",
101 &timing::I2CSlave::read_i2cArray)
102 .def<std::vector<uint8_t> (timing::I2CSlave::*)(uint32_t, uint32_t, uint32_t) const>( // NOLINT(build/unsigned)
103 "read_i2cArray",
104 &timing::I2CSlave::read_i2cArray)
105 .def<std::vector<uint8_t> (timing::I2CSlave::*)(uint32_t, uint32_t) const>( // NOLINT(build/unsigned)
106 "read_i2cArray_atomic",
107 &timing::I2CSlave::read_i2cArray_atomic)
108 .def<std::vector<uint8_t> (timing::I2CSlave::*)(uint32_t, uint32_t, uint32_t) const>( // NOLINT(build/unsigned)
109 "read_i2cArray_atomic",
110 &timing::I2CSlave::read_i2cArray_atomic)
111 .def<void (timing::I2CSlave::*)(uint32_t, std::vector<uint8_t>, bool) const>( // NOLINT(build/unsigned)
112 "write_i2cArray",
113 &timing::I2CSlave::write_i2cArray,
114 py::arg("i2c_reg_address"),
115 py::arg("data"),
116 py::arg("send_stop") = true)
117 .def<void (timing::I2CSlave::*)(uint32_t, uint32_t, std::vector<uint8_t>, bool) const>( // NOLINT(build/unsigned)
118 "write_i2cArray",
119 &timing::I2CSlave::write_i2cArray,
120 py::arg("i2c_device_address"),
121 py::arg("i2c_reg_address"),
122 py::arg("data"),
123 py::arg("send_stop") = true)
124 .def("read_i2cPrimitive", &timing::I2CSlave::read_i2cPrimitive)
125 .def("write_i2cPrimitive", &timing::I2CSlave::write_i2cPrimitive, py::arg("data"), py::arg("send_stop") = true)
126 .def("ping", &timing::I2CSlave::ping);
127
128 // Wrap SIChipSlave
129 py::class_<timing::SIChipSlave, timing::I2CSlave>(m, "SIChipSlave")
130 .def(py::init<const timing::I2CMasterNode*, uint8_t>()) // NOLINT(build/unsigned)
131 .def("read_page", &timing::SIChipSlave::read_page)
132 .def("switch_page", &timing::SIChipSlave::switch_page)
133 .def("read_device_version", &timing::SIChipSlave::read_device_version)
134 .def("read_clock_register", &timing::SIChipSlave::read_clock_register)
135 .def("write_clock_register", &timing::SIChipSlave::write_clock_register);
136
137 // Wrap SI534xSlave
138 py::class_<timing::SI534xSlave, timing::SIChipSlave>(m, "SI534xSlave")
139 .def(py::init<const timing::I2CMasterNode*, uint8_t>()) // NOLINT(build/unsigned)
140 .def("configure", &timing::SI534xSlave::configure)
141 .def("read_config_id", &timing::SI534xSlave::read_config_id)
142 .def("get_status", &timing::SI534xSlave::get_status, py::arg("print_out"))
143 // .def("registers", &timing::SI534xSlave::registers)
144 ;
145
146 // Wrap SI534xNode
147 py::class_<timing::SI534xNode, timing::SI534xSlave, timing::I2CMasterNode>(m, "SI534xNode")
148 .def(py::init<const uhal::Node&>());
149
150 // Wrap I2CExpanderSlave
151 py::class_<timing::I2CExpanderSlave, timing::I2CSlave>(m, "I2CExpanderSlave")
152 .def(py::init<const timing::I2CMasterNode*, uint8_t>()) // NOLINT(build/unsigned)
153 .def("set_io", &timing::I2CExpanderSlave::set_io)
154 .def("set_inversion", &timing::I2CExpanderSlave::set_inversion)
155 .def("set_outputs", &timing::I2CExpanderSlave::set_outputs)
156 .def("read_inputs", &timing::I2CExpanderSlave::read_inputs)
157 .def("read_outputs_config", &timing::I2CExpanderSlave::read_outputs_config)
158 .def("debug", &timing::I2CExpanderSlave::debug);
159
160// // Wrap I2CExpanderNode
161// py::class_<timing::I2CExpanderNode, timing::I2CExpanderSlave, timing::I2CMasterNode>(m, "I2CExpanderNode")
162// .def(py::init<const uhal::Node&>());
163
164 // Wrap DACSlave
165 py::class_<timing::DACSlave, timing::I2CSlave>(m, "DACSlave")
166 .def(py::init<const timing::I2CMasterNode*, uint8_t>()) // NOLINT(build/unsigned)
167 .def("set_interal_ref", &timing::DACSlave::set_interal_ref)
168 .def("set_dac", &timing::DACSlave::set_dac);
169
170 // Wrap DACNode
171 py::class_<timing::DACNode, timing::DACSlave, timing::I2CMasterNode>(m, "DACNode").def(py::init<const uhal::Node&>());
172 // NOLINT(readability/fn_size)
173
174 py::class_<timing::LTC2945Node, timing::I2CSlave>(m, "LTC2945Node")
175 .def(py::init<const timing::I2CMasterNode*, uint8_t, double>()) // NOLINT(build/unsigned)
176 .def("read_v_in", &timing::LTC2945Node::read_v_in)
177 .def("read_delta_sense_v", &timing::LTC2945Node::read_delta_sense_v)
178 .def("read_power", &timing::LTC2945Node::read_power)
179 ;
180
181 // Wrap I2C9546SwitchNode
182 py::class_<timing::I2C9546SwitchSlave, timing::I2CSlave>(m, "I2C9546SwitchSlave")
183 .def(py::init<const timing::I2CMasterNode*, uint8_t>()) // NOLINT(build/unsigned)
184 .def("enable_channel", &timing::I2C9546SwitchSlave::enable_channel)
185 .def("disable_channel", &timing::I2C9546SwitchSlave::disable_channel)
186 .def("read_channels_states", &timing::I2C9546SwitchSlave::read_channels_states)
187 .def("set_channels_states", &timing::I2C9546SwitchSlave::set_channels_states);
188}

◆ register_io()

void dunedaq::timing::python::register_io ( py::module & m)

Definition at line 35 of file io.cpp.

36{
37
38 py::class_<timing::IONode, uhal::Node>(m, "IONode");
39
40 py::class_<timing::FMCIONode, timing::IONode, uhal::Node>(m, "FMCIONode")
41 .def(py::init<const uhal::Node&>())
42 .def<void (timing::FMCIONode::*)(const std::string&) const>(
43 "reset", &timing::FMCIONode::reset, py::arg("clock_config_file"))
44 .def<void (timing::FMCIONode::*)(const timing::ClockSource&) const>(
45 "reset", &timing::FMCIONode::reset, py::arg("clock_source"))
46 .def("soft_reset", &timing::FMCIONode::soft_reset)
47 .def("read_firmware_frequency", &timing::FMCIONode::read_firmware_frequency)
48 .def("get_clock_frequencies_table", &timing::FMCIONode::get_clock_frequencies_table, py::arg("print_out") = false)
49 .def("get_status", &timing::FMCIONode::get_status, py::arg("print_out") = false)
50 .def("get_pll_status", &timing::FMCIONode::get_pll_status, py::arg("print_out") = false)
51 .def("get_hardware_info", &timing::FMCIONode::get_hardware_info, py::arg("print_out") = false)
52 .def("get_sfp_status", &timing::FMCIONode::get_sfp_status, py::arg("sfp_id"), py::arg("print_out") = false)
53 .def("switch_sfp_soft_tx_control_bit", &timing::FMCIONode::switch_sfp_soft_tx_control_bit)
54 .def("switch_sfp_tx", &timing::FMCIONode::switch_sfp_tx);
55
56 py::class_<timing::PC059IONode, timing::IONode, uhal::Node>(m, "PC059IONode")
57 .def(py::init<const uhal::Node&>())
58 .def<void (timing::PC059IONode::*)(const std::string&) const>(
59 "reset", &timing::PC059IONode::reset, py::arg("clock_config_file"))
60 .def<void (timing::PC059IONode::*)(const timing::ClockSource&) const>(
61 "reset", &timing::PC059IONode::reset, py::arg("clock_source"))
62 .def("soft_reset", &timing::PC059IONode::soft_reset)
63 .def("read_firmware_frequency", &timing::PC059IONode::read_firmware_frequency)
64 .def("get_clock_frequencies_table", &timing::PC059IONode::get_clock_frequencies_table, py::arg("print_out") = false)
65 .def("get_status", &timing::PC059IONode::get_status, py::arg("print_out") = false)
66 .def("get_pll_status", &timing::PC059IONode::get_pll_status, py::arg("print_out") = false)
67 .def("get_hardware_info", &timing::PC059IONode::get_hardware_info, py::arg("print_out") = false)
68 .def("get_sfp_status", &timing::PC059IONode::get_sfp_status, py::arg("sfp_id"), py::arg("print_out") = false)
69 .def("switch_sfp_soft_tx_control_bit", &timing::PC059IONode::switch_sfp_soft_tx_control_bit)
70 .def("switch_sfp_mux_channel", &timing::PC059IONode::switch_sfp_mux_channel, py::arg("mux_channel"))
71 .def("read_active_sfp_mux_channel", &timing::PC059IONode::read_active_sfp_mux_channel)
72 .def("switch_sfp_tx", &timing::PC059IONode::switch_sfp_tx);
73
74 py::class_<timing::FIBIONode, timing::IONode, uhal::Node>(m, "FIBIONode")
75 .def(py::init<const uhal::Node&>())
76 .def<void (timing::FIBIONode::*)(const std::string&) const>(
77 "reset", &timing::FIBIONode::reset, py::arg("clock_config_file"))
78 .def<void (timing::FIBIONode::*)(const timing::ClockSource&) const>(
79 "reset", &timing::FIBIONode::reset, py::arg("clock_source"))
80 .def("soft_reset", &timing::FIBIONode::soft_reset)
81 .def("read_firmware_frequency", &timing::FIBIONode::read_firmware_frequency)
82 .def("get_clock_frequencies_table", &timing::FIBIONode::get_clock_frequencies_table, py::arg("print_out") = false)
83 .def("get_status", &timing::FIBIONode::get_status, py::arg("print_out") = false)
84 .def("get_pll_status", &timing::FIBIONode::get_pll_status, py::arg("print_out") = false)
85 .def("get_hardware_info", &timing::FIBIONode::get_hardware_info, py::arg("print_out") = false)
86 .def("get_sfp_status", &timing::FIBIONode::get_sfp_status, py::arg("sfp_id"), py::arg("print_out") = false)
87 .def("switch_sfp_soft_tx_control_bit", &timing::FIBIONode::switch_sfp_soft_tx_control_bit)
88 .def("switch_sfp_mux_channel", &timing::FIBIONode::switch_sfp_mux_channel, py::arg("mux_channel"))
89 .def("read_active_sfp_mux_channel", &timing::FIBIONode::read_active_sfp_mux_channel)
90 .def("switch_sfp_tx", &timing::FIBIONode::switch_sfp_tx);
91
92 py::class_<timing::FIBV2IONode, timing::IONode, uhal::Node>(m, "FIBV2IONode")
93 .def(py::init<const uhal::Node&>())
94 .def<void (timing::FIBV2IONode::*)(const timing::ClockSource&) const>(
95 "reset", &timing::FIBV2IONode::reset, py::arg("clock_source"))
96 .def("soft_reset", &timing::FIBV2IONode::soft_reset)
97 .def("read_firmware_frequency", &timing::FIBV2IONode::read_firmware_frequency)
98 .def("get_clock_frequencies_table", &timing::FIBV2IONode::get_clock_frequencies_table, py::arg("print_out") = false)
99 .def("get_status", &timing::FIBV2IONode::get_status, py::arg("print_out") = false)
100 .def("get_pll_status", &timing::FIBV2IONode::get_pll_status, py::arg("print_out") = false)
101 .def("get_hardware_info", &timing::FIBV2IONode::get_hardware_info, py::arg("print_out") = false)
102 .def("get_sfp_status", &timing::FIBV2IONode::get_sfp_status, py::arg("sfp_id"), py::arg("print_out") = false)
103 .def("switch_sfp_soft_tx_control_bit", &timing::FIBV2IONode::switch_sfp_soft_tx_control_bit)
104 .def("switch_sfp_tx", &timing::FIBV2IONode::switch_sfp_tx)
105 .def("read_board_temperature", &timing::FIBV2IONode::read_board_temperature)
106 ;
107
108 py::class_<timing::TLUIONode, timing::IONode, uhal::Node>(m, "TLUIONode")
109 .def(py::init<const uhal::Node&>())
110 .def<void (timing::TLUIONode::*)(const std::string&) const>(
111 "reset", &timing::TLUIONode::reset, py::arg("clock_config_file"))
112 .def<void (timing::TLUIONode::*)(const timing::ClockSource&) const>(
113 "reset", &timing::TLUIONode::reset, py::arg("clock_source"))
114 .def("soft_reset", &timing::TLUIONode::soft_reset)
115 .def("read_firmware_frequency", &timing::TLUIONode::read_firmware_frequency)
116 .def("get_clock_frequencies_table", &timing::TLUIONode::get_clock_frequencies_table, py::arg("print_out") = false)
117 .def("get_status", &timing::TLUIONode::get_status, py::arg("print_out") = false)
118 .def("get_pll_status", &timing::TLUIONode::get_pll_status, py::arg("print_out") = false)
119 .def("get_hardware_info", &timing::TLUIONode::get_hardware_info, py::arg("print_out") = false)
120 .def("get_sfp_status", &timing::TLUIONode::get_sfp_status, py::arg("sfp_id"), py::arg("print_out") = false)
121 .def("switch_sfp_soft_tx_control_bit", &timing::TLUIONode::switch_sfp_soft_tx_control_bit)
122 .def("configure_dac",
123 &timing::TLUIONode::configure_dac,
124 py::arg("dac_id"),
125 py::arg("dac_value"),
126 py::arg("internal_ref") = false)
127 .def("switch_sfp_tx", &timing::TLUIONode::switch_sfp_tx);
128
129 py::class_<timing::SIMIONode, timing::IONode, uhal::Node>(m, "SIMIONode")
130 .def(py::init<const uhal::Node&>())
131 .def<void (timing::SIMIONode::*)(const std::string&) const>(
132 "reset", &timing::SIMIONode::reset, py::arg("clock_config_file"))
133 .def<void (timing::SIMIONode::*)(const timing::ClockSource&) const>(
134 "reset", &timing::SIMIONode::reset, py::arg("clock_source"))
135 .def("soft_reset", &timing::SIMIONode::soft_reset)
136 .def("read_firmware_frequency", &timing::SIMIONode::read_firmware_frequency)
137 .def("get_clock_frequencies_table", &timing::SIMIONode::get_clock_frequencies_table, py::arg("print_out") = false)
138 .def("get_status", &timing::SIMIONode::get_status, py::arg("print_out") = false)
139 .def("get_pll_status", &timing::SIMIONode::get_pll_status, py::arg("print_out") = false)
140 .def("get_hardware_info", &timing::SIMIONode::get_hardware_info, py::arg("print_out") = false)
141 .def("get_sfp_status", &timing::SIMIONode::get_sfp_status, py::arg("sfp_id"), py::arg("print_out") = false)
142 .def("switch_sfp_soft_tx_control_bit", &timing::SIMIONode::switch_sfp_soft_tx_control_bit)
143 .def("switch_sfp_tx", &timing::SIMIONode::switch_sfp_tx);
144
145 py::class_<timing::MIBIONode, timing::IONode, uhal::Node>(m, "MIBIONode")
146 .def(py::init<const uhal::Node&>())
147 .def<void (timing::MIBIONode::*)(const std::string&) const>(
148 "reset", &timing::MIBIONode::reset, py::arg("clock_config_file"))
149 .def<void (timing::MIBIONode::*)(const timing::ClockSource&) const>(
150 "reset", &timing::MIBIONode::reset, py::arg("clock_source"))
151 .def("soft_reset", &timing::MIBIONode::soft_reset)
152 .def("read_firmware_frequency", &timing::MIBIONode::read_firmware_frequency)
153 .def("get_clock_frequencies_table", &timing::MIBIONode::get_clock_frequencies_table, py::arg("print_out") = false)
154 .def("get_status", &timing::MIBIONode::get_status, py::arg("print_out") = false)
155 .def("get_pll_status", &timing::MIBIONode::get_pll_status, py::arg("print_out") = false)
156 .def("get_pll", &timing::MIBIONode::get_pll)
157 .def("get_hardware_info", &timing::MIBIONode::get_hardware_info, py::arg("print_out") = false)
158 .def("get_sfp_status", &timing::MIBIONode::get_sfp_status, py::arg("sfp_id"), py::arg("print_out") = false)
159 .def("switch_sfp_soft_tx_control_bit", &timing::MIBIONode::switch_sfp_soft_tx_control_bit)
160 .def("switch_sfp_tx", &timing::MIBIONode::switch_sfp_tx)
161 ;
162
163 py::class_<timing::SwitchyardNode, uhal::Node>(m, "SwitchyardNode")
164 .def("get_status", &timing::SwitchyardNode::get_status, py::arg("print_out") = false)
165 .def("configure_master_source", &timing::SwitchyardNode::configure_master_source, py::arg("master_source"), py::arg("dispatch") = true)
166 .def("configure_endpoint_source", &timing::SwitchyardNode::configure_endpoint_source, py::arg("endpoint_source"), py::arg("dispatch") = true);
167
168 py::class_<timing::MIBV2IONode, timing::IONode, uhal::Node>(m, "MIBV2IONode")
169 .def(py::init<const uhal::Node&>())
170 .def<void (timing::MIBV2IONode::*)(const std::string&) const>(
171 "reset", &timing::MIBV2IONode::reset, py::arg("clock_config_file"))
172 .def<void (timing::MIBV2IONode::*)(const timing::ClockSource&) const>(
173 "reset", &timing::MIBV2IONode::reset, py::arg("clock_source"))
174 .def("soft_reset", &timing::MIBV2IONode::soft_reset)
175 .def("read_firmware_frequency", &timing::MIBV2IONode::read_firmware_frequency)
176 .def("get_clock_frequencies_table", &timing::MIBV2IONode::get_clock_frequencies_table, py::arg("print_out") = false)
177 .def("get_status", &timing::MIBV2IONode::get_status, py::arg("print_out") = false)
178 .def("get_pll_status", &timing::MIBV2IONode::get_pll_status, py::arg("print_out") = false)
179 .def("get_pll", &timing::MIBV2IONode::get_pll)
180 .def("get_hardware_info", &timing::MIBV2IONode::get_hardware_info, py::arg("print_out") = false)
181 .def("get_sfp_status", &timing::MIBV2IONode::get_sfp_status, py::arg("sfp_id"), py::arg("print_out") = false)
182 .def("switch_sfp_soft_tx_control_bit", &timing::MIBV2IONode::switch_sfp_soft_tx_control_bit)
183 .def("switch_sfp_tx", &timing::MIBV2IONode::switch_sfp_tx)
184 ;
185
186 // TODO fix missing binding and add GIBv2/3 inheritance, dlindebaum, 2025.10.06
187 py::class_<timing::GIBIONode, timing::IONode, uhal::Node>(m, "GIBIONode")
188 .def(py::init<const uhal::Node&>())
189 .def<void (timing::GIBIONode::*)(const std::string&) const>(
190 "reset", &timing::GIBIONode::reset, py::arg("clock_config_file"))
191 .def<void (timing::GIBIONode::*)(const timing::ClockSource&) const>(
192 "reset", &timing::GIBIONode::reset, py::arg("clock_source"))
193 .def("configure_pll", &timing::GIBIONode::configure_pll, py::arg("clock_config_file"))
194 .def("soft_reset", &timing::GIBIONode::soft_reset)
195 .def("read_firmware_frequency", &timing::GIBIONode::read_firmware_frequency)
196 .def("get_clock_frequencies_table", &timing::GIBIONode::get_clock_frequencies_table, py::arg("print_out") = false)
197 .def("get_full_clock_config_file_path", &timing::GIBIONode::get_full_clock_config_file_path, py::arg("clock_source"))
198 .def("get_status", &timing::GIBIONode::get_status, py::arg("print_out") = false)
199 .def("get_pll_status", &timing::GIBIONode::get_pll_status, py::arg("print_out") = false)
200 .def("get_pll", &timing::GIBIONode::get_pll)
201 .def("get_hardware_info", &timing::GIBIONode::get_hardware_info, py::arg("print_out") = false)
202 .def("set_up_io_infrastructure", &timing::GIBIONode::set_up_io_infrastructure)
203 .def("configure_expander", &timing::GIBIONode::configure_expander)
204 .def("reset_pll", &timing::GIBIONode::reset_pll)
205 .def("get_sfp_status", &timing::GIBIONode::get_sfp_status, py::arg("sfp_id"), py::arg("print_out") = false)
206 .def("read_io_expanders", &timing::GIBIONode::read_io_expanders)
207 .def("read_sfps_los", &timing::GIBIONode::read_sfps_los)
208 .def("read_sfps_fault", &timing::GIBIONode::read_sfps_fault)
209 .def("clocks_ok", &timing::GIBIONode::clocks_ok)
210 .def("switch_sfp_soft_tx_control_bit", &timing::GIBIONode::switch_sfp_soft_tx_control_bit)
211 .def("set_i2c_mux_channels", &timing::GIBIONode::set_i2c_mux_channels)
212 .def("switch_sfp_tx", &timing::GIBIONode::switch_sfp_tx)
213 ;
214
215 py::class_<timing::GIBV2IONode, timing::IONode, uhal::Node>(m, "GIBV2IONode")
216 .def(py::init<const uhal::Node&>())
217 .def<void (timing::GIBV2IONode::*)(const std::string&) const>(
218 "reset", &timing::GIBV2IONode::reset, py::arg("clock_config_file"))
219 .def<void (timing::GIBV2IONode::*)(const timing::ClockSource&) const>(
220 "reset", &timing::GIBV2IONode::reset, py::arg("clock_source"))
221 .def("configure_pll", &timing::GIBV2IONode::configure_pll, py::arg("clock_config_file"))
222 .def("soft_reset", &timing::GIBV2IONode::soft_reset)
223 .def("read_firmware_frequency", &timing::GIBV2IONode::read_firmware_frequency)
224 .def("get_full_clock_config_file_path", &timing::GIBV2IONode::get_full_clock_config_file_path, py::arg("clock_source"))
225 .def("get_clock_frequencies_table", &timing::GIBV2IONode::get_clock_frequencies_table, py::arg("print_out") = false)
226 .def("get_status", &timing::GIBV2IONode::get_status, py::arg("print_out") = false)
227 .def("get_pll_status", &timing::GIBV2IONode::get_pll_status, py::arg("print_out") = false)
228 .def("get_pll", &timing::GIBV2IONode::get_pll)
229 .def("get_hardware_info", &timing::GIBV2IONode::get_hardware_info, py::arg("print_out") = false)
230 .def("set_up_io_infrastructure", &timing::GIBV2IONode::set_up_io_infrastructure)
231 .def("configure_expander", &timing::GIBV2IONode::configure_expander)
232 .def("reset_pll", &timing::GIBV2IONode::reset_pll)
233 .def("get_sfp_status", &timing::GIBV2IONode::get_sfp_status, py::arg("sfp_id"), py::arg("print_out") = false)
234 .def("read_io_expanders", &timing::GIBV2IONode::read_io_expanders)
235 .def("read_sfps_los", &timing::GIBV2IONode::read_sfps_los)
236 .def("read_sfps_fault", &timing::GIBV2IONode::read_sfps_fault)
237 .def("clocks_ok", &timing::GIBV2IONode::clocks_ok)
238 .def("switch_sfp_soft_tx_control_bit", &timing::GIBV2IONode::switch_sfp_soft_tx_control_bit)
239 .def("set_i2c_mux_channels", &timing::GIBV2IONode::set_i2c_mux_channels)
240 .def("switch_sfp_tx", &timing::GIBV2IONode::switch_sfp_tx)
241 ;
242
243 py::class_<timing::GIBV3IONode, timing::IONode, uhal::Node>(m, "GIBV3IONode")
244 .def(py::init<const uhal::Node&>())
245 .def<void (timing::GIBV3IONode::*)(const std::string&) const>(
246 "reset", &timing::GIBV3IONode::reset, py::arg("clock_config_file"))
247 .def<void (timing::GIBV3IONode::*)(const timing::ClockSource&) const>(
248 "reset", &timing::GIBV3IONode::reset, py::arg("clock_source"))
249 .def("configure_pll", &timing::GIBV3IONode::configure_pll, py::arg("clock_config_file"))
250 .def("soft_reset", &timing::GIBV3IONode::soft_reset)
251 .def("read_firmware_frequency", &timing::GIBV3IONode::read_firmware_frequency)
252 .def("get_full_clock_config_file_path", &timing::GIBV3IONode::get_full_clock_config_file_path, py::arg("clock_source"))
253 .def("get_clock_frequencies_table", &timing::GIBV3IONode::get_clock_frequencies_table, py::arg("print_out") = false)
254 .def("get_status", &timing::GIBV3IONode::get_status, py::arg("print_out") = false)
255 .def("get_pll_status", &timing::GIBV3IONode::get_pll_status, py::arg("print_out") = false)
256 .def("get_pll", &timing::GIBV3IONode::get_pll)
257 .def("get_hardware_info", &timing::GIBV3IONode::get_hardware_info, py::arg("print_out") = false)
258 .def("set_up_io_infrastructure", &timing::GIBV3IONode::set_up_io_infrastructure)
259 .def("configure_expander", &timing::GIBV3IONode::configure_expander)
260 .def("reset_pll", &timing::GIBV3IONode::reset_pll)
261 .def("get_sfp_status", &timing::GIBV3IONode::get_sfp_status, py::arg("sfp_id"), py::arg("print_out") = false)
262 .def("read_io_expanders", &timing::GIBV3IONode::read_io_expanders)
263 .def("read_sfps_los", &timing::GIBV3IONode::read_sfps_los)
264 .def("read_sfps_fault", &timing::GIBV3IONode::read_sfps_fault)
265 .def("clocks_ok", &timing::GIBV3IONode::clocks_ok)
266 .def("switch_sfp_soft_tx_control_bit", &timing::GIBV3IONode::switch_sfp_soft_tx_control_bit)
267 .def("set_i2c_mux_channels", &timing::GIBV3IONode::set_i2c_mux_channels)
268 .def("switch_sfp_tx", &timing::GIBV3IONode::switch_sfp_tx)
269 ;
270
271} // NOLINT
Class for the FIB board.
Definition FIBIONode.hpp:32
Class for the FIB board.
Class for the timing FMC board.
Definition FMCIONode.hpp:33
Class for the timing FMC board.
Definition GIBIONode.hpp:33
Class for the timing FMC board.
Class for the timing FMC board.
Class for the timing FMC board.
Definition MIBIONode.hpp:34
Class for the timing FMC board.
Class for the PC059 board.
Class for the timing simulation IO.
Definition SIMIONode.hpp:34
Class for the TLU board.
Definition TLUIONode.hpp:34

◆ register_master()

void dunedaq::timing::python::register_master ( py::module & m)

Definition at line 23 of file master.cpp.

24{
25 py::class_<timing::MasterNode, uhal::Node>(m, "MasterNode")
26 .def(py::init<const uhal::Node&>())
27 .def("switch_endpoint_sfp", &timing::MasterNode::switch_endpoint_sfp)
28 .def("enable_upstream_endpoint", &timing::MasterNode::enable_upstream_endpoint)
29 .def("reset_command_counters", &timing::MasterNode::reset_command_counters)
30 .def("transmit_async_packet", &timing::MasterNode::transmit_async_packet, py::arg("packet"), py::arg("timeout") = 500) //timeout [us]
31 .def("write_endpoint_data", &timing::MasterNode::write_endpoint_data)
32 .def("read_endpoint_data", &timing::MasterNode::read_endpoint_data)
33 .def("send_fl_cmd",
34 &timing::MasterNode::send_fl_cmd,
35 py::arg("command"),
36 py::arg("channel"),
37 py::arg("number_of_commands") = 1)
38 .def<void (timing::MasterNode::*)(uint32_t, uint32_t, double, bool, uint32_t) const>("enable_periodic_fl_cmd",
39 &timing::MasterNode::enable_periodic_fl_cmd,
40 py::arg("command"),
41 py::arg("channel"),
42 py::arg("rate"),
43 py::arg("poisson"),
44 py::arg("clock_frequency_hz"))
45 .def("disable_periodic_fl_cmd", &timing::MasterNode::disable_periodic_fl_cmd)
46 .def("get_status", &timing::MasterNode::get_status, py::arg("print_out") = false)
47 .def("get_status_with_date", &timing::MasterNode::get_status_with_date, py::arg("clock_frequency_hz"), py::arg("print_out") = false)
48 .def("sync_timestamp", &timing::MasterNode::sync_timestamp, py::arg("source"))
49 .def("read_timestamp", &timing::MasterNode::read_timestamp)
50 .def("disable_timestamp_broadcast", &timing::MasterNode::disable_timestamp_broadcast)
51 .def("enable_timestamp_broadcast", &timing::MasterNode::enable_timestamp_broadcast)
52 .def("configure_endpoint_command_decoder", &timing::MasterNode::configure_endpoint_command_decoder,
53 py::arg("endpoint_address"),
54 py::arg("slot"),
55 py::arg("command"));
56
57 py::class_<timing::UpstreamCDRNode, uhal::Node>(m, "UpstreamCDRNode")
58 .def(py::init<const uhal::Node&>())
59 .def("get_status", &timing::UpstreamCDRNode::get_status, py::arg("print_out") = false)
60 .def("resync", &timing::UpstreamCDRNode::resync);
61
62 py::class_<timing::IRIGTimestampNode, uhal::Node>(m, "IRIGTimestampNode")
63 .def(py::init<const uhal::Node&>())
64 .def("get_status", &timing::IRIGTimestampNode::get_status, py::arg("print_out") = false)
65 .def("set_ts_timebase", &timing::IRIGTimestampNode::set_ts_timebase, py::arg("ts_timebase"))
66 .def("set_ts_epoch", &timing::IRIGTimestampNode::set_ts_epoch, py::arg("ts_epoch"))
67 .def("set_ts_epoch_value", &timing::IRIGTimestampNode::set_ts_epoch_value, py::arg("epoch_to_2000_seconds_tai"), py::arg("epoch_to_2000_leap_seconds"))
68 .def("set_ts_seconds_offset", &timing::IRIGTimestampNode::set_ts_seconds_offset, py::arg("seconds_offset"))
69 .def("set_ts_ticks_offset", &timing::IRIGTimestampNode::set_ts_ticks_offset, py::arg("ticks_offset"))
70 ;
71
72}
Class for PD-II/DUNE master timing nodes.

◆ register_toolbox()

void dunedaq::timing::python::register_toolbox ( py::module & m)
extern

Definition at line 21 of file toolbox.cpp.

22{
23 m.def("format_firmware_version", &timing::format_firmware_version);
24}

◆ register_top_designs()

void dunedaq::timing::python::register_top_designs ( py::module & m)
extern

Definition at line 29 of file top_designs.cpp.

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",
38 &timing::BoreasDesign::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",
43 &timing::BoreasDesign::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",
49 &timing::BoreasDesign::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",
58 &timing::BoreasDesign::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",
64 &timing::BoreasDesign::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",
89 &timing::OuroborosMuxDesign::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",
94 &timing::OuroborosMuxDesign::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",
102 &timing::OuroborosMuxDesign::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",
111 &timing::OuroborosMuxDesign::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",
125 &timing::MasterMuxDesign::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",
130 &timing::MasterMuxDesign::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",
138 &timing::MasterMuxDesign::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",
147 &timing::MasterMuxDesign::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",
162 &timing::MasterDesign::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",
167 &timing::MasterDesign::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",
173 &timing::MasterDesign::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",
182 &timing::MasterDesign::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",
196 &timing::OuroborosDesign::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",
201 &timing::OuroborosDesign::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",
207 &timing::OuroborosDesign::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",
216 &timing::OuroborosDesign::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",
238 &timing::ChronosDesign::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",
255 &timing::HadesDesign::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",
271 &timing::KerberosDesign::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",
276 &timing::KerberosDesign::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",
282 &timing::KerberosDesign::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",
291 &timing::KerberosDesign::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 .def("switch_timing_source_mux", &timing::KerberosDesign::switch_timing_source_mux, py::arg("mux_channel"))
299 .def("read_active_timing_source_mux", &timing::KerberosDesign::read_active_timing_source_mux)
300 ;
301
302 // Gaia
303 py::class_<timing::GaiaDesign, uhal::Node>(m, "GaiaDesign")
304 .def("read_firmware_version", &timing::GaiaDesign::read_firmware_version)
305 .def("validate_firmware_version", &timing::GaiaDesign::validate_firmware_version)
306 .def("sync_timestamp", &timing::GaiaDesign::sync_timestamp)
307 .def<void (timing::GaiaDesign::*)(uint32_t, double, bool) const>("enable_periodic_fl_cmd",
308 &timing::GaiaDesign::enable_periodic_fl_cmd,
309 py::arg("channel"),
310 py::arg("rate"),
311 py::arg("poisson"))
312 .def<void (timing::GaiaDesign::*)(uint32_t, uint32_t, double, bool) const>("enable_periodic_fl_cmd",
313 &timing::GaiaDesign::enable_periodic_fl_cmd,
314 py::arg("command"),
315 py::arg("channel"),
316 py::arg("rate"),
317 py::arg("poisson"))
318 .def("apply_endpoint_delay",
319 &timing::GaiaDesign::apply_endpoint_delay,
320 py::arg("address"),
321 py::arg("coarse_delay"),
322 py::arg("fine_delay"),
323 py::arg("phase_delay"),
324 py::arg("measure_rtt") = false,
325 py::arg("control_sfp") = true,
326 py::arg("sfp_mux") = -1)
327 .def("measure_endpoint_rtt",
328 &timing::GaiaDesign::measure_endpoint_rtt,
329 py::arg("address"),
330 py::arg("control_sfp") = true,
331 py::arg("sfp_mux") = -1)
332 .def("switch_mux", &timing::GaiaDesign::switch_mux, py::arg("mux"), py::arg("resync_cdr") = false)
333 .def("read_active_mux", &timing::GaiaDesign::read_active_mux)
334 .def<void (timing::GaiaDesign::*)(ClockSource, TimestampSource, TimestampTimebase) const>("configure", &timing::GaiaDesign::configure, py::arg("clock_source"), py::arg("ts_source"), py::arg("timebase"))
335 ;
336} // NOLINT
Class for timing master with integrated HSI designs.
Class for timing fanout designs.
Class for timing fanout designs.
Base class for timing master designs.
Class for PDI timing master design on mux board.
Class for PDI timing master design (known as overlord).
Class for PDI ouroboros timing master design.

◆ swap_commands_map()

std::map< std::string, FixedLengthCommandType > dunedaq::timing::python::swap_commands_map ( const std::map< FixedLengthCommandType, std::string > & command_map)

Definition at line 28 of file definitions.cpp.

29{
30 std::map<std::string, FixedLengthCommandType> swapped_map;
31 for (auto& cmd: command_map) {
32 swapped_map.emplace( std::pair<std::string,FixedLengthCommandType>(cmd.second, cmd.first) );
33 }
34 return swapped_map;
35}