aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/firrtlTests/fixed
diff options
context:
space:
mode:
authorJack Koenig2017-03-06 14:51:20 -0600
committerGitHub2017-03-06 14:51:20 -0600
commit3d58123ae654a2101ba81304ca3863b3be12c4f3 (patch)
tree2e662485fef5327a2697dbd4a9b42a2cdc5bae5f /src/test/scala/firrtlTests/fixed
parentc89f74f19dd5162ee533a0a20825819bc52bc73e (diff)
Add ability to emit 1 file per module (#443)
Changes Emitters to also be Transforms and use Annotations for both telling an emitter to do emission as well as getting the emitted result. Helper functions ease the use of the new interface. Also adds a FirrtlExecutionOptions field as well as a command-line option. Use of Writers in Compilers and Emitters is now deprecated.
Diffstat (limited to 'src/test/scala/firrtlTests/fixed')
-rw-r--r--src/test/scala/firrtlTests/fixed/FixedPointMathSpec.scala8
-rw-r--r--src/test/scala/firrtlTests/fixed/FixedTypeInferenceSpec.scala8
2 files changed, 2 insertions, 14 deletions
diff --git a/src/test/scala/firrtlTests/fixed/FixedPointMathSpec.scala b/src/test/scala/firrtlTests/fixed/FixedPointMathSpec.scala
index 0c30b59e..39da2a33 100644
--- a/src/test/scala/firrtlTests/fixed/FixedPointMathSpec.scala
+++ b/src/test/scala/firrtlTests/fixed/FixedPointMathSpec.scala
@@ -2,8 +2,6 @@
package firrtlTests.fixed
-import java.io.StringWriter
-
import firrtl.{CircuitState, ChirrtlForm, LowFirrtlCompiler, Parser, AnnotationMap}
import firrtl.Parser.IgnoreInfo
import firrtlTests.FirrtlFlatSpec
@@ -41,11 +39,9 @@ class FixedPointMathSpec extends FirrtlFlatSpec {
val lowerer = new LowFirrtlCompiler
- val writer = new StringWriter()
-
- lowerer.compile(CircuitState(parse(input), ChirrtlForm), writer)
+ val res = lowerer.compileAndEmit(CircuitState(parse(input), ChirrtlForm))
- val output = writer.toString.split("\n")
+ val output = res.getEmittedCircuit.value split "\n"
def inferredAddWidth: Int = {
val binaryDifference = binaryPoint1 - binaryPoint2
diff --git a/src/test/scala/firrtlTests/fixed/FixedTypeInferenceSpec.scala b/src/test/scala/firrtlTests/fixed/FixedTypeInferenceSpec.scala
index 44fa1d29..37209786 100644
--- a/src/test/scala/firrtlTests/fixed/FixedTypeInferenceSpec.scala
+++ b/src/test/scala/firrtlTests/fixed/FixedTypeInferenceSpec.scala
@@ -20,14 +20,6 @@ class FixedTypeInferenceSpec extends FirrtlFlatSpec {
lines should contain(e)
}
}
- private def executeTest(input: String, expected: Seq[String], compiler: Compiler) = {
- val writer = new StringWriter()
- compiler.compile(CircuitState(parse(input), ChirrtlForm), writer)
- val lines = writer.toString().split("\n") map normalized
- expected foreach { e =>
- lines should contain(e)
- }
- }
"Fixed types" should "infer add correctly" in {
val passes = Seq(