soc/tools/remove/comm_uart: limit write bursts to 8 32bits words
This commit is contained in:
parent
6a35337a09
commit
f193873bb8
|
@ -55,9 +55,14 @@ class CommUART:
|
|||
def write(self, addr, data):
|
||||
data = data if isinstance(data, list) else [data]
|
||||
length = len(data)
|
||||
self._write([self.msg_type["write"], length])
|
||||
self._write(list((addr//4).to_bytes(4, byteorder="big")))
|
||||
for i, value in enumerate(data):
|
||||
self._write(list(value.to_bytes(4, byteorder="big")))
|
||||
if self.debug:
|
||||
print("write {:08x} @ {:08x}".format(value, addr + 4*i))
|
||||
offset = 0
|
||||
while length:
|
||||
size = min(length, 8)
|
||||
self._write([self.msg_type["write"], size])
|
||||
self._write(list(((addr+offset)//4).to_bytes(4, byteorder="big")))
|
||||
for i, value in enumerate(data[offset:offset+size]):
|
||||
self._write(list(value.to_bytes(4, byteorder="big")))
|
||||
if self.debug:
|
||||
print("write {:08x} @ {:08x}".format(value, addr + offset, 4*i))
|
||||
offset += size
|
||||
length -= size
|
||||
|
|
Loading…
Reference in New Issue