Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Commit

Permalink
Establish a fixed relative order for FPGA-backed passes + reflect in …
Browse files Browse the repository at this point in the history
…ScalaDoc
  • Loading branch information
albert-magyar committed Apr 5, 2021
1 parent 78dc3d0 commit a95df00
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/main/scala/firrtl/stage/FirrtlCompilerTargets.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ import firrtl.options.{HasShellOptions, ShellOption}
* to any particular vendor; instead, they aim to emit simple Verilog that more closely reflects traditional
* human-written definitions of synchronous-read memories.
*
* 1) Add a [[firrtl.passes.memlib.PassthroughSimpleSyncReadMemsAnnotation]] to allow some synchronous-read memories
* and readwrite ports to pass through [[firrtl.passes.memlib.VerilogMemDelays]] without introducing explicit
* pipeline registers or splitting ports.
* 1) Enable the [[firrtl.passes.memlib.InferReadWrite]] transform to reduce port count, where applicable.
*
* 2) Use the [[firrtl.transforms.SimplifyMems]] transform to Lower aggregate-typed memories with always-high masks to
* packed memories without splitting them into multiple independent ground-typed memories.
Expand All @@ -30,7 +28,10 @@ import firrtl.options.{HasShellOptions, ShellOption}
* default. This eliminates the difficulty of inferring a RAM macro that matches the strict semantics of
* "write-first" ports.
*
* 5) Enable the [[firrtl.passes.memlib.InferReadWrite]] transform to reduce port count, where applicable.
* 5) Add a [[firrtl.passes.memlib.PassthroughSimpleSyncReadMemsAnnotation]] to allow some synchronous-read memories
* and readwrite ports to pass through [[firrtl.passes.memlib.VerilogMemDelays]] without introducing explicit
* pipeline registers or splitting ports.
*
*/
object OptimizeForFPGA extends HasShellOptions {
private val fpgaAnnos = Seq(
Expand Down
3 changes: 2 additions & 1 deletion src/main/scala/firrtl/transforms/SimplifyMems.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package transforms
import firrtl.ir._
import firrtl.Mappers._
import firrtl.annotations._
import firrtl.options.Dependency
import firrtl.passes._
import firrtl.passes.memlib._
import firrtl.stage.Forms
Expand All @@ -21,7 +22,7 @@ import ResolveMaskGranularity._
class SimplifyMems extends Transform with DependencyAPIMigration {

override def prerequisites = Forms.MidForm
override def optionalPrerequisites = Seq.empty
override def optionalPrerequisites = Seq(Dependency[InferReadWrite])
override def optionalPrerequisiteOf = Forms.MidEmitters
override def invalidates(a: Transform) = a match {
case InferTypes => true
Expand Down

0 comments on commit a95df00

Please sign in to comment.