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 6fbc976 commit 88bc6fb
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 @@ -24,27 +24,6 @@ object ZeroWidth extends Transform with DependencyAPIMigration {
case _ => false
}

<<<<<<< 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 @@ -66,7 +45,6 @@ object ZeroWidth extends Transform with DependencyAPIMigration {
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 88bc6fb

Please sign in to comment.