Standardize Data.holdUnless and SeqMem.readAndHold
- Make API more idiomatic (x holdUnless y, instead of holdUnless(x, y)) - Add new SeqMem API, readAndHold, which corresponds to most common use of holdUnless
This commit is contained in:
@ -5,6 +5,7 @@ package uncore.tilelink2
|
||||
import Chisel._
|
||||
import config._
|
||||
import diplomacy._
|
||||
import util._
|
||||
|
||||
class TLRAM(address: AddressSet, executable: Boolean = true, beatBytes: Int = 4)(implicit p: Parameters) extends LazyModule
|
||||
{
|
||||
@ -73,7 +74,7 @@ class TLRAM(address: AddressSet, executable: Boolean = true, beatBytes: Int = 4)
|
||||
mem.write(memAddress, wdata, in.a.bits.mask.toBools)
|
||||
}
|
||||
val ren = in.a.fire() && read
|
||||
rdata := holdUnless(mem.read(memAddress, ren), RegNext(ren))
|
||||
rdata := mem.readAndHold(memAddress, ren)
|
||||
|
||||
// Tie off unused channels
|
||||
in.b.valid := Bool(false)
|
||||
|
Reference in New Issue
Block a user