How to install casperfpga¶
This section explains how to install
casperfpga, a python library used to interact with CASPER hardware.
Once you have cloned the casperfpga repository, ensure that you are on the correct branch (usually master unless you are a contributor) and always pull regularly to make sure you have the latest version of casperfpga.
casperfpga is now available on the Python Package Index (PyPI) and can be installed via
pip. However, should you need to interface with a SNAP board, your installation workflow involves the extra step of installing against
$ git clone https://github.com/casper-astro/casperfpga $ cd casperfpga/ $ git checkout master $ sudo apt-get install python-pip $ sudo pip install -r requirements.txt $ sudo pip install casperfpga
The distribution on the Python Package Index is, of course, a built-distribution; this contains an already-compiled version of the SKARAB programming utility
progska, written in
C. Operating Systems tested using
pip install casperfpga include:
- Ubuntu 14.04 LTS
- Ubuntu 16.04 LTS
- Ubuntu 18.04 LTS
- Debian 8.x
Unfortunately the success of your installation using
pip depends on the host OS of the installation, and you might need to rebuild the utility using the C-compiler native to your OS. In short follow the more traditional method of installing custom Python packages.
# remove current casperfpga install files $ cd /usr/local/lib/python2.7/dist-packages $ sudo rm -rf casper* # clone the repository to your working directory $ cd /path/to/working/directory $ git clone https://github.com/casper-astro/casperfpga.git $ cd casperfpga $ git checkout master $ sudo pip install -r requirements.txt $ sudo python setup.py install
Testing that the installation worked¶
To check that casperfpga has been installed correctly open an ipython session and import casperfpga. To avoid errors, move out of your cloned casperfpga repository directory before doing this test.
casperfpga.__version__ will output the build and githash version of your casperfpga library.
$ cd .. $ ipython
In : import casperfpga In : casperfpga.__version__
The introductory tutorials for current CASPER hardware serve as a guide to the entire process of:
- Creating an FPGA design in Simulink using the CASPER and Xilinx Blocksets
- Building the design using the toolflow, and lastly
- Reconfiguring your CASPER Hardware with the generated .fpg file using
casperfpga is written in python and mainly used to communicate with CASPER Hardware and reconfigure it’s firmware. Hence the medium of communication is usually done through an ipython session, as shown below:
import casperfpga fpga = casperfpga.CasperFpga('skarab_host or roach_name') fpga.upload_to_ram_and_program('your_file.fpg')