LCOV - code coverage report
Current view: top level - timing/src - EndpointDesign.cpp (source / functions) Coverage Total Hit
Test: code.result Lines: 0.0 % 34 0
Test Date: 2025-12-21 13:07:08 Functions: 0.0 % 9 0

            Line data    Source code
       1              : /**
       2              :  * @file EndpointDesign.cpp
       3              :  *
       4              :  * This is part of the DUNE DAQ Software Suite, copyright 2020.
       5              :  * Licensing/copyright details are in the COPYING file that you should have
       6              :  * received with this code.
       7              :  */
       8              : 
       9              : #include "timing/EndpointDesign.hpp"
      10              : 
      11              : #include <sstream>
      12              : #include <string>
      13              : 
      14              : namespace dunedaq::timing {
      15              : 
      16            0 : UHAL_REGISTER_DERIVED_NODE(EndpointDesign)
      17              : 
      18              : //-----------------------------------------------------------------------------
      19            0 : EndpointDesign::EndpointDesign(const uhal::Node& node)
      20              :   : TopDesignInterface(node)
      21              :   , TopDesign(node)
      22            0 :   , EndpointDesignInterface(node)
      23              : 
      24            0 : {}
      25              : //-----------------------------------------------------------------------------
      26              : 
      27              : //-----------------------------------------------------------------------------
      28            0 : EndpointDesign::~EndpointDesign()
      29            0 : {}
      30              : //-----------------------------------------------------------------------------
      31              : 
      32              : //-----------------------------------------------------------------------------
      33              : std::string
      34            0 : EndpointDesign::get_status(bool print_out) const
      35              : {
      36            0 :   std::stringstream status;
      37            0 :   status << TopDesign::get_io_node_plain()->get_pll_status();
      38            0 :   size_t number_of_endpoint_nodes = EndpointDesign::get_number_of_endpoint_nodes(); 
      39            0 :   for (size_t i = 0; i < number_of_endpoint_nodes; ++i) {
      40            0 :     status << "Endpoint node " << i << " status" << std::endl;
      41            0 :     status << get_endpoint_node_plain(i)->get_status();
      42              :   }
      43            0 :   if (print_out)
      44            0 :     TLOG() << status.str();
      45            0 :   return status.str();
      46            0 : }
      47              : //-----------------------------------------------------------------------------
      48              : 
      49              : //-----------------------------------------------------------------------------
      50              : void
      51            0 : EndpointDesign::configure(ClockSource clock_source) const
      52              : {
      53            0 :   TopDesign::configure(clock_source);
      54              : 
      55            0 :   for (uint i=0; i <  get_number_of_endpoint_nodes(); ++i)
      56              :   {
      57            0 :     get_endpoint_node_plain(i)->reset(0x30+i);
      58            0 :     std::this_thread::sleep_for(std::chrono::milliseconds(1000));
      59            0 :     get_endpoint_node_plain(i)->get_status(true);
      60            0 :     if (!get_endpoint_node_plain(i)->endpoint_ready())
      61              :     {
      62            0 :       ers::error(EndpointNotReady(ERS_HERE, "Endpoint "+std::to_string(i)+" not ready!", get_endpoint_node_plain(i)->read_endpoint_state()));
      63              :     }
      64              :   }
      65            0 : }
      66              : //-----------------------------------------------------------------------------
      67              : 
      68              : //-----------------------------------------------------------------------------
      69              : uint32_t // NOLINT(build/unsigned)
      70            0 : EndpointDesign::read_firmware_version() const
      71              : {
      72            0 :   return 0; //TODO
      73              :   //return get_endpoint_node_plain(0)->read_version();
      74              : }
      75              : //-----------------------------------------------------------------------------
      76              : 
      77              : //-----------------------------------------------------------------------------
      78              : void
      79            0 : EndpointDesign::validate_firmware_version() const
      80              : {
      81              : // TODO
      82              : //  auto firmware_version = read_firmware_version();
      83              : //  
      84              : //  int major_firmware_version = (firmware_version >> 16) & 0xff;
      85              : //  int minor_firmware_version = (firmware_version >> 8) & 0xff;
      86              : //  int patch_firmware_version = (firmware_version >> 0) & 0xff;
      87              : //
      88              : //  if (major_firmware_version != g_required_major_endpoint_firmware_version)
      89              : //    ers::error(IncompatibleMajorEndpointFirmwareVersion(ERS_HERE, major_firmware_version, g_required_major_endpoint_firmware_version));
      90              : //  if (minor_firmware_version != g_required_minor_endpoint_firmware_version)
      91              : //    ers::warning(IncompatibleMinorEndpointFirmwareVersion(ERS_HERE, minor_firmware_version, g_required_minor_endpoint_firmware_version));
      92              : //  if (patch_firmware_version != g_required_patch_endpoint_firmware_version)
      93              : //    ers::warning(IncompatiblePatchEndpointFirmwareVersion(ERS_HERE, patch_firmware_version, g_required_patch_endpoint_firmware_version));
      94            0 : }
      95              : //-----------------------------------------------------------------------------
      96              : 
      97              : void
      98            0 : EndpointDesign::get_info(timingfirmwareinfo::TimingDeviceInfo& mon_data) const
      99              : {
     100            0 :   TopDesign::get_info(mon_data);
     101            0 :   EndpointDesignInterface::get_info(0, mon_data.endpoint_info);
     102            0 : }
     103              : } // namespace dunedaq::timing  
        

Generated by: LCOV version 2.0-1