使用katcp或dcp与casper硬件设备交谈。更多信息请参见https://github.com/casper-astro/casperfpga。
casperfpga的Python项目详细描述
casperfpga
casperfpga
是一个python库,用于与CASPER Hardware交互和接口。功能包括能够重新配置固件,以及通过各种通信接口读写寄存器。
本自述将概述并参考以下内容:
casperfpga用户注意事项
新用户
除了欢迎,对新用户没什么好说的!不用说,一旦克隆了这个resposition,就应该确保您位于正确的分支上(通常是master,除非您是贡献者),并且总是定期进行拉取。这是为了确保您拥有具有最新功能的casperfpga的最新版本。您可以直接转到Installation。
你是否应该是一个现存的^ {CD2>}用户,想知道当你的RoCH/2接口时你的一些功能已经消失了,请{^ a10}详细解释^ {STR 1 } $如何迁移到^ {CD1>}。
现有用户从commit^{} 和更早的版本开始,实例化skarab对象的方法如下:
In[1]:importcasperfpgaIn[2]:skarab=casperfpga.SkarabFpga('skarab010103')In[3]:roach=casperfpga.katcp_fpga.KatcpFpga('roach020203')
从commit^{} 开始,实例化ROACH或SKARAB的方法被修改为智能地执行casperfpga
自动计算其实例化中给定的主机名是roach、skarab还是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:nowaCasperFpga
安装
^{} 现在可以在python包索引(pypi)上使用,并且可以通过^{} 安装。但是,如果需要与管理单元板交互,则安装工作流程涉及针对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
当然,Python包索引上的发行版是一个构建的发行版;它包含一个已经编译好的SKARAB编程实用程序progska
,用C
编写使用pip install casperfpga
测试的操作系统包括:
- Ubuntu 14.04 LTS公司
- ubuntu 16.04 LTS
- Debian 8.x
不幸的是,使用pip
成功安装取决于安装的主机操作系统,您可能需要使用操作系统本机的C编译器重新生成实用程序简而言之,遵循更传统的安装定制Python包的方法
$gitclonehttps://github.com/ska-sa/casperfpga.git$cdcasperfpga$sudopipinstall-rrequirements.txt$sudopythonsetup.pyinstall
要检查casperfpga是否已正确安装,请打开ipython会话并导入casperfpga。
$ ipython
In[1]:importcasperfpga
如果您在此之后收到任何错误,请随时与CASPER Mailing List上的任何人联系,或检查Mailing List Archive以查看您的问题是否已经解决。
用法
ROACH/2、SKARAB和SNAP的介绍性tutorials可作为以下整个过程的指南:
- 使用casper和xilinx块集在simulink中创建一个fpga设计
- 使用工具流构建设计,最后
- 使用
casperfpga
使用生成的.fpg文件重新配置CASPER硬件
casperfpga
是用python编写的,主要用于与casper硬件通信并重新配置其固件。因此,通信媒介通常通过ipython会话完成,如下所示:
importcasperfpgafpga=casperfpga.CasperFpga('skarab_host or roach_name')fpga.upload_to_ram_and_program('your_file.fpg')
贡献
forkthisrepo,添加更改并发出一个pull请求。
推荐PyPI第三方库
从commit^{
In[1]:importcasperfpgaIn[2]:skarab=casperfpga.SkarabFpga('skarab010103')In[3]:roach=casperfpga.katcp_fpga.KatcpFpga('roach020203')
从commit^{casperfpga
自动计算其实例化中给定的主机名是roach、skarab还是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:nowaCasperFpga
安装
^{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
当然,Python包索引上的发行版是一个构建的发行版;它包含一个已经编译好的SKARAB编程实用程序progska
,用C
编写使用pip install casperfpga
测试的操作系统包括:
- Ubuntu 14.04 LTS公司
- ubuntu 16.04 LTS
- Debian 8.x
不幸的是,使用pip
成功安装取决于安装的主机操作系统,您可能需要使用操作系统本机的C编译器重新生成实用程序简而言之,遵循更传统的安装定制Python包的方法
$gitclonehttps://github.com/ska-sa/casperfpga.git$cdcasperfpga$sudopipinstall-rrequirements.txt$sudopythonsetup.pyinstall
要检查casperfpga是否已正确安装,请打开ipython会话并导入casperfpga。
$ ipython
In[1]:importcasperfpga
如果您在此之后收到任何错误,请随时与CASPER Mailing List上的任何人联系,或检查Mailing List Archive以查看您的问题是否已经解决。
用法
ROACH/2、SKARAB和SNAP的介绍性tutorials可作为以下整个过程的指南:
- 使用casper和xilinx块集在simulink中创建一个fpga设计
- 使用工具流构建设计,最后
- 使用
casperfpga
使用生成的.fpg文件重新配置CASPER硬件
casperfpga
是用python编写的,主要用于与casper硬件通信并重新配置其固件。因此,通信媒介通常通过ipython会话完成,如下所示:
importcasperfpgafpga=casperfpga.CasperFpga('skarab_host or roach_name')fpga.upload_to_ram_and_program('your_file.fpg')
贡献
forkthisrepo,添加更改并发出一个pull请求。