Upgrade to allow mgt508 decimated data.
MGT508 has a minimum pull (capture) rate 300MB/s. This is fixed in some very low level Xilinx DMA IP, but we can compensate indirectly as follows:
- capture at double the desired rate.
- decimate by 2 on the fly as the data is offloaded.
eg Desired capture condition:
32ch x 2b x 4M = 256MB/s
decimation work around:
32ch x 2b x 8M = 512MB/s, then decimate by 2 on offload.
The decimation is handled in user space on the A53 cpu, this is fast enough to run the process with NO impact on offload rate.
example
capture (s) | pull (GB) | read (GB) | decimation (y/n) | pull time (s) | read time (s) |
------------|-----------|-----------|------------------|---------------|---------------|
8 | 4 | 4 | no | 22.85 | 46.31 | 8s at double rate output
8 | 4 | 2 | yes | 22.94 | 24.50 | 8s at required rate
4 | 2 | 2 | no | 15.81 | 23.86 | 4s at double rate for comparison - offload time is about the same.
=> there is no significant time penalty to capturing double the amount of data.
To run this code, there's a small userland patch to the mgt508 firmware:
https://github.com/D-TACQ/acq400_hapi/releases/download/v2.16.1/decimation_patch.tar
tar -tf decimation_patch.tar # to check what's inside and that paths are good.
scp decimation_patch.tar dt100@mgt508:/tmp
ssh dt100@mgt508-xxx
sudo su
cd /
tar xvf /tmp/decimation_patch.tar
To run the shot, update to the current version of HAPI, add --decimate=2 to the command line.
The --samples argument is decimated samples.
./user_apps/acq2206/mgt508_capture.py --samples=20000000 --decimate=2 acq2206_069,mgt508-002