15#include "flxcard/FlxException.h"
16#include "packetformat/block_format.hpp"
54 std::ostringstream tnoss;
58 std::ostringstream cardoss;
64 throw flxlibs::CardError(
ERS_HERE,
"Couldn't create FlxCard object.");
109 TLOG() <<
"Block Address handler is not set! Is it intentional?";
127 std::this_thread::sleep_for(std::chrono::milliseconds(10));
157 u_int current_lock_mask =
m_flx_card->get_lock_mask(absolute_card_id);
159 u_int to_lock_mask = u_int(
m_dma_id+1);
160 if (current_lock_mask & to_lock_mask) {
161 ers::fatal(flxlibs::CardError(
ERS_HERE,
"FELIX card's DMA is locked by another process!"));
164 m_flx_card->card_open(
static_cast<int>(absolute_card_id), to_lock_mask);
166 }
catch (FlxException& ex) {
180 }
catch (FlxException& ex) {
191 unsigned ret = CMEM_Open();
193 ret = CMEM_NumaSegmentAllocate(bsize, numa,
const_cast<char*
>(
m_card_id_str.c_str()), &handle);
197 ret = CMEM_SegmentPhysicalAddress(handle, paddr);
200 ret = CMEM_SegmentVirtualAddress(handle, vaddr);
209 "Not enough CMEM memory allocated or the application demands too much CMEM memory.\n"
210 "Fix the CMEM memory reservation in the driver or change the module's configuration."));
229#if REGMAP_VERSION < 0x500
250 <<
" dma id:" << std::to_string(
m_dma_id);
260 <<
" dma id:" << std::to_string(
m_dma_id);
290 std::this_thread::sleep_for(std::chrono::microseconds(5000));
302#if REGMAP_VERSION < 0x500
309 std::this_thread::sleep_for(std::chrono::microseconds(
m_poll_time));
#define IRQ_DATA_AVAILABLE
uint32_t get_dma_memory_size_gb() const
Get "dma_memory_size_gb" attribute value. CMEM_RCC memory to allocate in GBs.
void read_current_address()
utilities::ReusableThread m_dma_processor
std::size_t m_dma_memory_size
void set_running(bool should_run)
std::function< void(uint64_t)> m_handle_block_addr
std::atomic< bool > m_run_lock
static constexpr size_t m_block_size
int allocate_CMEM(uint8_t numa, u_long bsize, u_long *paddr, u_long *vaddr)
std::atomic< bool > m_run_marker
bool m_block_addr_handler_available
std::vector< unsigned int > m_links_enabled
uint64_t bytes_available()
static constexpr size_t m_dma_wraparound
CardWrapper(const appmodel::FelixInterface *cfg, std::vector< unsigned int >)
CardWrapper Constructor.
static const std::string m_dma_processor_name
std::string m_card_id_str
#define TLVL_ENTER_EXIT_METHODS
#define TLOG_DEBUG(lvl,...)
void fatal(const Issue &issue)
void error(const Issue &issue)