# Why is one IP of my custom overlay is not working

**URL:** <https://discuss.pynq.io/t/why-is-one-ip-of-my-custom-overlay-is-not-working/3393>\
**Category:** Support\
**Created:** [December 6, 2021, 3:39pm UTC](https://discuss.pynq.io/t/why-is-one-ip-of-my-custom-overlay-is-not-working/3393 "2021-12-06T15:39:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anoir\_nechi](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@anoir\_nechi](https://discuss.pynq.io/u/anoir_nechi)\
**Post date:** [December 6, 2021, 3:39pm UTC](https://discuss.pynq.io/t/why-is-one-ip-of-my-custom-overlay-is-not-working/3393/1 "2021-12-06T15:39:54Z")

</div>

Hello  
I created a custom overlay with 2 different IPs and generated the bitstream with no problem. when I run the first IP, get the correct results. However, When I run my second IP the results are 0s (knowing that I testbench the HLS IP successfully). please check the block design below

 ![bd](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/2X/3/398e3f6bdcc182240c976642d4abd1cba9dd5ddb.png)

And when I check the list of IPs in the overlay I get the following:

```auto
from pynq import allocate, Overlay
import numpy as np
ol = Overlay('ns_accel.bit')
for i in ol.ip_dict:
    print(I)
# dual_gap_0
# ns_kernel_0
# zynq_ultra_ps_e_0

ns_ip = ol.ns_kernel_0

M = 144
N = 32400

At_buffer = allocate(shape=(N,M), dtype=np.float64)
Z_buffer = allocate(shape=(M), dtype=np.float64)
X_buffer = allocate(shape=(N), dtype=np.float64)
diagxtx_buffer = allocate(shape=(N), dtype=np.float64)
Pin_b = allocate(shape=(6), dtype=np.float64)

G_buffer = allocate(shape=(N), dtype=np.float64)
PRB_buffer = allocate(shape=(N), dtype=np.float64)
D1_buffer = allocate(shape=(N), dtype=np.float64)
Pout_b = allocate(shape=(2), dtype=np.float64)

def run_ns():
    ns_ip.write(0x10, At_buffer.physical_address)
    ns_ip.write(0x18, Z_buffer.physical_address)
    ns_ip.write(0x20, X_buffer.physical_address)
    ns_ip.write(0x28, diagxtx_buffer.physical_address)
    ns_ip.write(0x30, Pin_b.physical_address)
    ns_ip.write(0x38, G_buffer.physical_address)
    ns_ip.write(0x40, D1_buffer.physical_address)
    ns_ip.write(0x48, PRB_buffer.physical_address)
    ns_ip.write(0x50, Pout_b.physical_address)
    ns_ip.write(0x00, 1)

A = np.arange(0.0,M*N,1, dtype=np.float64).reshape(N,M)
Z = np.ones(M,dtype=np.float64)*2
X = np.ones(N,dtype=np.float64)*3
dgxtx = np.ones(N,dtype=np.float64)*0.2

s = 1
t = 0.2
MU = 4
lmbda = 1.4
eta = 0.5
gap = 2.6
Pi = np.array([s, t, MU, lmbda, eta, gap],dtype=np.float64)

At_buffer[:] = A
Z_buffer[:] = Z
X_buffer[:] = X
diagxtx_buffer[:] = dgxtx
Pin_b[:] = Pi

run_ns()

for i in range(N):
    print(D1_buffer[I])

# 0.0
# 0.0
# 0.0
# 0.0 ....

```

What could be the problem?

---

<div class="post-metadata">

**Author:** ![cathalmccabe](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/cathalmccabe/32/3348_2.png) [@cathalmccabe](https://discuss.pynq.io/u/cathalmccabe)\
**Post date:** [December 6, 2021, 6:51pm UTC](https://discuss.pynq.io/t/why-is-one-ip-of-my-custom-overlay-is-not-working/3393/2 "2021-12-06T18:51:45Z")

</div>

Are you only showing code for the IP that doesn’t work?

Do you leave enough time for the IP to complete before you check the results?

Is your IP using 64-bit floats?

Cathal

---

<div class="post-metadata">

**Author:** ![anoir\_nechi](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@anoir\_nechi](https://discuss.pynq.io/u/anoir_nechi)\
**Post date:** [December 8, 2021, 10:02am UTC](https://discuss.pynq.io/t/why-is-one-ip-of-my-custom-overlay-is-not-working/3393/3 "2021-12-08T10:02:54Z")

</div>

Hello @cathalmccabe

I am showing the code only for the IP that does not work (ns\_kernel\_0 in the block design).  
Yes, I am leaving enough time before I check the results.  
My IP is using double (float 64-bit)

Further Info:  
I used vivado 2018.2 to generate the HLS IP and create the design.  
I use a specific AXI4 HP port for each IP to avoid addresses overlapping.

Could you please help? This is critical for my work I need to be able to put all the IPs in one design to be able to benchmark them later with overwriting the overlay.

Thank you

---

<div class="post-metadata">

**Author:** ![cathalmccabe](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/cathalmccabe/32/3348_2.png) [@cathalmccabe](https://discuss.pynq.io/u/cathalmccabe)\
**Post date:** [December 9, 2021, 9:44am UTC](https://discuss.pynq.io/t/why-is-one-ip-of-my-custom-overlay-is-not-working/3393/4 "2021-12-09T09:44:16Z")

</div>

Do you know if you output buffer gets written at all (i.e. with all zeros) or if the IP does not write anything back? You could try initialise your output buffer with some known non-zero value and check if it changes.  
One possible problem I’ve seen people make with floating point -  
Say you have an int value of 100. This is 0x00000064 represented as a 32-bit hex value. This should get converted to 0x42800000 (64.0) in float. If it does not get formatted properly and is sent as the value 0x00000064, this is 1.4013e-43 in float. This can mean your IP processes very small numbers and the results are zero.

Have you tried use register\_map to readback the status register of the IP that isn’t working?  
You should try check the IP starts (i.e. you write the correct start bit) and that the IP completes - is not stuck.

After that I think I would try add ILA probes (CHipScope) to the IP inputs/outputs to check what is happening.

Cathal
