aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/firrtlTests/ReplSeqMemTests.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/scala/firrtlTests/ReplSeqMemTests.scala')
-rw-r--r--src/test/scala/firrtlTests/ReplSeqMemTests.scala36
1 files changed, 15 insertions, 21 deletions
diff --git a/src/test/scala/firrtlTests/ReplSeqMemTests.scala b/src/test/scala/firrtlTests/ReplSeqMemTests.scala
index 01a4501b..1a5b44e6 100644
--- a/src/test/scala/firrtlTests/ReplSeqMemTests.scala
+++ b/src/test/scala/firrtlTests/ReplSeqMemTests.scala
@@ -9,6 +9,7 @@ import firrtl.passes.memlib._
import annotations._
class ReplSeqMemSpec extends SimpleTransformSpec {
+ def emitter = new LowFirrtlEmitter
def transforms = Seq(
new ChirrtlToHighFirrtl(),
new IRToWorkingIR(),
@@ -62,10 +63,9 @@ circuit Top :
""".stripMargin
val confLoc = "ReplSeqMemTests.confTEMP"
val aMap = AnnotationMap(Seq(ReplSeqMemAnnotation("-c:Top:-o:"+confLoc)))
- val writer = new java.io.StringWriter
- compile(CircuitState(parse(input), ChirrtlForm, Some(aMap)), writer)
+ val res = compileAndEmit(CircuitState(parse(input), ChirrtlForm, Some(aMap)))
// Check correctness of firrtl
- parse(writer.toString)
+ parse(res.getEmittedCircuit.value)
(new java.io.File(confLoc)).delete()
}
@@ -85,10 +85,9 @@ circuit Top :
""".stripMargin
val confLoc = "ReplSeqMemTests.confTEMP"
val aMap = AnnotationMap(Seq(ReplSeqMemAnnotation("-c:Top:-o:"+confLoc)))
- val writer = new java.io.StringWriter
- compile(CircuitState(parse(input), ChirrtlForm, Some(aMap)), writer)
+ val res = compileAndEmit(CircuitState(parse(input), ChirrtlForm, Some(aMap)))
// Check correctness of firrtl
- parse(writer.toString)
+ parse(res.getEmittedCircuit.value)
(new java.io.File(confLoc)).delete()
}
@@ -111,10 +110,9 @@ circuit CustomMemory :
""".stripMargin
val confLoc = "ReplSeqMemTests.confTEMP"
val aMap = AnnotationMap(Seq(ReplSeqMemAnnotation("-c:CustomMemory:-o:"+confLoc)))
- val writer = new java.io.StringWriter
- compile(CircuitState(parse(input), ChirrtlForm, Some(aMap)), writer)
+ val res = compileAndEmit(CircuitState(parse(input), ChirrtlForm, Some(aMap)))
// Check correctness of firrtl
- parse(writer.toString)
+ parse(res.getEmittedCircuit.value)
(new java.io.File(confLoc)).delete()
}
@@ -137,10 +135,9 @@ circuit CustomMemory :
""".stripMargin
val confLoc = "ReplSeqMemTests.confTEMP"
val aMap = AnnotationMap(Seq(ReplSeqMemAnnotation("-c:CustomMemory:-o:"+confLoc)))
- val writer = new java.io.StringWriter
- compile(CircuitState(parse(input), ChirrtlForm, Some(aMap)), writer)
+ val res = compileAndEmit(CircuitState(parse(input), ChirrtlForm, Some(aMap)))
// Check correctness of firrtl
- parse(writer.toString)
+ parse(res.getEmittedCircuit.value)
(new java.io.File(confLoc)).delete()
}
@@ -213,10 +210,9 @@ circuit CustomMemory :
val aMap = AnnotationMap(Seq(
ReplSeqMemAnnotation("-c:CustomMemory:-o:"+confLoc),
NoDedupMemAnnotation(ComponentName("mem_0", ModuleName("CustomMemory",CircuitName("CustomMemory"))))))
- val writer = new java.io.StringWriter
- compile(CircuitState(parse(input), ChirrtlForm, Some(aMap)), writer)
+ val res = compileAndEmit(CircuitState(parse(input), ChirrtlForm, Some(aMap)))
// Check correctness of firrtl
- val circuit = parse(writer.toString)
+ val circuit = parse(res.getEmittedCircuit.value)
val numExtMods = circuit.modules.count {
case e: ExtModule => true
case _ => false
@@ -254,10 +250,9 @@ circuit CustomMemory :
val aMap = AnnotationMap(Seq(
ReplSeqMemAnnotation("-c:CustomMemory:-o:"+confLoc),
NoDedupMemAnnotation(ComponentName("mem_1", ModuleName("CustomMemory",CircuitName("CustomMemory"))))))
- val writer = new java.io.StringWriter
- compile(CircuitState(parse(input), ChirrtlForm, Some(aMap)), writer)
+ val res = compileAndEmit(CircuitState(parse(input), ChirrtlForm, Some(aMap)))
// Check correctness of firrtl
- val circuit = parse(writer.toString)
+ val circuit = parse(res.getEmittedCircuit.value)
val numExtMods = circuit.modules.count {
case e: ExtModule => true
case _ => false
@@ -289,10 +284,9 @@ circuit CustomMemory :
"""
val confLoc = "ReplSeqMemTests.confTEMP"
val aMap = AnnotationMap(Seq(ReplSeqMemAnnotation("-c:CustomMemory:-o:"+confLoc)))
- val writer = new java.io.StringWriter
- compile(CircuitState(parse(input), ChirrtlForm, Some(aMap)), writer)
+ val res = compileAndEmit(CircuitState(parse(input), ChirrtlForm, Some(aMap)))
// Check correctness of firrtl
- val circuit = parse(writer.toString)
+ val circuit = parse(res.getEmittedCircuit.value)
val numExtMods = circuit.modules.count {
case e: ExtModule => true
case _ => false