aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/firrtlTests/ZeroWidthTests.scala
diff options
context:
space:
mode:
authorAdam Izraelevitz2017-05-10 11:23:18 -0700
committerGitHub2017-05-10 11:23:18 -0700
commit8b8eb4eac5b353d4d632065c78faf6a706d6aae8 (patch)
tree39e2d9344166b61b376df9d3cd15a4787bcd01f4 /src/test/scala/firrtlTests/ZeroWidthTests.scala
parentaf222c1737fa72fce964190876346bdb7ff220cd (diff)
Update rename2 (#478)
* Added pass name to debug logger * Addresses #459. Rewords transform annotations API. Now, any annotation not propagated by a transform is considered deleted. A new DeletedAnnotation is added in place of it. * Added more stylized debugging style * WIP: make pass transform * WIP: All tests pass, need to pull master * Cleaned up PR * Added rename updates to all core transforms * Added more rename tests, and bugfixes * Renaming tracks non-leaf subfields E.g. given: wire x: {a: UInt<1>, b: UInt<1>[2]} Annotating x.b will eventually annotate x_b_0 and x_b_1 * Bugfix instance rename lowering broken * Address review comments * Remove check for seqTransform, UnknownForm too restrictive check
Diffstat (limited to 'src/test/scala/firrtlTests/ZeroWidthTests.scala')
-rw-r--r--src/test/scala/firrtlTests/ZeroWidthTests.scala21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/test/scala/firrtlTests/ZeroWidthTests.scala b/src/test/scala/firrtlTests/ZeroWidthTests.scala
index 90926bc1..8c39dc1e 100644
--- a/src/test/scala/firrtlTests/ZeroWidthTests.scala
+++ b/src/test/scala/firrtlTests/ZeroWidthTests.scala
@@ -11,7 +11,7 @@ import firrtl.Parser
import firrtl.passes._
class ZeroWidthTests extends FirrtlFlatSpec {
- val passes = Seq(
+ val transforms = Seq(
ToWorkingIR,
ResolveKinds,
InferTypes,
@@ -19,9 +19,10 @@ class ZeroWidthTests extends FirrtlFlatSpec {
InferWidths,
ZeroWidth)
private def exec (input: String) = {
- passes.foldLeft(parse(input)) {
- (c: Circuit, p: Pass) => p.run(c)
- }.serialize
+ val circuit = parse(input)
+ transforms.foldLeft(CircuitState(circuit, UnknownForm)) {
+ (c: CircuitState, p: Transform) => p.runTransform(c)
+ }.circuit.serialize
}
// =============================
"Zero width port" should " be deleted" in {
@@ -105,6 +106,18 @@ class ZeroWidthTests extends FirrtlFlatSpec {
| skip""".stripMargin
(parse(exec(input)).serialize) should be (parse(check).serialize)
}
+ "IsInvalid on <0>" should "be deleted" in {
+ val input =
+ """circuit Top :
+ | module Top :
+ | output y: UInt<0>
+ | y is invalid""".stripMargin
+ val check =
+ """circuit Top :
+ | module Top :
+ | skip""".stripMargin
+ (parse(exec(input)).serialize) should be (parse(check).serialize)
+ }
"Expression in node with type <0>" should "be replaced by UInt<1>(0)" in {
val input =
"""circuit Top :