From f86d72c9cd2526fc33528cc6a8023d1c313c4eb2 Mon Sep 17 00:00:00 2001 From: Schuyler Eldridge Date: Thu, 21 Jun 2018 15:05:31 -0400 Subject: --infer-rw should take no argument (#829) This fixes --infer-rw to not expect an argument. After the annotations refactor, no option was required, but some legacy code remained. This also updates the test cases to be more correct and not specify an option to --infer-rw. Signed-off-by: Schuyler Eldridge --- src/main/scala/firrtl/ExecutionOptionsManager.scala | 4 +--- src/test/scala/firrtlTests/DriverSpec.scala | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/main/scala/firrtl/ExecutionOptionsManager.scala b/src/main/scala/firrtl/ExecutionOptionsManager.scala index b359ba5e..f8caf842 100644 --- a/src/main/scala/firrtl/ExecutionOptionsManager.scala +++ b/src/main/scala/firrtl/ExecutionOptionsManager.scala @@ -406,9 +406,8 @@ trait HasFirrtlOptions { """Inline one or more module (comma separated, no spaces) module looks like "MyModule" or "MyModule.myinstance""" } - parser.opt[String]("infer-rw") + parser.opt[Unit]("infer-rw") .abbr("firw") - .valueName ("") .foreach { x => firrtlOptions = firrtlOptions.copy( annotations = firrtlOptions.annotations :+ InferReadWriteAnnotation, @@ -585,4 +584,3 @@ class ExecutionOptionsManager(val applicationName: String) extends HasParser(app s"$directoryName$baseName$normalizedSuffix" } } - diff --git a/src/test/scala/firrtlTests/DriverSpec.scala b/src/test/scala/firrtlTests/DriverSpec.scala index 43275392..4afd5674 100644 --- a/src/test/scala/firrtlTests/DriverSpec.scala +++ b/src/test/scala/firrtlTests/DriverSpec.scala @@ -183,7 +183,7 @@ class DriverSpec extends FreeSpec with Matchers with BackendCompilationUtilities val optionsManager = new ExecutionOptionsManager("test") with HasFirrtlOptions optionsManager.parse( - Array("--infer-rw", "circuit") + Array("--infer-rw") ) should be(true) val firrtlOptions = optionsManager.firrtlOptions @@ -334,7 +334,7 @@ class DriverSpec extends FreeSpec with Matchers with BackendCompilationUtilities val annoFile = new File(targetDir, "annotations.anno") optionsManager.parse( - Array("--infer-rw", "circuit", "-faf", annoFile.toString) + Array("--infer-rw", "-faf", annoFile.toString) ) should be(true) copyResourceToFile("/annotations/SampleAnnotations.anno.json", annoFile) -- cgit v1.2.3