aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/firrtlTests/WidthSpec.scala
diff options
context:
space:
mode:
authorAlbert Chen2019-02-22 15:30:27 -0800
committermergify[bot]2019-02-22 23:30:27 +0000
commit5608aa8f42c1d69b59bee158d14fc6cef9b19a47 (patch)
tree86b7bad9c5f164d12aba9f324bde223e7ff5e9f3 /src/test/scala/firrtlTests/WidthSpec.scala
parent0ace0218d3151df2d102463dd682128a88ae7be6 (diff)
Add Width Constraints with Annotations (#956)
* refactor InferWidths to allow for extra contraints, add InferWidthsWithAnnos * add test cases * add ResolvedAnnotationPaths trait to InferWidthsWithAnnos * remove println * cleanup tests * remove extraneous constraints * use foreachStmt instead of mapStmt * remove support for aggregates * fold InferWidthsWithAnnos into InferWidths * throw exception if ref not found, check for annos before AST walk
Diffstat (limited to 'src/test/scala/firrtlTests/WidthSpec.scala')
-rw-r--r--src/test/scala/firrtlTests/WidthSpec.scala20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/test/scala/firrtlTests/WidthSpec.scala b/src/test/scala/firrtlTests/WidthSpec.scala
index 058cc1fa..96bd249c 100644
--- a/src/test/scala/firrtlTests/WidthSpec.scala
+++ b/src/test/scala/firrtlTests/WidthSpec.scala
@@ -11,10 +11,10 @@ import firrtl.passes._
import firrtl.Parser.IgnoreInfo
class WidthSpec extends FirrtlFlatSpec {
- private def executeTest(input: String, expected: Seq[String], passes: Seq[Pass]) = {
- val c = passes.foldLeft(Parser.parse(input.split("\n").toIterator)) {
- (c: Circuit, p: Pass) => p.run(c)
- }
+ private def executeTest(input: String, expected: Seq[String], passes: Seq[Transform]) = {
+ val c = passes.foldLeft(CircuitState(Parser.parse(input.split("\n").toIterator), UnknownForm)) {
+ (c: CircuitState, p: Transform) => p.runTransform(c)
+ }.circuit
val lines = c.serialize.split("\n") map normalized
expected foreach { e =>
@@ -54,7 +54,7 @@ class WidthSpec extends FirrtlFlatSpec {
InferTypes,
CheckTypes,
ResolveGenders,
- InferWidths,
+ new InferWidths,
CheckWidths)
val input =
"""circuit Unit :
@@ -77,7 +77,7 @@ class WidthSpec extends FirrtlFlatSpec {
InferTypes,
CheckTypes,
ResolveGenders,
- InferWidths,
+ new InferWidths,
CheckWidths)
val input =
s"""circuit Unit :
@@ -96,7 +96,7 @@ class WidthSpec extends FirrtlFlatSpec {
InferTypes,
CheckTypes,
ResolveGenders,
- InferWidths,
+ new InferWidths,
CheckWidths)
val input =
"""circuit Unit :
@@ -121,7 +121,7 @@ class WidthSpec extends FirrtlFlatSpec {
InferTypes,
CheckTypes,
ResolveGenders,
- InferWidths)
+ new InferWidths)
val input =
"""circuit Unit :
| module Unit :
@@ -143,7 +143,7 @@ class WidthSpec extends FirrtlFlatSpec {
InferTypes,
CheckTypes,
ResolveGenders,
- InferWidths)
+ new InferWidths)
val input =
"""circuit Unit :
| module Unit :
@@ -166,7 +166,7 @@ class WidthSpec extends FirrtlFlatSpec {
InferTypes,
CheckTypes,
ResolveGenders,
- InferWidths,
+ new InferWidths,
CheckWidths)
val input =
"""|circuit Foo :