Skip to content

Commit

Permalink
Implement debug() using LinkedHashSet for determinism
Browse files Browse the repository at this point in the history
In general, we should use LinkedHashSet/LinkedHashMap for collections
that we iterate over; this makes the behavior deterministic.  For
collections that are merely accessed but not iterated over, HashSet
etc. are fine.
  • Loading branch information
aswaterman committed Mar 16, 2014
1 parent f7d7595 commit f8c3c09
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/main/scala/Module.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,9 @@

package Chisel
import scala.math._
import scala.collection.mutable.ArrayBuffer
import scala.collection.mutable.{ArrayBuffer, Stack, BitSet}
import scala.collection.mutable.{LinkedHashSet, HashSet, HashMap}
import scala.collection.mutable.{Queue=>ScalaQueue}
import scala.collection.mutable.Stack
import scala.collection.mutable.HashSet
import scala.collection.mutable.HashMap
import scala.collection.mutable.BitSet
import java.lang.reflect.Modifier._
import scala.sys.process._
import scala.math.max;
Expand Down Expand Up @@ -268,7 +265,7 @@ abstract class Module(var clock: Clock = null, private var _reset: Bool = null)
var parent: Module = null;
var containsReg = false;
val children = ArrayBuffer[Module]()
val debugs = HashSet[Node]()
val debugs = LinkedHashSet[Node]()
val printfs = ArrayBuffer[Printf]()
val asserts = ArrayBuffer[Assert]()

Expand Down

0 comments on commit f8c3c09

Please sign in to comment.