4 #ifndef artdaq_dune_Overlays_FrameFormat_hh 5 #define artdaq_dune_Overlays_FrameFormat_hh 18 uint32_t crate_num : 8, frame_version: 4, slot_num : 3, fiber_num : 1;
19 uint32_t femb_valid : 2, link_mask : 8, reserved : 6;
22 uint32_t femb_a_seg[56];
23 uint32_t femb_b_seg[56];
24 uint32_t crc20 : 20, flex12 : 12;
25 uint32_t eof: 8, flex24 : 24;
32 const size_t low_bit = i*14;
33 const size_t low_word = low_bit / 32;
34 const size_t high_bit = (i+1)*14-1;
35 const size_t high_word = high_bit / 32;
37 if (low_word == high_word) {
38 return (packed[low_word] >> (low_bit%32)) & 0x3FFF;
40 size_t high_off = high_word*32-low_bit;
42 uint16_t
result = (packed[low_word] >> (low_bit%32)) & (0x3FFF >> (14-high_off));
43 result |= (packed[high_word] << high_off) & ((0x3FFF << high_off) & 0x3FFF);
uint16_t unpack14(const uint32_t *packed, size_t i)