summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.sbt2
-rw-r--r--plugin/src/main/scala-2.12/chisel3/internal/plugin/ChiselPlugin.scala6
-rw-r--r--src/test/scala/chiselTests/AutoClonetypeSpec.scala21
3 files changed, 14 insertions, 15 deletions
diff --git a/build.sbt b/build.sbt
index 42fcece3..5c051ff5 100644
--- a/build.sbt
+++ b/build.sbt
@@ -179,8 +179,6 @@ lazy val chisel = (project in file(".")).
mimaPreviousArtifacts := Set(),
libraryDependencies += defaultVersions("treadle") % "test",
scalacOptions in Test ++= Seq("-language:reflectiveCalls"),
- // Only used in Test for 3.4.x, used in Compile in 3.5
- scalacOptions in Test += "-P:chiselplugin:useBundlePlugin",
scalacOptions in Compile in doc ++= Seq(
"-diagrams",
"-groups",
diff --git a/plugin/src/main/scala-2.12/chisel3/internal/plugin/ChiselPlugin.scala b/plugin/src/main/scala-2.12/chisel3/internal/plugin/ChiselPlugin.scala
index a0651e1d..23082329 100644
--- a/plugin/src/main/scala-2.12/chisel3/internal/plugin/ChiselPlugin.scala
+++ b/plugin/src/main/scala-2.12/chisel3/internal/plugin/ChiselPlugin.scala
@@ -5,8 +5,9 @@ package chisel3.internal.plugin
import scala.tools.nsc
import nsc.Global
import nsc.plugins.{Plugin, PluginComponent}
+import scala.reflect.internal.util.NoPosition
-private[plugin] case class ChiselPluginArguments(var useBundlePlugin: Boolean = false) {
+private[plugin] case class ChiselPluginArguments(var useBundlePlugin: Boolean = true) {
def useBundlePluginOpt = "useBundlePlugin"
def useBundlePluginFullOpt = s"-P:chiselplugin:$useBundlePluginOpt"
}
@@ -24,7 +25,8 @@ class ChiselPlugin(val global: Global) extends Plugin {
override def init(options: List[String], error: String => Unit): Boolean = {
for (option <- options) {
if (option == arguments.useBundlePluginOpt) {
- arguments.useBundlePlugin = true
+ val msg = s"'${arguments.useBundlePluginFullOpt}' is now default behavior, you can stop using the scalacOption."
+ global.reporter.warning(NoPosition, msg)
} else {
error(s"Option not understood: '$option'")
}
diff --git a/src/test/scala/chiselTests/AutoClonetypeSpec.scala b/src/test/scala/chiselTests/AutoClonetypeSpec.scala
index e0e6b2f0..57e00e99 100644
--- a/src/test/scala/chiselTests/AutoClonetypeSpec.scala
+++ b/src/test/scala/chiselTests/AutoClonetypeSpec.scala
@@ -265,19 +265,18 @@ class AutoClonetypeSpec extends ChiselFlatSpec with Utils {
behavior of "Compiler Plugin Autoclonetype"
- // Necessary test for 3.4.x, but we will break this (for non-plugin users) in 3.5
- it should "NOT break code that extends chisel3.util Bundles (whether they use the plugin or not)" in {
- class MyModule extends MultiIOModule {
- val io = IO(new InheritingBundle)
- io.deq <> io.enq
- io.count := 0.U
- io.error := true.B
- }
- elaborate(new MyModule)
- }
-
// New tests from the plugin
if (usingPlugin) {
+ it should "NOT break code that extends chisel3.util Bundles if they use the plugin" in {
+ class MyModule extends MultiIOModule {
+ val io = IO(new InheritingBundle)
+ io.deq <> io.enq
+ io.count := 0.U
+ io.error := true.B
+ }
+ elaborate(new MyModule)
+ }
+
it should "support Bundles with non-val parameters" in {
class MyBundle(i: Int) extends Bundle {
val foo = UInt(i.W)