summaryrefslogtreecommitdiff
path: root/chiselFrontend/src/main/scala/chisel3/core/Reg.scala
diff options
context:
space:
mode:
authorJim Lawson2016-09-29 11:44:09 -0700
committerJim Lawson2016-09-29 11:44:09 -0700
commiteb5e5dc30019be342b7a0534b425bf33b7984ce3 (patch)
tree1f04fd7157a17cc45fe1ff0835500d93809809fd /chiselFrontend/src/main/scala/chisel3/core/Reg.scala
parent12a651513541d6c96e3b709b424d5d3384179076 (diff)
Massive rename of CompileOptions.
Massage CompileOption names in an attempt to preserve default (Strict) CompileOptions in the absence of explicit imports. NOTE: Since the default is now strict, we may encounter errors when we generate connections for clients (i.e., in Vec.do_apply() when we wire up a sequence). We should really thread the CompileOptions through the macro system so the client's implicits are used.
Diffstat (limited to 'chiselFrontend/src/main/scala/chisel3/core/Reg.scala')
-rw-r--r--chiselFrontend/src/main/scala/chisel3/core/Reg.scala9
1 files changed, 5 insertions, 4 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/core/Reg.scala b/chiselFrontend/src/main/scala/chisel3/core/Reg.scala
index 2569e9ea..1bdfb40f 100644
--- a/chiselFrontend/src/main/scala/chisel3/core/Reg.scala
+++ b/chiselFrontend/src/main/scala/chisel3/core/Reg.scala
@@ -6,9 +6,10 @@ import chisel3.internal._
import chisel3.internal.Builder.pushCommand
import chisel3.internal.firrtl._
import chisel3.internal.sourceinfo.{SourceInfo, UnlocatableSourceInfo}
+import chisel3.ImplicitCompileOptions
object Reg {
- private[core] def makeType[T <: Data](compileOptions: ExplicitCompileOptions, t: T = null, next: T = null, init: T = null): T = {
+ private[core] def makeType[T <: Data](compileOptions: ImplicitCompileOptions, t: T = null, next: T = null, init: T = null): T = {
if (t ne null) {
if (compileOptions.declaredTypeMustBeUnbound) {
Binding.checkUnbound(t, s"t ($t) must be unbound Type. Try using cloneType?")
@@ -40,7 +41,7 @@ object Reg {
* is a valid value. In those cases, you can either use the outType only Reg
* constructor or pass in `null.asInstanceOf[T]`.
*/
- def apply[T <: Data](t: T = null, next: T = null, init: T = null)(implicit sourceInfo: SourceInfo, compileOptions: ExplicitCompileOptions): T =
+ def apply[T <: Data](t: T = null, next: T = null, init: T = null)(implicit sourceInfo: SourceInfo, compileOptions: ImplicitCompileOptions): T =
// Scala macros can't (yet) handle named or default arguments.
do_apply(t, next, init)(sourceInfo, compileOptions)
@@ -49,9 +50,9 @@ object Reg {
*
* @param outType: data type for the register
*/
- def apply[T <: Data](outType: T)(implicit sourceInfo: SourceInfo, compileOptions: ExplicitCompileOptions): T = Reg[T](outType, null.asInstanceOf[T], null.asInstanceOf[T])(sourceInfo, compileOptions)
+ def apply[T <: Data](outType: T)(implicit sourceInfo: SourceInfo, compileOptions: ImplicitCompileOptions): T = Reg[T](outType, null.asInstanceOf[T], null.asInstanceOf[T])(sourceInfo, compileOptions)
- def do_apply[T <: Data](t: T, next: T, init: T)(implicit sourceInfo: SourceInfo, compileOptions: ExplicitCompileOptions = chisel3.NotStrict.CompileOptions): T = {
+ def do_apply[T <: Data](t: T, next: T, init: T)(implicit sourceInfo: SourceInfo, compileOptions: ImplicitCompileOptions = chisel3.ExplicitCompileOptions.NotStrict): T = {
// TODO: write this in a way that doesn't need nulls (bad Scala style),
// null.asInstanceOf[T], and two constructors. Using Option types are an
// option, but introduces cumbersome syntax (wrap everything in a Some()).