From 541003c59c73ecce6d38020ecc3cf537dd214fd9 Mon Sep 17 00:00:00 2001 From: Jack Koenig Date: Mon, 12 Jun 2017 13:58:26 -0700 Subject: Add option to disable combinational loop detection Resolves #600 --- src/test/scala/firrtlTests/CheckCombLoopsSpec.scala | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/test/scala') diff --git a/src/test/scala/firrtlTests/CheckCombLoopsSpec.scala b/src/test/scala/firrtlTests/CheckCombLoopsSpec.scala index dfb61843..2c12d4ca 100644 --- a/src/test/scala/firrtlTests/CheckCombLoopsSpec.scala +++ b/src/test/scala/firrtlTests/CheckCombLoopsSpec.scala @@ -8,6 +8,8 @@ import firrtl.passes._ import firrtl.transforms._ import firrtl.Mappers._ import annotations._ +import java.io.File +import java.nio.file.Paths class CheckCombLoopsSpec extends SimpleTransformSpec { @@ -147,5 +149,22 @@ class CheckCombLoopsSpec extends SimpleTransformSpec { compile(CircuitState(parse(input), ChirrtlForm, None), writer) } } +} + +class CheckCombLoopsCommandLineSpec extends FirrtlFlatSpec { + val testDir = createTestDirectory("CombLoopChecker") + val inputFile = Paths.get(getClass.getResource("/features/HasLoops.fir").toURI()).toFile() + val outFile = new File(testDir, "HasLoops.v") + val args = Array("-i", inputFile.getAbsolutePath, "-o", outFile.getAbsolutePath, "-X", "verilog") + + "Combinational loops detection" should "run by default" in { + a [CheckCombLoops.CombLoopException] should be thrownBy { + firrtl.Driver.execute(args) + } + } + + it should "not run when given --no-check-comb-loops option" in { + firrtl.Driver.execute(args :+ "--no-check-comb-loops") + } } -- cgit v1.2.3