aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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()