bench/test_etherbone/test_speeed: use bursts.

This commit is contained in:
Florent Kermarrec 2020-11-24 19:46:43 +01:00
parent d1571ad1df
commit f97f6b0635
1 changed files with 6 additions and 5 deletions

View File

@ -104,20 +104,21 @@ def speed_test(port):
wb = RemoteClient(port=port)
wb.open()
test_size = 16*KiB
test_size = 16*KiB
burst_size = 255 # FIXME: Use 256, fix Etherbone encoding.
print("Testing write speed... ", end="")
start = time.time()
for i in range(test_size//4):
wb.write(wb.mems.sram.base + i%0x100, i)
for i in range(test_size//(4*burst_size)):
wb.write(wb.mems.sram.base, [j for j in range(burst_size)])
end = time.time()
duration = (end - start)
print("{:3.2f} KiB/s".format(test_size/(duration*KiB)))
print("Testing read speed... ", end="")
start = time.time()
for i in range(test_size//4):
wb.read(wb.mems.sram.base + i%0x100)
for i in range(test_size//(4*burst_size)):
wb.read(wb.mems.sram.base, length=burst_size)
end = time.time()
duration = (end - start)
print("{:3.2f} KiB/s".format(test_size/(duration*KiB)))