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/SeqUtils.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/SeqUtils.scala')
| -rw-r--r-- | chiselFrontend/src/main/scala/chisel3/core/SeqUtils.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/core/SeqUtils.scala b/chiselFrontend/src/main/scala/chisel3/core/SeqUtils.scala index 0d8604cd..558dea7a 100644 --- a/chiselFrontend/src/main/scala/chisel3/core/SeqUtils.scala +++ b/chiselFrontend/src/main/scala/chisel3/core/SeqUtils.scala @@ -4,7 +4,7 @@ package chisel3.core import scala.language.experimental.macros -import chisel3.internal.sourceinfo.{SourceInfo, SourceInfoTransform} +import chisel3.internal.sourceinfo._ private[chisel3] object SeqUtils { /** Concatenates the data elements of the input sequence, in sequence order, together. @@ -51,9 +51,9 @@ private[chisel3] object SeqUtils { * * @note assumes exactly one true predicate, results undefined otherwise */ - def oneHotMux[T <: Data](in: Iterable[(Bool, T)]): T = macro SourceInfoTransform.inArg + def oneHotMux[T <: Data](in: Iterable[(Bool, T)]): T = macro CompileOptionsTransform.inArg - def do_oneHotMux[T <: Data](in: Iterable[(Bool, T)])(implicit sourceInfo: SourceInfo): T = { + def do_oneHotMux[T <: Data](in: Iterable[(Bool, T)])(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): T = { if (in.tail.isEmpty) { in.head._2 } else { |
