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.
makeA 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> SAMPLES_PER_TURN= <SAMPLES_PER_TURN> VCXO_TYPE=<VCXO_TYPE> CROSS_COMPILE=${ARM_TOOLCHAIN_LOCATION}/bin/aarch64-none-elf- && notify-send 'Compilation SUCCESS' || notify-send 'Compilation ERROR'; date) 2>&1 | tee make_outputSo, for example, to generate the DSBPM application for the ZCU208 board, 81 samples per turn and VCXO with center frequency of 160MHz:
ARM_TOOLCHAIN_LOCATION=/media/Xilinx/Vivado/2022.1/Vitis/2022.1/gnu/aarch64/lin/aarch64-none
(time make PLATFORM=zcu208 APP=dsbpm SAMPLES_PER_TURN=81 VCXO_TYPE=160 CROSS_COMPILE=${ARM_TOOLCHAIN_LOCATION}/bin/aarch64-none-elf- && notify-send 'Compilation SUCCESS' || notify-send 'Compilation ERROR'; date) 2>&1 | tee make_outputTo 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.bitThe 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>.elfThe 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.csvThe tables are generated by a python script createDemodGenTables.py located at
: software/scripts
To execute that script do:
cd software/scripts
python3 createDemodGenTables.pyAn 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.csvAn 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.csvAn 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.csvtftp -v -m binary <system IP> -c put BOOT.bin BOOT.binWhen 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.