1
0

Merge pull request #544 from ucb-bar/jchang

Added access function
This commit is contained in:
Jacob Chang 2017-02-02 14:56:23 -08:00 committed by GitHub
commit 094b3bc2b1
2 changed files with 11 additions and 0 deletions

View File

@ -39,6 +39,8 @@ case class IdRange(start: Int, end: Int)
def shift(x: Int) = IdRange(start+x, end+x)
def size = end - start
def range = start until end
}
// An potentially empty inclusive range of 2-powers [min, max] (in bytes)

View File

@ -158,6 +158,15 @@ class TLEdge(
}
}
def source(x: TLDataChannel): UInt = {
x match {
case a: TLBundleA => a.source
case b: TLBundleB => b.source
case c: TLBundleC => c.source
case d: TLBundleD => d.source
}
}
def addr_hi(x: UInt): UInt = x >> log2Ceil(manager.beatBytes)
def addr_lo(x: UInt): UInt =
if (manager.beatBytes == 1) UInt(0) else x(log2Ceil(manager.beatBytes)-1, 0)