summaryrefslogtreecommitdiff
path: root/src/main/scala
diff options
context:
space:
mode:
authorRichard Lin2016-06-28 10:38:25 -0700
committerGitHub2016-06-28 10:38:25 -0700
commitbc3813ebd752646a92987c74136bb2adb476b687 (patch)
treecc6e0e257f57d87e828a811e8c0c85d5780bb141 /src/main/scala
parent3eb51f8484ad21d8a39da1ab7b036f1bb3bbe102 (diff)
parenta367073eaad494e86883b319d3b06bd6e8f05a00 (diff)
Merge pull request #224 from ucb-bar/renamechisel3
renamechisel3 - "chisel" -> "chisel3"
Diffstat (limited to 'src/main/scala')
-rw-r--r--src/main/scala/chisel/compatibility.scala151
-rw-r--r--src/main/scala/chisel/package.scala82
-rw-r--r--src/main/scala/chisel3/Driver.scala (renamed from src/main/scala/chisel/Driver.scala)2
-rw-r--r--src/main/scala/chisel3/compatibility.scala151
-rw-r--r--src/main/scala/chisel3/compatibility/FileSystemUtilities.scala (renamed from src/main/scala/chisel/compatibility/FileSystemUtilities.scala)4
-rw-r--r--src/main/scala/chisel3/compatibility/Main.scala (renamed from src/main/scala/chisel/compatibility/Main.scala)4
-rw-r--r--src/main/scala/chisel3/compatibility/debug.scala (renamed from src/main/scala/chisel/compatibility/debug.scala)4
-rw-r--r--src/main/scala/chisel3/compatibility/throwException.scala (renamed from src/main/scala/chisel/compatibility/throwException.scala)4
-rw-r--r--src/main/scala/chisel3/internal/firrtl/Emitter.scala (renamed from src/main/scala/chisel/internal/firrtl/Emitter.scala)8
-rw-r--r--src/main/scala/chisel3/package.scala82
-rw-r--r--src/main/scala/chisel3/testers/BasicTester.scala (renamed from src/main/scala/chisel/testers/BasicTester.scala)4
-rw-r--r--src/main/scala/chisel3/testers/TesterDriver.scala (renamed from src/main/scala/chisel/testers/TesterDriver.scala)4
-rw-r--r--src/main/scala/chisel3/util/Arbiter.scala (renamed from src/main/scala/chisel/util/Arbiter.scala)4
-rw-r--r--src/main/scala/chisel3/util/BitPat.scala (renamed from src/main/scala/chisel/util/BitPat.scala)6
-rw-r--r--src/main/scala/chisel3/util/Bitwise.scala (renamed from src/main/scala/chisel/util/Bitwise.scala)6
-rw-r--r--src/main/scala/chisel3/util/Cat.scala (renamed from src/main/scala/chisel/util/Cat.scala)6
-rw-r--r--src/main/scala/chisel3/util/CircuitMath.scala (renamed from src/main/scala/chisel/util/CircuitMath.scala)4
-rw-r--r--src/main/scala/chisel3/util/Conditional.scala (renamed from src/main/scala/chisel/util/Conditional.scala)6
-rw-r--r--src/main/scala/chisel3/util/Counter.scala (renamed from src/main/scala/chisel/util/Counter.scala)4
-rw-r--r--src/main/scala/chisel3/util/Decoupled.scala (renamed from src/main/scala/chisel/util/Decoupled.scala)4
-rw-r--r--src/main/scala/chisel3/util/Enum.scala (renamed from src/main/scala/chisel/util/Enum.scala)4
-rw-r--r--src/main/scala/chisel3/util/ImplicitConversions.scala (renamed from src/main/scala/chisel/util/ImplicitConversions.scala)4
-rw-r--r--src/main/scala/chisel3/util/LFSR.scala (renamed from src/main/scala/chisel/util/LFSR.scala)4
-rw-r--r--src/main/scala/chisel3/util/Lookup.scala (renamed from src/main/scala/chisel/util/Lookup.scala)4
-rw-r--r--src/main/scala/chisel3/util/Math.scala (renamed from src/main/scala/chisel/util/Math.scala)4
-rw-r--r--src/main/scala/chisel3/util/Mux.scala (renamed from src/main/scala/chisel/util/Mux.scala)6
-rw-r--r--src/main/scala/chisel3/util/OneHot.scala (renamed from src/main/scala/chisel/util/OneHot.scala)4
-rw-r--r--src/main/scala/chisel3/util/Reg.scala (renamed from src/main/scala/chisel/util/Reg.scala)4
-rw-r--r--src/main/scala/chisel3/util/TransitName.scala (renamed from src/main/scala/chisel/util/TransitName.scala)4
-rw-r--r--src/main/scala/chisel3/util/Valid.scala (renamed from src/main/scala/chisel/util/Valid.scala)4
30 files changed, 291 insertions, 291 deletions
diff --git a/src/main/scala/chisel/compatibility.scala b/src/main/scala/chisel/compatibility.scala
deleted file mode 100644
index af5daef7..00000000
--- a/src/main/scala/chisel/compatibility.scala
+++ /dev/null
@@ -1,151 +0,0 @@
-// 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
- val stop = chisel.core.stop
-
- 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/package.scala b/src/main/scala/chisel/package.scala
deleted file mode 100644
index f7ed6b13..00000000
--- a/src/main/scala/chisel/package.scala
+++ /dev/null
@@ -1,82 +0,0 @@
-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/Driver.scala b/src/main/scala/chisel3/Driver.scala
index 8fdc8f65..0979314f 100644
--- a/src/main/scala/chisel/Driver.scala
+++ b/src/main/scala/chisel3/Driver.scala
@@ -1,6 +1,6 @@
// See LICENSE for license details.
-package chisel
+package chisel3
import scala.sys.process._
import java.io._
diff --git a/src/main/scala/chisel3/compatibility.scala b/src/main/scala/chisel3/compatibility.scala
new file mode 100644
index 00000000..c0e933e0
--- /dev/null
+++ b/src/main/scala/chisel3/compatibility.scala
@@ -0,0 +1,151 @@
+// 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 chisel3 (lowercase c).
+
+package object Chisel {
+ type Direction = chisel3.core.Direction
+ val INPUT = chisel3.core.INPUT
+ val OUTPUT = chisel3.core.OUTPUT
+ val NO_DIR = chisel3.core.NO_DIR
+
+ type Flipped = chisel3.core.Flipped
+ type Data = chisel3.core.Data
+ val Wire = chisel3.core.Wire
+ val Clock = chisel3.core.Clock
+ type Clock = chisel3.core.Clock
+
+ type Aggregate = chisel3.core.Aggregate
+ val Vec = chisel3.core.Vec
+ type Vec[T <: Data] = chisel3.core.Vec[T]
+ type VecLike[T <: Data] = chisel3.core.VecLike[T]
+ type Bundle = chisel3.core.Bundle
+
+ val assert = chisel3.core.assert
+ val stop = chisel3.core.stop
+
+ type Element = chisel3.core.Element
+ type Bits = chisel3.core.Bits
+ val Bits = chisel3.core.Bits
+ type Num[T <: Data] = chisel3.core.Num[T]
+ type UInt = chisel3.core.UInt
+ val UInt = chisel3.core.UInt
+ type SInt = chisel3.core.SInt
+ val SInt = chisel3.core.SInt
+ type Bool = chisel3.core.Bool
+ val Bool = chisel3.core.Bool
+ val Mux = chisel3.core.Mux
+
+ type BlackBox = chisel3.core.BlackBox
+
+ val Mem = chisel3.core.Mem
+ type MemBase[T <: Data] = chisel3.core.MemBase[T]
+ type Mem[T <: Data] = chisel3.core.Mem[T]
+ val SeqMem = chisel3.core.SeqMem
+ type SeqMem[T <: Data] = chisel3.core.SeqMem[T]
+
+ val Module = chisel3.core.Module
+ type Module = chisel3.core.Module
+
+ val printf = chisel3.core.printf
+
+ val Reg = chisel3.core.Reg
+
+ val when = chisel3.core.when
+ type WhenContext = chisel3.core.WhenContext
+
+
+ type BackendCompilationUtilities = chisel3.BackendCompilationUtilities
+ val Driver = chisel3.Driver
+ type FileSystemUtilities = chisel3.compatibility.FileSystemUtilities
+ val ImplicitConversions = chisel3.util.ImplicitConversions
+ val chiselMain = chisel3.compatibility.chiselMain
+ val throwException = chisel3.compatibility.throwException
+ val debug = chisel3.compatibility.debug
+
+ object testers {
+ type BasicTester = chisel3.testers.BasicTester
+ val TesterDriver = chisel3.testers.TesterDriver
+ }
+
+
+ val log2Up = chisel3.util.log2Up
+ val log2Ceil = chisel3.util.log2Ceil
+ val log2Down = chisel3.util.log2Down
+ val log2Floor = chisel3.util.log2Floor
+ val isPow2 = chisel3.util.isPow2
+
+ val BitPat = chisel3.util.BitPat
+ type BitPat = chisel3.util.BitPat
+
+ type ArbiterIO[T <: Data] = chisel3.util.ArbiterIO[T]
+ type LockingArbiterLike[T <: Data] = chisel3.util.LockingArbiterLike[T]
+ type LockingRRArbiter[T <: Data] = chisel3.util.LockingRRArbiter[T]
+ type LockingArbiter[T <: Data] = chisel3.util.LockingArbiter[T]
+ type RRArbiter[T <: Data] = chisel3.util.RRArbiter[T]
+ type Arbiter[T <: Data] = chisel3.util.Arbiter[T]
+
+ val FillInterleaved = chisel3.util.FillInterleaved
+ val PopCount = chisel3.util.PopCount
+ val Fill = chisel3.util.Fill
+ val Reverse = chisel3.util.Reverse
+
+ val Cat = chisel3.util.Cat
+
+ val Log2 = chisel3.util.Log2
+
+ val unless = chisel3.util.unless
+ type SwitchContext[T <: Bits] = chisel3.util.SwitchContext[T]
+ val is = chisel3.util.is
+ val switch = chisel3.util.switch
+
+ type Counter = chisel3.util.Counter
+ val Counter = chisel3.util.Counter
+
+ type DecoupledIO[+T <: Data] = chisel3.util.DecoupledIO[T]
+ val Decoupled = chisel3.util.Decoupled
+ type EnqIO[T <: Data] = chisel3.util.EnqIO[T]
+ type DeqIO[T <: Data] = chisel3.util.DeqIO[T]
+ type DecoupledIOC[+T <: Data] = chisel3.util.DecoupledIOC[T]
+ type QueueIO[T <: Data] = chisel3.util.QueueIO[T]
+ type Queue[T <: Data] = chisel3.util.Queue[T]
+ val Queue = chisel3.util.Queue
+
+ val Enum = chisel3.util.Enum
+
+ val LFSR16 = chisel3.util.LFSR16
+
+ val ListLookup = chisel3.util.ListLookup
+ val Lookup = chisel3.util.Lookup
+
+ val Mux1H = chisel3.util.Mux1H
+ val PriorityMux = chisel3.util.PriorityMux
+ val MuxLookup = chisel3.util.MuxLookup
+ val MuxCase = chisel3.util.MuxCase
+
+ val OHToUInt = chisel3.util.OHToUInt
+ val PriorityEncoder = chisel3.util.PriorityEncoder
+ val UIntToOH = chisel3.util.UIntToOH
+ val PriorityEncoderOH = chisel3.util.PriorityEncoderOH
+
+ val RegNext = chisel3.util.RegNext
+ val RegInit = chisel3.util.RegInit
+ val RegEnable = chisel3.util.RegEnable
+ val ShiftRegister = chisel3.util.ShiftRegister
+
+ type ValidIO[+T <: Data] = chisel3.util.ValidIO[T]
+ val Valid = chisel3.util.Valid
+ val Pipe = chisel3.util.Pipe
+ type Pipe[T <: Data] = chisel3.util.Pipe[T]
+
+
+ import chisel3.internal.firrtl.Width
+ implicit def fromBigIntToLiteral(x: BigInt): chisel3.fromBigIntToLiteral =
+ new chisel3.fromBigIntToLiteral(x)
+ implicit def fromIntToLiteral(x: Int): chisel3.fromIntToLiteral=
+ new chisel3.fromIntToLiteral(x)
+ implicit def fromStringToLiteral(x: String): chisel3.fromStringToLiteral=
+ new chisel3.fromStringToLiteral(x)
+ implicit def fromBooleanToLiteral(x: Boolean): chisel3.fromBooleanToLiteral=
+ new chisel3.fromBooleanToLiteral(x)
+}
diff --git a/src/main/scala/chisel/compatibility/FileSystemUtilities.scala b/src/main/scala/chisel3/compatibility/FileSystemUtilities.scala
index d12e627d..cd47c731 100644
--- a/src/main/scala/chisel/compatibility/FileSystemUtilities.scala
+++ b/src/main/scala/chisel3/compatibility/FileSystemUtilities.scala
@@ -1,8 +1,8 @@
// See LICENSE for license details.
-package chisel.compatibility
+package chisel3.compatibility
-import chisel._
+import chisel3._
@deprecated("FileSystemUtilities doesn't exist in chisel3", "3.0.0")
trait FileSystemUtilities {
diff --git a/src/main/scala/chisel/compatibility/Main.scala b/src/main/scala/chisel3/compatibility/Main.scala
index 9072bfcf..a41599a3 100644
--- a/src/main/scala/chisel/compatibility/Main.scala
+++ b/src/main/scala/chisel3/compatibility/Main.scala
@@ -1,10 +1,10 @@
// See LICENSE for license details.
-package chisel.compatibility
+package chisel3.compatibility
import java.io.File
-import chisel._
+import chisel3._
@deprecated("chiselMain doesn't exist in Chisel3", "3.0") object chiselMain {
def apply[T <: Module](args: Array[String], gen: () => T): Unit =
diff --git a/src/main/scala/chisel/compatibility/debug.scala b/src/main/scala/chisel3/compatibility/debug.scala
index 8850c76b..c3966dae 100644
--- a/src/main/scala/chisel/compatibility/debug.scala
+++ b/src/main/scala/chisel3/compatibility/debug.scala
@@ -1,6 +1,6 @@
-package chisel.compatibility
+package chisel3.compatibility
-import chisel.core._
+import chisel3.core._
@deprecated("debug doesn't do anything in Chisel3 as no pruning happens in the frontend", "chisel3")
object debug { // scalastyle:ignore object.name
diff --git a/src/main/scala/chisel/compatibility/throwException.scala b/src/main/scala/chisel3/compatibility/throwException.scala
index 3b9fd06e..3e8b33e6 100644
--- a/src/main/scala/chisel/compatibility/throwException.scala
+++ b/src/main/scala/chisel3/compatibility/throwException.scala
@@ -1,8 +1,8 @@
// See LICENSE for license details.
-package chisel.compatibility
+package chisel3.compatibility
-import chisel._
+import chisel3._
@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/chisel3/internal/firrtl/Emitter.scala
index e48eb226..08646cf9 100644
--- a/src/main/scala/chisel/internal/firrtl/Emitter.scala
+++ b/src/main/scala/chisel3/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 chisel3.internal.firrtl
+import chisel3._
+import chisel3.internal.sourceinfo.{NoSourceInfo, SourceLine}
-private[chisel] object Emitter {
+private[chisel3] object Emitter {
def emit(circuit: Circuit): String = new Emitter(circuit).toString
}
diff --git a/src/main/scala/chisel3/package.scala b/src/main/scala/chisel3/package.scala
new file mode 100644
index 00000000..0b548683
--- /dev/null
+++ b/src/main/scala/chisel3/package.scala
@@ -0,0 +1,82 @@
+package object chisel3 {
+ import scala.language.experimental.macros
+
+ import internal.firrtl.Width
+ import internal.sourceinfo.{SourceInfo, SourceInfoTransform}
+ import util.BitPat
+
+
+ type Direction = chisel3.core.Direction
+ val INPUT = chisel3.core.INPUT
+ val OUTPUT = chisel3.core.OUTPUT
+ val NO_DIR = chisel3.core.NO_DIR
+ type Flipped = chisel3.core.Flipped
+ type Data = chisel3.core.Data
+ val Wire = chisel3.core.Wire
+ val Clock = chisel3.core.Clock
+ type Clock = chisel3.core.Clock
+
+ type Aggregate = chisel3.core.Aggregate
+ val Vec = chisel3.core.Vec
+ type Vec[T <: Data] = chisel3.core.Vec[T]
+ type VecLike[T <: Data] = chisel3.core.VecLike[T]
+ type Bundle = chisel3.core.Bundle
+
+ val assert = chisel3.core.assert
+
+ type Element = chisel3.core.Element
+ type Bits = chisel3.core.Bits
+ val Bits = chisel3.core.Bits
+ type Num[T <: Data] = chisel3.core.Num[T]
+ type UInt = chisel3.core.UInt
+ val UInt = chisel3.core.UInt
+ type SInt = chisel3.core.SInt
+ val SInt = chisel3.core.SInt
+ type Bool = chisel3.core.Bool
+ val Bool = chisel3.core.Bool
+ val Mux = chisel3.core.Mux
+
+ type BlackBox = chisel3.core.BlackBox
+
+ val Mem = chisel3.core.Mem
+ type MemBase[T <: Data] = chisel3.core.MemBase[T]
+ type Mem[T <: Data] = chisel3.core.Mem[T]
+ val SeqMem = chisel3.core.SeqMem
+ type SeqMem[T <: Data] = chisel3.core.SeqMem[T]
+
+ val Module = chisel3.core.Module
+ type Module = chisel3.core.Module
+
+ val printf = chisel3.core.printf
+
+ val Reg = chisel3.core.Reg
+
+ val when = chisel3.core.when
+ type WhenContext = chisel3.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/chisel3/testers/BasicTester.scala
index 36ff7c52..f91536d5 100644
--- a/src/main/scala/chisel/testers/BasicTester.scala
+++ b/src/main/scala/chisel3/testers/BasicTester.scala
@@ -1,7 +1,7 @@
// See LICENSE for license details.
-package chisel.testers
-import chisel._
+package chisel3.testers
+import chisel3._
import scala.language.experimental.macros
diff --git a/src/main/scala/chisel/testers/TesterDriver.scala b/src/main/scala/chisel3/testers/TesterDriver.scala
index 5c0275e0..586fa780 100644
--- a/src/main/scala/chisel/testers/TesterDriver.scala
+++ b/src/main/scala/chisel3/testers/TesterDriver.scala
@@ -1,8 +1,8 @@
// See LICENSE for license details.
-package chisel.testers
+package chisel3.testers
-import chisel._
+import chisel3._
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/chisel3/util/Arbiter.scala
index 3723f2a9..eb541977 100644
--- a/src/main/scala/chisel/util/Arbiter.scala
+++ b/src/main/scala/chisel3/util/Arbiter.scala
@@ -3,9 +3,9 @@
/** Arbiters in all shapes and sizes.
*/
-package chisel.util
+package chisel3.util
-import chisel._
+import chisel3._
/** An I/O bundle for the Arbiter */
class ArbiterIO[T <: Data](gen: T, n: Int) extends Bundle {
diff --git a/src/main/scala/chisel/util/BitPat.scala b/src/main/scala/chisel3/util/BitPat.scala
index 13bbe1b0..9eb5cf67 100644
--- a/src/main/scala/chisel/util/BitPat.scala
+++ b/src/main/scala/chisel3/util/BitPat.scala
@@ -1,11 +1,11 @@
// See LICENSE for license details.
-package chisel.util
+package chisel3.util
import scala.language.experimental.macros
-import chisel._
-import chisel.internal.sourceinfo.{SourceInfo, SourceInfoTransform}
+import chisel3._
+import chisel3.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/chisel3/util/Bitwise.scala
index d7d62ea3..ab1ff550 100644
--- a/src/main/scala/chisel/util/Bitwise.scala
+++ b/src/main/scala/chisel3/util/Bitwise.scala
@@ -3,10 +3,10 @@
/** Miscellaneous circuit generators operating on bits.
*/
-package chisel.util
+package chisel3.util
-import chisel._
-import chisel.core.SeqUtils
+import chisel3._
+import chisel3.core.SeqUtils
object FillInterleaved
{
diff --git a/src/main/scala/chisel/util/Cat.scala b/src/main/scala/chisel3/util/Cat.scala
index b47da706..469bf9ab 100644
--- a/src/main/scala/chisel/util/Cat.scala
+++ b/src/main/scala/chisel3/util/Cat.scala
@@ -1,9 +1,9 @@
// See LICENSE for license details.
-package chisel.util
+package chisel3.util
-import chisel._
-import chisel.core.SeqUtils
+import chisel3._
+import chisel3.core.SeqUtils
object Cat {
/** Combine data elements together
diff --git a/src/main/scala/chisel/util/CircuitMath.scala b/src/main/scala/chisel3/util/CircuitMath.scala
index c3b94fdb..1174c71c 100644
--- a/src/main/scala/chisel/util/CircuitMath.scala
+++ b/src/main/scala/chisel3/util/CircuitMath.scala
@@ -3,9 +3,9 @@
/** Circuit-land math operations.
*/
-package chisel.util
+package chisel3.util
-import chisel._
+import chisel3._
/** 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/chisel3/util/Conditional.scala
index 01c12799..6218feb0 100644
--- a/src/main/scala/chisel/util/Conditional.scala
+++ b/src/main/scala/chisel3/util/Conditional.scala
@@ -3,14 +3,14 @@
/** Conditional blocks.
*/
-package chisel.util
+package chisel3.util
import scala.language.reflectiveCalls
import scala.language.experimental.macros
import scala.reflect.runtime.universe._
import scala.reflect.macros.blackbox._
-import chisel._
+import chisel3._
/** This is identical to [[Chisel.when when]] with the condition inverted */
object unless { // scalastyle:ignore object.name
@@ -63,7 +63,7 @@ object switch { // scalastyle:ignore object.name
def extractIsStatement(tree: Tree): List[c.universe.Tree] = tree match {
// 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 q"chisel3.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/chisel3/util/Counter.scala
index 1c0b0203..40615769 100644
--- a/src/main/scala/chisel/util/Counter.scala
+++ b/src/main/scala/chisel3/util/Counter.scala
@@ -1,8 +1,8 @@
// See LICENSE for license details.
-package chisel.util
+package chisel3.util
-import chisel._
+import chisel3._
/** 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/chisel3/util/Decoupled.scala
index 89b0e39d..f37a5c31 100644
--- a/src/main/scala/chisel/util/Decoupled.scala
+++ b/src/main/scala/chisel3/util/Decoupled.scala
@@ -3,9 +3,9 @@
/** Wrappers for ready-valid (Decoupled) interfaces and associated circuit generators using them.
*/
-package chisel.util
+package chisel3.util
-import chisel._
+import chisel3._
/** An I/O Bundle with simple handshaking using valid and ready signals for data 'bits'*/
class DecoupledIO[+T <: Data](gen: T) extends Bundle
diff --git a/src/main/scala/chisel/util/Enum.scala b/src/main/scala/chisel3/util/Enum.scala
index 8babcd23..4ecc243b 100644
--- a/src/main/scala/chisel/util/Enum.scala
+++ b/src/main/scala/chisel3/util/Enum.scala
@@ -3,9 +3,9 @@
/** Enum generators, allowing circuit constants to have more meaningful names.
*/
-package chisel.util
+package chisel3.util
-import chisel._
+import chisel3._
object Enum {
/** Returns a sequence of Bits subtypes with values from 0 until n. Helper method. */
diff --git a/src/main/scala/chisel/util/ImplicitConversions.scala b/src/main/scala/chisel3/util/ImplicitConversions.scala
index 846c0cbd..4d816a19 100644
--- a/src/main/scala/chisel/util/ImplicitConversions.scala
+++ b/src/main/scala/chisel3/util/ImplicitConversions.scala
@@ -1,8 +1,8 @@
// See LICENSE for license details.
-package chisel.util
+package chisel3.util
-import chisel._
+import chisel3._
object ImplicitConversions {
implicit def intToUInt(x: Int): UInt = UInt(x)
diff --git a/src/main/scala/chisel/util/LFSR.scala b/src/main/scala/chisel3/util/LFSR.scala
index f70630bf..a30c276f 100644
--- a/src/main/scala/chisel/util/LFSR.scala
+++ b/src/main/scala/chisel3/util/LFSR.scala
@@ -3,9 +3,9 @@
/** LFSRs in all shapes and sizes.
*/
-package chisel.util
+package chisel3.util
-import chisel._
+import chisel3._
// scalastyle:off magic.number
/** linear feedback shift register
diff --git a/src/main/scala/chisel/util/Lookup.scala b/src/main/scala/chisel3/util/Lookup.scala
index d32d9aec..9e909c0c 100644
--- a/src/main/scala/chisel/util/Lookup.scala
+++ b/src/main/scala/chisel3/util/Lookup.scala
@@ -1,8 +1,8 @@
// See LICENSE for license details.
-package chisel.util
+package chisel3.util
-import chisel._
+import chisel3._
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/chisel3/util/Math.scala
index 69464d15..73665f0f 100644
--- a/src/main/scala/chisel/util/Math.scala
+++ b/src/main/scala/chisel3/util/Math.scala
@@ -3,9 +3,9 @@
/** Scala-land math helper functions, like logs.
*/
-package chisel.util
+package chisel3.util
-import chisel._
+import chisel3._
/** 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/chisel3/util/Mux.scala
index 04b174e9..9956a7e3 100644
--- a/src/main/scala/chisel/util/Mux.scala
+++ b/src/main/scala/chisel3/util/Mux.scala
@@ -3,10 +3,10 @@
/** Mux circuit generators.
*/
-package chisel.util
+package chisel3.util
-import chisel._
-import chisel.core.SeqUtils
+import chisel3._
+import chisel3.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/chisel3/util/OneHot.scala
index ef21c65d..820c72d6 100644
--- a/src/main/scala/chisel/util/OneHot.scala
+++ b/src/main/scala/chisel3/util/OneHot.scala
@@ -3,9 +3,9 @@
/** Circuit generators for working with one-hot representations.
*/
-package chisel.util
+package chisel3.util
-import chisel._
+import chisel3._
/** 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/chisel3/util/Reg.scala
index 1b40646d..81de4754 100644
--- a/src/main/scala/chisel/util/Reg.scala
+++ b/src/main/scala/chisel3/util/Reg.scala
@@ -3,9 +3,9 @@
/** Variations and helpers for registers.
*/
-package chisel.util
+package chisel3.util
-import chisel._
+import chisel3._
object RegNext {
diff --git a/src/main/scala/chisel/util/TransitName.scala b/src/main/scala/chisel3/util/TransitName.scala
index 04e1995b..f36f926f 100644
--- a/src/main/scala/chisel/util/TransitName.scala
+++ b/src/main/scala/chisel3/util/TransitName.scala
@@ -1,6 +1,6 @@
-package chisel.util
+package chisel3.util
-import chisel._
+import chisel3._
import internal.HasId
object TransitName {
diff --git a/src/main/scala/chisel/util/Valid.scala b/src/main/scala/chisel3/util/Valid.scala
index 56ac9abb..78187ff6 100644
--- a/src/main/scala/chisel/util/Valid.scala
+++ b/src/main/scala/chisel3/util/Valid.scala
@@ -3,9 +3,9 @@
/** Wrappers for valid interfaces and associated circuit generators using them.
*/
-package chisel.util
+package chisel3.util
-import chisel._
+import chisel3._
/** An I/O Bundle containing data and a signal determining if it is valid */
class ValidIO[+T <: Data](gen2: T) extends Bundle