aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Lehmann <Patrick.Lehmann@plc2.de>2021-07-30 09:00:38 +0200
committerumarcor <unai.martinezcorral@ehu.eus>2021-08-23 16:35:33 +0200
commit7ad5199fef58f8966121adaeda0440b10840ccdd (patch)
treeb176aa745636653776db7eb06b6978716bda7897
parentee6a244880f2d4fff429118ccbce043b342fae4d (diff)
downloadghdl-7ad5199fef58f8966121adaeda0440b10840ccdd.tar.gz
ghdl-7ad5199fef58f8966121adaeda0440b10840ccdd.tar.bz2
ghdl-7ad5199fef58f8966121adaeda0440b10840ccdd.zip
Handle parameter '-D' in ghdl-dom.
-rwxr-xr-xpyGHDL/cli/dom.py20
1 files changed, 20 insertions, 0 deletions
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()