--
EnkhboldOchirsuren - 17 Oct 2024
How-To: Burst generation
this functionality is under development and not available in any release
A simple solution for generating bursts using a Timing Receiver (TR).
The software implementation is proposed as LM32 firmware (
burstgen.bin) and Saftlib utility (
saft-burst-ctl).
The latest status (as of October 2024):
- LM32 FW: v00.01.01 ("fallout" branch of bel_projects)
- Saftlib: v3.0.0 ("master" branch of saftlib)
$ eb-info -w dev/wbm0
Project : pci_control
Platform : pexaria5 +db[12] +wrex1
FPGA model : Arria V (5agxma3d4f27i3)
Source info : fallout-3847
Build type : fallout-v6.1.2
Build date : Mon Aug 09 08:48:31 CEST 2021
Prepared by : Timing Group Jenkins <csco-tg@gsi.de>
Prepared on : tsl021.acc.gsi.de
OS version : CentOS Linux release 7.9.2009 (Core), kernel 3.10.0-1160.36.2.el7.x86_64
Quartus : Version 18.1.0 Build 625 09/12/2018 SJ Standard Edition
33b311a Merge pull request #287 from GSI-CS-CO/dm-fallout-tests
79bfcd2 datamaster-tests.tex: add hint to install scheduleCompare as a prerequisite.
5a22eb0 Makefile: use python3 explicitly. Tests do not run with python2.
0113dcd Merge branch 'fallout' into dm-fallout-tests
f6369d7 test_safe2remove.py: use longer duration for some long running performance tests, 3. try
Detecting Firmwares ...
Found 1 RAMs, 1 holding a Firmware ID
********************
* RAM @ 0x04060000 *
********************
UserLM32
Stack Status: okok
Project : burstgen
Version : 00.01.01
Platform : pcicontrol
Build Date : Thu May 11 10:33:48 CEST 2023
Prepared by : eochirs Enkhbold Ochirsuren <E.Ochirsuren@gsi.de>
Prepared on : acopc061
OS Version : Linux Mint 21 Linux 5.15.0-71-generic x86_64
GCC Version : lm32-elf-gcc(GCC)4.5.3 (build )
IntAdrOffs : 0x10000000
SharedOffs : 0x500
SharedSize : 16K
FW-ID ROM will contain:
4a410af6e burstgen: provide the common buffer addresses for host communication
401656634 burstgen: re-factored the task scheduler period measurement
e04891af6 burstgen: remove existing IO conditions before setting up each test
1b19e6fee burstgen: extend demo script for supporting saftlib v3
cb48356e1 Merge pull request #326 from GSI-CS-CO/b2b_dietrich_2023-jan-30
*****
$ saft-ctl -fi bla
saftlib source version : saftlib 3.0.0 (v2.5.1-462-gdae822c): May 11 2023 10:34:57
saftlib build info : built by eochirs on May 11 2023 10:35:37 with acopc061 running Linux Mint
1. Limitations
Please consider the characteristics given below:
- maximum number of bursts: 16
- minimum burst period: 200 us (dependent from the maximum number of bursts)
- internal delay: 200 us (from control message to burst production)
2. Run a demo
Demo burst production is composed in bash script
"bel_projects/modules/burst_generator/test/run_burst_generation.sh".
It generates 2 kinds of burst at chosen output (IO1/B1) of pexaria5/SCU.
On local host, you need:
- bel_projects
- pexaria5 (WR lock is required)
- (optional) LEMO cable
2.1. Build the LM32 firmware (burstgen.bin)
Download the
bel_projects project repo and check out the
fallout branch.
The firmware source code is available in the
bel_projects/modules/burst_generator directory.
Build a firmware binary on your local host and copy it to the dedicated folder for saftlib (where saftlib search for firmware):
$ make # build binary burstgen.bin
$ cp burstgen.bin <prefix>/share/saftlib/firmware # prefix=/usr by default
2.2. Build and install saftlib (saft-burst-ctl, saftbusd)
The
saftlib project is available in the
bel_projects/ip_cores/saftlib directory.
Check out the
master branch, build and install it:
$ make -j8 && sudo make install
Both firmware and saftlib are ready to run.
2.3. Load the saftbusd daemon
Specify the
socket path required by saftlib (for non-root user):
$ export SAFTBUS_SOCKET_PATH=/tmp/saftbus
Assume that TR on local host is available as
dev/wbm0.
Launch the
saftbusd daemon:
$ saftbusd libsaft-service.so tr0:dev/wbm0 # blocks the current terminal
It blocks the current terminal, therefore press "CTRL+Z" type "bg" to release the terminal.
Check
saftbusd status by invoking:
$ saftbus-ctl -s
services:
object-path ID [owner] sig-fd/use-count interface-names
/de/gsi/saftlib 2 [-1]d SAFTd
/de/gsi/saftlib/tr0 21 [-1]d TimingReceiver BuildIdRom ECA ECA_Event ECA_TLU LM32Cluster Mailbox OpenDevice Reset TempSensor Watchdog WhiteRabbit
/de/gsi/saftlib/tr0/acwbm 3 [-1] WbmActionSink ActionSink Owned
/de/gsi/saftlib/tr0/embedded_cpu 4 [-1] EmbeddedCPUActionSink ActionSink Owned
/de/gsi/saftlib/tr0/inputs/IO1 13 [-1] Input EventSource Owned
/de/gsi/saftlib/tr0/inputs/IO2 15 [-1] Input EventSource Owned
/de/gsi/saftlib/tr0/inputs/IO3 17 [-1] Input EventSource Owned
/de/gsi/saftlib/tr0/inputs/MHDMR_SYIN 19 [-1] Input EventSource Owned
/de/gsi/saftlib/tr0/inputs/MHDMR_TRIN 20 [-1] Input EventSource Owned
/de/gsi/saftlib/tr0/outputs/IO1 14 [-1] Output ActionSink Owned
/de/gsi/saftlib/tr0/outputs/IO2 16 [-1] Output ActionSink Owned
/de/gsi/saftlib/tr0/outputs/IO3 18 [-1] Output ActionSink Owned
/de/gsi/saftlib/tr0/outputs/LED1_ADD_R 9 [-1] Output ActionSink Owned
/de/gsi/saftlib/tr0/outputs/LED1_BASE_R 5 [-1] Output ActionSink Owned
/de/gsi/saftlib/tr0/outputs/LED2_ADD_B 10 [-1] Output ActionSink Owned
/de/gsi/saftlib/tr0/outputs/LED2_BASE_B 6 [-1] Output ActionSink Owned
/de/gsi/saftlib/tr0/outputs/LED3_ADD_G 11 [-1] Output ActionSink Owned
/de/gsi/saftlib/tr0/outputs/LED3_BASE_G 7 [-1] Output ActionSink Owned
/de/gsi/saftlib/tr0/outputs/LED4_ADD_W 12 [-1] Output ActionSink Owned
/de/gsi/saftlib/tr0/outputs/LED4_BASE_W 8 [-1] Output ActionSink Owned
/saftbus 1 [-1] 9/1 Container
active plugins:
libsaft-service.so
connected client processes:
8 (pid=5908)
allocator:
chunksize used/available
128 908/16384
1024 48/1024
16384 5/64
heap 0/-
Proceed next steps, if you agree the output by saftbus-ctl.
2.4. Run the demo script
All actions required to generate 2 kinds of burst at chosen output (eg, IO1 for pexaria5, B1 for SCU) are given in the
bel_projects/modules/burst_generator/test/run_burst_generation.sh bash script.
Firs it detects whether
saftbusd is running.
Next it asks if the burst generator firmware to be loaded. Answer 'y' if the firmware is not loaded at all.
Further it will generate 2 kinds of bursts sequentially:
- infinite: period=15ms, high pulse=10ms
- run-once: period=20us, high pulse=10us (duration 1,44 ms)
$ ./run_burst_generation.sh # follow the output message
2.5. Check the burst generation
One can verify the burst generation quickly in different ways.
A. Look at the firmware output msg on the TR console.
$ eb-console dev/wbm0 # inspect the output message
The output messages are for debug purpose, hence, might be not user-friendly.
B. Snoop input events by directing the burst signal to an input port
Here, burst signal generated at chosen port will be delivered to an free input port (eg., IO3 for pexaria5). Do not use IO2/B2 for this purpose, as it is reserved for measurement this demo script.
Connect the IO1 port to IO3 (in case of pexaria5) with a LEMO cable.
Configure the IO3 port to generate input events on signal changes:
$ saft-io-ctl tr0 -n IO3 -b 0xffff100000000000
Snoop the input by invoking:
$ saft-io-ctl tr0 -s
IO Edge Flags ID Timestamp Formatted Date
---------------------------------------------------------------------------------------------------------
# starting the infinite burst
IO3 Rising .... (0x0) 0xfffe000000000005 0x4c8846d30de0f 1970-01-16 13:59:31.000000015
IO3 Falling .... (0x0) 0xfffe000000000004 0x4c8846dc97488 1970-01-16 13:59:31.010000008
IO3 Rising .... (0x0) 0xfffe000000000005 0x4c8846e15bfcf 1970-01-16 13:59:31.015000015
IO3 Falling .... (0x0) 0xfffe000000000004 0x4c8846eae5648 1970-01-16 13:59:31.025000008
IO3 Rising .... (0x0) 0xfffe000000000005 0x4c8846efaa18f 1970-01-16 13:59:31.030000015
# stopping the infinite burst and starting the run-once burst
IO1 Rising .... (0x0) 0xfffe000000000001 0x4c894424e8600 1970-01-16 14:00:39.000000000
IO3 Rising d... (0x8) 0xfffe000000000005 0x4c894424e860f 1970-01-16 14:00:39.000000015
IO3 Falling d... (0x8) 0xfffe000000000004 0x4c894424ead18 1970-01-16 14:00:39.000010008
IO3 Rising d... (0x8) 0xfffe000000000005 0x4c894424ed42f 1970-01-16 14:00:39.000020015
...
IO3 Rising d... (0x8) 0xfffe000000000005 0x4c8944263e2cf 1970-01-16 14:00:39.001400015
IO3 Falling d... (0x8) 0xfffe000000000004 0x4c894426409d8 1970-01-16 14:00:39.001410008
IO3 Rising d... (0x8) 0xfffe000000000005 0x4c894426430ef 1970-01-16 14:00:39.001420015
IO3 Falling d... (0x8) 0xfffe000000000004 0x4c894426457f8 1970-01-16 14:00:39.001430008
# stopping the run-once burst
When the demo script re-started, input events can be seen. Check the timestamp of events to verify the burst signal period and pulse length.