aboutsummaryrefslogtreecommitdiff
path: root/build.sc
diff options
context:
space:
mode:
authorJack Koenig2021-08-31 14:10:29 -0700
committerJack Koenig2021-12-01 11:40:52 -0800
commit17250fba841ae3129dc798c0bc48d10200be18ae (patch)
tree37b93b1c487f78e39acd17f94faf5f5c3b24b9d8 /build.sc
parent64a0ca2512199c55e51ec90dbd3ec7d563472255 (diff)
Use ANTLR Listener to save memory during parsing
The ANTLR-generated concrete syntax tree (CST) takes up much more memory than the parsed .fir file. By using a Listener, we can construct the FIRRTL AST live with CST construction and null out the CST as we consume pieces of it. Not only does this improve performance, it drastically reduces max memory use for the parser.
Diffstat (limited to 'build.sc')
-rw-r--r--build.sc4
1 files changed, 2 insertions, 2 deletions
diff --git a/build.sc b/build.sc
index 59e6d4c0..de5922d8 100644
--- a/build.sc
+++ b/build.sc
@@ -139,7 +139,7 @@ class firrtlCrossModule(val crossScalaVersion: String)
antlrSource().path.toString,
"-package",
"firrtl.antlr",
- "-no-listener",
+ "-listener",
"-visitor",
antlrSource().path.toString
).call()
@@ -152,7 +152,7 @@ class firrtlCrossModule(val crossScalaVersion: String)
antlrSource().path.toString,
"-package",
"firrtl.antlr",
- "-no-listener",
+ "-listener",
"-visitor",
antlrSource().path.toString
).call()