aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/python/libghdl/__init__.py
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-10-03 05:51:24 +0200
committerTristan Gingold <tgingold@free.fr>2017-10-03 05:51:24 +0200
commitc88790b96b70bd6cb10b806978c34c42f2616e6f (patch)
tree6ab8f938b3f7731686dc84de476de6ad37c51587 /src/vhdl/python/libghdl/__init__.py
parent4e05204aa6fc73e440196bcc9be14cf2e1b9b6a4 (diff)
downloadghdl-c88790b96b70bd6cb10b806978c34c42f2616e6f.tar.gz
ghdl-c88790b96b70bd6cb10b806978c34c42f2616e6f.tar.bz2
ghdl-c88790b96b70bd6cb10b806978c34c42f2616e6f.zip
WIP: python binding to libghdl
Diffstat (limited to 'src/vhdl/python/libghdl/__init__.py')
-rw-r--r--src/vhdl/python/libghdl/__init__.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/vhdl/python/libghdl/__init__.py b/src/vhdl/python/libghdl/__init__.py
new file mode 100644
index 000000000..d36f58d9f
--- /dev/null
+++ b/src/vhdl/python/libghdl/__init__.py
@@ -0,0 +1,11 @@
+import ctypes
+import sys
+
+dll_ext = {'linux': '.so',
+ 'linux2': '.so',
+ 'darwin': '.dylib',
+ 'win32': '.dll',
+ 'cygwin': '.dll'}
+
+libghdl = ctypes.CDLL("libghdl" + dll_ext.get(sys.platform, '.so'))
+libghdl.libghdl_init()