-
Notifications
You must be signed in to change notification settings - Fork 237
Description
On a Windows 11 computer I'm seeing glasgow run benchmark source fail:
I: glasgow.cli: running handler for applet 'benchmark'
I: glasgow.applet.internal.benchmark: running benchmark mode source for 8.000 MiB
E: glasgow.applet.internal.benchmark: mode source failed!
Very rarely, it sometimes succeeds:
I: glasgow.applet.internal.benchmark: running benchmark mode source for 8.000 MiB
I: glasgow.applet.internal.benchmark: mode source: 37.70 MiB/s (301.61 Mb/s)
After comparing the actual vs golden data, it seems there is a 0x400 offset to the test pattern in the actual data. It would seem some initial data is getting lost somehow?
(A future improvement to the benchmark test might be to send the requested length from Python to the FPGA, and have it refuse to send more than the requested amount of data. This likely would have caused an unexpectedly short read in this case, and may have made the bug more visible initially.)
If I comment out iface.reset() here, it consistently works fine (I don't know what the impact of removing the reset() call is though):
glasgow/software/glasgow/applet/internal/benchmark/__init__.py
Lines 155 to 157 in 2b01503
| if mode == "source": | |
| await device.write_register(self.__addr_mode, Mode.SOURCE.value) | |
| await iface.reset() |
Does DirectDemultiplexer.reset() cause a read (or discard some read data) that could interfere with the test?
actual and golden data available here: https://gist.github.com/bburky/ac39a5211eb386c2edcc73e8b29b5397
I'm not an expert in USB debugging, but if there's something specific I can check I'm happy to.