1
0
Fork 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
1 changed files with 2 additions and 2 deletions

View File

@ -18,8 +18,8 @@ trait Pattern {
case class WritePattern(address: BigInt, size: Int, data: BigInt) extends Pattern
{
require (log2Floor(data) < (BigInt(8) << size))
def bits(edge: TLEdgeOut) = edge.Put(UInt(0), UInt(address), UInt(size), UInt(data))
require (0 <= data && data < (BigInt(1) << (8 << size)))
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