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

Commit

Permalink
fixup! Fix bug in zero-width memory removal (#2153)
Browse files Browse the repository at this point in the history
  • Loading branch information
seldridge committed Mar 26, 2021
1 parent 4b3b016 commit a83f7be
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions src/main/scala/firrtl/passes/ZeroWidth.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,6 @@ object ZeroWidth extends Transform {
def inputForm: CircuitForm = UnknownForm
def outputForm: CircuitForm = UnknownForm

<<<<<<< HEAD
private def makeEmptyMemBundle(name: String): Field =
Field(name, Flip, BundleType(Seq(
Field("addr", Default, UIntType(IntWidth(0))),
Field("en", Default, UIntType(IntWidth(0))),
Field("clk", Default, UIntType(IntWidth(0))),
Field("data", Flip, UIntType(IntWidth(0)))
)))

private def onEmptyMemStmt(s: Statement): Statement = s match {
case d @ DefMemory(info, name, tpe, _, _, _, rs, ws, rws, _) => removeZero(tpe) match {
case None =>
DefWire(info, name, BundleType(
rs.map(r => makeEmptyMemBundle(r)) ++
ws.map(w => makeEmptyMemBundle(w)) ++
rws.map(rw => makeEmptyMemBundle(rw))
))
case Some(_) => d
}
case sx => sx map onEmptyMemStmt
=======
private def makeZero(tpe: ir.Type): ir.Type = tpe match {
case ClockType => UIntType(IntWidth(0))
case a: UIntType => a.copy(IntWidth(0))
Expand All @@ -53,7 +32,6 @@ object ZeroWidth extends Transform {
case Some(_) => d
}
case sx => sx.map(onEmptyMemStmt)
>>>>>>> 67ce97a1... Fix bug in zero-width memory removal (#2153)
}

private def onModuleEmptyMemStmt(m: DefModule): DefModule = {
Expand Down

0 comments on commit a83f7be

Please sign in to comment.