RegMapper: regmap(...) now takes BYTE addresses
If a device has configurable bus-width, we need a stable way of enumerating registers. The byte offset stays unchanged. This change also makes it possible to put an arbitrary number of RegFields starting at some address which are then chopped up into appropriately bus- sized registers.
This commit is contained in:
@ -85,7 +85,9 @@ case class RegField(width: Int, read: RegReadFn, write: RegWriteFn)
|
||||
|
||||
object RegField
|
||||
{
|
||||
// Byte address => sequence of bitfields, lowest index => lowest address
|
||||
type Map = (Int, Seq[RegField])
|
||||
|
||||
def apply(n: Int) : RegField = apply(n, (), ())
|
||||
def apply(n: Int, rw: UInt) : RegField = apply(n, rw, rw)
|
||||
def r(n: Int, r: RegReadFn) : RegField = apply(n, r, ())
|
||||
|
Reference in New Issue
Block a user