python riffa reusable integration framework for fpga PythonRiffa可重复使用集成框架.pdf
|RIFFA:AReusableIntegrationFrameworkForFPGAA...
PythonAPI
ThesoftwareinterfaceisprovidedbybindingsforC/C++,Python,MatlabandJava.Afterinstallationallbindingsareavailableintheirrespectiveruntime
environments.TheAPIisbasedonthenotionofchannels.RIFFA2canbeconfiguredtosupportbetween1-12tchannels.Eachchannelconnects
toanIPcoreandcanbeaddressedbyspecifyingthechannelnumberfromtheuserapplication.Thechannelsaretandthreadsafe.Atmostone
threadshouldbeusedtoaccessasinglechannel.
ThePythonbindingsareusedbyimportingthe
riffa
module.YouwillneedPython2.7orgreater.BelowareacoupleofcompleteexamplesandanAPI
listing.
1.importriffa
2.importarray
3.
4.fid0
5.channel0
6.
7.dataarray.array(I,range(100))
8.fdriffa.fpga_open(fid)
9.riffa.fpga_send(fd,channel,data,100,0,True,0)
10.riffa.fpga_recv(fd,channel,data,0)
11.riffa.fpga_close(fd)
ThiamplefirstopensupFPGAwithid0.Itthensends400bytesofdata(1004-bytewords)tochannel0with0destinationoffset,0timeout,andmarks
thetransferaslast.TheIPcoreonchannel0isdesignedtosendbacksomedata.Sothenextcallistoreceivedatafromthesamechannel,upto400bytes
(