Added range function in IdRange
Added source accessor function in TLEdge
This commit is contained in:
parent
8225676a86
commit
83a83c778a
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user