diff options
| author | Andrew Waterman | 2016-10-27 18:41:51 -0700 |
|---|---|---|
| committer | Jack Koenig | 2016-10-28 00:35:04 -0700 |
| commit | 224ee397db324067b35874bf22c76a63e9ca531b (patch) | |
| tree | e49b3d11759db94de50940ac1eb19fff95974c30 /chiselFrontend/src/main/scala/chisel3/core/Reg.scala | |
| parent | 09282f32bec847bcd0b652f778f42be13c7d027e (diff) | |
Plug holes where defaultCompileOptions leaked in
defaultCompileOptions is convenient, but it frequently foils the
compatibility layer by providing strict defaults rather than passing
through the user's CompileOptions. This notably manifests for
chiselCloneType, which has different behavior for chisel3 and Chisel.
Ideally, we'd get rid of defaultCompileOptions within chisel3.core
and only supply it to people who import chisel3._ (attn. @ucbjrl).
That would statically prevent further regressions of this nature
within the core.
The change to Vec.truncateIndex seems extraneous, but I chose an
alternate implementation rather than requiring compileOptions in
another place.
Diffstat (limited to 'chiselFrontend/src/main/scala/chisel3/core/Reg.scala')
| -rw-r--r-- | chiselFrontend/src/main/scala/chisel3/core/Reg.scala | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/core/Reg.scala b/chiselFrontend/src/main/scala/chisel3/core/Reg.scala index 9d380695..57979be0 100644 --- a/chiselFrontend/src/main/scala/chisel3/core/Reg.scala +++ b/chiselFrontend/src/main/scala/chisel3/core/Reg.scala @@ -9,6 +9,7 @@ import chisel3.internal.sourceinfo.{SourceInfo, UnlocatableSourceInfo} object Reg { private[core] def makeType[T <: Data](compileOptions: CompileOptions, t: T = null, next: T = null, init: T = null): T = { + implicit val myCompileOptions = compileOptions if (t ne null) { if (compileOptions.declaredTypeMustBeUnbound) { Binding.checkUnbound(t, s"t ($t) must be unbound Type. Try using cloneType?") |
