summaryrefslogtreecommitdiff
path: root/src/main/scala/Chisel/Enum.scala
diff options
context:
space:
mode:
authorAndrew Waterman2015-08-12 16:53:05 -0700
committerAndrew Waterman2015-08-12 16:53:05 -0700
commit4031fad8dda90a1c14149c3c378dbf9798b388d9 (patch)
tree1cfb894908070f65d3d53385d064997193d779fd /src/main/scala/Chisel/Enum.scala
parentac582545be061be24cabd982dfad913e1114ecbe (diff)
Marshal the global mutable state into one object
Hopefully, the Chisel core is now thread-safe.
Diffstat (limited to 'src/main/scala/Chisel/Enum.scala')
-rw-r--r--src/main/scala/Chisel/Enum.scala6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/scala/Chisel/Enum.scala b/src/main/scala/Chisel/Enum.scala
index 6f7994f0..7072be0c 100644
--- a/src/main/scala/Chisel/Enum.scala
+++ b/src/main/scala/Chisel/Enum.scala
@@ -33,11 +33,11 @@ import Literal._
object Enum {
/** create n enum values of given type */
- def apply[T <: Bits](nodeType: T, n: Int): List[T] = Range(0, n).map(x => nodeType.makeLit(x)).toList
+ def apply[T <: Bits](nodeType: T, n: Int): List[T] = Range(0, n).map(x => nodeType.fromInt(x)).toList
/** create enum values of given type and names */
- def apply[T <: Bits](nodeType: T, l: Symbol *): Map[Symbol, T] = (l.toList zip (Range(0, l.length).map(x => nodeType.makeLit(x)))).toMap
+ def apply[T <: Bits](nodeType: T, l: Symbol *): Map[Symbol, T] = (l.toList zip (Range(0, l.length).map(x => nodeType.fromInt(x)))).toMap
/** create enum values of given type and names */
- def apply[T <: Bits](nodeType: T, l: List[Symbol]): Map[Symbol, T] = (l zip (Range(0, l.length).map(x => nodeType.makeLit(x)))).toMap
+ def apply[T <: Bits](nodeType: T, l: List[Symbol]): Map[Symbol, T] = (l zip (Range(0, l.length).map(x => nodeType.fromInt(x)))).toMap
}