PYNQ icon indicating copy to clipboard operation
PYNQ copied to clipboard

mmio.write() does not accept numpy.uint32 as type of data argument

Open drichmond opened this issue 6 years ago • 0 comments

If I call mmio.write() when data is an instance of np.uint32, the method raises a ValueError. This is funky, because the value of data is cast to an np.uint32 when it is written to the array member variable inside the method.

I fixed this in my own code by adding:

	if isinstance(data, (np.uint32, np.int32)):
            self._debug('Writing 4 bytes to offset {0:x}: {1:x}',
                        offset, data)
            self.array[idx] = data

But you might find a better solution (Hence, a raised issue, and not a PR)

drichmond avatar May 22 '18 21:05 drichmond