Talk to CASPER hardware devices using katcp or dcp. See https://github.com/casper-astro/casperfpga for more.
Project description
casperfpga
casperfpga
is a python library used to interact and interface with CASPER Hardware. Functionality includes being able to reconfigure firmware, as well as read and write registers across the various communication interfaces.
This README will outline, and make reference to, the following:
- Notes to Users
- Installation
- Usage
- Contributing
Notes to casperfpga users
New Users
Not much to say to new users except welcome! It goes without saying that once you have cloned this respository you should make sure you're on the correct branch (usually master, unless you're a contributor) and always pull regularly. This, to make sure you have the latest version of casperfpga with the latest features. You can move on straight to Installation.
Should you be an existing corr
user, wondering where some of your functionality has gone when interfacing to your ROACH/2, please look here for a detailed explanation on How to migrate to casperfpga
.
Existing Users
From commit a5e7dcc
and earlier the method of instantiating e.g. a SKARAB object was as follows:
In [1]: import casperfpga
In [2]: skarab = casperfpga.SkarabFpga('skarab010103')
In [3]: roach = casperfpga.katcp_fpga.KatcpFpga('roach020203')
As of commit 4adffc0
the method of instantiating a ROACH or SKARAB was altered to be done intelligently. casperfpga
automatically works out whether the hostname given in its instantiation is a ROACH, SKARAB or SNAP board.
In [1]: import casperfpga
In [2]: skarab = casperfpga.CasperFpga('skarab010103')
DEBUG:root:skarab010103 seems to be a SKARAB
INFO:casperfpga.transport_skarab:skarab010103: port(30584) created & connected.
DEBUG:root:casperfpga.casperfpga:skarab010103: now a CasperFpga
In [3]: roach = casperfpga.CasperFpga('roach020203')
DEBUG:root:roach020203 seems to be a ROACH
INFO:casperfpga.transport_katcp:roach020203: port(7147) created and connected.
DEBUG:root:casperfpga.casperfpga:roach020203: now a CasperFpga
Installation
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 casperfpga's requirements.txt
.
$ git clone https://github.com/casper-astro/casperfpga
$ cd casperfpga/
$ 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
- 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.
$ git clone https://github.com/casper-astro/casperfpga.git
$ cd casperfpga
$ sudo pip install -r requirements.txt
$ sudo python setup.py install
To check that casperfpga has been installed correctly open an ipython session and import casperfpga.
$ ipython
In [1]: import casperfpga
If you receive any errors after this please feel free to contact anyone on the CASPER Mailing List, or check the Mailing List Archive to see if your issue has been resolved already.
Usage
The introductory tutorials for ROACH/2, SKARAB and SNAP 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
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')
Contributing
Fork this repo, add your changes and issue a pull request.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file casperfpga-0.1.3-py2.7-linux-x86_64.egg
.
File metadata
- Download URL: casperfpga-0.1.3-py2.7-linux-x86_64.egg
- Upload date:
- Size: 513.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.19.1 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/2.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fdb3f0e6901cb83dfe67008b7c991e7dbd264c8f35d4a423498275ec115e2a16 |
|
MD5 | ada2517805a72a58d48485258cfe914b |
|
BLAKE2b-256 | 5c788817d94d59c24883114577ed1125dc3e87be703ba04830466acca4f422d1 |
File details
Details for the file casperfpga-0.1.3-cp27-cp27mu-any.whl
.
File metadata
- Download URL: casperfpga-0.1.3-cp27-cp27mu-any.whl
- Upload date:
- Size: 259.0 kB
- Tags: CPython 2.7mu
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.19.1 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/2.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a34d3806ff96852d36bf329c329bfe10b2ff161061a3d397c1c5028a262d6d6b |
|
MD5 | 36058a482d2db8f8027d8447717fe7e7 |
|
BLAKE2b-256 | eaad453b364386623382466cb1daa3b2b9c49c85179e8977d7f92de161795a72 |