From 545eab84eb8c3c6ea78c948251f0eb4245760f95 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Mon, 16 May 2022 22:26:56 +0200 Subject: =?UTF-8?q?Bumped=20dependencies=20to=20support=20pyTooling=20?= =?UTF-8?q?=E2=89=A52.0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyGHDL/cli/requirements.txt | 4 ++-- pyGHDL/libghdl/requirements.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyGHDL/cli/requirements.txt b/pyGHDL/cli/requirements.txt index 9865f70b8..e453bcbde 100644 --- a/pyGHDL/cli/requirements.txt +++ b/pyGHDL/cli/requirements.txt @@ -1,5 +1,5 @@ -r ../dom/requirements.txt -pyTooling>=1.6.0,<=1.10.0 -pyTooling.TerminalUI>=1.5.3,<=1.5.7 +pyTooling>=2.1.0 +pyTooling.TerminalUI>=1.5.9 pyAttributes>=2.3.2 diff --git a/pyGHDL/libghdl/requirements.txt b/pyGHDL/libghdl/requirements.txt index aeb01d251..571c5f637 100644 --- a/pyGHDL/libghdl/requirements.txt +++ b/pyGHDL/libghdl/requirements.txt @@ -1 +1 @@ -pyTooling>=1.6.0,<=1.10.0 +pyTooling>=2.0.1 -- cgit v1.2.3 From e35bc1bd8b4a60e5a3c18aeb5e8747a123c5a13b Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 17 May 2022 07:28:35 +0200 Subject: Workaround for Application class. --- pyGHDL/cli/dom.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pyGHDL/cli/dom.py b/pyGHDL/cli/dom.py index 1ec168842..2443beb54 100755 --- a/pyGHDL/cli/dom.py +++ b/pyGHDL/cli/dom.py @@ -41,7 +41,7 @@ from pyGHDL.dom import DOMException from pyGHDL.libghdl import LibGHDLException from pyTooling.Decorators import export -from pyTooling.MetaClasses import Singleton +from pyTooling.MetaClasses import ExtendedType from pyTooling.TerminalUI import LineTerminal, Severity from pyAttributes import Attribute from pyAttributes.ArgParseAttributes import ( @@ -118,10 +118,6 @@ class Application(LineTerminal, ArgParseMixin): def __init__(self, debug=False, verbose=False, quiet=False, sphinx=False): super().__init__(verbose, debug, quiet) - # Initialize the Terminal class - # -------------------------------------------------------------------------- - Singleton.Register(LineTerminal, self) - # Initialize DOM with an empty design # -------------------------------------------------------------------------- self._design = Design() @@ -347,7 +343,7 @@ def main(): # mccabe:disable=MC0001 try: # handover to a class instance - app = Application(debug, verbose, quiet) + app = Application() #debug, verbose, quiet) app.Run() app.exit() except PrettyPrintException as ex: -- cgit v1.2.3 From dacb6ca492a1bf0d1b352615c0435826891a0fc0 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 17 May 2022 07:28:58 +0200 Subject: Bumped dependency of pyVHDLModel to latest release. --- pyGHDL/cli/dom.py | 2 +- pyGHDL/dom/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyGHDL/cli/dom.py b/pyGHDL/cli/dom.py index 2443beb54..b342b3d9c 100755 --- a/pyGHDL/cli/dom.py +++ b/pyGHDL/cli/dom.py @@ -343,7 +343,7 @@ def main(): # mccabe:disable=MC0001 try: # handover to a class instance - app = Application() #debug, verbose, quiet) + app = Application() # debug, verbose, quiet) app.Run() app.exit() except PrettyPrintException as ex: diff --git a/pyGHDL/dom/requirements.txt b/pyGHDL/dom/requirements.txt index 18b3495eb..2e00a19a6 100644 --- a/pyGHDL/dom/requirements.txt +++ b/pyGHDL/dom/requirements.txt @@ -1,4 +1,4 @@ -r ../libghdl/requirements.txt -pyVHDLModel==0.14.1 +pyVHDLModel==0.14.3 #https://github.com/VHDL/pyVHDLModel/archive/dev.zip#pyVHDLModel -- cgit v1.2.3 From ea72eb4f0703b16e935dc6f41f54bc94739a18f3 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 17 May 2022 21:14:58 +0200 Subject: Fixed failing sanity checks for pyGHDL.dom in coverage job. --- pyGHDL/cli/dom.py | 3 +++ testsuite/pyunit/dom/Sanity.py | 7 +++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pyGHDL/cli/dom.py b/pyGHDL/cli/dom.py index b342b3d9c..20a49d8eb 100755 --- a/pyGHDL/cli/dom.py +++ b/pyGHDL/cli/dom.py @@ -307,6 +307,9 @@ class Application(LineTerminal, ArgParseMixin): for architecture in architectures: entity.Architectures.append(architecture) + if not self._design.Documents: + self.WriteFatal(f"No files processed at all.") + PP = PrettyPrint() buffer = [] diff --git a/testsuite/pyunit/dom/Sanity.py b/testsuite/pyunit/dom/Sanity.py index cc321acc7..0d84687ba 100644 --- a/testsuite/pyunit/dom/Sanity.py +++ b/testsuite/pyunit/dom/Sanity.py @@ -13,7 +13,7 @@ # # License: # ============================================================================ -# Copyright (C) 2019-2021 Tristan Gingold +# Copyright (C) 2019-2022 Tristan Gingold # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -46,10 +46,9 @@ if __name__ == "__main__": _TESTSUITE_ROOT = Path(__file__).parent.parent.parent.resolve() _GHDL_ROOT = _TESTSUITE_ROOT.parent +# design = Design() -design = Design() - -@mark.parametrize("file", [str(f.relative_to(_TESTSUITE_ROOT)) for f in _TESTSUITE_ROOT.glob("sanity/**/*.vhdl")]) +@mark.parametrize("file", [str(f.relative_to(_GHDL_ROOT)) for f in _TESTSUITE_ROOT.glob("sanity/**/*.vhdl")]) def test_AllVHDLSources(file): check_call([sys_executable, _GHDL_ROOT / "pyGHDL/cli/dom.py", "pretty", "-f", file], stderr=STDOUT) -- cgit v1.2.3 From 305b86aaf545eb662b8801868560575c8aeb2dd6 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sat, 18 Jun 2022 22:27:52 +0200 Subject: Bumped Python package dependencies in pyGHDL. --- doc/requirements.txt | 6 +++--- pyGHDL/libghdl/requirements.txt | 2 +- pyproject.toml | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index cb4081ec3..14fe95810 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,8 +1,8 @@ -r ../pyGHDL/requirements.txt -sphinx>=3.4.2 +sphinx>=5.0.2 #recommonmark>=0.7.1 -python-dateutil>=2.8.1 +python-dateutil>=2.8.2 # Sphinx Extenstions # sphinxcontrib-textstyle>=0.2.1 @@ -10,7 +10,7 @@ python-dateutil>=2.8.1 # changelog>=0.3.5 autoapi sphinx_fontawesome>=0.0.6 -sphinx_autodoc_typehints>=1.11.1 +sphinx_autodoc_typehints>=1.18.3 # BuildTheDocs Extensions (mostly patched Sphinx extensions) btd.sphinx.autoprogram>=0.1.6.post1 diff --git a/pyGHDL/libghdl/requirements.txt b/pyGHDL/libghdl/requirements.txt index 571c5f637..5f5b740d6 100644 --- a/pyGHDL/libghdl/requirements.txt +++ b/pyGHDL/libghdl/requirements.txt @@ -1 +1 @@ -pyTooling>=2.0.1 +pyTooling>=2.1.0 diff --git a/pyproject.toml b/pyproject.toml index c2ddfb778..3d59efe58 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,8 @@ [build-system] requires = [ - "pyTooling >= 1.7.0", - "setuptools >= 35.0.2", - "wheel >= 0.29.0" + "pyTooling >= 2.1.0", + "setuptools >= 62.3.3", + "wheel >= 0.37.1" ] build-backend = "setuptools.build_meta" -- cgit v1.2.3 From abbe1d1fe14671a760e5a75d8ed9d95a963dfda9 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sat, 18 Jun 2022 23:20:37 +0200 Subject: Updated dependency to pyVHDLModel to 0.14.4. --- pyGHDL/dom/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyGHDL/dom/requirements.txt b/pyGHDL/dom/requirements.txt index 2e00a19a6..943757e92 100644 --- a/pyGHDL/dom/requirements.txt +++ b/pyGHDL/dom/requirements.txt @@ -1,4 +1,4 @@ -r ../libghdl/requirements.txt -pyVHDLModel==0.14.3 +pyVHDLModel==0.14.4 #https://github.com/VHDL/pyVHDLModel/archive/dev.zip#pyVHDLModel -- cgit v1.2.3 From c634df29a8ccd593f07f5e67625c556eff3a5345 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sat, 18 Jun 2022 23:48:24 +0200 Subject: Checking if all other stuff is working without sanity checks. --- testsuite/pyunit/dom/Sanity.py | 1 + 1 file changed, 1 insertion(+) diff --git a/testsuite/pyunit/dom/Sanity.py b/testsuite/pyunit/dom/Sanity.py index 0d84687ba..6ac4bea25 100644 --- a/testsuite/pyunit/dom/Sanity.py +++ b/testsuite/pyunit/dom/Sanity.py @@ -48,6 +48,7 @@ _GHDL_ROOT = _TESTSUITE_ROOT.parent # design = Design() +@mark.xfail(reason="Was it every working?") @mark.parametrize("file", [str(f.relative_to(_GHDL_ROOT)) for f in _TESTSUITE_ROOT.glob("sanity/**/*.vhdl")]) def test_AllVHDLSources(file): check_call([sys_executable, _GHDL_ROOT / "pyGHDL/cli/dom.py", "pretty", "-f", file], stderr=STDOUT) -- cgit v1.2.3 From 2387eff54cb72997fb9afd30a2ea0754264deb3b Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 19 Jun 2022 20:49:03 +0200 Subject: Enabled AMS support for all VHDL files. Added more [NOT IMPLEMENTED] rules to support VHDL-AMS code. --- pyGHDL/dom/NonStandard.py | 1 + pyGHDL/dom/_Translate.py | 16 ++++++++++++++++ testsuite/pyunit/dom/Sanity.py | 22 +++++++++------------- 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/pyGHDL/dom/NonStandard.py b/pyGHDL/dom/NonStandard.py index f6f451325..4e842f012 100644 --- a/pyGHDL/dom/NonStandard.py +++ b/pyGHDL/dom/NonStandard.py @@ -98,6 +98,7 @@ class Design(VHDLModel_Design): errorout_memory.Install_Handler() libghdl_set_option("--std=08") + libghdl_set_option("--ams") parse.Flag_Parse_Parenthesis.value = True diff --git a/pyGHDL/dom/_Translate.py b/pyGHDL/dom/_Translate.py index ee1586e6b..2f4a90343 100644 --- a/pyGHDL/dom/_Translate.py +++ b/pyGHDL/dom/_Translate.py @@ -823,6 +823,16 @@ def GetDeclaredItemsFromChainedNodes(nodeChain: Iir, entity: str, name: str) -> print("[NOT IMPLEMENTED] Group template declaration in {name}".format(name=name)) elif kind == nodes.Iir_Kind.Disconnection_Specification: print("[NOT IMPLEMENTED] Disconnect specification in {name}".format(name=name)) + elif kind == nodes.Iir_Kind.Nature_Declaration: + print("[NOT IMPLEMENTED] Nature declaration in {name}".format(name=name)) + elif kind == nodes.Iir_Kind.Free_Quantity_Declaration: + print("[NOT IMPLEMENTED] Free quantity declaration in {name}".format(name=name)) + elif kind == nodes.Iir_Kind.Across_Quantity_Declaration: + print("[NOT IMPLEMENTED] Across quantity declaration in {name}".format(name=name)) + elif kind == nodes.Iir_Kind.Through_Quantity_Declaration: + print("[NOT IMPLEMENTED] Through quantity declaration in {name}".format(name=name)) + elif kind == nodes.Iir_Kind.Terminal_Declaration: + print("[NOT IMPLEMENTED] Terminal declaration in {name}".format(name=name)) else: position = Position.parse(item) raise DOMException( @@ -924,6 +934,12 @@ def GetConcurrentStatementsFromChainedNodes( yield ForGenerateStatement.parse(statement, label) elif kind == nodes.Iir_Kind.Psl_Assert_Directive: yield ConcurrentAssertStatement.parse(statement, label) + elif kind == nodes.Iir_Kind.Simple_Simultaneous_Statement: + print( + "[NOT IMPLEMENTED] Simple simultaneous statement (label: '{label}') at line {line}".format( + label=label, line=pos.Line + ) + ) else: raise DOMException( "Unknown statement of kind '{kind}' in {entity} '{name}' at {file}:{line}:{column}.".format( diff --git a/testsuite/pyunit/dom/Sanity.py b/testsuite/pyunit/dom/Sanity.py index 6ac4bea25..5e932322d 100644 --- a/testsuite/pyunit/dom/Sanity.py +++ b/testsuite/pyunit/dom/Sanity.py @@ -31,31 +31,27 @@ # SPDX-License-Identifier: GPL-2.0-or-later # ============================================================================ from pathlib import Path -from subprocess import check_call, STDOUT -from sys import executable as sys_executable from pytest import mark -from pyGHDL.dom.NonStandard import Design +from pyGHDL.dom.NonStandard import Design, Document + if __name__ == "__main__": print("ERROR: you called a testcase declaration file as an executable module.") print("Use: 'python -m unitest '") exit(1) + _TESTSUITE_ROOT = Path(__file__).parent.parent.parent.resolve() _GHDL_ROOT = _TESTSUITE_ROOT.parent -# design = Design() -@mark.xfail(reason="Was it every working?") +design = Design() + + @mark.parametrize("file", [str(f.relative_to(_GHDL_ROOT)) for f in _TESTSUITE_ROOT.glob("sanity/**/*.vhdl")]) def test_AllVHDLSources(file): - check_call([sys_executable, _GHDL_ROOT / "pyGHDL/cli/dom.py", "pretty", "-f", file], stderr=STDOUT) - - # try: - # lib = design.GetLibrary("sanity") - # document = Document(Path(file)) - # design.AddDocument(document, lib) - # except DOMException as ex: - # print(ex) + lib = design.GetLibrary("sanity") + document = Document(Path(file)) + design.AddDocument(document, lib) -- cgit v1.2.3 From 24f4de4220f3635afc8c4334c5805e874329e396 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 19 Jun 2022 21:06:11 +0200 Subject: Made paths relative, so it can be launched from testsuits directory too. --- testsuite/pyunit/dom/Sanity.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/testsuite/pyunit/dom/Sanity.py b/testsuite/pyunit/dom/Sanity.py index 5e932322d..ff5151fb3 100644 --- a/testsuite/pyunit/dom/Sanity.py +++ b/testsuite/pyunit/dom/Sanity.py @@ -44,14 +44,16 @@ if __name__ == "__main__": _TESTSUITE_ROOT = Path(__file__).parent.parent.parent.resolve() -_GHDL_ROOT = _TESTSUITE_ROOT.parent +_SANITY_TESTS_ROOT = _TESTSUITE_ROOT / "sanity" design = Design() -@mark.parametrize("file", [str(f.relative_to(_GHDL_ROOT)) for f in _TESTSUITE_ROOT.glob("sanity/**/*.vhdl")]) +@mark.parametrize("file", [str(f.relative_to(_TESTSUITE_ROOT)) for f in _SANITY_TESTS_ROOT.glob("**/*.vhdl")]) def test_AllVHDLSources(file): + filePath = _TESTSUITE_ROOT / file + lib = design.GetLibrary("sanity") - document = Document(Path(file)) + document = Document(filePath) design.AddDocument(document, lib) -- cgit v1.2.3