PYNQ 2.7, Could not find IP or hierarchy write in overlay

Hi,

I was able to get the scalar_addition done in the tutorial. Now, I want to do vector addition and found a very related post(the example in the post is adding constant value to each element in the input vector).
When I run the code below,

overlay = Overlay("design_1_wrapper.bit")
ip = overlay.test

in_arr = allocate(shape=(10,),dtype=np.int32)
out_arr = allocate(shape=(10,),dtype=np.int32)
np_in = np.array([-3,-1,1,3,5,7,9,11,13,15],dtype=np.int32)
np_out = np.zeros((10,), dtype=np.int32)

np.copyto(in_arr,np_in)
np.copyto(out_arr,np_out)

ip.write(0x10, in_arr.device_address) # error!

it has an error below.

Traceback (most recent call last):
  File "adder.py", line 40, in <module>
    ip.write(0x10, in_arr.device_address)
  File "/usr/local/share/pynq-venv/lib/python3.8/site-packages/pynq/overlay.py", line 903, in __getattr__
    raise AttributeError(
AttributeError: Could not find IP or hierarchy write in overlay

When I do

for i in overlay:
    print(i)

the output is below.

test/s_axi_control
test/s_axi_CTRL
zynq_ultra_ps_e_0

I am using 2020.2 xilinx tools and PYNQ 2.7 with Ultra96v2 board.
Can anyone direct me to the related example if there is one?

Thanks in advance.

I attached some related files too!
xtest_hw.h (1.9 KB)
design_1_wrapper.hwh (351.5 KB)

1 Like

I was able to resolve by doing
ip = overlay.test.s_axi_control.
I haven’t tested, but accessing like overlay.test.register_map.in_arr_1 should work too.

1 Like