summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/scala/Chisel/package.scala31
-rw-r--r--src/main/scala/chisel/Driver.scala (renamed from src/main/scala/Chisel/Driver.scala)2
-rw-r--r--src/main/scala/chisel/compatibility.scala150
-rw-r--r--src/main/scala/chisel/compatibility/FileSystemUtilities.scala (renamed from src/main/scala/Chisel/FileSystemUtilities.scala)4
-rw-r--r--src/main/scala/chisel/compatibility/Main.scala (renamed from src/main/scala/Chisel/Main.scala)4
-rw-r--r--src/main/scala/chisel/compatibility/debug.scala8
-rw-r--r--src/main/scala/chisel/compatibility/throwException.scala (renamed from src/main/scala/Chisel/throwException.scala)4
-rw-r--r--src/main/scala/chisel/internal/firrtl/Emitter.scala (renamed from src/main/scala/Chisel/internal/firrtl/Emitter.scala)8
-rw-r--r--src/main/scala/chisel/package.scala82
-rw-r--r--src/main/scala/chisel/testers/BasicTester.scala (renamed from src/main/scala/Chisel/testers/BasicTester.scala)4
-rw-r--r--src/main/scala/chisel/testers/TesterDriver.scala (renamed from src/main/scala/Chisel/testers/TesterDriver.scala)5
-rw-r--r--src/main/scala/chisel/util/Arbiter.scala (renamed from src/main/scala/Chisel/util/Arbiter.scala)4
-rw-r--r--src/main/scala/chisel/util/BitPat.scala (renamed from src/main/scala/Chisel/BitPat.scala)5
-rw-r--r--src/main/scala/chisel/util/Bitwise.scala (renamed from src/main/scala/Chisel/util/Bitwise.scala)5
-rw-r--r--src/main/scala/chisel/util/Cat.scala (renamed from src/main/scala/Chisel/util/Cat.scala)5
-rw-r--r--src/main/scala/chisel/util/CircuitMath.scala (renamed from src/main/scala/Chisel/util/CircuitMath.scala)4
-rw-r--r--src/main/scala/chisel/util/Conditional.scala (renamed from src/main/scala/Chisel/util/Conditional.scala)8
-rw-r--r--src/main/scala/chisel/util/Counter.scala (renamed from src/main/scala/Chisel/util/Counter.scala)4
-rw-r--r--src/main/scala/chisel/util/Decoupled.scala (renamed from src/main/scala/Chisel/util/Decoupled.scala)6
-rw-r--r--src/main/scala/chisel/util/Enum.scala (renamed from src/main/scala/Chisel/util/Enum.scala)4
-rw-r--r--src/main/scala/chisel/util/ImplicitConversions.scala (renamed from src/main/scala/Chisel/ImplicitConversions.scala)4
-rw-r--r--src/main/scala/chisel/util/LFSR.scala (renamed from src/main/scala/Chisel/util/LFSR.scala)4
-rw-r--r--src/main/scala/chisel/util/Lookup.scala (renamed from src/main/scala/Chisel/util/Lookup.scala)4
-rw-r--r--src/main/scala/chisel/util/Math.scala (renamed from src/main/scala/Chisel/util/Math.scala)4
-rw-r--r--src/main/scala/chisel/util/Mux.scala (renamed from src/main/scala/Chisel/util/Mux.scala)5
-rw-r--r--src/main/scala/chisel/util/OneHot.scala (renamed from src/main/scala/Chisel/util/OneHot.scala)4
-rw-r--r--src/main/scala/chisel/util/Reg.scala (renamed from src/main/scala/Chisel/util/Reg.scala)4
-rw-r--r--src/main/scala/chisel/util/TransitName.scala (renamed from src/main/scala/Chisel/util/TransitName.scala)3
-rw-r--r--src/main/scala/chisel/util/Valid.scala (renamed from src/main/scala/Chisel/util/Valid.scala)4
29 files changed, 319 insertions, 64 deletions
diff --git a/src/main/scala/Chisel/package.scala b/src/main/scala/Chisel/package.scala
deleted file mode 100644
index f05e8b5d..00000000
--- a/src/main/scala/Chisel/package.scala
+++ /dev/null
@@ -1,31 +0,0 @@
-package object Chisel {
- import scala.language.experimental.macros
-
- import internal.firrtl.Width
- import internal.sourceinfo.{SourceInfo, SourceInfoTransform}
-
- implicit class fromBigIntToLiteral(val x: BigInt) extends AnyVal {
- def U: UInt = UInt(x, Width())
- def S: SInt = SInt(x, Width())
- }
- implicit class fromIntToLiteral(val x: Int) extends AnyVal {
- def U: UInt = UInt(BigInt(x), Width())
- def S: SInt = SInt(BigInt(x), Width())
- }
- implicit class fromStringToLiteral(val x: String) extends AnyVal {
- def U: UInt = UInt(x)
- }
- implicit class fromBooleanToLiteral(val x: Boolean) extends AnyVal {
- def B: Bool = Bool(x)
- }
-
- implicit class fromUIntToBitPatComparable(val x: UInt) extends AnyVal {
- final def === (that: BitPat): Bool = macro SourceInfoTransform.thatArg
- final def != (that: BitPat): Bool = macro SourceInfoTransform.thatArg
- final def =/= (that: BitPat): Bool = macro SourceInfoTransform.thatArg
-
- def do_=== (that: BitPat)(implicit sourceInfo: SourceInfo): Bool = that === x
- def do_!= (that: BitPat)(implicit sourceInfo: SourceInfo): Bool = that != x
- def do_=/= (that: BitPat)(implicit sourceInfo: SourceInfo): Bool = that =/= x
- }
-}
diff --git a/src/main/scala/Chisel/Driver.scala b/src/main/scala/chisel/Driver.scala
index 02204684..ba2b1389 100644
--- a/src/main/scala/Chisel/Driver.scala
+++ b/src/main/scala/chisel/Driver.scala
@@ -1,6 +1,6 @@
// See LICENSE for license details.
-package Chisel
+package chisel
import scala.sys.process._
import java.io._
diff --git a/src/main/scala/chisel/compatibility.scala b/src/main/scala/chisel/compatibility.scala
new file mode 100644
index 00000000..56088562
--- /dev/null
+++ b/src/main/scala/chisel/compatibility.scala
@@ -0,0 +1,150 @@
+// See LICENSE for license details.
+
+// Allows legacy users to continue using Chisel (capital C) package name while
+// moving to the more standard package naming convention chisel (lowercase c).
+
+package object Chisel {
+ type Direction = chisel.core.Direction
+ val INPUT = chisel.core.INPUT
+ val OUTPUT = chisel.core.OUTPUT
+ val NO_DIR = chisel.core.NO_DIR
+
+ type Flipped = chisel.core.Flipped
+ type Data = chisel.core.Data
+ val Wire = chisel.core.Wire
+ val Clock = chisel.core.Clock
+ type Clock = chisel.core.Clock
+
+ type Aggregate = chisel.core.Aggregate
+ val Vec = chisel.core.Vec
+ type Vec[T <: Data] = chisel.core.Vec[T]
+ type VecLike[T <: Data] = chisel.core.VecLike[T]
+ type Bundle = chisel.core.Bundle
+
+ val assert = chisel.core.assert
+
+ type Element = chisel.core.Element
+ type Bits = chisel.core.Bits
+ val Bits = chisel.core.Bits
+ type Num[T <: Data] = chisel.core.Num[T]
+ type UInt = chisel.core.UInt
+ val UInt = chisel.core.UInt
+ type SInt = chisel.core.SInt
+ val SInt = chisel.core.SInt
+ type Bool = chisel.core.Bool
+ val Bool = chisel.core.Bool
+ val Mux = chisel.core.Mux
+
+ type BlackBox = chisel.core.BlackBox
+
+ val Mem = chisel.core.Mem
+ type MemBase[T <: Data] = chisel.core.MemBase[T]
+ type Mem[T <: Data] = chisel.core.Mem[T]
+ val SeqMem = chisel.core.SeqMem
+ type SeqMem[T <: Data] = chisel.core.SeqMem[T]
+
+ val Module = chisel.core.Module
+ type Module = chisel.core.Module
+
+ val printf = chisel.core.printf
+
+ val Reg = chisel.core.Reg
+
+ val when = chisel.core.when
+ type WhenContext = chisel.core.WhenContext
+
+
+ type BackendCompilationUtilities = chisel.BackendCompilationUtilities
+ val Driver = chisel.Driver
+ type FileSystemUtilities = chisel.compatibility.FileSystemUtilities
+ val ImplicitConversions = chisel.util.ImplicitConversions
+ val chiselMain = chisel.compatibility.chiselMain
+ val throwException = chisel.compatibility.throwException
+ val debug = chisel.compatibility.debug
+
+ object testers {
+ type BasicTester = chisel.testers.BasicTester
+ val TesterDriver = chisel.testers.TesterDriver
+ }
+
+
+ val log2Up = chisel.util.log2Up
+ val log2Ceil = chisel.util.log2Ceil
+ val log2Down = chisel.util.log2Down
+ val log2Floor = chisel.util.log2Floor
+ val isPow2 = chisel.util.isPow2
+
+ val BitPat = chisel.util.BitPat
+ type BitPat = chisel.util.BitPat
+
+ type ArbiterIO[T <: Data] = chisel.util.ArbiterIO[T]
+ type LockingArbiterLike[T <: Data] = chisel.util.LockingArbiterLike[T]
+ type LockingRRArbiter[T <: Data] = chisel.util.LockingRRArbiter[T]
+ type LockingArbiter[T <: Data] = chisel.util.LockingArbiter[T]
+ type RRArbiter[T <: Data] = chisel.util.RRArbiter[T]
+ type Arbiter[T <: Data] = chisel.util.Arbiter[T]
+
+ val FillInterleaved = chisel.util.FillInterleaved
+ val PopCount = chisel.util.PopCount
+ val Fill = chisel.util.Fill
+ val Reverse = chisel.util.Reverse
+
+ val Cat = chisel.util.Cat
+
+ val Log2 = chisel.util.Log2
+
+ val unless = chisel.util.unless
+ type SwitchContext[T <: Bits] = chisel.util.SwitchContext[T]
+ val is = chisel.util.is
+ val switch = chisel.util.switch
+
+ type Counter = chisel.util.Counter
+ val Counter = chisel.util.Counter
+
+ type DecoupledIO[+T <: Data] = chisel.util.DecoupledIO[T]
+ val Decoupled = chisel.util.Decoupled
+ type EnqIO[T <: Data] = chisel.util.EnqIO[T]
+ type DeqIO[T <: Data] = chisel.util.DeqIO[T]
+ type DecoupledIOC[+T <: Data] = chisel.util.DecoupledIOC[T]
+ type QueueIO[T <: Data] = chisel.util.QueueIO[T]
+ type Queue[T <: Data] = chisel.util.Queue[T]
+ val Queue = chisel.util.Queue
+
+ val Enum = chisel.util.Enum
+
+ val LFSR16 = chisel.util.LFSR16
+
+ val ListLookup = chisel.util.ListLookup
+ val Lookup = chisel.util.Lookup
+
+ val Mux1H = chisel.util.Mux1H
+ val PriorityMux = chisel.util.PriorityMux
+ val MuxLookup = chisel.util.MuxLookup
+ val MuxCase = chisel.util.MuxCase
+
+ val OHToUInt = chisel.util.OHToUInt
+ val PriorityEncoder = chisel.util.PriorityEncoder
+ val UIntToOH = chisel.util.UIntToOH
+ val PriorityEncoderOH = chisel.util.PriorityEncoderOH
+
+ val RegNext = chisel.util.RegNext
+ val RegInit = chisel.util.RegInit
+ val RegEnable = chisel.util.RegEnable
+ val ShiftRegister = chisel.util.ShiftRegister
+
+ type ValidIO[+T <: Data] = chisel.util.ValidIO[T]
+ val Valid = chisel.util.Valid
+ val Pipe = chisel.util.Pipe
+ type Pipe[T <: Data] = chisel.util.Pipe[T]
+
+
+ import chisel.internal.firrtl.Width
+ implicit def fromBigIntToLiteral(x: BigInt): chisel.fromBigIntToLiteral =
+ new chisel.fromBigIntToLiteral(x)
+ implicit def fromIntToLiteral(x: Int): chisel.fromIntToLiteral=
+ new chisel.fromIntToLiteral(x)
+ implicit def fromStringToLiteral(x: String): chisel.fromStringToLiteral=
+ new chisel.fromStringToLiteral(x)
+ implicit def fromBooleanToLiteral(x: Boolean): chisel.fromBooleanToLiteral=
+ new chisel.fromBooleanToLiteral(x)
+}
diff --git a/src/main/scala/Chisel/FileSystemUtilities.scala b/src/main/scala/chisel/compatibility/FileSystemUtilities.scala
index 575ae138..d12e627d 100644
--- a/src/main/scala/Chisel/FileSystemUtilities.scala
+++ b/src/main/scala/chisel/compatibility/FileSystemUtilities.scala
@@ -1,6 +1,8 @@
// See LICENSE for license details.
-package Chisel
+package chisel.compatibility
+
+import chisel._
@deprecated("FileSystemUtilities doesn't exist in chisel3", "3.0.0")
trait FileSystemUtilities {
diff --git a/src/main/scala/Chisel/Main.scala b/src/main/scala/chisel/compatibility/Main.scala
index a72debc3..9072bfcf 100644
--- a/src/main/scala/Chisel/Main.scala
+++ b/src/main/scala/chisel/compatibility/Main.scala
@@ -1,9 +1,11 @@
// See LICENSE for license details.
-package Chisel
+package chisel.compatibility
import java.io.File
+import chisel._
+
@deprecated("chiselMain doesn't exist in Chisel3", "3.0") object chiselMain {
def apply[T <: Module](args: Array[String], gen: () => T): Unit =
Predef.assert(false, "No more chiselMain in Chisel3")
diff --git a/src/main/scala/chisel/compatibility/debug.scala b/src/main/scala/chisel/compatibility/debug.scala
new file mode 100644
index 00000000..8850c76b
--- /dev/null
+++ b/src/main/scala/chisel/compatibility/debug.scala
@@ -0,0 +1,8 @@
+package chisel.compatibility
+
+import chisel.core._
+
+@deprecated("debug doesn't do anything in Chisel3 as no pruning happens in the frontend", "chisel3")
+object debug { // scalastyle:ignore object.name
+ def apply (arg: Data): Data = arg
+}
diff --git a/src/main/scala/Chisel/throwException.scala b/src/main/scala/chisel/compatibility/throwException.scala
index 702884aa..3b9fd06e 100644
--- a/src/main/scala/Chisel/throwException.scala
+++ b/src/main/scala/chisel/compatibility/throwException.scala
@@ -1,6 +1,8 @@
// See LICENSE for license details.
-package Chisel
+package chisel.compatibility
+
+import chisel._
@deprecated("throwException doesn't exist in Chisel3", "3.0.0")
@throws(classOf[Exception])
diff --git a/src/main/scala/Chisel/internal/firrtl/Emitter.scala b/src/main/scala/chisel/internal/firrtl/Emitter.scala
index 7ca3268a..e48eb226 100644
--- a/src/main/scala/Chisel/internal/firrtl/Emitter.scala
+++ b/src/main/scala/chisel/internal/firrtl/Emitter.scala
@@ -1,10 +1,10 @@
// See LICENSE for license details.
-package Chisel.internal.firrtl
-import Chisel._
-import Chisel.internal.sourceinfo.{NoSourceInfo, SourceLine}
+package chisel.internal.firrtl
+import chisel._
+import chisel.internal.sourceinfo.{NoSourceInfo, SourceLine}
-private[Chisel] object Emitter {
+private[chisel] object Emitter {
def emit(circuit: Circuit): String = new Emitter(circuit).toString
}
diff --git a/src/main/scala/chisel/package.scala b/src/main/scala/chisel/package.scala
new file mode 100644
index 00000000..f7ed6b13
--- /dev/null
+++ b/src/main/scala/chisel/package.scala
@@ -0,0 +1,82 @@
+package object chisel {
+ import scala.language.experimental.macros
+
+ import internal.firrtl.Width
+ import internal.sourceinfo.{SourceInfo, SourceInfoTransform}
+ import util.BitPat
+
+
+ type Direction = chisel.core.Direction
+ val INPUT = chisel.core.INPUT
+ val OUTPUT = chisel.core.OUTPUT
+ val NO_DIR = chisel.core.NO_DIR
+ type Flipped = chisel.core.Flipped
+ type Data = chisel.core.Data
+ val Wire = chisel.core.Wire
+ val Clock = chisel.core.Clock
+ type Clock = chisel.core.Clock
+
+ type Aggregate = chisel.core.Aggregate
+ val Vec = chisel.core.Vec
+ type Vec[T <: Data] = chisel.core.Vec[T]
+ type VecLike[T <: Data] = chisel.core.VecLike[T]
+ type Bundle = chisel.core.Bundle
+
+ val assert = chisel.core.assert
+
+ type Element = chisel.core.Element
+ type Bits = chisel.core.Bits
+ val Bits = chisel.core.Bits
+ type Num[T <: Data] = chisel.core.Num[T]
+ type UInt = chisel.core.UInt
+ val UInt = chisel.core.UInt
+ type SInt = chisel.core.SInt
+ val SInt = chisel.core.SInt
+ type Bool = chisel.core.Bool
+ val Bool = chisel.core.Bool
+ val Mux = chisel.core.Mux
+
+ type BlackBox = chisel.core.BlackBox
+
+ val Mem = chisel.core.Mem
+ type MemBase[T <: Data] = chisel.core.MemBase[T]
+ type Mem[T <: Data] = chisel.core.Mem[T]
+ val SeqMem = chisel.core.SeqMem
+ type SeqMem[T <: Data] = chisel.core.SeqMem[T]
+
+ val Module = chisel.core.Module
+ type Module = chisel.core.Module
+
+ val printf = chisel.core.printf
+
+ val Reg = chisel.core.Reg
+
+ val when = chisel.core.when
+ type WhenContext = chisel.core.WhenContext
+
+
+ implicit class fromBigIntToLiteral(val x: BigInt) extends AnyVal {
+ def U: UInt = UInt(x, Width())
+ def S: SInt = SInt(x, Width())
+ }
+ implicit class fromIntToLiteral(val x: Int) extends AnyVal {
+ def U: UInt = UInt(BigInt(x), Width())
+ def S: SInt = SInt(BigInt(x), Width())
+ }
+ implicit class fromStringToLiteral(val x: String) extends AnyVal {
+ def U: UInt = UInt(x)
+ }
+ implicit class fromBooleanToLiteral(val x: Boolean) extends AnyVal {
+ def B: Bool = Bool(x)
+ }
+
+ implicit class fromUIntToBitPatComparable(val x: UInt) extends AnyVal {
+ final def === (that: BitPat): Bool = macro SourceInfoTransform.thatArg
+ final def != (that: BitPat): Bool = macro SourceInfoTransform.thatArg
+ final def =/= (that: BitPat): Bool = macro SourceInfoTransform.thatArg
+
+ def do_=== (that: BitPat)(implicit sourceInfo: SourceInfo): Bool = that === x
+ def do_!= (that: BitPat)(implicit sourceInfo: SourceInfo): Bool = that != x
+ def do_=/= (that: BitPat)(implicit sourceInfo: SourceInfo): Bool = that =/= x
+ }
+}
diff --git a/src/main/scala/Chisel/testers/BasicTester.scala b/src/main/scala/chisel/testers/BasicTester.scala
index b8c1494a..36ff7c52 100644
--- a/src/main/scala/Chisel/testers/BasicTester.scala
+++ b/src/main/scala/chisel/testers/BasicTester.scala
@@ -1,7 +1,7 @@
// See LICENSE for license details.
-package Chisel.testers
-import Chisel._
+package chisel.testers
+import chisel._
import scala.language.experimental.macros
diff --git a/src/main/scala/Chisel/testers/TesterDriver.scala b/src/main/scala/chisel/testers/TesterDriver.scala
index a56bb8b7..5c0275e0 100644
--- a/src/main/scala/Chisel/testers/TesterDriver.scala
+++ b/src/main/scala/chisel/testers/TesterDriver.scala
@@ -1,7 +1,8 @@
// See LICENSE for license details.
-package Chisel.testers
-import Chisel._
+package chisel.testers
+
+import chisel._
import scala.io.Source
import scala.sys.process._
import java.io._
diff --git a/src/main/scala/Chisel/util/Arbiter.scala b/src/main/scala/chisel/util/Arbiter.scala
index 16ae9be5..3723f2a9 100644
--- a/src/main/scala/Chisel/util/Arbiter.scala
+++ b/src/main/scala/chisel/util/Arbiter.scala
@@ -3,7 +3,9 @@
/** Arbiters in all shapes and sizes.
*/
-package Chisel
+package chisel.util
+
+import chisel._
/** An I/O bundle for the Arbiter */
class ArbiterIO[T <: Data](gen: T, n: Int) extends Bundle {
diff --git a/src/main/scala/Chisel/BitPat.scala b/src/main/scala/chisel/util/BitPat.scala
index 96206f63..13bbe1b0 100644
--- a/src/main/scala/Chisel/BitPat.scala
+++ b/src/main/scala/chisel/util/BitPat.scala
@@ -1,10 +1,11 @@
// See LICENSE for license details.
-package Chisel
+package chisel.util
import scala.language.experimental.macros
-import Chisel.internal.sourceinfo.{SourceInfo, SourceInfoTransform}
+import chisel._
+import chisel.internal.sourceinfo.{SourceInfo, SourceInfoTransform}
object BitPat {
/** Parses a bit pattern string into (bits, mask, width).
diff --git a/src/main/scala/Chisel/util/Bitwise.scala b/src/main/scala/chisel/util/Bitwise.scala
index 239a295e..d7d62ea3 100644
--- a/src/main/scala/Chisel/util/Bitwise.scala
+++ b/src/main/scala/chisel/util/Bitwise.scala
@@ -3,7 +3,10 @@
/** Miscellaneous circuit generators operating on bits.
*/
-package Chisel
+package chisel.util
+
+import chisel._
+import chisel.core.SeqUtils
object FillInterleaved
{
diff --git a/src/main/scala/Chisel/util/Cat.scala b/src/main/scala/chisel/util/Cat.scala
index dd706e62..b47da706 100644
--- a/src/main/scala/Chisel/util/Cat.scala
+++ b/src/main/scala/chisel/util/Cat.scala
@@ -1,6 +1,9 @@
// See LICENSE for license details.
-package Chisel
+package chisel.util
+
+import chisel._
+import chisel.core.SeqUtils
object Cat {
/** Combine data elements together
diff --git a/src/main/scala/Chisel/util/CircuitMath.scala b/src/main/scala/chisel/util/CircuitMath.scala
index 06cab903..c3b94fdb 100644
--- a/src/main/scala/Chisel/util/CircuitMath.scala
+++ b/src/main/scala/chisel/util/CircuitMath.scala
@@ -3,7 +3,9 @@
/** Circuit-land math operations.
*/
-package Chisel
+package chisel.util
+
+import chisel._
/** Compute Log2 with truncation of a UInt in hardware using a Mux Tree
* An alternative interpretation is it computes the minimum number of bits needed to represent x
diff --git a/src/main/scala/Chisel/util/Conditional.scala b/src/main/scala/chisel/util/Conditional.scala
index 9cab25ef..01c12799 100644
--- a/src/main/scala/Chisel/util/Conditional.scala
+++ b/src/main/scala/chisel/util/Conditional.scala
@@ -3,13 +3,15 @@
/** Conditional blocks.
*/
-package Chisel
+package chisel.util
import scala.language.reflectiveCalls
import scala.language.experimental.macros
import scala.reflect.runtime.universe._
import scala.reflect.macros.blackbox._
+import chisel._
+
/** This is identical to [[Chisel.when when]] with the condition inverted */
object unless { // scalastyle:ignore object.name
def apply(c: Bool)(block: => Unit) {
@@ -59,7 +61,9 @@ object switch { // scalastyle:ignore object.name
def impl(c: Context)(cond: c.Tree)(x: c.Tree): c.Tree = { import c.universe._
val sc = c.universe.internal.reificationSupport.freshTermName("sc")
def extractIsStatement(tree: Tree): List[c.universe.Tree] = tree match {
- case q"Chisel.is.apply( ..$params )( ..$body )" => List(q"$sc.is( ..$params )( ..$body )")
+ // TODO: remove when Chisel compatibility package is removed
+ case q"Chisel.`package`.is.apply( ..$params )( ..$body )" => List(q"$sc.is( ..$params )( ..$body )")
+ case q"chisel.util.is.apply( ..$params )( ..$body )" => List(q"$sc.is( ..$params )( ..$body )")
case b => throw new Exception(s"Cannot include blocks that do not begin with is() in switch.")
}
val q"..$body" = x
diff --git a/src/main/scala/Chisel/util/Counter.scala b/src/main/scala/chisel/util/Counter.scala
index 872e830a..1c0b0203 100644
--- a/src/main/scala/Chisel/util/Counter.scala
+++ b/src/main/scala/chisel/util/Counter.scala
@@ -1,6 +1,8 @@
// See LICENSE for license details.
-package Chisel
+package chisel.util
+
+import chisel._
/** A counter module
* @param n number of counts before the counter resets (or one more than the
diff --git a/src/main/scala/Chisel/util/Decoupled.scala b/src/main/scala/chisel/util/Decoupled.scala
index 8e045855..89b0e39d 100644
--- a/src/main/scala/Chisel/util/Decoupled.scala
+++ b/src/main/scala/chisel/util/Decoupled.scala
@@ -3,7 +3,9 @@
/** Wrappers for ready-valid (Decoupled) interfaces and associated circuit generators using them.
*/
-package Chisel
+package chisel.util
+
+import chisel._
/** An I/O Bundle with simple handshaking using valid and ready signals for data 'bits'*/
class DecoupledIO[+T <: Data](gen: T) extends Bundle
@@ -108,7 +110,7 @@ class Queue[T <: Data](gen: T, val entries: Int,
extends Module(override_reset=override_reset) {
def this(gen: T, entries: Int, pipe: Boolean, flow: Boolean, _reset: Bool) =
this(gen, entries, pipe, flow, Some(_reset))
-
+
val io = new QueueIO(gen, entries)
val ram = Mem(entries, gen)
diff --git a/src/main/scala/Chisel/util/Enum.scala b/src/main/scala/chisel/util/Enum.scala
index 20057197..8babcd23 100644
--- a/src/main/scala/Chisel/util/Enum.scala
+++ b/src/main/scala/chisel/util/Enum.scala
@@ -3,7 +3,9 @@
/** Enum generators, allowing circuit constants to have more meaningful names.
*/
-package Chisel
+package chisel.util
+
+import chisel._
object Enum {
/** Returns a sequence of Bits subtypes with values from 0 until n. Helper method. */
diff --git a/src/main/scala/Chisel/ImplicitConversions.scala b/src/main/scala/chisel/util/ImplicitConversions.scala
index 6a230022..846c0cbd 100644
--- a/src/main/scala/Chisel/ImplicitConversions.scala
+++ b/src/main/scala/chisel/util/ImplicitConversions.scala
@@ -1,6 +1,8 @@
// See LICENSE for license details.
-package Chisel
+package chisel.util
+
+import chisel._
object ImplicitConversions {
implicit def intToUInt(x: Int): UInt = UInt(x)
diff --git a/src/main/scala/Chisel/util/LFSR.scala b/src/main/scala/chisel/util/LFSR.scala
index 839b1d1f..f70630bf 100644
--- a/src/main/scala/Chisel/util/LFSR.scala
+++ b/src/main/scala/chisel/util/LFSR.scala
@@ -3,7 +3,9 @@
/** LFSRs in all shapes and sizes.
*/
-package Chisel
+package chisel.util
+
+import chisel._
// scalastyle:off magic.number
/** linear feedback shift register
diff --git a/src/main/scala/Chisel/util/Lookup.scala b/src/main/scala/chisel/util/Lookup.scala
index 54922fc4..d32d9aec 100644
--- a/src/main/scala/Chisel/util/Lookup.scala
+++ b/src/main/scala/chisel/util/Lookup.scala
@@ -1,6 +1,8 @@
// See LICENSE for license details.
-package Chisel
+package chisel.util
+
+import chisel._
object ListLookup {
def apply[T <: Data](addr: UInt, default: List[T], mapping: Array[(BitPat, List[T])]): List[T] = {
diff --git a/src/main/scala/Chisel/util/Math.scala b/src/main/scala/chisel/util/Math.scala
index 5f8212d8..69464d15 100644
--- a/src/main/scala/Chisel/util/Math.scala
+++ b/src/main/scala/chisel/util/Math.scala
@@ -3,7 +3,9 @@
/** Scala-land math helper functions, like logs.
*/
-package Chisel
+package chisel.util
+
+import chisel._
/** Compute the log2 rounded up with min value of 1 */
object log2Up {
diff --git a/src/main/scala/Chisel/util/Mux.scala b/src/main/scala/chisel/util/Mux.scala
index 9d92321a..6f074a7e 100644
--- a/src/main/scala/Chisel/util/Mux.scala
+++ b/src/main/scala/chisel/util/Mux.scala
@@ -3,7 +3,10 @@
/** Mux circuit generators.
*/
-package Chisel
+package chisel.util
+
+import chisel._
+import chisel.core.SeqUtils
/** Builds a Mux tree out of the input signal vector using a one hot encoded
select signal. Returns the output of the Mux tree.
diff --git a/src/main/scala/Chisel/util/OneHot.scala b/src/main/scala/chisel/util/OneHot.scala
index 73f27403..ef21c65d 100644
--- a/src/main/scala/Chisel/util/OneHot.scala
+++ b/src/main/scala/chisel/util/OneHot.scala
@@ -3,7 +3,9 @@
/** Circuit generators for working with one-hot representations.
*/
-package Chisel
+package chisel.util
+
+import chisel._
/** Converts from One Hot Encoding to a UInt indicating which bit is active
* This is the inverse of [[Chisel.UIntToOH UIntToOH]]*/
diff --git a/src/main/scala/Chisel/util/Reg.scala b/src/main/scala/chisel/util/Reg.scala
index 6584a4bf..1b40646d 100644
--- a/src/main/scala/Chisel/util/Reg.scala
+++ b/src/main/scala/chisel/util/Reg.scala
@@ -3,7 +3,9 @@
/** Variations and helpers for registers.
*/
-package Chisel
+package chisel.util
+
+import chisel._
object RegNext {
diff --git a/src/main/scala/Chisel/util/TransitName.scala b/src/main/scala/chisel/util/TransitName.scala
index ec5a11cc..04e1995b 100644
--- a/src/main/scala/Chisel/util/TransitName.scala
+++ b/src/main/scala/chisel/util/TransitName.scala
@@ -1,5 +1,6 @@
-package Chisel
+package chisel.util
+import chisel._
import internal.HasId
object TransitName {
diff --git a/src/main/scala/Chisel/util/Valid.scala b/src/main/scala/chisel/util/Valid.scala
index 9e2202bb..56ac9abb 100644
--- a/src/main/scala/Chisel/util/Valid.scala
+++ b/src/main/scala/chisel/util/Valid.scala
@@ -3,7 +3,9 @@
/** Wrappers for valid interfaces and associated circuit generators using them.
*/
-package Chisel
+package chisel.util
+
+import chisel._
/** An I/O Bundle containing data and a signal determining if it is valid */
class ValidIO[+T <: Data](gen2: T) extends Bundle