Skip to content

Commit

Permalink
Merge pull request #126 from ucb-bar/rm-duplicate-compiler-anno
Browse files Browse the repository at this point in the history
Remove duplicate compiler annotation
  • Loading branch information
abejgonzalez authored Mar 2, 2023
2 parents c58458e + 3090096 commit 39b4af7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

Expand Down

0 comments on commit 39b4af7

Please sign in to comment.