summaryrefslogtreecommitdiff
path: root/src/main/scala/Chisel/util/Enum.scala
diff options
context:
space:
mode:
authorJim Lawson2016-07-19 13:43:48 -0700
committerJim Lawson2016-07-19 13:43:48 -0700
commitb27f29902d9f1d886e8edf1fc5e960cf9a634184 (patch)
treec6f3e27e46e5ed9c3cc62f2c368c766cdded74c6 /src/main/scala/Chisel/util/Enum.scala
parent083610b2faa456dfccc4365dd115565d36e522fa (diff)
parent12810b5efe6a8f872fbc1c63cdfb835ca354624f (diff)
Merge branch 'sdtwigg_rebase_renamechisel3' into sdtwigg_wrap_renamechisel3
Diffstat (limited to 'src/main/scala/Chisel/util/Enum.scala')
-rw-r--r--src/main/scala/Chisel/util/Enum.scala21
1 files changed, 0 insertions, 21 deletions
diff --git a/src/main/scala/Chisel/util/Enum.scala b/src/main/scala/Chisel/util/Enum.scala
deleted file mode 100644
index 20057197..00000000
--- a/src/main/scala/Chisel/util/Enum.scala
+++ /dev/null
@@ -1,21 +0,0 @@
-// See LICENSE for license details.
-
-/** Enum generators, allowing circuit constants to have more meaningful names.
- */
-
-package Chisel
-
-object Enum {
- /** Returns a sequence of Bits subtypes with values from 0 until n. Helper method. */
- private def createValues[T <: Bits](nodeType: T, n: Int): Seq[T] =
- (0 until n).map(x => nodeType.fromInt(x, log2Up(n)))
-
- /** create n enum values of given type */
- def apply[T <: Bits](nodeType: T, n: Int): List[T] = createValues(nodeType, n).toList
-
- /** create enum values of given type and names */
- def apply[T <: Bits](nodeType: T, l: Symbol *): Map[Symbol, T] = (l zip createValues(nodeType, l.length)).toMap
-
- /** create enum values of given type and names */
- def apply[T <: Bits](nodeType: T, l: List[Symbol]): Map[Symbol, T] = (l zip createValues(nodeType, l.length)).toMap
-}