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