1
0

PatternPusher: put data at correct address when misaligned (#1249)

This commit is contained in:
Wesley W. Terpstra 2018-02-23 15:20:56 -08:00 committed by GitHub
parent 87eed645d8
commit 95294bbdcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,8 +18,8 @@ trait Pattern {
case class WritePattern(address: BigInt, size: Int, data: BigInt) extends Pattern case class WritePattern(address: BigInt, size: Int, data: BigInt) extends Pattern
{ {
require (log2Floor(data) < (BigInt(8) << size)) require (0 <= data && data < (BigInt(1) << (8 << size)))
def bits(edge: TLEdgeOut) = edge.Put(UInt(0), UInt(address), UInt(size), UInt(data)) def bits(edge: TLEdgeOut) = edge.Put(UInt(0), UInt(address), UInt(size), UInt(data << (8*(address % edge.manager.beatBytes).toInt)))
} }
case class ReadPattern(address: BigInt, size: Int) extends Pattern case class ReadPattern(address: BigInt, size: Int) extends Pattern