# Partial reconfigure problem with pynqv2.7

**URL:** <https://discuss.pynq.io/t/partial-reconfigure-problem-with-pynqv2-7/4661>\
**Category:** Support\
**Created:** [September 15, 2022, 1:59am UTC](https://discuss.pynq.io/t/partial-reconfigure-problem-with-pynqv2-7/4661 "2022-09-15T01:59:53Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![luwawa](https://avatars.discourse-cdn.com/v4/letter/l/5fc32e/32.png) [@luwawa](https://discuss.pynq.io/u/luwawa)\
**Post date:** [September 15, 2022, 1:59am UTC](https://discuss.pynq.io/t/partial-reconfigure-problem-with-pynqv2-7/4661/1 "2022-09-15T01:59:54Z")

</div>

-PYNQv2.7, pynq z2, vivado hls 2020.1 and vivado 2020.1

- I uesd simple ip core to test partial reconfiguration.  
void add(int a, int b, int& c) {  
#pragma HLS INTERFACE ap\_ctrl\_none port=return  
#pragma HLS INTERFACE s\_axilite port=a  
#pragma HLS INTERFACE s\_axilite port=b  
#pragma HLS INTERFACE s\_axilite port=c

c = a + b;  
}

 ![image](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/2X/5/528546a40d9751a4411efc51521d90cabbd8f661.jpeg)  
but when I ran in jupyter notebook  
ip = overlay.hier\_0.add\_0  
ip.write(0x18, 6)  
the board will hang out. I am sure the offset is right.

---

<div class="post-metadata">

**Author:** ![marioruiz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/marioruiz/32/2177_2.png) [@marioruiz](https://discuss.pynq.io/u/marioruiz)\
**Post date:** [September 15, 2022, 6:28am UTC](https://discuss.pynq.io/t/partial-reconfigure-problem-with-pynqv2-7/4661/2 "2022-09-15T06:28:29Z")

</div>

Hi @luwawa,

Welcome to the PYNQ community.

There is a small bug when handling PR in pynq. To address this, the base address inside of the reconfigurable module should be 0. Or, you can update the Python code not to (re)use the offset inside of the RM.

You can change this line

> <https://github.com/Xilinx/PYNQ/blob/master/pynq/pl_server/server.py#L355-L356>

to

```python
merged_ip_dict[ip_name]['phys_addr'] = self._ip_dict[parent]['phys_addr']

```

This bug will be solved in the next release.

Mario

---

<div class="post-metadata">

**Author:** ![luwawa](https://avatars.discourse-cdn.com/v4/letter/l/5fc32e/32.png) [@luwawa](https://discuss.pynq.io/u/luwawa)\
**Post date:** [September 15, 2022, 5:43pm UTC](https://discuss.pynq.io/t/partial-reconfigure-problem-with-pynqv2-7/4661/3 "2022-09-15T17:43:30Z")

</div>

Hi marioruiz,

Thank you for your answer! I have a few related questions.

1.ip = overlay.hier\_0.add\_0  
ip.write(0x18, 6)

and

IP\_BASE\_ADDRESS = 0x40000000  
ADDRESS\_RANGE = 0x1000  
ADDRESS\_OFFSET = 0x10  
mmio = MMIO(IP\_BASE\_ADDRESS, ADDRESS\_RANGE)  
data = 0xdeadbeef  
self.mmio.write(ADDRESS\_OFFSET, data)  
result = self.mmio.read(ADDRESS\_OFFSET)

These two methods are actually the same. Is that correct?  
2. In another case, I create an IP core that has axi control signal(offset is 0x00).  
ip = overlay.test  
ip.write(0x00, 0x1)  
isready = ip.read(0x00)  
while (isready == 1): # wait PL to finish  
isready = ip.read(0x00)

I use this way to start the core. But when I use mmio way(mmio.read(0x00), the control signal will never change. Do you know why this happen?  
Thank you very much!

---

<div class="post-metadata">

**Author:** ![marioruiz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/marioruiz/32/2177_2.png) [@marioruiz](https://discuss.pynq.io/u/marioruiz)\
**Post date:** [September 15, 2022, 5:50pm UTC](https://discuss.pynq.io/t/partial-reconfigure-problem-with-pynqv2-7/4661/4 "2022-09-15T17:50:46Z")

</div>

Hi,

The `DefaultIP` gets assigned an MMIO object with the proper base address and range.

For question 1, why are you using `self.`?  
These two methods are the same yes.

For 2, it is likely that the base address for the mmio object is not correct.

Mario

---

<div class="post-metadata">

**Author:** ![luwawa](https://avatars.discourse-cdn.com/v4/letter/l/5fc32e/32.png) [@luwawa](https://discuss.pynq.io/u/luwawa)\
**Post date:** [September 15, 2022, 6:25pm UTC](https://discuss.pynq.io/t/partial-reconfigure-problem-with-pynqv2-7/4661/5 "2022-09-15T18:25:57Z")

</div>

Hi,

Thank you for your reply!

For 1, I mistype. Sorry for that.

For 2, I got correct result in this way(ip = overlay.test), so I think block design is correct. For base address, should I use 0x43C00000? When I use this address, reading 0x00 and it will never change.

 ![image](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/2X/9/927e393b56cb61a9976fdb9def113328c9b769bb.png)  
Do you think there are other potential reasons?

Thanks!

---

<div class="post-metadata">

**Author:** ![marioruiz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/marioruiz/32/2177_2.png) [@marioruiz](https://discuss.pynq.io/u/marioruiz)\
**Post date:** [September 16, 2022, 7:41am UTC](https://discuss.pynq.io/t/partial-reconfigure-problem-with-pynqv2-7/4661/6 "2022-09-16T07:41:17Z")

</div>

Yes, that’s the correct address.  
Did you start the IP? What are you doing before reading from register 0?

---

<div class="post-metadata">

**Author:** ![luwawa](https://avatars.discourse-cdn.com/v4/letter/l/5fc32e/32.png) [@luwawa](https://discuss.pynq.io/u/luwawa)\
**Post date:** [September 18, 2022, 3:01am UTC](https://discuss.pynq.io/t/partial-reconfigure-problem-with-pynqv2-7/4661/7 "2022-09-18T03:01:55Z")

</div>

In this [question](https://discuss.pynq.io/t/partial-reconfiguration-pynq-v2-7/3564), vivado doesn’t generate register information for partial reconfiguration. So can I use mmio.read and mmio.write to replace method(  
ip.s\_axi\_CTRL.register\_map.xxx) without register information in .hwh file?  
Thanks!

---

<div class="post-metadata">

**Author:** ![marioruiz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/marioruiz/32/2177_2.png) [@marioruiz](https://discuss.pynq.io/u/marioruiz)\
**Post date:** [September 19, 2022, 7:02am UTC](https://discuss.pynq.io/t/partial-reconfigure-problem-with-pynqv2-7/4661/8 "2022-09-19T07:02:28Z")

</div>

Yes, you can.

You can also add the register information yourself as indicated in my last comment in that topic.

Mario

---

<div class="post-metadata">

**Author:** ![marioruiz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/marioruiz/32/2177_2.png) [@marioruiz](https://discuss.pynq.io/u/marioruiz)\
**Post date:** [September 19, 2022, 9:05pm UTC](https://discuss.pynq.io/t/partial-reconfigure-problem-with-pynqv2-7/4661/9 "2022-09-19T21:05:43Z")

</div>

Closed on September 19, 2022, 9:05pm UTC


