interface riffa reusable integration framework for afpga可重复使用集成框架.pdf
C/C++Interface|RIFFA:AReusableIntegrationFrameworkForFP...
voidfpga_close(fpga_t*fpga);
Cleansupmemory/resourcesfortheFPGAspecifiedbythedescriptor(pointer).
fpga
-Pointerto
fpga_t
struct.
Returns:
Nothing.
intfpga_send(fpga_t*fpga,intchnl,void*data,intlen,intdestoff,intlast,longlongtimeout);
Sends
len
words(4bytewords)from
data
toFPGAchannel
chnl
usingthe
fpga_t
struct.TheFPGAchannelwillbesent
len,
destoff,and
last.The
valueof
destoff
isusedtosupportsendingdataacrossmultiplesendtransactions.
Notethatonlythelow31bitsofthis
unsignedint
aresent.If
last
is1,
thechannelshouldinterpretofthissendasofa
transaction.If
last
is0,thechannelshouldwaitforadditionalsends
beforeofthe
transaction.If
timeout
isnon-zero,thiscallwill
senddataandwaitupto
timeout
msfortheFPGAtorespond(between
packets)beforetimingout.
If
timeout
iszero,thiscallmayblock
indefinitely.Multiplethreadssendingonthesamechannelmayresultin
corruptdataorerror.Thisfunctionisthread
safeacrosschannels.Returnsthenumberofwordssent.
fpga
-Pointerto
fpga_t
structure.
chnl
-Channelnumberoverwhichtocommunicate.
data
-Pointertoarrayofda