#include <CardControllerWrapper.hpp>
Definition at line 27 of file CardControllerWrapper.hpp.
◆ data_t
◆ UniqueFlxCard
◆ CardControllerWrapper() [1/3]
CardControllerWrapper Constructor.
Definition at line 40 of file CardControllerWrapper.cpp.
40 :
44{
45
47 <<
"CardControllerWrapper constructor called. Open card " <<
m_device_id;
48
52 }
55
56}
const std::vector< const appmodel::FelixDataSender * > m_flx_senders
const appmodel::FelixInterface * m_flx_cfg
#define TLVL_ENTER_EXIT_METHODS
#define TLOG_DEBUG(lvl,...)
void fatal(const Issue &issue)
◆ ~CardControllerWrapper()
dunedaq::flxlibs::CardControllerWrapper::~CardControllerWrapper |
( |
| ) |
|
Definition at line 58 of file CardControllerWrapper.cpp.
59{
61 << "CardControllerWrapper destructor called. First stop check, then closing card.";
64}
◆ CardControllerWrapper() [2/3]
◆ CardControllerWrapper() [3/3]
◆ check_alignment()
void dunedaq::flxlibs::CardControllerWrapper::check_alignment |
( |
uint64_t | aligned | ) |
|
Definition at line 200 of file CardControllerWrapper.cpp.
201{
203
204 bool emu_fanout =
get_bitfield(
"FE_EMU_ENA_EMU_TOHOST");
205
207
208
209#warning FIXME: Horrible remapping workaround. Temporary fix only!
211 bool is_aligned = aligned & (1<<id_to_check);
212
213
214
215
216
217
218 if(!emu_fanout && !is_aligned) {
220 }
221 }
222}
uint16_t get_slr() const
Get "slr" attribute value. Super logic region of a FLX card.
uint64_t get_bitfield(std::string key)
void error(const Issue &issue)
◆ close_card()
void dunedaq::flxlibs::CardControllerWrapper::close_card |
( |
| ) |
|
|
private |
Definition at line 143 of file CardControllerWrapper.cpp.
144{
146 try {
149 } catch (FlxException& ex) {
151 exit(EXIT_FAILURE);
152 }
153}
◆ configure()
void dunedaq::flxlibs::CardControllerWrapper::configure |
( |
uint16_t | super_chunk_size, |
|
|
bool | emu_fanout ) |
Definition at line 89 of file CardControllerWrapper.cpp.
90{
91
92 for(size_t i=0 ; i<12; ++i) {
93
94
95 set_bitfield(fmt::format(
"DECODING_LINK{:02}_EGROUP0_CTRL_EPATH_ENA", i), 0);
96 }
97
98
99 if(emu_fanout) {
100
101
102
103
104
109 }
110 else {
111
112
113
114
115
120 }
121
122
124 set_bitfield(fmt::format(
"SUPER_CHUNK_FACTOR_LINK_{:02}",
s->get_link()), super_chunk_size);
125 set_bitfield(fmt::format(
"DECODING_LINK{:02}_EGROUP0_CTRL_EPATH_ENA",
s->get_link()), 1);
126 }
127}
void set_bitfield(std::string key, uint64_t value)
◆ generate_opmon_data()
void dunedaq::flxlibs::CardControllerWrapper::generate_opmon_data |
( |
| ) |
|
|
overrideprotectedvirtual |
Hook for customisable pubblication. The function can throw, exception will be caught by the monitoring thread
Reimplemented from dunedaq::opmonlib::MonitorableObject.
Definition at line 225 of file CardControllerWrapper.cpp.
226{
228
229 uint64_t aligned =
get_register(REG_GBT_ALIGNMENT_DONE);
230
232
233 opmon::LinkInfo i;
234 i.set_enabled(true);
235#warning FIXME: Horrible remapping workaround. Temporary fix only!
237 bool is_aligned = aligned & (1<<id_to_check);
238 i.set_aligned( is_aligned );
241 {
"link", fmt::format(
"{}",
s->get_link()) } });
242
243 }
244}
uint64_t get_register(std::string key)
void publish(google::protobuf::Message &&, CustomOrigin &&co={}, OpMonLevel l=to_level(EntryOpMonLevel::kDefault)) const noexcept
◆ get_bitfield()
uint64_t dunedaq::flxlibs::CardControllerWrapper::get_bitfield |
( |
std::string | key | ) |
|
◆ get_register()
uint64_t dunedaq::flxlibs::CardControllerWrapper::get_register |
( |
std::string | key | ) |
|
◆ gth_reset()
void dunedaq::flxlibs::CardControllerWrapper::gth_reset |
( |
| ) |
|
◆ init()
void dunedaq::flxlibs::CardControllerWrapper::init |
( |
| ) |
|
Definition at line 67 of file CardControllerWrapper.cpp.
67 {
68
69
70
71
73 m_flx_card->cfg_set_option( BF_MMCM_MAIN_LCLK_SEL, 1 );
75
76
77 m_flx_card->cfg_set_option(BF_GBT_SOFT_RESET, 0xFFFFFFFFFFFF);
78 m_flx_card->cfg_set_option(BF_GBT_SOFT_RESET, 0);
79
80 int bad_channels =
m_flx_card->gbt_setup( FLX_GBT_ALIGNMENT_ONE, FLX_GBT_TMODE_FEC );
81 if(bad_channels) {
82 TLOG()<< bad_channels <<
" not aligned.";
83 }
85
86}
◆ open_card()
void dunedaq::flxlibs::CardControllerWrapper::open_card |
( |
| ) |
|
|
private |
Definition at line 130 of file CardControllerWrapper.cpp.
131{
133 try {
136 } catch (FlxException& ex) {
138 exit(EXIT_FAILURE);
139 }
140}
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ set_bitfield()
void dunedaq::flxlibs::CardControllerWrapper::set_bitfield |
( |
std::string | key, |
|
|
uint64_t | value ) |
◆ set_register()
void dunedaq::flxlibs::CardControllerWrapper::set_register |
( |
std::string | key, |
|
|
uint64_t | value ) |
◆ m_card_mutex
std::mutex dunedaq::flxlibs::CardControllerWrapper::m_card_mutex |
|
private |
◆ m_device_id
uint32_t dunedaq::flxlibs::CardControllerWrapper::m_device_id |
|
private |
◆ m_flx_card
UniqueFlxCard dunedaq::flxlibs::CardControllerWrapper::m_flx_card |
|
private |
◆ m_flx_cfg
◆ m_flx_senders
The documentation for this class was generated from the following files: