You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an overlay has 64-bit wide registers, the register_map member of the overlay cannot be elaborated due to the following error:
Traceback (most recent call last):
File "./test.py", line 8, in <module>
print(ip.register_map)
File "/home/xilinx/pynq/registers.py", line 438, in __repr__
" {} = {}".format(k, repr(v)))
File "/home/xilinx/pynq/registers.py", line 277, in __repr__
return "Register(value={})".format(self[:])
File "/home/xilinx/pynq/registers.py", line 166, in __getitem__
return int((curr_val & mask) >> stop)
TypeError: ufunc 'right_shift' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
The mechanism behind is that type(curr_val & mask) becomes numpy.uint64 when mask does not fit within 32-bit, and numpy.uint64 somehow cannot be right-shifted as shown in this code:
>>> import numpy as np
>>> curr_val = np.uint32(1)
>>> mask = 18446744073709551615
>>> type(curr_val & mask)
<class 'numpy.uint64'>
>>> (curr_val & mask) >> 1
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: ufunc 'right_shift' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
>>>
On the other hand, when mask is smaller (e.g., 4294967294), typeof(curr_val & mask) is numpy.int64 (not uint), which can be right-sifted without an error.
The text was updated successfully, but these errors were encountered:
PYNQ version: v2.5
Board name: PYNQ-Z1
When an overlay has 64-bit wide registers, the register_map member of the overlay cannot be elaborated due to the following error:
The mechanism behind is that
type(curr_val & mask)
becomesnumpy.uint64
whenmask
does not fit within 32-bit, andnumpy.uint64
somehow cannot be right-shifted as shown in this code:On the other hand, when mask is smaller (e.g., 4294967294),
typeof(curr_val & mask)
isnumpy.int64
(not uint), which can be right-sifted without an error.The text was updated successfully, but these errors were encountered: