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/Driver.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/Driver.scala')
| -rw-r--r-- | src/main/scala/firrtl/Driver.scala | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/main/scala/firrtl/Driver.scala b/src/main/scala/firrtl/Driver.scala index c8713e09..66e09e86 100644 --- a/src/main/scala/firrtl/Driver.scala +++ b/src/main/scala/firrtl/Driver.scala @@ -18,8 +18,8 @@ import firrtl.transforms._ import firrtl.Utils.throwInternalError import firrtl.stage.{FirrtlExecutionResultView, FirrtlStage} import firrtl.stage.phases.DriverCompatibility -import firrtl.options.{StageUtils, Phase} -import firrtl.options.Viewer +import firrtl.options.{StageUtils, Phase, Viewer} +import firrtl.options.phases.DeletedWrapper /** @@ -216,15 +216,16 @@ object Driver { val annos = optionsManager.firrtlOptions.toAnnotations ++ optionsManager.commonOptions.toAnnotations - val phases: Seq[Phase] = Seq( - new DriverCompatibility.AddImplicitAnnotationFile, - new DriverCompatibility.AddImplicitFirrtlFile, - new DriverCompatibility.AddImplicitOutputFile, - new DriverCompatibility.AddImplicitEmitter, - new FirrtlStage ) + val phases: Seq[Phase] = + Seq( new DriverCompatibility.AddImplicitAnnotationFile, + new DriverCompatibility.AddImplicitFirrtlFile, + new DriverCompatibility.AddImplicitOutputFile, + new DriverCompatibility.AddImplicitEmitter, + new FirrtlStage ) + .map(DeletedWrapper(_)) val annosx = try { - phases.foldLeft(annos)( (a, p) => p.runTransform(a) ) + phases.foldLeft(annos)( (a, p) => p.transform(a) ) } catch { case e: firrtl.options.OptionsException => return FirrtlExecutionFailure(e.message) } |
