1
0

Merge remote-tracking branch 'origin/master' into periphery-adjustments

This commit is contained in:
Henry Cook
2017-02-27 19:40:55 -08:00
12 changed files with 29 additions and 25 deletions

View File

@ -5,6 +5,7 @@ package uncore.apb
import Chisel._
import config._
import diplomacy._
import util._
class APBRAM(address: AddressSet, executable: Boolean = true, beatBytes: Int = 4)(implicit p: Parameters) extends LazyModule
{
@ -34,7 +35,6 @@ class APBRAM(address: AddressSet, executable: Boolean = true, beatBytes: Int = 4
// Use single-ported memory with byte-write enable
val mem = SeqMem(1 << mask.filter(b=>b).size, Vec(beatBytes, Bits(width = 8)))
def holdUnless[T <: Data](in : T, enable: Bool): T = Mux(!enable, RegEnable(in, enable), in)
val read = in.psel && !in.penable && !in.pwrite
when (in.psel && !in.penable && in.pwrite) {
@ -43,6 +43,6 @@ class APBRAM(address: AddressSet, executable: Boolean = true, beatBytes: Int = 4
in.pready := Bool(true)
in.pslverr := Bool(false)
in.prdata := holdUnless(mem.read(paddr, read).asUInt, RegNext(read))
in.prdata := mem.readAndHold(paddr, read).asUInt
}
}