aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJack Koenig2021-03-02 15:32:24 -0800
committerGitHub2021-03-02 15:32:24 -0800
commit38dc5401ea875037e23bbbe998fb1b0f9aef7334 (patch)
tree948ea28b7dbbef0347e6e86d30b6f12854fe61f1 /src
parent541a70c9489ec90118d45d4c953af0d0a33f8316 (diff)
Remove Scala 2.11 (#2062)
Diffstat (limited to 'src')
-rw-r--r--src/main/scala/firrtl/stage/FirrtlAnnotations.scala9
-rw-r--r--src/main/scala/firrtl/stage/transforms/CheckScalaVersion.scala17
-rw-r--r--src/test/scala/firrtl/backends/experimental/smt/end2end/SMTCompilationTest.scala3
-rw-r--r--src/test/scala/firrtlTests/stage/FirrtlMainSpec.scala28
4 files changed, 12 insertions, 45 deletions
diff --git a/src/main/scala/firrtl/stage/FirrtlAnnotations.scala b/src/main/scala/firrtl/stage/FirrtlAnnotations.scala
index 7d0d237a..26655efd 100644
--- a/src/main/scala/firrtl/stage/FirrtlAnnotations.scala
+++ b/src/main/scala/firrtl/stage/FirrtlAnnotations.scala
@@ -255,13 +255,18 @@ case class FirrtlCircuitAnnotation(circuit: Circuit) extends NoTargetAnnotation
*
* - set with `--warn:no-scala-version-deprecation`
*/
+@deprecated("Support for Scala 2.11 has been dropped, this object no longer does anything", "FIRRTL 1.5")
case object WarnNoScalaVersionDeprecation extends NoTargetAnnotation with FirrtlOption with HasShellOptions {
def longOption: String = "warn:no-scala-version-deprecation"
val options = Seq(
new ShellOption[Unit](
longOption = longOption,
- toAnnotationSeq = { _ => Seq(this) },
- helpText = "Suppress Scala 2.11 deprecation warning (ignored in Scala 2.12+)"
+ toAnnotationSeq = { _ =>
+ val msg = s"'$longOption' no longer does anything and will be removed in FIRRTL 1.6"
+ firrtl.options.StageUtils.dramaticWarning(msg)
+ Seq(this)
+ },
+ helpText = "(deprecated, this option does nothing)"
)
)
}
diff --git a/src/main/scala/firrtl/stage/transforms/CheckScalaVersion.scala b/src/main/scala/firrtl/stage/transforms/CheckScalaVersion.scala
index 9d894905..6ed900f1 100644
--- a/src/main/scala/firrtl/stage/transforms/CheckScalaVersion.scala
+++ b/src/main/scala/firrtl/stage/transforms/CheckScalaVersion.scala
@@ -6,14 +6,10 @@ import firrtl.{BuildInfo, CircuitState, DependencyAPIMigration, Transform}
import firrtl.stage.WarnNoScalaVersionDeprecation
import firrtl.options.StageUtils.dramaticWarning
+@deprecated("Support for 2.11 has been dropped, this logic no longer does anything", "FIRRTL 1.5")
object CheckScalaVersion {
def migrationDocumentLink: String = "https://www.chisel-lang.org/chisel3/upgrading-from-scala-2-11.html"
- private def getScalaMajorVersion: Int = {
- val "2" :: major :: _ :: Nil = BuildInfo.scalaVersion.split("\\.").toList
- major.toInt
- }
-
final def deprecationMessage(version: String, option: String) =
s"""|FIRRTL support for Scala $version is deprecated, please upgrade to Scala 2.12.
| Migration guide: $migrationDocumentLink
@@ -21,17 +17,10 @@ object CheckScalaVersion {
}
+@deprecated("Support for 2.11 has been dropped, this transform no longer does anything", "FIRRTL 1.5")
class CheckScalaVersion extends Transform with DependencyAPIMigration {
- import CheckScalaVersion._
override def invalidates(a: Transform) = false
- def execute(state: CircuitState): CircuitState = {
- def suppress = state.annotations.contains(WarnNoScalaVersionDeprecation)
- if (getScalaMajorVersion == 11 && !suppress) {
- val option = s"--${WarnNoScalaVersionDeprecation.longOption}"
- dramaticWarning(deprecationMessage("2.11", option))
- }
- state
- }
+ def execute(state: CircuitState): CircuitState = state
}
diff --git a/src/test/scala/firrtl/backends/experimental/smt/end2end/SMTCompilationTest.scala b/src/test/scala/firrtl/backends/experimental/smt/end2end/SMTCompilationTest.scala
index 72949830..f846e19c 100644
--- a/src/test/scala/firrtl/backends/experimental/smt/end2end/SMTCompilationTest.scala
+++ b/src/test/scala/firrtl/backends/experimental/smt/end2end/SMTCompilationTest.scala
@@ -15,8 +15,7 @@ import scala.sys.process.{Process, ProcessLogger}
class SMTCompilationTest extends AnyFlatSpec with LazyLogging {
it should "generate valid SMTLib for AddNot" taggedAs (RequiresZ3) in { compileAndParse("AddNot") }
it should "generate valid SMTLib for FPU" taggedAs (RequiresZ3) in { compileAndParse("FPU") }
- // we get a stack overflow in Scala 2.11 because of a deeply nested and(...) expression in the sequencer
- it should "generate valid SMTLib for HwachaSequencer" taggedAs (RequiresZ3) ignore {
+ it should "generate valid SMTLib for HwachaSequencer" taggedAs (RequiresZ3) in {
compileAndParse("HwachaSequencer")
}
it should "generate valid SMTLib for ICache" taggedAs (RequiresZ3) in { compileAndParse("ICache") }
diff --git a/src/test/scala/firrtlTests/stage/FirrtlMainSpec.scala b/src/test/scala/firrtlTests/stage/FirrtlMainSpec.scala
index ea590d26..eaf48b49 100644
--- a/src/test/scala/firrtlTests/stage/FirrtlMainSpec.scala
+++ b/src/test/scala/firrtlTests/stage/FirrtlMainSpec.scala
@@ -164,16 +164,6 @@ class FirrtlMainSpec
|""".stripMargin
}
- /** This returns a string containing the default standard out string based on the Scala version. E.g., if there are
- * version-specific deprecation warnings, those are available here and can be passed to tests that should have them.
- */
- val defaultStdOut: Option[String] = BuildInfo.scalaVersion.split("\\.").toList match {
- case "2" :: v :: _ :: Nil if v.toInt <= 11 =>
- Some(CheckScalaVersion.deprecationMessage("2.11", s"--${WarnNoScalaVersionDeprecation.longOption}"))
- case x =>
- None
- }
-
info("As a FIRRTL command line user")
info("I want to compile some FIRRTL")
Feature("FirrtlMain command line interface") {
@@ -205,58 +195,48 @@ class FirrtlMainSpec
Seq(
/* Test all standard emitters with and without annotation file outputs */
FirrtlMainTest(args = Array("-X", "none", "-E", "chirrtl"), files = Seq("Top.fir")),
- FirrtlMainTest(args = Array("-X", "high", "-E", "high"), stdout = defaultStdOut, files = Seq("Top.hi.fir")),
+ FirrtlMainTest(args = Array("-X", "high", "-E", "high"), files = Seq("Top.hi.fir")),
FirrtlMainTest(
args = Array("-X", "middle", "-E", "middle", "-foaf", "Top"),
- stdout = defaultStdOut,
files = Seq("Top.mid.fir", "Top.anno.json")
),
FirrtlMainTest(
args = Array("-X", "low", "-E", "low", "-foaf", "annotations.anno.json"),
- stdout = defaultStdOut,
files = Seq("Top.lo.fir", "annotations.anno.json")
),
FirrtlMainTest(
args = Array("-X", "verilog", "-E", "verilog", "-foaf", "foo.anno"),
- stdout = defaultStdOut,
files = Seq("Top.v", "foo.anno.anno.json")
),
FirrtlMainTest(
args = Array("-X", "sverilog", "-E", "sverilog", "-foaf", "foo.json"),
- stdout = defaultStdOut,
files = Seq("Top.sv", "foo.json.anno.json")
),
/* Test all one file per module emitters */
FirrtlMainTest(args = Array("-X", "none", "-e", "chirrtl"), files = Seq("Top.fir", "Child.fir")),
FirrtlMainTest(
args = Array("-X", "high", "-e", "high"),
- stdout = defaultStdOut,
files = Seq("Top.hi.fir", "Child.hi.fir")
),
FirrtlMainTest(
args = Array("-X", "middle", "-e", "middle"),
- stdout = defaultStdOut,
files = Seq("Top.mid.fir", "Child.mid.fir")
),
FirrtlMainTest(
args = Array("-X", "low", "-e", "low"),
- stdout = defaultStdOut,
files = Seq("Top.lo.fir", "Child.lo.fir")
),
FirrtlMainTest(
args = Array("-X", "verilog", "-e", "verilog"),
- stdout = defaultStdOut,
files = Seq("Top.v", "Child.v")
),
FirrtlMainTest(
args = Array("-X", "sverilog", "-e", "sverilog"),
- stdout = defaultStdOut,
files = Seq("Top.sv", "Child.sv")
),
/* Test mixing of -E with -e */
FirrtlMainTest(
args = Array("-X", "middle", "-E", "high", "-e", "middle"),
- stdout = defaultStdOut,
files = Seq("Top.hi.fir", "Top.mid.fir", "Child.mid.fir"),
notFiles = Seq("Child.hi.fir")
),
@@ -264,33 +244,27 @@ class FirrtlMainSpec
FirrtlMainTest(args = Array("-X", "none", "-E", "chirrtl", "-o", "foo"), files = Seq("foo.fir")),
FirrtlMainTest(
args = Array("-X", "high", "-E", "high", "-o", "foo"),
- stdout = defaultStdOut,
files = Seq("foo.hi.fir")
),
FirrtlMainTest(
args = Array("-X", "middle", "-E", "middle", "-o", "foo.middle"),
- stdout = defaultStdOut,
files = Seq("foo.middle.mid.fir")
),
FirrtlMainTest(
args = Array("-X", "low", "-E", "low", "-o", "foo.lo.fir"),
- stdout = defaultStdOut,
files = Seq("foo.lo.fir")
),
FirrtlMainTest(
args = Array("-X", "verilog", "-E", "verilog", "-o", "foo.sv"),
- stdout = defaultStdOut,
files = Seq("foo.sv.v")
),
FirrtlMainTest(
args = Array("-X", "sverilog", "-E", "sverilog", "-o", "Foo"),
- stdout = defaultStdOut,
files = Seq("Foo.sv")
),
/* Test that an output is generated if no emitter is specified */
FirrtlMainTest(
args = Array("-X", "verilog", "-o", "Foo"),
- stdout = defaultStdOut,
files = Seq("Foo.v")
)
)