Gateware/Software for Direct-Sampling Beam Position Monitor
This repository contains both gateware and software for the Direct-Sampling Beam Position Monitor.
To build the gateware the following dependencies are needed:
Make sure vivado
and vitis
are in PATH.
To build the software the following dependencies are needed:
- aarch64-none toolchain, bundled within Vitis
With the dependencies in place a simple make
should be able to generate
both gateware and software, plus the SD boot image .bin.
make
A suggestion in running the make
command is to measure the time
and redirect stdout/stderr to a file so you can inspect it later:
ARM_TOOLCHAIN_LOCATION=/media/Xilinx/Vivado/2022.1/Vitis/2022.1/gnu/aarch64/lin/aarch64-none
(time make PLATFORM=<PLATFORM_NAME> APP=<APP_NAME> CROSS_COMPILE=${ARM_TOOLCHAIN_LOCATION}/bin/aarch64-none-elf- && notify-send 'Compilation SUCCESS' || notify-send 'Compilation ERROR'; date) 2>&1 | tee make_output
For now the following combinations of PLATFORM and APP are supported:
APP / PLATFORM | zcu208 | lbl208 |
---|---|---|
dsbpm_vcxo_117 | x | x |
dsbpm_vcxo_160 | x | x |
So, for example, to generate the DSBPM application for the ZCU208 board:
ARM_TOOLCHAIN_LOCATION=/media/Xilinx/Vivado/2022.1/Vitis/2022.1/gnu/aarch64/lin/aarch64-none
(time make PLATFORM=zcu208 APP=dsbpm_vcxo_160 CROSS_COMPILE=${ARM_TOOLCHAIN_LOCATION}/bin/aarch64-none-elf- && notify-send 'Compilation SUCCESS' || notify-send 'Compilation ERROR'; date) 2>&1 | tee make_output
To deploy the gateware and the software we can use a variety of methods. For development, JTAG is being used. Remember to check the DIP switches on development boards and ensure the switches are set to JTAG mode and NOT SD Card mode.
The following script can download the gateware via JTAG:
cd gateware/scripts
xsct download_bit.tcl ../syn/<APP>_<PLATFORM>/<APP>_<PLATFORM>_top.bit
The following script can download the software via JTAG:
cd software/scripts
xsct download_elf.tcl ../../gateware/syn/<APP>_<PLATFORM>/psu_init.tcl ../app/<APP>/<APP>_<PLATFORM>.elf
The following system parameters can be updated via TFTP:
- RF demodulation table
- Pilot demodulation Tone table
- Pilot Tone generation table
- System parameters
- Gateware + Software boot file (BOOT.bin)
An example of the parameters used can be found at: software/app/<APP>/scripts/sysParms.csv
tftp -v -m binary <system IP> -c put sysParms.csv sysParms.csv
The tables are generated by a python script createDemodGenTables.py
located at
: software/scripts
To execute that script do:
cd software/scripts
python3 createDemodGenTables.py
An example of the RF table can be found at: software/scripts/rfTableSR_81_328_bin_20_conjugate.csv
tftp -v -m binary <system IP> -c put <RF TABLE>.csv rfTable.csv
An example of the PT table can be found at: software/scripts/ptTableSR_81_328_L7_19_H11_19_bin_20_conjugate.csv
tftp -v -m binary <system IP> -c put <PT TABLE>.csv ptTable.csv
An example of the PT generation table can be found at: software/scripts/ptGen_81_7_low_11_high_19.csv
tftp -v -m binary <system IP> -c put <PTGEN TABLE>.csv ptGen.csv
tftp -v -m binary <system IP> -c put BOOT.bin BOOT.bin
When copying BOOT.bin
, the user needs to reboot the system via a power cycle
or via the console boot
command.
Another option to upgrade the image is to use the programFlash.sh
script
located at: software/scripts
. The script will automatically readback the
image file from the system and peform a byte-to-byte comparison to detect
possible transmission errors.
cd software/scripts
sh ./programFlash.sh <system IP> [BOOT.bin filename]
If BOOT.bin filename
is missing the current path is assumed.