diff options
| -rw-r--r-- | chiselFrontend/src/main/scala/chisel3/core/CompileOptions.scala | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/core/CompileOptions.scala b/chiselFrontend/src/main/scala/chisel3/core/CompileOptions.scala index 4aa3ad33..f512bf26 100644 --- a/chiselFrontend/src/main/scala/chisel3/core/CompileOptions.scala +++ b/chiselFrontend/src/main/scala/chisel3/core/CompileOptions.scala @@ -3,6 +3,7 @@ package chisel3.core import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context trait CompileOptions { // Should Record connections require a strict match of fields. @@ -26,7 +27,13 @@ trait CompileOptions { object CompileOptions { // Provides a low priority Strict default. Can be overridden by importing the NotStrict option. - implicit def materialize: CompileOptions = chisel3.core.ExplicitCompileOptions.Strict + // Implemented as a macro to prevent this from being used inside chisel core. + implicit def materialize: CompileOptions = macro materialize_impl + + def materialize_impl(c: Context): c.Tree = { + import c.universe._ + q"_root_.chisel3.core.ExplicitCompileOptions.Strict" + } } object ExplicitCompileOptions { |
