Skip to content

Commit 12b033e

Browse files
authored
Issue deprecation warning on startup. (#749)
* Issue deprecation warning on startup. * Respond to comments - avoid burying warning in a wall of text. Print deprecation warning after elaboration and after tests.
1 parent f5623b0 commit 12b033e

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/main/scala/Driver.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ import sys.process.{BasicIO,stringSeqToProcess}
3636
import BuildInfo._
3737

3838
object Driver extends FileSystemUtilities{
39+
// Indicate this version of Chisel is deprecated and advise moving to chisel3.
40+
val deprecatedWarning = new ChiselError(() => "Chisel2 is deprecated. Please use Chisel3: https://github.com/freechipsproject/chisel3", null, ChiselError.warningLevel)
41+
42+
def done: Unit = {
43+
deprecatedWarning.print()
44+
}
45+
3946
def apply[T <: Module](args: Array[String], gen: () => T, wrapped:Boolean): T = {
4047
initChisel(args)
4148
try {
@@ -46,6 +53,7 @@ object Driver extends FileSystemUtilities{
4653
println("Re-running Chisel in debug mode to obtain erroneous line numbers...")
4754
apply(args :+ "--lineNumbers", gen, wrapped)
4855
}
56+
done
4957
}
5058
}
5159

@@ -69,6 +77,7 @@ object Driver extends FileSystemUtilities{
6977
} finally {
7078
Tester.close
7179
}
80+
done
7281
}
7382
mod
7483
}

src/main/scala/testers/TesterDriver.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ object TesterDriver {
6060
c.step(1)
6161
c.finish
6262
}
63+
Driver.done
6364
true
6465
} catch {
6566
case e: Throwable =>

0 commit comments

Comments
 (0)