diff options
| author | Schuyler Eldridge | 2018-08-07 18:38:28 -0400 |
|---|---|---|
| committer | GitHub | 2018-08-07 18:38:28 -0400 |
| commit | 0a2e2c2e4a97fb8d14e7259f779d8398e243e889 (patch) | |
| tree | 5a1286c11553d73541ef2b92ea7ee4d88afd1ca7 /src/test | |
| parent | b84cb05faba6d787cb599fac4ea687ce4249ef1d (diff) | |
| parent | adf66019948afc46f8818e6883f1bab4d200265d (diff) | |
Respect register references in RemoveWires (#868)
- makes RemoveWires properly include registers in dependency graph
- adds an apply method to WRef for DefNode
- adds a test case requiring register reordering
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/scala/firrtlTests/RemoveWiresSpec.scala | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/scala/firrtlTests/RemoveWiresSpec.scala b/src/test/scala/firrtlTests/RemoveWiresSpec.scala index f162f32c..d15e6908 100644 --- a/src/test/scala/firrtlTests/RemoveWiresSpec.scala +++ b/src/test/scala/firrtlTests/RemoveWiresSpec.scala @@ -150,4 +150,19 @@ class RemoveWiresSpec extends FirrtlFlatSpec { val names = orderedNames(result.circuit) names should be (Seq("a", "clock2", "b")) } + + it should "order registers correctly" in { + val result = compileBody(s""" + |input clock : Clock + |input a : UInt<8> + |output c : UInt<8> + |wire w : UInt<8> + |node n = tail(add(w, UInt(1)), 1) + |reg r : UInt<8>, clock + |w <= tail(add(r, a), 1) + |c <= n""".stripMargin + ) + // Check declaration before use is maintained + passes.CheckHighForm.execute(result) + } } |
