Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<node id="io" description="MIB v2 IO" fwinfo="endpoint" class="MIBV2IONode">
<node id="io" description="MIB v3 IO" fwinfo="endpoint" class="MIBV3IONode">
<node id="csr" address="0x0" description="ctrl/stat register" fwinfo="endpoint;width=1">
<node id="ctrl" address="0x0">
<node id="soft_rst" mask="0x1"/>
Expand Down Expand Up @@ -33,4 +33,4 @@
<node id="sfp1_i2c" address="0x20" module="file://opencores_i2c.xml" class="I2CMasterNode" parameters="SFP_EEProm=0x50;SFP_Diag=0x51"/>
<node id="sfp2_i2c" address="0x40" module="file://opencores_i2c.xml" class="I2CMasterNode" parameters="SFP_EEProm=0x50;SFP_Diag=0x51"/>
<node id="freq" address="0x50" module="file://ipbus_freq_ctr.xml" class="FrequencyCounterNode"/>
</node>
</node>
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
</node>
<node id="stat" address="0x10">
<node id="valid" mask="0x1"/>
<node id="clk1_early" mask="0x2"/>
<node id="clk2_early" mask="0x4"/>
<node id="clk1_early" mask="0x2"/>
<node id="clk2_early" mask="0x4"/>
</node>
<node id="000" address="0x11"/>
<node id="001" address="0x12"/>
<node id="010" address="0x13"/>
<node id="011" address="0x14"/>
<node id="100" address="0x15"/>
<node id="100" address="0x15"/>
<node id="101" address="0x16"/>
<node id="110" address="0x17"/>
<node id="111" address="0x18"/>
<node id="111" address="0x18"/>
</node>
</node>
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
<node id="rst" mask="0x1"/>
<node id="go" mask="0x2"/>
</node>
<node id="stat" address="0x1">
<node id="stat" address="0x8">
<node id="err_sticky" mask="0x1"/>
<node id="valid" mask="0x2"/>
</node>
<node id="ts_0_lo" address="0x2"/>
<node id="ts_0_hi" address="0x3"/>
<node id="ts_1_lo" address="0x4"/>
<node id="ts_1_hi" address="0x5"/>
<node id="ts_0_lo" address="0x9"/>
<node id="ts_0_hi" address="0xA"/>
<node id="ts_1_lo" address="0xB"/>
<node id="ts_1_hi" address="0xC"/>
<node id="ts_2_lo" address="0xD"/>
<node id="ts_2_hi" address="0xE"/>
</node>
</node>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<node id="TOP" class="KerberosDesign">
<node id="io" address="0x0" module="file://pdts_mib_v2_io.xml"/>
<node id="io" address="0x0" module="file://pdts_mib_v3_io.xml"/>
<node id="endpoint0" address="0x100" module="file://pdts_ep_mon.xml"/>
<node id="endpoint1" address="0x200" module="file://pdts_ep_mon.xml"/>
<node id="endpoint2" address="0x300" module="file://pdts_ep_mon.xml"/>
Expand Down
20 changes: 10 additions & 10 deletions include/timing/MIBV2IONode.hpp → include/timing/MIBV3IONode.hpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/**
* @file MIBV2IONode.hpp
* @file MIBV3IONode.hpp
*
* MIBV2IONode is a class providing an interface
* MIBV3IONode is a class providing an interface
* to the MIB V2 IO firmware block.
*
* This is part of the DUNE DAQ Software Suite, copyright 2020.
* Licensing/copyright details are in the COPYING file that you should have
* received with this code.
*/

#ifndef TIMING_INCLUDE_TIMING_MIBV2IONODE_HPP_
#define TIMING_INCLUDE_TIMING_MIBV2IONODE_HPP_
#ifndef TIMING_INCLUDE_TIMING_MIBV3IONODE_HPP_
#define TIMING_INCLUDE_TIMING_MIBV3IONODE_HPP_

