Skip to content

Commit

Permalink
LatchReg file now use ff core control path to ease timing constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
Dolu1990 committed Feb 8, 2024
1 parent d51b924 commit 6aeaba2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/scala/naxriscv/misc/RegFilePlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,15 @@ class RegFileLatch(addressWidth : Int,

val writeFrontend = new Area {
@dontName val clock = ClockDomain.current.readClockWire
val buffers = for (port <- io.writes) yield LatchWhen(port.data, clock)
// val buffers = for (port <- io.writes) yield RegNext(port.data)
// val buffers = for (port <- io.writes) yield LatchWhen(port.data, clock)
val buffers = for (port <- io.writes) yield RegNext(port.data)
}

val latches = for (i <- headZero.toInt until (1 << addressWidth)/fakeRatio) yield new Area {
val write = new Area {
val mask = B(io.writes.map(port => port.valid && port.address === i))
val maskReg = LatchWhen(mask, writeFrontend.clock)
val validReg = LatchWhen(mask.orR, writeFrontend.clock)
val maskReg = RegNext(mask)
val validReg = RegNext(mask.orR)
val data = OhMux.or(maskReg, writeFrontend.buffers)
val sample = !writeFrontend.clock && validReg
}
Expand Down

0 comments on commit 6aeaba2

Please sign in to comment.