vatactrl - ComPair/ComPair-tracker-FPGA GitHub Wiki
vatactrl
vatactrl
is a command-line tool that you run on the silicon layer. It is one way to control the VATA's. And if you are ssh'd onto the silicon layer, it is probably the simplest if you want to do things by hand.
Build steps
vatactrl
is setup as a petalinux user-space application. But it relies on the header files produced when you make a BSP for the vivado project. So..
1) Build the BSP
Compile the vivado design, and run "export hardware". Then, launch the SDK. Then, create the BSP with File -> New -> Board Support Package. I make it with all defaults (you shouldn't have to change anything). When the settings come up, I don't select anything.
2) Modify the vatactrl bb file
The vatactrl app is found in:
ComPair-tracker-FPGA/src/petalinux/si-layer/project-spec/meta-user/recipes-apps/vatactrl
You will have to edit the vatactrl bitbake recipe:
ComPair-tracker-FPGA/src/petalinux/si-layer/project-spec/meta-user/recipes-apps/vatactrl/vatactrl.bb
.
Specificall, edit COMPAIR_TRACKER_FPGA_ROOT
to be the path to the repo.
3) Cross-compile vatactrl
While in ComPair-tracker-FPGA/src/petalinux/si-layer
, run:
$ petalinux-build -c vatactrl -x compile
This will produce the vatactrl executable. You should be able to find it in the awfully buried location of:
ComPair-tracker-FPGA/src/petalinux/si-layer/build/tmp/work/cortexa9hf-neon-xilinx-linux-gnueabi/vatactrl/1.0-r0/build/src/vatactrl
You should scp that to the silayer, and hopefully you are good to go!
Usage
Usage: vatactrl ASIC-NUM [OPTIONS]
ASIC-NUM : Number of the ASIC we are targeting
OPTIONS:
--set-config FNAME : set configuration from file FNAME
--get-config FNAME : get configuration, write to file FNAME
--set-hold HOLD : set the ASIC hold time to HOLD clk-cycles
--get-hold : write ASIC hold time to stdout
--get-counters : print 'running' and 'live' counters to stdout
--reset-counters : reset the 'running' and 'live' counters
--trigger-enable : enable triggered data readout
--trigger-disable : disable triggered data readout
--get-event-count : print event counter to stdout
--reset-event-count : reset the event counter
--get-n-fifo : print number of data packets in fifo to stdout
--single-read-fifo : read a single data packet, print to stdout
--read-fifo : read the entire fifo, each packet to a single line of stdout
Note that options can be chained together to do multiple things in a single command. And you must always have the first argument as the asic number
Examples
- Enable triggering for ASIC 0:
vatactrl 0 --trigger-enable
- Print out ASIC 0's fifo count, and then counters:
vatactrl 0 --get-n-fifo --get-counters
- Set ASIC 0's config to the local file saved to
/home/root/default.config
:vatactrl 0 --set-config /home/root/default.config