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:
Andrew Waterman committed 2017-02-25 03:07:49 -08:00
1 parent fd972f5c67
commit dfa61bc487
9 files changed
+25 -22

No files matched your search

+2 -1
View File
@@ -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)