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/passes/memlib/MemLibOptions.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/passes/memlib/MemLibOptions.scala')
| -rw-r--r-- | src/main/scala/firrtl/passes/memlib/MemLibOptions.scala | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main/scala/firrtl/passes/memlib/MemLibOptions.scala b/src/main/scala/firrtl/passes/memlib/MemLibOptions.scala index 2f26e4e5..4076d5d6 100644 --- a/src/main/scala/firrtl/passes/memlib/MemLibOptions.scala +++ b/src/main/scala/firrtl/passes/memlib/MemLibOptions.scala @@ -3,13 +3,14 @@ package firrtl.passes.memlib import firrtl._ -import firrtl.options.RegisteredLibrary +import firrtl.options.{RegisteredLibrary, ShellOption} import scopt.OptionParser class MemLibOptions extends RegisteredLibrary { val name: String = "MemLib Options" - def addOptions(p: OptionParser[AnnotationSeq]): Unit = - Seq( new InferReadWrite, - new ReplSeqMem ) - .map(_.addOptions(p)) + + val options: Seq[ShellOption[_]] = Seq( new InferReadWrite, + new ReplSeqMem ) + .flatMap(_.options) + } |