// PDT Headers
#include "TimingIssues.hpp"
Expand All @@ -29,13 +29,13 @@ namespace timing {
/**
* @brief Class for the timing FMC board.
*/
class MIBV2IONode : public IONode
class MIBV3IONode : public IONode
{
UHAL_DERIVEDNODE(MIBV2IONode)
UHAL_DERIVEDNODE(MIBV3IONode)

public:
explicit MIBV2IONode(const uhal::Node& node);
virtual ~MIBV2IONode();
explicit MIBV3IONode(const uhal::Node& node);
virtual ~MIBV3IONode();

/**
* @brief Get the UID address parameter name.
Expand Down Expand Up @@ -92,7 +92,7 @@ class MIBV2IONode : public IONode
/**
* @brief Fill hardware monitoring structure.
*/
//void get_info(timinghardwareinfo::TimingMIBV2MonitorData& mon_data) const;
//void get_info(timinghardwareinfo::TimingMIBV3MonitorData& mon_data) const;

/**
* @brief Give info to collector.
Expand All @@ -107,4 +107,4 @@ class MIBV2IONode : public IONode
} // namespace timing
} // namespace dunedaq

#endif // TIMING_INCLUDE_TIMING_MIBV2IONODE_HPP_
#endif // TIMING_INCLUDE_TIMING_MIBV3IONODE_HPP_
32 changes: 16 additions & 16 deletions pybindsrc/io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "timing/TLUIONode.hpp"
#include "timing/MIBIONode.hpp"
#include "timing/SwitchyardNode.hpp"
#include "timing/MIBV2IONode.hpp"
#include "timing/MIBV3IONode.hpp"
#include "timing/GIBIONode.hpp"
#include "timing/GIBV2IONode.hpp"
#include "timing/GIBV3IONode.hpp"
Expand Down Expand Up @@ -165,22 +165,22 @@ register_io(py::module& m)
.def("configure_master_source", &timing::SwitchyardNode::configure_master_source, py::arg("master_source"), py::arg("dispatch") = true)
.def("configure_endpoint_source", &timing::SwitchyardNode::configure_endpoint_source, py::arg("endpoint_source"), py::arg("dispatch") = true);

py::class_<timing::MIBV2IONode, timing::IONode, uhal::Node>(m, "MIBV2IONode")
py::class_<timing::MIBV3IONode, timing::IONode, uhal::Node>(m, "MIBV3IONode")
.def(py::init<const uhal::Node&>())
.def<void (timing::MIBV2IONode::*)(const std::string&) const>(
"reset", &timing::MIBV2IONode::reset, py::arg("clock_config_file"))
.def<void (timing::MIBV2IONode::*)(const timing::ClockSource&) const>(
"reset", &timing::MIBV2IONode::reset, py::arg("clock_source"))
.def("soft_reset", &timing::MIBV2IONode::soft_reset)
.def("read_firmware_frequency", &timing::MIBV2IONode::read_firmware_frequency)
.def("get_clock_frequencies_table", &timing::MIBV2IONode::get_clock_frequencies_table, py::arg("print_out") = false)
.def("get_status", &timing::MIBV2IONode::get_status, py::arg("print_out") = false)
.def("get_pll_status", &timing::MIBV2IONode::get_pll_status, py::arg("print_out") = false)
.def("get_pll", &timing::MIBV2IONode::get_pll)
.def("get_hardware_info", &timing::MIBV2IONode::get_hardware_info, py::arg("print_out") = false)
.def("get_sfp_status", &timing::MIBV2IONode::get_sfp_status, py::arg("sfp_id"), py::arg("print_out") = false)
.def("switch_sfp_soft_tx_control_bit", &timing::MIBV2IONode::switch_sfp_soft_tx_control_bit)
.def("switch_sfp_tx", &timing::MIBV2IONode::switch_sfp_tx)
.def<void (timing::MIBV3IONode::*)(const std::string&) const>(
"reset", &timing::MIBV3IONode::reset, py::arg("clock_config_file"))
.def<void (timing::MIBV3IONode::*)(const timing::ClockSource&) const>(
"reset", &timing::MIBV3IONode::reset, py::arg("clock_source"))
.def("soft_reset", &timing::MIBV3IONode::soft_reset)
.def("read_firmware_frequency", &timing::MIBV3IONode::read_firmware_frequency)
.def("get_clock_frequencies_table", &timing::MIBV3IONode::get_clock_frequencies_table, py::arg("print_out") = false)
.def("get_status", &timing::MIBV3IONode::get_status, py::arg("print_out") = false)
.def("get_pll_status", &timing::MIBV3IONode::get_pll_status, py::arg("print_out") = false)
.def("get_pll", &timing::MIBV3IONode::get_pll)
.def("get_hardware_info", &timing::MIBV3IONode::get_hardware_info, py::arg("print_out") = false)
.def("get_sfp_status", &timing::MIBV3IONode::get_sfp_status, py::arg("sfp_id"), py::arg("print_out") = false)
.def("switch_sfp_soft_tx_control_bit", &timing::MIBV3IONode::switch_sfp_soft_tx_control_bit)
.def("switch_sfp_tx", &timing::MIBV3IONode::switch_sfp_tx)
;

// TODO fix missing binding and add GIBv2/3 inheritance, dlindebaum, 2025.10.06
Expand Down
38 changes: 19 additions & 19 deletions src/MIBV2IONode.cpp → src/MIBV3IONode.cpp
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
/**
* @file MIBV2IONode.cpp
* @file MIBV3IONode.cpp
*
* This is part of the DUNE DAQ Software Suite, copyright 2020.
* Licensing/copyright details are in the COPYING file that you should have
* received with this code.
*/

#include "timing/MIBV2IONode.hpp"
#include "timing/MIBV3IONode.hpp"

#include <string>
#include <math.h>

namespace dunedaq {
namespace timing {

UHAL_REGISTER_DERIVED_NODE(MIBV2IONode)
UHAL_REGISTER_DERIVED_NODE(MIBV3IONode)

//-----------------------------------------------------------------------------
MIBV2IONode::MIBV2IONode(const uhal::Node& node)
MIBV3IONode::MIBV3IONode(const uhal::Node& node)
: IONode(node, "i2c", "i2c", { "PLL" }, { "OSC", "PLL", "EP 0", "EP 1", "EP 2" }, { "sfp0_i2c", "sfp1_i2c", "sfp2_i2c" })
{
}
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
MIBV2IONode::~MIBV2IONode() {}
MIBV3IONode::~MIBV3IONode() {}
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
std::string
MIBV2IONode::get_uid_address_parameter_name() const
MIBV3IONode::get_uid_address_parameter_name() const
{
return "UID_PROM";
}
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
std::string
MIBV2IONode::get_status(bool print_out) const
MIBV3IONode::get_status(bool print_out) const
{
std::stringstream status;

Expand All @@ -52,7 +52,7 @@ MIBV2IONode::get_status(bool print_out) const

//-----------------------------------------------------------------------------
void
MIBV2IONode::reset(const std::string& clock_config_file) const
MIBV3IONode::reset(const std::string& clock_config_file) const
{
write_soft_reset_register();

Expand All @@ -73,7 +73,7 @@ MIBV2IONode::reset(const std::string& clock_config_file) const

//-----------------------------------------------------------------------------
void
MIBV2IONode::reset(const ClockSource& clock_source) const
MIBV3IONode::reset(const ClockSource& clock_source) const
{
IONode::reset(clock_source);

Expand All @@ -82,14 +82,14 @@ MIBV2IONode::reset(const ClockSource& clock_source) const
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
void MIBV2IONode::reset_pll() const
void MIBV3IONode::reset_pll() const
{
}
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
void
MIBV2IONode::switch_clock_source(const ClockSource& clock_source) const
MIBV3IONode::switch_clock_source(const ClockSource& clock_source) const
{
if (clock_source != kFreeRun)
{
Expand All @@ -101,7 +101,7 @@ MIBV2IONode::switch_clock_source(const ClockSource& clock_source) const

//-----------------------------------------------------------------------------
std::string
MIBV2IONode::get_sfp_status(uint32_t sfp_id, bool print_out) const { // NOLINT(build/unsigned)
MIBV3IONode::get_sfp_status(uint32_t sfp_id, bool print_out) const { // NOLINT(build/unsigned)
std::stringstream status;

validate_sfp_id(sfp_id);
Expand All @@ -120,7 +120,7 @@ MIBV2IONode::get_sfp_status(uint32_t sfp_id, bool print_out) const { // NOLINT(b

//-----------------------------------------------------------------------------
bool
MIBV2IONode::clocks_ok() const
MIBV3IONode::clocks_ok() const
{
std::stringstream status;

Expand All @@ -136,7 +136,7 @@ MIBV2IONode::clocks_ok() const

//-----------------------------------------------------------------------------
void
MIBV2IONode::switch_sfp_soft_tx_control_bit(uint32_t sfp_id, bool turn_on) const { // NOLINT(build/unsigned)
MIBV3IONode::switch_sfp_soft_tx_control_bit(uint32_t sfp_id, bool turn_on) const { // NOLINT(build/unsigned)
validate_sfp_id(sfp_id);

auto sfp = get_i2c_device<I2CSFPSlave>(m_sfp_i2c_buses.at(sfp_id), "SFP_EEProm");
Expand All @@ -146,7 +146,7 @@ MIBV2IONode::switch_sfp_soft_tx_control_bit(uint32_t sfp_id, bool turn_on) const

//-----------------------------------------------------------------------------
void
MIBV2IONode::switch_sfp_tx(uint32_t /*sfp_id*/, bool /*turn_on*/) const // NOLINT(build/unsigned)
MIBV3IONode::switch_sfp_tx(uint32_t /*sfp_id*/, bool /*turn_on*/) const // NOLINT(build/unsigned)
{
// TODO firmware support needed
//validate_sfp_id(sfp_id);
Expand All @@ -171,23 +171,23 @@ MIBV2IONode::switch_sfp_tx(uint32_t /*sfp_id*/, bool /*turn_on*/) const // NOLIN

//-----------------------------------------------------------------------------
//void
//MIBV2IONode::get_info(timinghardwareinfo::TimingMIBV2MonitorData& mon_data) const
//MIBV3IONode::get_info(timinghardwareinfo::TimingMIBV3MonitorData& mon_data) const
//{
// TODO
//}
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
// void
// MIBV2IONode::get_info(opmonlib::InfoCollector& /*ci*/, int /*level*/) const
// MIBV3IONode::get_info(opmonlib::InfoCollector& /*ci*/, int /*level*/) const
// {
// // TO DO
// }
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
void
MIBV2IONode::validate_sfp_id(uint32_t sfp_id) const { // NOLINT(build/unsigned)
MIBV3IONode::validate_sfp_id(uint32_t sfp_id) const { // NOLINT(build/unsigned)
// on this board we have 3 upstream SFPs
if (sfp_id > 2) {
throw InvalidSFPId(ERS_HERE, format_reg_value(sfp_id));
Expand All @@ -197,7 +197,7 @@ MIBV2IONode::validate_sfp_id(uint32_t sfp_id) const { // NOLINT(build/unsigned)

//-----------------------------------------------------------------------------
void
MIBV2IONode::validate_amc_slot(uint32_t amc_slot) const { // NOLINT(build/unsigned)
MIBV3IONode::validate_amc_slot(uint32_t amc_slot) const { // NOLINT(build/unsigned)
if (amc_slot < 1 || amc_slot > 12) {
throw InvalidAMCSlot(ERS_HERE, format_reg_value(amc_slot, 10));
}
Expand Down