13 unsigned int max_block_no = 0;
15 max_block_no = (
size - 1023) / 4096;
17 if (
block != max_block_no)
35 }
else if (
block == 0) {
53 return (
size - 1023) / 4096 + 1;
71 unsigned int board_id,
73 : data0_((
uint64_t(amc_no & AmcNo_mask) << AmcNo_shift) | (
uint64_t(lv1_id & LV1ID_mask) << LV1ID_shift) |
75 data1_((
uint64_t(or_n & OrN_mask) << OrN_shift) | (
uint64_t(board_id & BoardID_mask) << BoardID_shift) |
82 bool Trailer::check(
unsigned int crc,
unsigned int lv1_id,
unsigned int size,
bool mtf7_mode)
const {
85 <<
"\n\tLV1 ID " <<
getLV1ID() <<
", size " <<
getSize() <<
", CRC " << std::hex
86 << std::setw(8) << std::setfill(
'0') <<
getCRC() <<
std::dec <<
"\nBut expected:" 87 <<
"\n\tLV1 ID " << (lv1_id &
LV1ID_mask) <<
", size " <<
size <<
", CRC " << std::hex
88 << std::setw(8) << std::setfill(
'0') << crc;
95 std::string dstring(reinterpret_cast<const char *>(
start), reinterpret_cast<const char *>(
end) + 4);
106 const std::vector<uint64_t> &
load,
110 trailer_(0, lv1id,
load.
size() + 3) {
157 for (
unsigned int i = 0;
i <
payload_.size() - 3; ++
i)
static const unsigned int CRC_mask
unsigned int getLV1ID() const
static void writeCRC(const uint64_t *start, uint64_t *end)
unsigned int getCRC() const
BlockHeader block_header_
static const unsigned int CRC_shift
void addPayload(const uint64_t *, unsigned int)
void finalize(unsigned int lv1, unsigned int bx, bool legacy_mc=false, bool mtf7_mode=false)
constexpr uint64_t CRC_mask
bool check(unsigned int crc, unsigned int lv1_id, unsigned int size, bool mtf7_mode=false) const
static const unsigned int split_block_size
static const unsigned int LV1ID_mask
constexpr uint32_t CRC_shift
unsigned long long uint64_t
unsigned int getSize() const
char data[epos_bytes_allocation]
std::unique_ptr< uint64_t[]> data()
std::vector< uint64_t > block(unsigned int id) const
unsigned int size() const
Log< level::Warning, false > LogWarning
Packet(const uint64_t *d)
std::vector< uint64_t > payload_