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

Class for master global node. More...

#include <VLCmdGeneratorNode.hpp>

Inheritance diagram for dunedaq::timing::VLCmdGeneratorNode:
[legend]
Collaboration diagram for dunedaq::timing::VLCmdGeneratorNode:
[legend]

Public Member Functions

 VLCmdGeneratorNode (const uhal::Node &node)
 
virtual ~VLCmdGeneratorNode ()
 
std::string get_status (bool print_out=false) const override
 Print the status of the timing node.
 
void switch_endpoint_sfp (uint32_t address, bool enable=false) const
 Control the endpoint sfp tx laser.
 
void apply_endpoint_delay (uint32_t address, uint32_t coarse_delay, uint32_t fine_delay, uint32_t phase_delay) const
 Adjust endpoint delay.
 
- Public Member Functions inherited from dunedaq::timing::TimingNode
 TimingNode (const uhal::Node &node)
 
virtual ~TimingNode ()
 
std::map< std::string, uhal::ValWord< uint32_t > > read_sub_nodes (const uhal::Node &node, bool dispatch=true) const
 Read subnodes.
 
void reset_sub_nodes (const uhal::Node &node, uint32_t aValue=0x0, bool dispatch=true) const
 Reset subnodes.
 

Detailed Description

Class for master global node.

Definition at line 29 of file VLCmdGeneratorNode.hpp.

Constructor & Destructor Documentation

◆ VLCmdGeneratorNode()

dunedaq::timing::VLCmdGeneratorNode::VLCmdGeneratorNode ( const uhal::Node & node)
explicit

Definition at line 22 of file VLCmdGeneratorNode.cpp.

23 : TimingNode(node)
24{}
TimingNode(const uhal::Node &node)

◆ ~VLCmdGeneratorNode()

dunedaq::timing::VLCmdGeneratorNode::~VLCmdGeneratorNode ( )
virtual

Definition at line 28 of file VLCmdGeneratorNode.cpp.

28{}

Member Function Documentation

◆ apply_endpoint_delay()

void dunedaq::timing::VLCmdGeneratorNode::apply_endpoint_delay ( uint32_t address,
uint32_t coarse_delay,
uint32_t fine_delay,
uint32_t phase_delay ) const

Adjust endpoint delay.

Definition at line 61 of file VLCmdGeneratorNode.cpp.

65{
66 reset_sub_nodes(getNode("csr.ctrl"), false);
67 getNode("csr.ctrl.tx_en").write(0x0);
68 getNode("csr.ctrl.addr").write(address);
69 getNode("csr.ctrl.cdel").write(coarse_delay);
70 getNode("csr.ctrl.fdel").write(fine_delay);
71 getNode("csr.ctrl.pdel").write(phase_delay);
72 getNode("csr.ctrl.update").write(0x1);
73 getNode("csr.ctrl.go").write(0x1);
74 getNode("csr.ctrl.go").write(0x0);
75 getClient().dispatch();
76
77 TLOG_DEBUG(2) << "Coarse delay " << format_reg_value(coarse_delay) << " applied";
78 TLOG_DEBUG(2) << "Fine delay " << format_reg_value(fine_delay) << " applied";
79 TLOG_DEBUG(2) << "Phase delay " << format_reg_value(phase_delay) << " applied";
80}
void reset_sub_nodes(const uhal::Node &node, uint32_t aValue=0x0, bool dispatch=true) const
Reset subnodes.
#define TLOG_DEBUG(lvl,...)
Definition Logging.hpp:112
std::string format_reg_value(T reg_value, uint32_t base)
Definition toolbox.hxx:117

◆ get_status()

std::string dunedaq::timing::VLCmdGeneratorNode::get_status ( bool print_out = false) const
overridevirtual

Print the status of the timing node.

Implements dunedaq::timing::TimingNode.

Definition at line 33 of file VLCmdGeneratorNode.cpp.

34{
35 std::stringstream status;
36 auto subnodes = read_sub_nodes(getNode("csr.stat"));
37 status << format_reg_table(subnodes, "VL Cmd gen state");
38
39 if (print_out)
40 TLOG() << status.str();
41 return status.str();
42}
std::map< std::string, uhal::ValWord< uint32_t > > read_sub_nodes(const uhal::Node &node, bool dispatch=true) const
Read subnodes.
#define TLOG(...)
Definition macro.hpp:22
std::string format_reg_table(T data, std::string title, std::vector< std::string > headers)
Format reg-value table.
Definition toolbox.hxx:166

◆ switch_endpoint_sfp()

void dunedaq::timing::VLCmdGeneratorNode::switch_endpoint_sfp ( uint32_t address,
bool enable = false ) const

Control the endpoint sfp tx laser.

Definition at line 47 of file VLCmdGeneratorNode.cpp.

48{
49 TLOG_DEBUG(3) << "Switching SFP for endpoint address: " << address << ", to state: " << enable;
50 reset_sub_nodes(getNode("csr.ctrl"));
51 getNode("csr.ctrl.addr").write(address);
52 getNode("csr.ctrl.tx_en").write(enable);
53 getNode("csr.ctrl.go").write(0x1);
54 getNode("csr.ctrl.go").write(0x0);
55 getClient().dispatch();
56}

The documentation for this class was generated from the following files: