aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJack Koenig2020-06-09 13:18:53 -0700
committerGitHub2020-06-09 13:18:53 -0700
commitbffc340e347563adfaa70e695cf339752a6b1da4 (patch)
treeb0e2b84d12679bb61d427604942bac601416734f /src
parent14099e1d6b7937206cfc5309cbb0e044afc358d0 (diff)
Speed up ExpandWhens for very large designs (#1666)
Use WrappedExpression instead of MemoizedHash. The benefit of memoizing the hash pales in comparison to the cost of hashing deeply nested Types in the AST. Co-authored-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/main/scala/firrtl/passes/ExpandWhens.scala7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/scala/firrtl/passes/ExpandWhens.scala b/src/main/scala/firrtl/passes/ExpandWhens.scala
index f84309d0..32fec4ed 100644
--- a/src/main/scala/firrtl/passes/ExpandWhens.scala
+++ b/src/main/scala/firrtl/passes/ExpandWhens.scala
@@ -53,8 +53,11 @@ object ExpandWhens extends Pass {
}
/** Maps an expression to a declared node name. Used to memoize predicates */
+ @deprecated("This will be removed in FIRRTL 1.4.0", "FIRRTL 1.3.2")
type NodeMap = mutable.HashMap[MemoizedHash[Expression], String]
+ private type NodeLookup = mutable.HashMap[WrappedExpression, String]
+
/** Maps a reference to whatever connects to it. Used to resolve last connect semantics */
type Netlist = mutable.LinkedHashMap[WrappedExpression, Expression]
@@ -88,10 +91,10 @@ object ExpandWhens extends Pass {
val simlist = new Simlist
// Memoizes if an expression contains any WVoids inserted in this pass
- val memoizedVoid = new mutable.HashSet[MemoizedHash[Expression]] += WVoid
+ val memoizedVoid = new mutable.HashSet[WrappedExpression] += WVoid
// Memoizes the node that holds a particular expression, if any
- val nodes = new NodeMap
+ val nodes = new NodeLookup
// Seq of attaches in order
lazy val attaches = mutable.ArrayBuffer.empty[Attach]