Skip to content

Commit

Permalink
fixup! Use CustomFileEmission for ChiselCircuitAnnotation
Browse files Browse the repository at this point in the history
  • Loading branch information
seldridge committed Aug 10, 2020
1 parent 66512ff commit 308e16b
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/main/scala/chisel3/stage/ChiselAnnotations.scala
Expand Up @@ -109,18 +109,14 @@ case class ChiselCircuitAnnotation(circuit: Circuit)
*/
override lazy val hashCode: Int = circuit.hashCode

protected def baseFileName: String = circuit.name
protected def baseFileName(annotations: AnnotationSeq): String = {
view[ChiselOptions](annotations).outputFile.getOrElse(circuit.name)
}

protected def suffix: Option[String] = Some(".fir")

override def toBytes: Option[Iterable[Byte]] = Some(OldEmitter.emit(circuit).map(_.toByte))

override def filename(annotations: AnnotationSeq): File = {
val sopts = view[StageOptions](annotations)
val copts = view[ChiselOptions](annotations)
new File(sopts.getBuildFileName(copts.outputFile.getOrElse(baseFileName), suffix))
}

}

case class ChiselOutputFileAnnotation(file: String) extends NoTargetAnnotation with ChiselOption with Unserializable
Expand Down

0 comments on commit 308e16b

Please sign in to comment.