diff options
| author | Schuyler Eldridge | 2019-04-22 21:20:08 -0400 |
|---|---|---|
| committer | Schuyler Eldridge | 2019-04-25 16:24:15 -0400 |
| commit | ef8f06f23b9ee6cf86de2450752dfd0fcd32da80 (patch) | |
| tree | 79e2e8c5753903ca6d14e9b952c26a07442bd980 /src/main/scala/firrtl/transforms/CheckCombLoops.scala | |
| parent | 47fe781c4ace38dff7f31da7e78f772e131d689e (diff) | |
Add ShellOption, DeletedWrapper
Abstracts away option writing such that users no longer have to
understand scopt semantics. This adds a ShellOption class and a
HasShellOptions trait for something which provides one or more
ShellOptions. This refactors the FIRRTL codebase to use this style of
option specification.
Adds and uses DeletedWrapper to automatically generate
DeletedAnnotations.
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
Diffstat (limited to 'src/main/scala/firrtl/transforms/CheckCombLoops.scala')
| -rw-r--r-- | src/main/scala/firrtl/transforms/CheckCombLoops.scala | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/scala/firrtl/transforms/CheckCombLoops.scala b/src/main/scala/firrtl/transforms/CheckCombLoops.scala index 0a9ec0e3..17e1569b 100644 --- a/src/main/scala/firrtl/transforms/CheckCombLoops.scala +++ b/src/main/scala/firrtl/transforms/CheckCombLoops.scala @@ -17,7 +17,7 @@ import firrtl.annotations._ import firrtl.Utils.throwInternalError import firrtl.graph.{MutableDiGraph,DiGraph} import firrtl.analyses.InstanceGraph -import firrtl.options.RegisteredTransform +import firrtl.options.{RegisteredTransform, ShellOption} import scopt.OptionParser object CheckCombLoops { @@ -69,11 +69,11 @@ class CheckCombLoops extends Transform with RegisteredTransform { import CheckCombLoops._ - def addOptions(parser: OptionParser[AnnotationSeq]): Unit = parser - .opt[Unit]("no-check-comb-loops") - .action( (x, c) => c :+ DontCheckCombLoopsAnnotation ) - .maxOccurs(1) - .text("Do NOT check for combinational loops (not recommended)") + val options = Seq( + new ShellOption[Unit]( + longOption = "no-check-comb-loops", + toAnnotationSeq = (_: Unit) => Seq(DontCheckCombLoopsAnnotation), + helpText = "Disable combinational loop checking" ) ) /* * A case class that represents a net in the circuit. This is |
