From 95294bbdcb00c3d61c4aa531850e27f97e1b727a Mon Sep 17 00:00:00 2001 From: "Wesley W. Terpstra" Date: Fri, 23 Feb 2018 15:20:56 -0800 Subject: [PATCH] PatternPusher: put data at correct address when misaligned (#1249) --- src/main/scala/tilelink/PatternPusher.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/scala/tilelink/PatternPusher.scala b/src/main/scala/tilelink/PatternPusher.scala index 60ab48cc..253fe4a0 100644 --- a/src/main/scala/tilelink/PatternPusher.scala +++ b/src/main/scala/tilelink/PatternPusher.scala @@ -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