summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Lawson2017-02-07 17:18:53 -0800
committerJack Koenig2017-02-07 17:18:53 -0800
commitc9beeeb1408f760309524f44a2dbd1c4f6d116b6 (patch)
tree480686fa20aaf21b077567c1cc52733ecca3c1f3 /src
parent8d2fff4eff3ba0f92437b290985b35afbb0ed565 (diff)
Add generateFirrtl() method to ChiselSpec.scala (#423)
Diffstat (limited to 'src')
-rw-r--r--src/test/scala/chiselTests/ChiselSpec.scala8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/scala/chiselTests/ChiselSpec.scala b/src/test/scala/chiselTests/ChiselSpec.scala
index 4588abe1..55d58d77 100644
--- a/src/test/scala/chiselTests/ChiselSpec.scala
+++ b/src/test/scala/chiselTests/ChiselSpec.scala
@@ -27,6 +27,14 @@ trait ChiselRunners extends Assertions {
assert(!runTester(t, additionalVResources))
}
def elaborate(t: => Module): Unit = Driver.elaborate(() => t)
+
+ /** Given a generator, return the Firrtl that it generates.
+ *
+ * @param t Module generator
+ * @return Firrtl representation as a String
+ */
+ def generateFirrtl(t: => Module): String = Driver.emit(() => t)
+
/** Compiles a Chisel Module to Verilog */
def compile(t: => Module): String = {
val manager = new ExecutionOptionsManager("compile") with HasFirrtlOptions