From 7ad5199fef58f8966121adaeda0440b10840ccdd Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Fri, 30 Jul 2021 09:00:38 +0200 Subject: Handle parameter '-D' in ghdl-dom. --- pyGHDL/cli/dom.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'pyGHDL/cli/dom.py') diff --git a/pyGHDL/cli/dom.py b/pyGHDL/cli/dom.py index 2d0e85ea9..83ef7c42e 100755 --- a/pyGHDL/cli/dom.py +++ b/pyGHDL/cli/dom.py @@ -296,6 +296,26 @@ class Application(LineTerminal, ArgParseMixin): document.DOMTranslationTime * 10 ** 6, ) ) + elif args.Directory is not None: + d : Path = args.Directory + if not d.exists(): + self.WriteError("Directory '{0!s}' does not exist.".format(d)) + + for file in d.glob("**/*.vhd?"): + self.WriteNormal("Parsing file '{!s}'".format(file)) + document = self.addFile(file, "pretty") + self.WriteInfo( + dedent( + """\ + libghdl processing time: {: 5.3f} us + DOM translation time: {:5.3f} us + """ + ).format( + document.LibGHDLProcessingTime * 10**6, + document.DOMTranslationTime * 10**6, + ) + ) + PP = PrettyPrint() -- cgit v1.2.3 From 5314281f0b8090f820ae64b652e40c300c2bdec2 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Fri, 30 Jul 2021 23:55:18 +0200 Subject: Fixes. --- pyGHDL/cli/dom.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'pyGHDL/cli/dom.py') diff --git a/pyGHDL/cli/dom.py b/pyGHDL/cli/dom.py index 83ef7c42e..63350d729 100755 --- a/pyGHDL/cli/dom.py +++ b/pyGHDL/cli/dom.py @@ -297,7 +297,7 @@ class Application(LineTerminal, ArgParseMixin): ) ) elif args.Directory is not None: - d : Path = args.Directory + d: Path = args.Directory if not d.exists(): self.WriteError("Directory '{0!s}' does not exist.".format(d)) @@ -311,12 +311,11 @@ class Application(LineTerminal, ArgParseMixin): DOM translation time: {:5.3f} us """ ).format( - document.LibGHDLProcessingTime * 10**6, - document.DOMTranslationTime * 10**6, + document.LibGHDLProcessingTime * 10 ** 6, + document.DOMTranslationTime * 10 ** 6, ) ) - PP = PrettyPrint() buffer = [] -- cgit v1.2.3 From b543ae7178207a3100e1ae85d5d57b16952165a3 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Wed, 11 Aug 2021 00:41:15 +0200 Subject: Resolve entity names in architectures to entities. --- pyGHDL/cli/dom.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'pyGHDL/cli/dom.py') diff --git a/pyGHDL/cli/dom.py b/pyGHDL/cli/dom.py index 63350d729..4a9fd0b3c 100755 --- a/pyGHDL/cli/dom.py +++ b/pyGHDL/cli/dom.py @@ -316,6 +316,14 @@ class Application(LineTerminal, ArgParseMixin): ) ) + for library in self._design.Libraries.values(): + for entityName, architectures in library.Architectures.items(): + for entity in library.Entities: + if entity.Identifier == str(entityName): + for architecture in architectures: + entity.Architectures.append(architecture) + + PP = PrettyPrint() buffer = [] -- cgit v1.2.3 From 3f31acc7304b03996f045f39b9e1130a4ffdc330 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Wed, 11 Aug 2021 02:55:48 +0200 Subject: Improved pretty-printing for hierarchy. --- pyGHDL/cli/dom.py | 1 - 1 file changed, 1 deletion(-) (limited to 'pyGHDL/cli/dom.py') diff --git a/pyGHDL/cli/dom.py b/pyGHDL/cli/dom.py index 4a9fd0b3c..69a0b92ec 100755 --- a/pyGHDL/cli/dom.py +++ b/pyGHDL/cli/dom.py @@ -323,7 +323,6 @@ class Application(LineTerminal, ArgParseMixin): for architecture in architectures: entity.Architectures.append(architecture) - PP = PrettyPrint() buffer = [] -- cgit v1.2.3