12#ifndef TIMING_INCLUDE_TIMING_IONODE_HPP_
13#define TIMING_INCLUDE_TIMING_IONODE_HPP_
29#include "uhal/DerivedNode.hpp"
47 IONode(
const uhal::Node& node,
48 std::string uid_i2c_bus,
49 std::string pll_i2c_bus,
50 std::string pll_i2c_device,
51 std::vector<std::string> clock_names,
52 std::vector<std::string> sfp_i2c_buses);
122 std::unique_ptr<const T>
get_i2c_device(
const std::string& i2c_bus_name,
const std::string& i2c_device_name)
const;
129 virtual std::unique_ptr<const SI534xSlave>
get_pll()
const;
134 virtual void configure_pll(
const std::string& clock_config_file =
"")
const;
159 virtual std::string
get_sfp_status(uint32_t sfp_id,
bool print_out =
false)
const;
184 virtual void reset(
const std::string& clock_config_file)
const = 0;
377 {
"fmc_5344_ouroboros_free_run",
"SI5344/PDTS0003.txt" },
378 {
"fmc_5394_ouroboros_free_run",
"SI5344/PDTS0003.txt" },
380 {
"fmc_5344_master_free_run",
"SI5344/PDTS0003.txt" },
381 {
"fmc_5394_master_free_run",
"SI5344/PDTS0003.txt" },
383 {
"fmc_5344_overlord_free_run",
"SI5344/PDTS0003.txt" },
384 {
"fmc_5394_overlord_free_run",
"SI5344/PDTS0003.txt" },
386 {
"fmc_5344_boreas_free_run",
"SI5344/PDTS0003.txt" },
387 {
"fmc_5394_boreas_free_run",
"SI5344/PDTS0003.txt" },
389 {
"fmc_5344_endpoint_input_1",
"devel/ENDPOINT-Si5344-50MHzRef.txt" },
390 {
"fmc_5394_endpoint_input_1",
"devel/ENDPOINT-Si5344-50MHzRef.txt" },
392 {
"fmc_5344_chronos_input_1",
"devel/ENDPOINT-Si5344-50MHzRef.txt" },
393 {
"fmc_5394_chronos_input_1",
"devel/ENDPOINT-Si5344-50MHzRef.txt" },
395 {
"fmc_5344_charon_input_1",
"devel/ENDPOINT-Si5344-50MHzRef.txt" },
396 {
"fmc_5394_charon_input_1",
"devel/ENDPOINT-Si5344-50MHzRef.txt" },
398 {
"fmc_5344_hades_input_1",
"devel/ENDPOINT-Si5344-50MHzRef.txt" },
399 {
"fmc_5394_hades_input_1",
"devel/ENDPOINT-Si5344-50MHzRef.txt" },
401 {
"tlu_5345_boreas_free_run",
"nocdr/DUNE_TLU-4_45_M-Registers.txt" },
403 {
"pc059_5345_master_free_run",
"devel/PDTS_PC059_FANOUT.txt" },
404 {
"pc059_5345_fanout_input_1",
"devel/PDTS_PC059_FANOUT_SFP_IN.txt" },
406 {
"pc069_5395_master_free_run",
"nocdr/Si5395-RevA-069a_mst-Registers.txt" },
407 {
"pc069_5395_boreas_free_run",
"nocdr/Si5395-RevA-069a_mst-Registers.txt" },
409 {
"pc069_5395_endpoint_input_1",
"nocdr/Si5395-RevA-069a_ep-Registers.txt" },
410 {
"pc069_5395_chronos_input_1",
"nocdr/Si5395-RevA-069a_ep-Registers.txt" },
411 {
"pc069_5395_charon_input_1",
"nocdr/Si5395-RevA-069a_ep-Registers.txt" },
412 {
"pc069_5395_hades_input_1",
"nocdr/Si5395-RevA-069a_ep-Registers.txt" },
414 {
"pc069_5345_master_free_run",
"nocdr/Si5345-RevD-pc69bmst-Registers.txt" },
415 {
"pc069_5345_boreas_free_run",
"nocdr/Si5345-RevD-pc69bmst-Registers.txt" },
417 {
"pc069_5345_chronos_input_1",
"nocdr/Si5345-RevD-pc69bept-Registers.txt" },
418 {
"pc069_5345_charon_input_1",
"nocdr/Si5345-RevD-pc69bept-Registers.txt" },
419 {
"pc069_5345_endpoint_input_1",
"nocdr/Si5345-RevD-pc69bept-Registers.txt" },
420 {
"pc069_5345_hades_input_1",
"nocdr/Si5345-RevD-pc69bept-Registers.txt" },
422 {
"gib_5395_gaia_free_run",
"nocdr/GIB_Debug_01.txt" },
423 {
"gibv3_5395_gaia_free_run",
"nocdr/GIB_Debug_01.txt" },
425 {
"gib_5395_gaia_input_0",
"nocdr/Si5395-RevA-GIB10MHZ-Registers.txt" },
426 {
"gibv3_5395_gaia_input_0",
"nocdr/Si5395-RevA-GIB10MHZ-Registers.txt" },
429 {
"mib_5395_kerberos_free_run",
430 "nocdr/Si5395-RevA-MIB_FREE-Registers.txt" },
431 {
"mib_5395_kerberos_input_0",
432 "nocdr/Si5395-RevA-MIB_INSW-Registers.txt" },
433 {
"mib_5395_kerberos_input_1",
434 "nocdr/Si5395-RevA-MIB_INSW-Registers.txt" },
435 {
"mib_5395_kerberos_input_2",
436 "nocdr/Si5395-RevA-MIB_INSW-Registers.txt" },
438 {
"fib_5395_fanout_input_1",
439 "nocdr/Si5395-RevA-FIB_FAN_AFCv4-FIBBP250-Registers.txt" },
447 kDesignMaster,
kDesignOuroboros,
kDesignOuroborosSim,
kDesignEndpoint,
kDesignFanout,
kDesignOverlord,
kDesignEndpoBICRT,
kDesignChronos,
kDesignBoreas,
kDesignKerberos,
kDesignGaia
454 return source_it->second;
virtual uint32_t read_board_type() const
Read the word identifying the timing board.
virtual void write_soft_reset_register() const
Write soft reset register.
virtual void switch_sfp_soft_tx_control_bit(uint32_t sfp_id, bool turn_on) const
control tx laser of on-board SFP softly (I2C command)
static const std::vector< BoardType > & get_library_supported_boards()
virtual void reset(const std::string &clock_config_file) const =0
Reset timing node.
static const std::map< CarrierType, std::string > carrier_type_map
virtual std::vector< double > read_clock_frequencies() const
Read frequencies of on-board clocks.
virtual BoardRevision get_board_revision() const
Read the word identifying the timing board.
const std::string m_pll_i2c_bus
virtual void switch_sfp_tx(uint32_t sfp_id, bool turn_on) const =0
control tx laser of on-board SFP
IONode(const uhal::Node &node, std::string uid_i2c_bus, std::string pll_i2c_bus, std::string pll_i2c_device, std::vector< std::string > clock_names, std::vector< std::string > sfp_i2c_buses)
virtual void set_up_io_infrastructure() const
Set up i2c buses, enable ICs.
const std::string m_pll_i2c_device
virtual uint32_t read_carrier_type() const
Read the word identifying the FPFA carrier board.
static const std::map< std::string, std::string > & get_clock_config_map()
static const std::vector< BoardType > library_supported_boards
virtual std::string get_sfp_status(uint32_t sfp_id, bool print_out=false) const
Print status of on-board SFP.
virtual std::string get_hardware_info(bool print_out=false) const
Print hardware information.
virtual std::string get_uid_address_parameter_name() const =0
Get the UID address parameter name.
virtual uint32_t read_design_type() const
Read the word identifying the firmware design in the FPGA.
const std::string m_uid_i2c_bus
static const std::map< BoardRevision, std::string > board_revision_map
virtual void soft_reset() const
Reset timing node.
const std::vector< std::string > m_clock_names
virtual std::string get_full_clock_config_file_path(const ClockSource &clock_source) const
Get the full config path.
static const std::vector< DesignType > & get_library_supported_designs()
const std::vector< std::string > m_sfp_i2c_buses
virtual std::unique_ptr< const SI534xSlave > get_pll() const
Get the PLL chip.
static const std::map< uint64_t, BoardRevision > & get_board_uid_revision_map()
virtual bool clocks_ok() const =0
Clocks ready?
virtual void reset_pll() const =0
Reset PLL.
static const std::map< BoardType, std::string > board_type_map
static const std::vector< DesignType > library_supported_designs
static const std::map< uint64_t, BoardRevision > board_uid_revision_map
virtual uint64_t read_board_uid() const
Read the word containing the timing board UID.
virtual uint32_t read_firmware_frequency() const
Read the word identifying the frequency [units of Hz] of the firmware in the FPGA.
static const std::map< DesignType, std::string > design_type_map
static const std::map< DesignType, std::string > & get_design_type_map()
static const std::map< ClockSource, std::string > clock_source_map
static const std::map< std::string, std::string > clock_config_map
virtual void configure_pll(const std::string &clock_config_file="") const
Configure clock chip.
static const std::map< BoardRevision, std::string > & get_board_revision_map()
virtual std::string get_clock_frequencies_table(bool print_out=false) const
Print frequencies of on-board clocks.
virtual void get_info(timinghardwareinfo::TimingPLLMonitorData &mon_data) const
static const std::map< BoardType, std::string > & get_board_type_map()
std::unique_ptr< const T > get_i2c_device(const std::string &i2c_bus_name, const std::string &i2c_device_name) const
Get the an I2C chip.
virtual std::string get_pll_status(bool print_out=false) const
Print status of on-board PLL.
static const std::map< CarrierType, std::string > & get_carrier_type_map()
static std::string clock_source_to_string(const ClockSource &source)
TimingNode(const uhal::Node &node)
std::string format_reg_value(T reg_value, uint32_t base)