remove duplicate compiler annotation

This commit is contained in:
joey0320
2023-02-20 23:58:46 -08:00
parent 9760528f1d
commit a9f9068baf
2 changed files with 1 additions and 28 deletions

View File

@@ -36,14 +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) =>

View File

@@ -28,32 +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))
}