Broker without hardware runs on MockAcquisitionDevice
A configuration without a pcie entry gets the mock of the card (AcquisitionDeviceGroup::AddMockDevice) instead of the HLS simulation. The local run of docs/JFJOCH_BROKER.md works as before: the images uploaded as the internal generator's images are streamed and written (checked end to end with jfjoch_broker_test.py: 18 images collected, written and equal to the uploaded image outside the pixel mask); the card's spot finding, ROI and azimuthal results are zero in this mode, as the mock computes nothing. The docs and CLAUDE.md say so. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UqXYdHHZ4cogS1mrGUtfN7
This commit is contained in:
1 parent
cb95938bc7
commit
c40bebca98
5 files changed
+22
-15
No files matched your search
@@ -317,9 +317,12 @@ Check first and do not duplicate a credit an adjacent comment already carries.
|
||||
|
||||
## Local end-to-end run (no detector / no FPGA)
|
||||
|
||||
The FPGA HLS logic can be simulated on the CPU (`HLSSimulatedDevice`), so the full software
|
||||
stack runs without hardware (slowly — fixed-point math on CPU). See
|
||||
`docs/JFJOCH_BROKER.md` for the canonical walkthrough.
|
||||
Without a `pcie` entry in its config the broker runs on `MockAcquisitionDevice`
|
||||
(`acquisition_device/`), a black-box mock of the FPGA card: it reproduces the card's interface
|
||||
towards the host (frames, completions, counters, start/stop/cancel, internal frame generator, the
|
||||
error and timeout paths) but computes nothing — the images are the uploaded generator images as
|
||||
given, and the card's spot-finding/ROI/azimuthal results are zero. The same mock carries the
|
||||
receiver, state-machine and writer tests. See `docs/JFJOCH_BROKER.md` for the canonical walkthrough.
|
||||
|
||||
```
|
||||
cd build/broker
|
||||
@@ -400,10 +403,11 @@ with cuFFT on a GPU and with pocketfft without one (or under `--no-gpu`), while
|
||||
implementation each. Only rugnux's CLI spells it this way: internally (and in the broker's OpenAPI)
|
||||
`FFT` is the GPU implementation, which the CLI's `cufft` maps onto.
|
||||
|
||||
**FPGA** (`fpga/`): `hls/` is the Vitis HLS source (image-analysis kernels), `hls_simulation/`
|
||||
runs that same HLS on CPU for hardware-free testing, `hdl/` is the Verilog RTL, `host_library/` is
|
||||
the host-side driver, `pcie_driver/` is the kernel module. The HLS algorithms are documented in
|
||||
`docs/FPGA_DATA_ANALYSIS.md`.
|
||||
**FPGA** (`fpga/`): `hls/` is the Vitis HLS source (image-analysis kernels; its CPU library
|
||||
`JFJochHLSCores` and the Xilinx headers in `fpga/include/` are no longer part of the software
|
||||
build), `hdl/` is the Verilog RTL, `host_library/` is the host-side driver, `pcie_driver/` is the
|
||||
kernel module. The HLS algorithms are documented in `docs/FPGA_DATA_ANALYSIS.md`. The software is
|
||||
tested without hardware on `MockAcquisitionDevice`, not on a simulation of the firmware.
|
||||
|
||||
**Detector control** (`detector_control/`): wrappers for SLS (JUNGFRAU) and DECTRIS SIMPLON
|
||||
(EIGER). **`jungfrau/`**: JUNGFRAU ADU→energy gain/pedestal calibration.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "AcquisitionDeviceGroup.h"
|
||||
#include "PCIExpressDevice.h"
|
||||
#include "HLSSimulatedDevice.h"
|
||||
#include "MockAcquisitionDevice.h"
|
||||
|
||||
AcquisitionDevice &AcquisitionDeviceGroup::operator[](int idx) {
|
||||
if ((idx < 0) || (idx >= aq_devices.size()))
|
||||
@@ -28,8 +28,8 @@ void AcquisitionDeviceGroup::AddPCIeDevice(const std::string &device_name, std::
|
||||
aq_devices.emplace_back(std::move(tmp));
|
||||
}
|
||||
|
||||
void AcquisitionDeviceGroup::AddHLSDevice(int64_t buffer_size_modules) {
|
||||
aq_devices.emplace_back(std::make_unique<HLSSimulatedDevice>(aq_devices.size(), buffer_size_modules));
|
||||
void AcquisitionDeviceGroup::AddMockDevice(int64_t buffer_size_modules) {
|
||||
aq_devices.emplace_back(std::make_unique<MockAcquisitionDevice>(aq_devices.size(), buffer_size_modules));
|
||||
}
|
||||
|
||||
std::vector<AcquisitionDeviceNetConfig> AcquisitionDeviceGroup::GetNetworkConfig() {
|
||||
|
||||
@@ -14,7 +14,8 @@ public:
|
||||
size_t size();
|
||||
void Add(std::unique_ptr<AcquisitionDevice> &&device);
|
||||
void AddPCIeDevice(const std::string &device_name, std::optional<uint32_t> ipv4_addr = {});
|
||||
void AddHLSDevice(int64_t buffer_size_modules);
|
||||
// The mock of the card, for the broker without hardware
|
||||
void AddMockDevice(int64_t buffer_size_modules);
|
||||
std::vector<AcquisitionDeviceNetConfig> GetNetworkConfig();
|
||||
std::vector<DeviceStatus> GetDeviceStatus() const;
|
||||
void EnableLogging(Logger *logger);
|
||||
|
||||
@@ -252,7 +252,7 @@ std::unique_ptr<ImagePusher> ParseImagePusher(const org::openapitools::server::m
|
||||
void ParseAcquisitionDeviceGroup(const org::openapitools::server::model::Jfjoch_settings &input,
|
||||
AcquisitionDeviceGroup &aq_devices) {
|
||||
if (!input.pcieIsSet())
|
||||
aq_devices.AddHLSDevice(256);
|
||||
aq_devices.AddMockDevice(256);
|
||||
else for (auto &p: input.getPcie()) {
|
||||
std::optional<uint32_t> ipv4_addr = {};
|
||||
if (p.ipv4IsSet())
|
||||
|
||||
@@ -429,9 +429,11 @@ For development, it is possible to set up a local installation of Jungfraujoch.
|
||||
This will work without FPGA installed in the computer and allows testing the Jungfraujoch software layer, including
|
||||
ZeroMQ streaming and file writing.
|
||||
|
||||
The workflow simulates FPGA behavior, by running high-level synthesis code on the CPU - the performance is therefore
|
||||
very low, as fixed-point calculations have a large performance penalty on the CPU. In the CPU simulation mode, one can simulate
|
||||
using only a single FPGA device.
|
||||
Without a `pcie` entry in the configuration, the broker runs on a mock of the FPGA card (`MockAcquisitionDevice`):
|
||||
it behaves like the card towards the host - frames, completions, counters, start/stop/cancel, the internal frame
|
||||
generator - but computes nothing. The images streamed and written are the ones uploaded as the internal generator's
|
||||
images, unconverted; the card's spot finding, ROI and azimuthal results are zero in this mode (with rugnux live on,
|
||||
the GPU analysis finds its own spots).
|
||||
|
||||
To run the test:
|
||||
|
||||
|
||||
Reference in new issue
Block a user