-
Notifications
You must be signed in to change notification settings - Fork 656
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For FireSim, support FIRRTL2 bridge + Chisel 6 annos
- All targets now compile w/ Chisel6 - Remove Chisel3 references as much as possible
- Loading branch information
1 parent
87edef0
commit 532db47
Showing
29 changed files
with
99 additions
and
565 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package firechip.core.firesim | ||
|
||
import firrtl.{AnnotationSeq} | ||
import firrtl.options.{StageMain, Phase, Dependency, StageOptions} | ||
import firrtl.options.Viewer.view | ||
import chipyard.stage._ | ||
import chipyard.stage.phases.{PreservesAll} | ||
|
||
object Generator extends StageMain(new FireSimStage) | ||
|
||
class FireSimStage extends ChipyardStage { | ||
override def extraPostPhases = Seq(Dependency[LegacyFirrtl2Emission]) | ||
} | ||
|
||
final class LegacyFirrtl2Emission extends Phase with PreservesAll with HasChipyardStageUtils { | ||
override val prerequisites = Seq(Dependency[chipyard.stage.ChipyardChiselStage]) | ||
|
||
override def transform(annotations: AnnotationSeq): AnnotationSeq = { | ||
val targetDir = view[StageOptions](annotations).targetDir | ||
val fileName = s"${view[ChipyardOptions](annotations).longName.get}.sfc.fir" | ||
|
||
val annos = annotations.filterNot(_.isInstanceOf[firrtl.options.TargetDirAnnotation]) | ||
|
||
val converted = firrtl2.bridge.ChiselBridge.annosToState(annos) | ||
val emitter = new firrtl2.ChirrtlEmitter | ||
val circuit = converted.copy(annotations = converted.annotations ++ Seq( | ||
firrtl2.EmitCircuitAnnotation(classOf[firrtl2.ChirrtlEmitter]) | ||
)) | ||
val emitted = emitter.execute(circuit) | ||
val emittedCircuit = emitted.annotations.collectFirst { case firrtl2.EmittedFirrtlCircuitAnnotation(circuit) => circuit }.get | ||
writeOutputFile(targetDir, fileName, emittedCircuit.value) | ||
|
||
annotations | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.1.1") | ||
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.4") | ||
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.6") | ||
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.1") | ||
addSbtPlugin("com.simplytyped" % "sbt-antlr4" % "0.8.2") | ||
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0") |
Submodule firesim
updated
9 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule dsptools-chisel3
deleted from
8f4336
Submodule fixedpoint-chisel3
deleted from
36ce43
Submodule midas-targetutils
deleted from
d0fc62
66 changes: 0 additions & 66 deletions
66
tools/stage-chisel3/src/main/scala/ChipyardAnnotations.scala
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.