The card counts the packets of a summed module in 16 bits (axis_completion packet_count, hls_jfjoch.h), 512 per frame, so from 128 summed frames the count wraps: at 128 and 256 to exactly 0, which the host took for a module not collected (IsAnyPacketCollected), so every image was lost; between them the efficiency came out wrong. Where 512 * card summation exceeds 16 bits, the host now counts the packets from the module's packet mask (the packets present in all of its frames) times the summation, and keeps the count in 32 bits (Completion, AcquisitionCounters). Exact for complete modules; with packets lost in some frames it counts only those present in all. The mock of the card keeps the card's 16-bit count, so it shows the same wrap (checked: without this, summation 256 on the mock delivers no image). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HVeDQrPqZ52Tp6rzzZGxf3
23 lines
478 B
C++
23 lines
478 B
C++
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#pragma once
|
|
|
|
#include <cstdint>
|
|
|
|
struct WorkRequest {
|
|
uint32_t handle;
|
|
};
|
|
|
|
struct Completion {
|
|
enum class Type {Start, End, Image} type;
|
|
|
|
uint64_t frame_number;
|
|
uint32_t handle;
|
|
uint32_t packet_count;
|
|
uint16_t data_collection_id;
|
|
uint16_t module_number;
|
|
};
|
|
|
|
Completion parse_hw_completion(uint32_t hw_input);
|