Package: casperfpga
casperfpgacasperfpgais a python library used to interact and interface withCASPERHardware. 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 UsersNew UsersExisting UsersInstallationUsageGetting StartedMethods and UtilitiesContributingNotes to casperfpga usersNew UsersNot 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 (usuallymaster, 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 toInstallation.Should you be an existingcorruser, wondering where some of your functionality has gone when interfacing to your ROACH/2, pleaselook herefor a detailed explanation onHow to migrate tocasperfpga.Existing UsersFrom commita5e7dccand earlier the method of instantiating e.g. a SKARAB object was as follows:In[1]:importcasperfpgaIn[2]:skarab=casperfpga.SkarabFpga('skarab010103')In[3]:roach=casperfpga.katcp_fpga.KatcpFpga('roach020203')As of commit4adffc0the method of instantiating a ROACH or SKARAB was altered to be done intelligently.casperfpgaautomatically works out whether the hostname given in its instantiation is a ROACH, SKARAB or SNAP board.In[1]:importcasperfpgaIn[2]:skarab=casperfpga.CasperFpga('skarab010103')DEBUG:root:skarab010103seemstobeaSKARABINFO:casperfpga.transport_skarab:skarab010103:port(30584)created&connected.DEBUG:root:casperfpga.casperfpga:skarab010103:nowaCasperFpgaIn[3]:roach=casperfpga.CasperFpga('roach020203')DEBUG:root:roach020203seemstobeaROACHINFO:casperfpga.transport_katcp:roach020203:port(7147)createdandconnected.DEBUG:root:casperfpga.casperfpga:roach020203:nowaCasperFpgaInstallationcasperfpgais now available on the Python Package Index (PyPI) and can be installed viapip. However, should you need to interface with a SNAP board, your installation workflow involves the extra step of installing againstcasperfpga's requirements.txt.$gitclonehttps://github.com/casper-astro/casperfpga
$cdcasperfpga/
$sudoapt-getinstallpython-pip
$sudopipinstall-rrequirements.txt
$sudopipinstallcasperfpgaThe distribution on the Python Package Index is, of course, a built-distribution; this contains an already-compiled version of the SKARAB programming utilityprogska, written inC. Operating Systems tested usingpip install casperfpgainclude:Ubuntu 14.04 LTSUbuntu 16.04 LTSDebian 8.xUnfortunately the success of your installation usingpipdepends 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.$gitclonehttps://github.com/casper-astro/casperfpga.git
$cdcasperfpga
$sudopipinstall-rrequirements.txt
$sudopythonsetup.pyinstallTo check that casperfpga has been installed correctly open an ipython session and import casperfpga.$ipythonIn[1]:importcasperfpgaIf you receive any errors after this please feel free to contact anyone on theCASPER Mailing List, or check theMailing List Archiveto see if your issue has been resolved already.UsageThe introductorytutorialsfor 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 BlocksetsBuilding the design using the toolflow, and lastlyReconfiguring your CASPER Hardware with the generated .fpg file usingcasperfpgacasperfpgais 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:importcasperfpgafpga=casperfpga.CasperFpga('skarab_host or roach_name')fpga.upload_to_ram_and_program('your_file.fpg')ContributingForkthisrepo, add your changes and issue a pull request.