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 /core/src/main | |
| parent | d9903de3357336c4bd158a02318b9cafea7bdf46 (diff) | |
Deprecate support for Scala 2.11 (#1551)
Leverages chiselRuntimeDeprecated infrastructure. As such it is not
currently suppressible.
Diffstat (limited to 'core/src/main')
| -rw-r--r-- | core/src/main/scala/chisel3/internal/Builder.scala | 16 |
1 files changed, 16 insertions, 0 deletions
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) |
