Commit aef493d7 authored by Dimitris Lampridis's avatar Dimitris Lampridis

sw/python: fix calls to trtl_close()

Before we were not calling the proper close() function in the destructor
of the TrtlDevice object.

We were also also not checking that the device handle (token) was
defined before using it.

Last but not least, we were not wrapping the device handle as a Python
Ctypes 'c_void_p', which caused Ctypes to convert it to a 32-bit int,
pointing to nowhere in a 64-bit system.
parent 05a14643
......@@ -203,7 +203,8 @@ class TrtlDevice(object):
def __del__(self):
if self.libtrtl is not None:
self.libtrtl.close(self.tkn)
if hasattr(self, 'tkn'):
self.libtrtl.trtl_close(self.tkn)
self.libtrtl.trtl_exit()
def __str__(self):
......@@ -218,6 +219,8 @@ class TrtlDevice(object):
self.libtrtl.trtl_open_by_id.argtypes = [c_uint]
self.libtrtl.trtl_open_by_id.restype = c_void_p
self.libtrtl.trtl_open_by_id.errcheck = self.__errcheck_pointer
self.libtrtl.trtl_close.argtypes = [c_void_p]
self.libtrtl.trtl_close.restype = None
# ERROR
self.libtrtl.trtl_strerror.argtypes = [c_int]
self.libtrtl.trtl_strerror.restype = c_char_p
......
......@@ -43,8 +43,6 @@ test_on_hw:
MODULE: "FMC-SVEC"
_BITSTREAM_NAME: "svec-mt_demo.bin"
before_script:
- ulimit -n | tee /tmp/${CI_JOB_ID}-ulimit.bak
- ulimit -n 4096
- *module_cleanup
- export PATH=$PATH:/acc/local/share/ht_tools/L867/git/latest
- sh /usr/local/drivers/scripts/${CARD}_fmc_carrier_install.sh
......@@ -92,8 +90,6 @@ test_on_hw:
- cd tests
- pytest --id $MT_NODE --fw-path $FIRMWARE_PATH --junitxml=./pytest.xml
after_script:
- if [ -f /tmp/${CI_JOB_ID}-ulimit.bak ]; then ulimit -n $(cat /tmp/${CI_JOB_ID}-ulimit.bak); fi
- ulimit -n
- *module_cleanup
artifacts:
when: always
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment