Merge pull request #126 from ucb-bar/rm-duplicate-compiler-anno
Remove duplicate compiler annotation
This commit is contained in:
@@ -36,17 +36,7 @@ private class GenerateModelStageMain(annotations: AnnotationSeq) extends LazyLog
|
||||
}
|
||||
|
||||
def executeStageMain(): Unit = {
|
||||
val appendedAnnotations = annotations
|
||||
.filter(_ match {
|
||||
case CompilerNameAnnotation(_) => true
|
||||
case _ => false
|
||||
})
|
||||
.map(_ match {
|
||||
case CompilerNameAnnotation("low") => Some(RunFirrtlTransformAnnotation(Dependency[ExtraLowTransforms]))
|
||||
case _ => None
|
||||
})
|
||||
.flatten
|
||||
val annos = new FirrtlStage().execute(Array.empty, annotations ++ appendedAnnotations)
|
||||
val annos = new FirrtlStage().execute(Array.empty, annotations)
|
||||
|
||||
annos.collectFirst { case FirrtlCircuitAnnotation(circuit) => circuit } match {
|
||||
case Some(circuit) =>
|
||||
|
||||
@@ -28,31 +28,12 @@ object OutAnnoAnnotation extends HasShellOptions {
|
||||
)
|
||||
}
|
||||
|
||||
case class CompilerNameAnnotation(name: String) extends NoTargetAnnotation with TapeoutOption
|
||||
|
||||
// duplicate of firrtl.stage.CompilerAnnotation but needed so that you can have a
|
||||
// CompilerAnnotation to match on when adding new transforms
|
||||
object DuplicateCompilerAnnotation extends HasShellOptions {
|
||||
val options: Seq[ShellOption[_]] = Seq(
|
||||
new ShellOption[String](
|
||||
longOption = "duplicate-compiler",
|
||||
shortOption = Some("DX"),
|
||||
toAnnotationSeq = (s: String) => {
|
||||
Seq(CompilerNameAnnotation(s))
|
||||
},
|
||||
helpText = "duplicate-compiler",
|
||||
helpValueName = Some("same as --compiler FIRRTL flag")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
trait TapeoutCli {
|
||||
this: Shell =>
|
||||
parser.note("Tapeout specific options")
|
||||
|
||||
Seq(
|
||||
OutAnnoAnnotation,
|
||||
DuplicateCompilerAnnotation
|
||||
).foreach(_.addOptions(parser))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user