Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Commit

Permalink
Remove accidental hashing of all Modules in Dedup
Browse files Browse the repository at this point in the history
  • Loading branch information
jackkoenig committed May 14, 2020
1 parent 36227e9 commit 71e922c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/scala/firrtl/transforms/Dedup.scala
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,11 @@ object DedupModules {
val dedupedName2module = tag2name.map({ case (tag, name) => name -> DedupModules.dedupInstances(top, name, moduleMap, name2name, renameMap) })

// Build map from original name to corresponding deduped module
val name2module = tag2all.flatMap({ case (tag, names) => names.map(n => n -> dedupedName2module(tag2name(tag))) })
// It is important to flatMap before looking up the DefModules so that they aren't hashed
val name2module: Map[String, DefModule] =
tag2all.flatMap { case (tag, names) => names.map(_ -> tag) }
.mapValues(tag => dedupedName2module(tag2name(tag)))
.toMap

// Build renameMap
val indexedTargets = mutable.HashMap[String, IndexedSeq[ReferenceTarget]]()
Expand All @@ -439,7 +443,7 @@ object DedupModules {
}
}

name2module.toMap
name2module
}

def computeIndexedNames(main: String, m: DefModule): IndexedSeq[ReferenceTarget] = {
Expand Down

0 comments on commit 71e922c

Please sign in to comment.