summaryrefslogtreecommitdiff
path: root/src/main/scala/chisel3/compatibility
diff options
context:
space:
mode:
authorJim Lawson2016-10-06 08:57:10 -0700
committerJim Lawson2016-10-06 08:57:10 -0700
commit82625071405672eb4a19363d6f73f359ac28a7f5 (patch)
treedee5beff0e7333fa86c1cdcdb79c0d111114b8c9 /src/main/scala/chisel3/compatibility
parentb7c6e0d1a2098b545938a5a8dfce2b1d9294532f (diff)
parent7de30c2b893a3f24d43f2e131557430eb64f6bc8 (diff)
Merge branch 'master' into tobits-deprecation
Diffstat (limited to 'src/main/scala/chisel3/compatibility')
-rw-r--r--src/main/scala/chisel3/compatibility/Main.scala19
-rw-r--r--src/main/scala/chisel3/compatibility/debug.scala10
-rw-r--r--src/main/scala/chisel3/compatibility/throwException.scala14
3 files changed, 43 insertions, 0 deletions
diff --git a/src/main/scala/chisel3/compatibility/Main.scala b/src/main/scala/chisel3/compatibility/Main.scala
new file mode 100644
index 00000000..a41599a3
--- /dev/null
+++ b/src/main/scala/chisel3/compatibility/Main.scala
@@ -0,0 +1,19 @@
+// See LICENSE for license details.
+
+package chisel3.compatibility
+
+import java.io.File
+
+import chisel3._
+
+@deprecated("chiselMain doesn't exist in Chisel3", "3.0") object chiselMain {
+ def apply[T <: Module](args: Array[String], gen: () => T): Unit =
+ Predef.assert(false, "No more chiselMain in Chisel3")
+
+ def run[T <: Module] (args: Array[String], gen: () => T): Unit = {
+ val circuit = Driver.elaborate(gen)
+ Driver.parseArgs(args)
+ val output_file = new File(Driver.targetDir + "/" + circuit.name + ".fir")
+ Driver.dumpFirrtl(circuit, Option(output_file))
+ }
+}
diff --git a/src/main/scala/chisel3/compatibility/debug.scala b/src/main/scala/chisel3/compatibility/debug.scala
new file mode 100644
index 00000000..d9f6e4b0
--- /dev/null
+++ b/src/main/scala/chisel3/compatibility/debug.scala
@@ -0,0 +1,10 @@
+// See LICENSE for license details.
+
+package chisel3.compatibility
+
+import chisel3.core._
+
+@deprecated("debug doesn't do anything in Chisel3 as no pruning happens in the frontend", "chisel3")
+object debug { // scalastyle:ignore object.name
+ def apply (arg: Data): Data = arg
+}
diff --git a/src/main/scala/chisel3/compatibility/throwException.scala b/src/main/scala/chisel3/compatibility/throwException.scala
new file mode 100644
index 00000000..3e8b33e6
--- /dev/null
+++ b/src/main/scala/chisel3/compatibility/throwException.scala
@@ -0,0 +1,14 @@
+// See LICENSE for license details.
+
+package chisel3.compatibility
+
+import chisel3._
+
+@deprecated("throwException doesn't exist in Chisel3", "3.0.0")
+@throws(classOf[Exception])
+object throwException {
+ def apply(s: String, t: Throwable = null) = {
+ val xcpt = new Exception(s, t)
+ throw xcpt
+ }
+}