diff options
| author | Albert Chen | 2019-02-22 15:30:27 -0800 |
|---|---|---|
| committer | mergify[bot] | 2019-02-22 23:30:27 +0000 |
| commit | 5608aa8f42c1d69b59bee158d14fc6cef9b19a47 (patch) | |
| tree | 86b7bad9c5f164d12aba9f324bde223e7ff5e9f3 /src/test/scala/firrtlTests/fixed | |
| parent | 0ace0218d3151df2d102463dd682128a88ae7be6 (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/fixed')
| -rw-r--r-- | src/test/scala/firrtlTests/fixed/FixedTypeInferenceSpec.scala | 26 | ||||
| -rw-r--r-- | src/test/scala/firrtlTests/fixed/RemoveFixedTypeSpec.scala | 20 |
2 files changed, 23 insertions, 23 deletions
diff --git a/src/test/scala/firrtlTests/fixed/FixedTypeInferenceSpec.scala b/src/test/scala/firrtlTests/fixed/FixedTypeInferenceSpec.scala index a866836f..667db7b0 100644 --- a/src/test/scala/firrtlTests/fixed/FixedTypeInferenceSpec.scala +++ b/src/test/scala/firrtlTests/fixed/FixedTypeInferenceSpec.scala @@ -10,10 +10,10 @@ import firrtl.passes._ import firrtl.Parser.IgnoreInfo class FixedTypeInferenceSpec 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 => @@ -30,7 +30,7 @@ class FixedTypeInferenceSpec extends FirrtlFlatSpec { CheckTypes, ResolveGenders, CheckGenders, - InferWidths, + new InferWidths, CheckWidths) val input = """circuit Unit : @@ -60,7 +60,7 @@ class FixedTypeInferenceSpec extends FirrtlFlatSpec { CheckTypes, ResolveGenders, CheckGenders, - InferWidths, + new InferWidths, CheckWidths) val input = """circuit Unit : @@ -86,7 +86,7 @@ class FixedTypeInferenceSpec extends FirrtlFlatSpec { CheckTypes, ResolveGenders, CheckGenders, - InferWidths, + new InferWidths, CheckWidths) val input = """circuit Unit : @@ -112,7 +112,7 @@ class FixedTypeInferenceSpec extends FirrtlFlatSpec { CheckTypes, ResolveGenders, CheckGenders, - InferWidths, + new InferWidths, CheckWidths) val input = """circuit Unit : @@ -138,7 +138,7 @@ class FixedTypeInferenceSpec extends FirrtlFlatSpec { CheckTypes, ResolveGenders, CheckGenders, - InferWidths, + new InferWidths, CheckWidths) val input = """circuit Unit : @@ -164,7 +164,7 @@ class FixedTypeInferenceSpec extends FirrtlFlatSpec { CheckTypes, ResolveGenders, CheckGenders, - InferWidths, + new InferWidths, CheckWidths) val input = """circuit Unit : @@ -190,7 +190,7 @@ class FixedTypeInferenceSpec extends FirrtlFlatSpec { CheckTypes, ResolveGenders, CheckGenders, - InferWidths, + new InferWidths, CheckWidths) val input = """circuit Unit : @@ -230,7 +230,7 @@ class FixedTypeInferenceSpec extends FirrtlFlatSpec { CheckTypes, ResolveGenders, CheckGenders, - InferWidths, + new InferWidths, CheckWidths) val input = """circuit Unit : @@ -256,7 +256,7 @@ class FixedTypeInferenceSpec extends FirrtlFlatSpec { CheckTypes, ResolveGenders, CheckGenders, - InferWidths, + new InferWidths, CheckWidths, ConvertFixedToSInt) val input = diff --git a/src/test/scala/firrtlTests/fixed/RemoveFixedTypeSpec.scala b/src/test/scala/firrtlTests/fixed/RemoveFixedTypeSpec.scala index 8645fa62..21a39e83 100644 --- a/src/test/scala/firrtlTests/fixed/RemoveFixedTypeSpec.scala +++ b/src/test/scala/firrtlTests/fixed/RemoveFixedTypeSpec.scala @@ -9,10 +9,10 @@ import firrtl.passes._ import firrtl.Parser.IgnoreInfo class RemoveFixedTypeSpec 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 println(c.serialize) @@ -30,7 +30,7 @@ class RemoveFixedTypeSpec extends FirrtlFlatSpec { CheckTypes, ResolveGenders, CheckGenders, - InferWidths, + new InferWidths, CheckWidths, ConvertFixedToSInt) val input = @@ -60,7 +60,7 @@ class RemoveFixedTypeSpec extends FirrtlFlatSpec { CheckTypes, ResolveGenders, CheckGenders, - InferWidths, + new InferWidths, CheckWidths, ConvertFixedToSInt) val input = @@ -91,7 +91,7 @@ class RemoveFixedTypeSpec extends FirrtlFlatSpec { CheckTypes, ResolveGenders, CheckGenders, - InferWidths, + new InferWidths, CheckWidths, ConvertFixedToSInt) val input = @@ -118,7 +118,7 @@ class RemoveFixedTypeSpec extends FirrtlFlatSpec { CheckTypes, ResolveGenders, CheckGenders, - InferWidths, + new InferWidths, CheckWidths, ConvertFixedToSInt) val input = @@ -145,7 +145,7 @@ class RemoveFixedTypeSpec extends FirrtlFlatSpec { CheckTypes, ResolveGenders, CheckGenders, - InferWidths, + new InferWidths, CheckWidths, ConvertFixedToSInt) val input = @@ -197,7 +197,7 @@ class RemoveFixedTypeSpec extends FirrtlFlatSpec { CheckTypes, ResolveGenders, CheckGenders, - InferWidths, + new InferWidths, CheckWidths, ConvertFixedToSInt) val input = |
