diff options
| author | Albert Magyar | 2018-06-28 22:15:28 -0700 |
|---|---|---|
| committer | Jack Koenig | 2018-06-28 22:15:28 -0700 |
| commit | 4ee238fc482aab582130cc4c3bb067cc3e872ce4 (patch) | |
| tree | 98e6fa5a1789c3d52d03510661c009b9ee450fbd /src/test | |
| parent | 3243f05a69b4b77761699be412f349a9b8b9193f (diff) | |
Make CheckCombLoops find combinational nodes with self-edges (#837)
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/scala/firrtlTests/CheckCombLoopsSpec.scala | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/scala/firrtlTests/CheckCombLoopsSpec.scala b/src/test/scala/firrtlTests/CheckCombLoopsSpec.scala index 06cbb8e4..d09b4d06 100644 --- a/src/test/scala/firrtlTests/CheckCombLoopsSpec.scala +++ b/src/test/scala/firrtlTests/CheckCombLoopsSpec.scala @@ -70,6 +70,21 @@ class CheckCombLoopsSpec extends SimpleTransformSpec { } } + "Single-element combinational loop" should "throw an exception" in { + val input = """circuit loop : + | module loop : + | output y : UInt<8> + | wire w : UInt<8> + | w <= w + | y <= w + |""".stripMargin + + val writer = new java.io.StringWriter + intercept[CheckCombLoops.CombLoopException] { + compile(CircuitState(parse(input), ChirrtlForm), writer) + } + } + "Node combinational loop" should "throw an exception" in { val input = """circuit hasloops : | module hasloops : |
