Skip to content

Commit b192eed

Browse files
authored
Revert "Use macro to materialize CompileOptions in Chisel._ (#1257)" (#1269)
This reverts commit 5a0f066.
1 parent 39f6c69 commit b192eed

File tree

2 files changed

+3
-31
lines changed

2 files changed

+3
-31
lines changed

src/main/scala/chisel3/compatibility.scala

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,11 @@ package object Chisel { // scalastyle:ignore package.object.name number.of.t
99
import chisel3.internal.firrtl.Width
1010

1111
import scala.language.experimental.macros
12-
import scala.reflect.macros.blackbox.Context
13-
import scala.annotation.{StaticAnnotation, compileTimeOnly}
12+
import scala.annotation.StaticAnnotation
13+
import scala.annotation.compileTimeOnly
1414
import scala.language.implicitConversions
1515

16-
17-
/** Default NotStrict CompileOptions for compatibility code
18-
*
19-
* No longer implicit, materialization macro below provides a low-priority default
20-
*/
21-
val defaultCompileOptions = chisel3.ExplicitCompileOptions.NotStrict
16+
implicit val defaultCompileOptions = chisel3.ExplicitCompileOptions.NotStrict
2217

2318
abstract class Direction
2419
case object INPUT extends Direction
@@ -589,16 +584,6 @@ package object Chisel { // scalastyle:ignore package.object.name number.of.t
589584
val Pipe = chisel3.util.Pipe
590585
type Pipe[T <: Data] = chisel3.util.Pipe[T]
591586

592-
/** Provides a low priority NotStrict default. Can be overridden by providing a custom implicit
593-
* val in lexical scope (ie. imported)
594-
* Implemented as a macro to provide a low-priority default
595-
*/
596-
implicit def materializeCompileOptions: CompileOptions = macro materializeCompileOptions_impl
597-
598-
def materializeCompileOptions_impl(c: Context): c.Tree = {
599-
import c.universe._
600-
q"_root_.chisel3.ExplicitCompileOptions.NotStrict"
601-
}
602587

603588
/** Package for experimental features, which may have their API changed, be removed, etc.
604589
*

src/test/scala/chiselTests/CompatibilitySpec.scala

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -118,19 +118,6 @@ class CompatibiltySpec extends ChiselFlatSpec with GeneratorDrivenPropertyChecks
118118
}
119119
elaborate { new Dummy }
120120
}
121-
122-
it should "be able to provide custom CompileOptions" in {
123-
implicit val CustomCompileOptions = chisel3.ExplicitCompileOptions.NotStrict.copy(inferModuleReset = true)
124-
// Top-level Module always uses Bool so needs to be an inner Module
125-
elaborate(new Module {
126-
val io = IO(new Bundle {})
127-
val inst = Module(new Module {
128-
val io = IO(new Bundle {})
129-
assert(reset.isInstanceOf[chisel3.ResetType])
130-
})
131-
})
132-
}
133-
134121
// Verify we can elaborate a design expressed in Chisel2
135122
class Chisel2CompatibleRisc extends Module {
136123
val io = new Bundle {

0 commit comments

Comments
 (0)