# Any "low-level" AXI4-Lite read/write method (e.g. manipulating ARADDR/AWADDR) in PYNQ?

**URL:** <https://discuss.pynq.io/t/any-low-level-axi4-lite-read-write-method-e-g-manipulating-araddr-awaddr-in-pynq/6009>\
**Category:** Support\
**Created:** [August 31, 2023, 8:35am UTC](https://discuss.pynq.io/t/any-low-level-axi4-lite-read-write-method-e-g-manipulating-araddr-awaddr-in-pynq/6009 "2023-08-31T08:35:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![marvtao](https://avatars.discourse-cdn.com/v4/letter/m/85e7bf/32.png) [@marvtao](https://discuss.pynq.io/u/marvtao)\
**Post date:** [August 31, 2023, 8:35am UTC](https://discuss.pynq.io/t/any-low-level-axi4-lite-read-write-method-e-g-manipulating-araddr-awaddr-in-pynq/6009/1 "2023-08-31T08:35:40Z")

</div>

**PYNQ version & Board name & Tool Version:**

- PYNQ: latest (3.0)
- Board name: pynq-z2 (xc7z020clg400-1)
- Tool version: Xilinx Vivado 2023.1

 ![Screenshot from 2023-08-31 16-18-09](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/2X/5/5f3449d59bbfd8c5e0d5209e38b5c900590a76bb.png)

My design consists of a custom IP, with an AXI4-Lite compatible interface. I followed the tutorial and Vivado automatically connected the IP to the `M_AXI_GP0 of PS`.

However, the IP directly takes the AWADDR/ARADDR as the control word or opcode. In order to control the IP, I need to use something like `device.write(addr, data)` or `device.read(addr)`，while the `pynq.axigpio` does not support read/write with an address. So my question is:

1. Does Pynq provide some kind of “low-level” API to manipulate the port-level signal for the interface over `M_AXI_GP0`?
2. Do other AXI ports support reading/writing with address, and how should I switch them?

Thank you so much!  
Marv

---

<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:** [August 31, 2023, 9:11am UTC](https://discuss.pynq.io/t/any-low-level-axi4-lite-read-write-method-e-g-manipulating-araddr-awaddr-in-pynq/6009/2 "2023-08-31T09:11:09Z")

</div>

Hi @marvtao,

Welcome to the PYNQ community.

Check out the MMIO driver.

[https://pynq.readthedocs.io/en/latest/pynq\_libraries/mmio.html](https://pynq.readthedocs.io/en/latest/pynq_libraries/mmio.html)

Here is an example: [https://github.com/Xilinx/PYNQ\_Workshop/blob/master/Session\_4/2\_axi\_gpio.ipynb](https://github.com/Xilinx/PYNQ_Workshop/blob/master/Session_4/2_axi_gpio.ipynb)

In genera, every AXI4-Lite IP in your design is assigned a MMIO driver by default.

[https://pynq.readthedocs.io/en/latest/overlay\_design\_methodology/python\_overlay\_api.html](https://pynq.readthedocs.io/en/latest/overlay_design_methodology/python_overlay_api.html)

So, you can do `.read(addr)` and `.write(addr, value)`

Mario

---

<div class="post-metadata">

**Author:** ![marvtao](https://avatars.discourse-cdn.com/v4/letter/m/85e7bf/32.png) [@marvtao](https://discuss.pynq.io/u/marvtao)\
**Post date:** [August 31, 2023, 9:48am UTC](https://discuss.pynq.io/t/any-low-level-axi4-lite-read-write-method-e-g-manipulating-araddr-awaddr-in-pynq/6009/3 "2023-08-31T09:48:21Z")

</div>

Thank you so much Mario!

MMIO looks promising, but it requires the address must be the multiple of 4. I understand that MMIO is designed to align by word rather than by byte. But, are there any really fine grained low level APIs for manipulating such as AWVALID/AWADDR/WDATA ports?

If no so, I have to modify the RTL to make the opcode multiple of 4, and do everything all over again😗

---

<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:** [August 31, 2023, 10:44am UTC](https://discuss.pynq.io/t/any-low-level-axi4-lite-read-write-method-e-g-manipulating-araddr-awaddr-in-pynq/6009/4 "2023-08-31T10:44:46Z")

</div>

Hi @marvtao,

There’s no finer granularity as the the M\_AXI\_GP0 is 32-bit wide.

Mario

---

<div class="post-metadata">

**Author:** ![marvtao](https://avatars.discourse-cdn.com/v4/letter/m/85e7bf/32.png) [@marvtao](https://discuss.pynq.io/u/marvtao)\
**Post date:** [August 31, 2023, 11:57am UTC](https://discuss.pynq.io/t/any-low-level-axi4-lite-read-write-method-e-g-manipulating-araddr-awaddr-in-pynq/6009/5 "2023-08-31T11:57:09Z")

</div>

Thank you for this precious information. Now I’m much assured about what I’m going to do next.

Marv

---

<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:** [August 31, 2023, 1:20pm UTC](https://discuss.pynq.io/t/any-low-level-axi4-lite-read-write-method-e-g-manipulating-araddr-awaddr-in-pynq/6009/6 "2023-08-31T13:20:09Z")

</div>


