1
0
mirror of https://github.com/KastnerRG/riffa.git synced 2025-01-30 23:02:54 +08:00

Merge pull request #6 from jrobrien/py3k-x64

Add support for 64 bit pointers and Python 3
This commit is contained in:
Dustin Richmond 2016-05-09 16:27:23 -07:00
commit af7c5928f2

View File

@ -48,6 +48,9 @@ if platform.system() == "Linux":
else:
libriffa = ctypes.CDLL("riffa.dll")
libriffa.fpga_recv.argtypes = [ctypes.c_void_p, ctypes.c_int, ctypes.c_void_p, ctypes.c_int, ctypes.c_longlong]
libriffa.fpga_send.argtypes = [ctypes.c_void_p, ctypes.c_int, ctypes.c_void_p, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_longlong]
class FpgaInfoList(ctypes.Structure):
_fields_ = [("num_fpgas", ctypes.c_int),
("id", ctypes.c_int * NUM_FPGAS),
@ -156,7 +159,7 @@ def fpga_recv(fd, chnl, data, timeout):
ctypes.pythonapi.PyObject_AsReadBuffer(obj, ctypes.byref(a), ctypes.byref(l))
ptr = a.value
datalen = l.value
return libriffa.fpga_recv(fd, chnl, ptr, datalen/4, timeout)
return libriffa.fpga_recv(fd, chnl, ptr, datalen//4, timeout)
# Resets the state of the FPGA and all transfers across all channels. This is