aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/requirements.txt7
-rw-r--r--pyGHDL/__init__.py36
-rw-r--r--pyGHDL/cli/__init__.py35
-rw-r--r--pyGHDL/cli/ghdl-ls34
-rw-r--r--pyGHDL/dom/Common.py34
-rw-r--r--pyGHDL/dom/DesignUnit.py34
-rw-r--r--pyGHDL/dom/InterfaceItem.py34
-rw-r--r--pyGHDL/dom/Misc.py34
-rw-r--r--pyGHDL/dom/__init__.py34
-rw-r--r--pyGHDL/libghdl/__init__.py46
-rw-r--r--pyGHDL/libghdl/utils/__init__.py37
-rw-r--r--setup.py4
-rw-r--r--testsuite/.coveragerc (renamed from .coveragerc)4
-rw-r--r--testsuite/pyunit/SimpleEntity.vhdl1
-rw-r--r--testsuite/pyunit/SimplePackage.vhdl3
15 files changed, 366 insertions, 11 deletions
diff --git a/doc/requirements.txt b/doc/requirements.txt
index 1c95fd25e..5a1472188 100644
--- a/doc/requirements.txt
+++ b/doc/requirements.txt
@@ -1,7 +1,8 @@
-r ../pyGHDL/requirements.txt
-sphinx>=3.0.0
-recommonmark
-python-dateutil
+
+sphinx>=3.4.1
+recommonmark>=0.7.1
+python-dateutil>=2.8.1
# sphinxcontrib-textstyle>=0.2.1
# sphinxcontrib-spelling>=2.2.0
# changelog>=0.3.5
diff --git a/pyGHDL/__init__.py b/pyGHDL/__init__.py
index e69de29bb..261022876 100644
--- a/pyGHDL/__init__.py
+++ b/pyGHDL/__init__.py
@@ -0,0 +1,36 @@
+# =============================================================================
+# ____ _ _ ____ _
+# _ __ _ _ / ___| | | | _ \| |
+# | '_ \| | | | | _| |_| | | | | |
+# | |_) | |_| | |_| | _ | |_| | |___
+# | .__/ \__, |\____|_| |_|____/|_____|
+# |_| |___/
+# =============================================================================
+# Authors: Tristan Gingold
+# Patrick Lehmann
+# Unai Martinez-Corral
+#
+# Package package: Python binding for GHDL and high-level APIs.
+#
+# License:
+# ============================================================================
+# Copyright (C) 2019-2020 Tristan Gingold
+#
+# GHDL is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2, or (at your option) any later
+# version.
+#
+# GHDL is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GHDL; see the file COPYING. If not, write to the Free
+# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+# ============================================================================
+#
diff --git a/pyGHDL/cli/__init__.py b/pyGHDL/cli/__init__.py
index e69de29bb..f3165ec9c 100644
--- a/pyGHDL/cli/__init__.py
+++ b/pyGHDL/cli/__init__.py
@@ -0,0 +1,35 @@
+# =============================================================================
+# ____ _ _ ____ _ _ _
+# _ __ _ _ / ___| | | | _ \| | ___| (_)
+# | '_ \| | | | | _| |_| | | | | | / __| | |
+# | |_) | |_| | |_| | _ | |_| | |___ | (__| | |
+# | .__/ \__, |\____|_| |_|____/|_____(_)___|_|_|
+# |_| |___/
+# =============================================================================
+# Authors: Patrick Lehmann
+# Unai Martinez-Corral
+#
+# Package package: Package for command line interfaces.
+#
+# License:
+# ============================================================================
+# Copyright (C) 2019-2020 Tristan Gingold
+#
+# GHDL is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2, or (at your option) any later
+# version.
+#
+# GHDL is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GHDL; see the file COPYING. If not, write to the Free
+# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+# ============================================================================
+#
diff --git a/pyGHDL/cli/ghdl-ls b/pyGHDL/cli/ghdl-ls
index 33949fa67..2ccb41b16 100644
--- a/pyGHDL/cli/ghdl-ls
+++ b/pyGHDL/cli/ghdl-ls
@@ -1,4 +1,38 @@
#!/usr/bin/env python
+# =============================================================================
+# ____ _ _ ____ _ _ _
+# _ __ _ _ / ___| | | | _ \| | ___| (_)
+# | '_ \| | | | | _| |_| | | | | | / __| | |
+# | |_) | |_| | |_| | _ | |_| | |___ | (__| | |
+# | .__/ \__, |\____|_| |_|____/|_____(_)___|_|_|
+# |_| |___/
+# =============================================================================
+# Authors: Tristan Gingold
+#
+# Package module: GHDLs Language Server implementing LSP for VHDL.
+#
+# License:
+# ============================================================================
+# Copyright (C) 2019-2020 Tristan Gingold
+#
+# GHDL is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2, or (at your option) any later
+# version.
+#
+# GHDL is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GHDL; see the file COPYING. If not, write to the Free
+# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+# ============================================================================
+#
from __future__ import absolute_import
import argparse
diff --git a/pyGHDL/dom/Common.py b/pyGHDL/dom/Common.py
index 0cd41c99e..224cf80b5 100644
--- a/pyGHDL/dom/Common.py
+++ b/pyGHDL/dom/Common.py
@@ -1,3 +1,37 @@
+# =============================================================================
+# ____ _ _ ____ _ _
+# _ __ _ _ / ___| | | | _ \| | __| | ___ _ __ ___
+# | '_ \| | | | | _| |_| | | | | | / _` |/ _ \| '_ ` _ \
+# | |_) | |_| | |_| | _ | |_| | |___ | (_| | (_) | | | | | |
+# | .__/ \__, |\____|_| |_|____/|_____(_)__,_|\___/|_| |_| |_|
+# |_| |___/
+# =============================================================================
+# Authors: Patrick Lehmann
+#
+# Package module: DOM: Common classes for package pyGHDL.dom.
+#
+# License:
+# ============================================================================
+# Copyright (C) 2019-2020 Tristan Gingold
+#
+# GHDL is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2, or (at your option) any later
+# version.
+#
+# GHDL is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GHDL; see the file COPYING. If not, write to the Free
+# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+# ============================================================================
+#
from pydecor import export
from pyVHDLModel.VHDLModel import Modes
diff --git a/pyGHDL/dom/DesignUnit.py b/pyGHDL/dom/DesignUnit.py
index 3e87bb41a..62a3af981 100644
--- a/pyGHDL/dom/DesignUnit.py
+++ b/pyGHDL/dom/DesignUnit.py
@@ -1,3 +1,37 @@
+# =============================================================================
+# ____ _ _ ____ _ _
+# _ __ _ _ / ___| | | | _ \| | __| | ___ _ __ ___
+# | '_ \| | | | | _| |_| | | | | | / _` |/ _ \| '_ ` _ \
+# | |_) | |_| | |_| | _ | |_| | |___ | (_| | (_) | | | | | |
+# | .__/ \__, |\____|_| |_|____/|_____(_)__,_|\___/|_| |_| |_|
+# |_| |___/
+# =============================================================================
+# Authors: Patrick Lehmann
+#
+# Package module: DOM: VHDL design units (e.g. entity or package).
+#
+# License:
+# ============================================================================
+# Copyright (C) 2019-2020 Tristan Gingold
+#
+# GHDL is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2, or (at your option) any later
+# version.
+#
+# GHDL is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GHDL; see the file COPYING. If not, write to the Free
+# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+# ============================================================================
+#
from pydecor import export
from pyVHDLModel.VHDLModel import Entity as VHDLModel_Entity
diff --git a/pyGHDL/dom/InterfaceItem.py b/pyGHDL/dom/InterfaceItem.py
index 0833c2547..b364df31a 100644
--- a/pyGHDL/dom/InterfaceItem.py
+++ b/pyGHDL/dom/InterfaceItem.py
@@ -1,3 +1,37 @@
+# =============================================================================
+# ____ _ _ ____ _ _
+# _ __ _ _ / ___| | | | _ \| | __| | ___ _ __ ___
+# | '_ \| | | | | _| |_| | | | | | / _` |/ _ \| '_ ` _ \
+# | |_) | |_| | |_| | _ | |_| | |___ | (_| | (_) | | | | | |
+# | .__/ \__, |\____|_| |_|____/|_____(_)__,_|\___/|_| |_| |_|
+# |_| |___/
+# =============================================================================
+# Authors: Patrick Lehmann
+#
+# Package module: DOM: Interface items (e.g. generic or port)
+#
+# License:
+# ============================================================================
+# Copyright (C) 2019-2020 Tristan Gingold
+#
+# GHDL is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2, or (at your option) any later
+# version.
+#
+# GHDL is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GHDL; see the file COPYING. If not, write to the Free
+# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+# ============================================================================
+#
from pydecor import export
from pyVHDLModel.VHDLModel import PortSignalInterfaceItem as VHDLModel_PortSignalInterfaceItem
diff --git a/pyGHDL/dom/Misc.py b/pyGHDL/dom/Misc.py
index 0c9736cb0..049a8c2ac 100644
--- a/pyGHDL/dom/Misc.py
+++ b/pyGHDL/dom/Misc.py
@@ -1,3 +1,37 @@
+# =============================================================================
+# ____ _ _ ____ _ _
+# _ __ _ _ / ___| | | | _ \| | __| | ___ _ __ ___
+# | '_ \| | | | | _| |_| | | | | | / _` |/ _ \| '_ ` _ \
+# | |_) | |_| | |_| | _ | |_| | |___ | (_| | (_) | | | | | |
+# | .__/ \__, |\____|_| |_|____/|_____(_)__,_|\___/|_| |_| |_|
+# |_| |___/
+# =============================================================================
+# Authors: Patrick Lehmann
+#
+# Package module: DOM: Elements not covered by the VHDL standard.
+#
+# License:
+# ============================================================================
+# Copyright (C) 2019-2020 Tristan Gingold
+#
+# GHDL is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2, or (at your option) any later
+# version.
+#
+# GHDL is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GHDL; see the file COPYING. If not, write to the Free
+# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+# ============================================================================
+#
from pathlib import Path
from typing import Any
diff --git a/pyGHDL/dom/__init__.py b/pyGHDL/dom/__init__.py
index df2dfb868..74348c59b 100644
--- a/pyGHDL/dom/__init__.py
+++ b/pyGHDL/dom/__init__.py
@@ -1,3 +1,37 @@
+# =============================================================================
+# ____ _ _ ____ _ _
+# _ __ _ _ / ___| | | | _ \| | __| | ___ _ __ ___
+# | '_ \| | | | | _| |_| | | | | | / _` |/ _ \| '_ ` _ \
+# | |_) | |_| | |_| | _ | |_| | |___ | (_| | (_) | | | | | |
+# | .__/ \__, |\____|_| |_|____/|_____(_)__,_|\___/|_| |_| |_|
+# |_| |___/
+# =============================================================================
+# Authors: Patrick Lehmann
+#
+# Package package: Document object model (DOM) for pyGHDL.libghdl.
+#
+# License:
+# ============================================================================
+# Copyright (C) 2019-2020 Tristan Gingold
+#
+# GHDL is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2, or (at your option) any later
+# version.
+#
+# GHDL is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GHDL; see the file COPYING. If not, write to the Free
+# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+# ============================================================================
+#
from pydecor import export
__all__ = []
diff --git a/pyGHDL/libghdl/__init__.py b/pyGHDL/libghdl/__init__.py
index 431008df3..d59803d68 100644
--- a/pyGHDL/libghdl/__init__.py
+++ b/pyGHDL/libghdl/__init__.py
@@ -1,3 +1,37 @@
+# =============================================================================
+# ____ _ _ ____ _ _ _ _ _ _ _
+# _ __ _ _ / ___| | | | _ \| | | (_) |__ __ _| |__ __| | |
+# | '_ \| | | | | _| |_| | | | | | | | | '_ \ / _` | '_ \ / _` | |
+# | |_) | |_| | |_| | _ | |_| | |___ _| | | |_) | (_| | | | | (_| | |
+# | .__/ \__, |\____|_| |_|____/|_____(_)_|_|_.__/ \__, |_| |_|\__,_|_|
+# |_| |___/ |___/
+# =============================================================================
+# Authors: Tristan Gingold
+#
+# Package package: Python binding and low-level API for shared library 'libghdl'.
+#
+# License:
+# ============================================================================
+# Copyright (C) 2019-2020 Tristan Gingold
+#
+# GHDL is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2, or (at your option) any later
+# version.
+#
+# GHDL is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GHDL; see the file COPYING. If not, write to the Free
+# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+# ============================================================================
+#
import ctypes
import os
import sys
@@ -35,7 +69,17 @@ def _check_libghdl_bindir(bindir, basename):
def _get_libghdl_path():
- """Locate the directory where the shared library is"""
+ """
+ Locate the directory where the shared library is installed.
+
+ Search order:
+
+ 1. `GHDL_PREFIX` - directory (prefix) of the vhdl libraries.
+ 2. `VUNIT_GHDL_PATH` - path of the `ghdl` binary when using VUnit.
+ 3. `GHDL` - name of, or path to the `ghdl` binary.
+ 4. Try within `libghdl/` Python installation.
+ 5. Try when running from the build directory.
+ """
basename = _get_libghdl_name()
# Try GHDL_PREFIX
r = os.environ.get("GHDL_PREFIX")
diff --git a/pyGHDL/libghdl/utils/__init__.py b/pyGHDL/libghdl/utils/__init__.py
index a8e0d4f3f..149009689 100644
--- a/pyGHDL/libghdl/utils/__init__.py
+++ b/pyGHDL/libghdl/utils/__init__.py
@@ -1,4 +1,39 @@
-from ctypes import c_char_p, c_int32, c_int, c_bool, sizeof, c_void_p, byref
+# =============================================================================
+# ____ _ _ ____ _ _ _ _ _ _ _
+# _ __ _ _ / ___| | | | _ \| | | (_) |__ __ _| |__ __| | |
+# | '_ \| | | | | _| |_| | | | | | | | | '_ \ / _` | '_ \ / _` | |
+# | |_) | |_| | |_| | _ | |_| | |___ _| | | |_) | (_| | | | | (_| | |
+# | .__/ \__, |\____|_| |_|____/|_____(_)_|_|_.__/ \__, |_| |_|\__,_|_|
+# |_| |___/ |___/
+# =============================================================================
+# Authors: Tristan Gingold
+#
+# Package module: Generators/iterators and low-level helpers for pyGHDL.libghdl.
+#
+# License:
+# ============================================================================
+# Copyright (C) 2019-2020 Tristan Gingold
+#
+# GHDL is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2, or (at your option) any later
+# version.
+#
+# GHDL is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GHDL; see the file COPYING. If not, write to the Free
+# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+# ============================================================================
+#
+from ctypes import byref
+
import pyGHDL.libghdl.name_table as name_table
import pyGHDL.libghdl.vhdl.nodes as nodes
import pyGHDL.libghdl.vhdl.nodes_meta as nodes_meta
diff --git a/setup.py b/setup.py
index 47f41fbc6..8a58e35ee 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,3 @@
-# EMACS settings: -*- tab-width: 2; indent-tabs-mode: t -*-
-# vim: tabstop=2:shiftwidth=2:noexpandtab
-# kate: tab-width 2; replace-tabs off; indent-width 2;
# =============================================================================
# ____ _ _ ____ _
# _ __ _ _ / ___| | | | _ \| |
@@ -11,6 +8,7 @@
# =============================================================================
# Authors: Tristan Gingold
# Patrick Lehmann
+# Unai Martinez-Corral
#
# Package installer: Python binding for GHDL and high-level APIs.
#
diff --git a/.coveragerc b/testsuite/.coveragerc
index 0ebb5bd64..7148874fb 100644
--- a/.coveragerc
+++ b/testsuite/.coveragerc
@@ -6,7 +6,7 @@ skip_covered = True
skip_empty = True
[html]
-directory = .cov
+directory = ../build/coverage
[xml]
-output = coverage.xml
+output = ../build/coverage.xml
diff --git a/testsuite/pyunit/SimpleEntity.vhdl b/testsuite/pyunit/SimpleEntity.vhdl
index a26a6357c..a61c1cf93 100644
--- a/testsuite/pyunit/SimpleEntity.vhdl
+++ b/testsuite/pyunit/SimpleEntity.vhdl
@@ -1,4 +1,5 @@
library ieee;
+use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity e1 is
diff --git a/testsuite/pyunit/SimplePackage.vhdl b/testsuite/pyunit/SimplePackage.vhdl
index f06cc32fa..0b93adf96 100644
--- a/testsuite/pyunit/SimplePackage.vhdl
+++ b/testsuite/pyunit/SimplePackage.vhdl
@@ -1,5 +1,6 @@
library ieee;
-use ieee.numeric_std.all
+use ieee.std_logic_1164.all;
+use ieee.numeric_std.all;
package pack_1 is
constant const_1 : boolean;