aboutsummaryrefslogtreecommitdiffstats
path: root/python/libghdl/thin/vhdl/lists.py
diff options
context:
space:
mode:
author1138-4EB <1138-4EB@users.noreply.github.com>2019-06-17 03:38:27 +0200
committertgingold <tgingold@users.noreply.github.com>2019-06-17 03:38:27 +0200
commit159e0bfdbb135e74aac10e54c7a499e9e34aa5a2 (patch)
treea1ed3fbd98ddd464041a25f5e389fdd029e55528 /python/libghdl/thin/vhdl/lists.py
parentd71489efc74c55ee09f242ae5d87dbee694a8b5e (diff)
downloadghdl-159e0bfdbb135e74aac10e54c7a499e9e34aa5a2.tar.gz
ghdl-159e0bfdbb135e74aac10e54c7a499e9e34aa5a2.tar.bz2
ghdl-159e0bfdbb135e74aac10e54c7a499e9e34aa5a2.zip
Rework libghdl build/install procedure (#840)
* feat(libghdl): add libghdl_pkg.py, add option to generate libghdl-py.tgz with dist/travis/build.sh * libghdl*.so is now part of GHDL * move python sources to python/libghdl and python/pnodes * rename src/vhdl/python to src/vhdl/libghdl * add generation of tarball for libghdl-py to the makefile * deprecate --enable-python and --disable-python * add configuration option --disable-libghdl * feat(python/libghdl): add support for LIBGHDL_PREFIX (#844) * fix(travis): disable libghdl on mac * feat(python/libghdl): add support for GHDL_BIN_PATH and VUNIT_GHDL_PATH
Diffstat (limited to 'python/libghdl/thin/vhdl/lists.py')
-rw-r--r--python/libghdl/thin/vhdl/lists.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/python/libghdl/thin/vhdl/lists.py b/python/libghdl/thin/vhdl/lists.py
new file mode 100644
index 000000000..8fc180073
--- /dev/null
+++ b/python/libghdl/thin/vhdl/lists.py
@@ -0,0 +1,33 @@
+from libghdl import libghdl
+from ctypes import c_int32, c_bool, POINTER, Structure
+
+List_Type = c_int32
+
+class Iterator(Structure):
+ _fields_ = [("chunk", c_int32),
+ ("chunk_idx", c_int32),
+ ("remain", c_int32)]
+
+Iterate = libghdl.vhdl__lists__iterate
+Iterate.argstype = [List_Type]
+Iterate.restype = Iterator
+
+Is_Valid = libghdl.vhdl__lists__is_valid
+Is_Valid.argstype = [POINTER(Iterator)]
+Is_Valid.restype = c_bool
+
+Next = libghdl.vhdl__lists__next
+Next.argstype = [POINTER(Iterator)]
+Next.restype = None
+
+Get_Element = libghdl.vhdl__lists__get_element
+Get_Element.argstype = [POINTER(Iterator)]
+Get_Element.restype = c_int32
+
+Get_Nbr_Elements = libghdl.vhdl__lists__get_nbr_elements
+Get_Nbr_Elements.argtype = [List_Type]
+Get_Nbr_Elements.restype = c_int32
+
+Create_Iir_List = libghdl.vhdl__lists__create_list
+
+Destroy_Iir_List = libghdl.vhdl__lists__destroy_list