diff options
| author | Jack Koenig | 2020-08-13 15:23:11 -0700 |
|---|---|---|
| committer | GitHub | 2020-08-13 22:23:11 +0000 |
| commit | 3e5c3a88d6814e91d4c5efff3aa0ed037411d881 (patch) | |
| tree | c60a2299ac49fc73a58860a4ad70a0720a884ac2 | |
| parent | d9903de3357336c4bd158a02318b9cafea7bdf46 (diff) | |
Deprecate support for Scala 2.11 (#1551)
Leverages chiselRuntimeDeprecated infrastructure. As such it is not
currently suppressible.
| -rw-r--r-- | build.sbt | 12 | ||||
| -rw-r--r-- | core/src/main/scala/chisel3/internal/Builder.scala | 16 |
2 files changed, 22 insertions, 6 deletions
@@ -180,6 +180,12 @@ lazy val macros = (project in file("macros")). lazy val core = (project in file("core")). settings(commonSettings: _*). + enablePlugins(BuildInfoPlugin). + settings( + buildInfoPackage := "chisel3", + buildInfoUsePackageAsPath := true, + buildInfoKeys := Seq[BuildInfoKey](buildInfoPackage, version, scalaVersion, sbtVersion) + ). settings(publishSettings: _*). settings( name := "chisel3-core", @@ -200,13 +206,7 @@ lazy val core = (project in file("core")). lazy val root = RootProject(file(".")) lazy val chisel = (project in file(".")). - enablePlugins(BuildInfoPlugin). enablePlugins(ScalaUnidocPlugin). - settings( - buildInfoPackage := name.value, - buildInfoUsePackageAsPath := true, - buildInfoKeys := Seq[BuildInfoKey](buildInfoPackage, version, scalaVersion, sbtVersion) - ). settings(commonSettings: _*). settings(chiselSettings: _*). settings(publishSettings: _*). diff --git a/core/src/main/scala/chisel3/internal/Builder.scala b/core/src/main/scala/chisel3/internal/Builder.scala index d05a69f7..e55f1af7 100644 --- a/core/src/main/scala/chisel3/internal/Builder.scala +++ b/core/src/main/scala/chisel3/internal/Builder.scala @@ -603,8 +603,24 @@ private[chisel3] object Builder { throwException(m) } + def getScalaMajorVersion: Int = { + val "2" :: major :: _ :: Nil = chisel3.BuildInfo.scalaVersion.split("\\.").toList + major.toInt + } + + def checkScalaVersion(): Unit = { + if (getScalaMajorVersion == 11) { + val url = _root_.firrtl.stage.transforms.CheckScalaVersion.migrationDocumentLink + val msg = s"Chisel 3.4 is the last version that will support Scala 2.11. " + + s"Please upgrade to Scala 2.12. See $url" + deprecated(msg, Some("")) + } + } + + def build[T <: RawModule](f: => T): (Circuit, T) = { dynamicContextVar.withValue(Some(new DynamicContext())) { + checkScalaVersion() errors.info("Elaborating design...") val mod = f mod.forceName(None, mod.name, globalNamespace) |
