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(+) 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