Do this on lcls-pc83236
Preparing git keys
Add you ssh keys to git (This is unfortunately necessary because the .gitmodules file use the "git" form of the URL instead of the "http" form):
https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/
Also note that the firmware requires a new version of git that supports "links to large files" (lfs). Add /afs/slac/g/reseng/git/git/bin to PATH.
Building Rogue
git clone https://github.com/slaclab/rogue.git
Needs a conda env with a bunch of stuff. Follow build instruction files in the rogue root directory README files (although I suggest setting up a conda python3 env instead of using pip install):
https://github.com/slaclab/rogue/blob/master/Readme_build.txt
https://github.com/slaclab/rogue/blob/master/Readme_python3.txt
cd rogue
git submodule init
git submodule update
make
To run, source this script:
https://github.com/slaclab/lcls2-pcie-apps/blob/master/software/TimeTool/setup_env_template.csh
Some applications are not built by default. cd to directory and make.
Building Firmware
Follow instructions in the README.md here (make sure to use the modern AFS version of git described here so you can use git-lfs):
https://github.com/slaclab/lcls2-pcie-apps.git
git submodule init
git submodule update
source /afs/slac/g/reseng/xilinx/vivado_2017.3/Vivado/2017.3/settings64.sh #this isn't working on 1/31/2018. sourcing below instead
source lcls2-pcie-apps/firmware/setup_env_slac.sh
if you want to store the output of "make" on your local machine: in the "firmware/" directory, "ln -s /u1/sioan/build ."
cd firmware/targets/TimeToolKcu1500
make
Making Vivado communicate with board over USB/JTAG
Do this to program with flash chips on the KCU1500 for the first time. Before programming lspci will show:
02:00.0 Serial controller: Xilinx Corporation Device 8638 (rev ff)
After programming powercycle the machine. Then lspci will show:
02:00.0 Signal processing controller: SLAC National Accelerator Lab PPA-REG Device 2030
#https://www.xilinx.com/support/answers/59128.html
1) Disconnect all Xilinx USB cables from the host computer.
2) Open a shell or terminal console.
3) Extract the driver script and its support files to a local drive of the machine where the cable will be used by typing:
#must cd to directory. Can't run install_drivers from arbitrary directory.
cd /afs/slac.stanford.edu/g/reseng/xilinx/vivado_2017.4/Vivado/2017.4/data/xicom/cable_drivers/lin64/install_script/install_drivers/
sudo ./install_drivers
#now vivado hardware manager will see the kcu1500 board.
#instructions to program using vivado hardware manager in link below
Larry has some slides on how to program the flash chips (mt25qu512) on the KCU1500 via USB/JTAG:
Programming FPGA over PCI
Before doing this, build/install the driver using the instructions here:
https://github.com/slaclab/lcls2-pcie-apps
After the first programming (and power-cycling) described above, use this script to reprogram:
https://github.com/slaclab/lcls2-pcie-apps/blob/master/software/TimeTool/scripts/updateProm.py