# Variable frequency controlled in python(pynq) for custom AXI IP

**URL:** <https://discuss.pynq.io/t/variable-frequency-controlled-in-python-pynq-for-custom-axi-ip/3696>\
**Category:** Support\
**Created:** [February 16, 2022, 5:29pm UTC](https://discuss.pynq.io/t/variable-frequency-controlled-in-python-pynq-for-custom-axi-ip/3696 "2022-02-16T17:29:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shariethernet](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/shariethernet/32/2857_2.png) [@shariethernet](https://discuss.pynq.io/u/shariethernet)\
**Post date:** [February 16, 2022, 5:29pm UTC](https://discuss.pynq.io/t/variable-frequency-controlled-in-python-pynq-for-custom-axi-ip/3696/1 "2022-02-16T17:29:59Z")

</div>

Hello,

I am working on a zynq based project on pynq z2, where I have a AXI stream IP (say, an adder - single master, single slave) with fifo’s on either ends.

The goal is to run the IP block at variable frequency by muxing the clocks generated from PLL.

**Question** :

How to send the data for the select lines of the mux from pynq, so that I can control the frequency of the IP from pynq as the data keeps streaming in at PS frequency. Any idea in this regard would be great.

**Block Design** :

 ![image](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/2X/0/07e0af1a9c7db857cc4050ab73e0a2c99b1d8168.jpeg)

Pynq Image Version: v2.7  
Board: Pynq z2  
Vivado version: 2020.2

Thanks in advance.

---

<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:** [February 17, 2022, 8:46am UTC](https://discuss.pynq.io/t/variable-frequency-controlled-in-python-pynq-for-custom-axi-ip/3696/2 "2022-02-17T08:46:32Z")

</div>

Hi,

There are a few ways you can do this.

1. Use PS GPIO and control them with the GPIO class [PYNQ\_Workshop/1\_ps\_gpio.ipynb at master · Xilinx/PYNQ\_Workshop · GitHub](https://github.com/Xilinx/PYNQ_Workshop/blob/master/Session_4/1_ps_gpio.ipynb)
2. Use an AXI GPIO [PYNQ\_Workshop/2\_axi\_gpio.ipynb at master · Xilinx/PYNQ\_Workshop · GitHub](https://github.com/Xilinx/PYNQ_Workshop/blob/master/Session_4/2_axi_gpio.ipynb)
3. Instead of using a clocking wizard you can enable another clock output from the PS and control it from pynq using the `pynq.ps.Clock` object

[https://pynq-testing.readthedocs.io/en/master/pynq\_package/pynq.ps.html#pynq.ps.Clocks](https://pynq-testing.readthedocs.io/en/master/pynq_package/pynq.ps.html#pynq.ps.Clocks)

An example here [| notebook.community](https://notebook.community/Xilinx/PYNQ/pynq/notebooks/common/zynq_clocks)

Mario

---

<div class="post-metadata">

**Author:** ![shariethernet](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/shariethernet/32/2857_2.png) [@shariethernet](https://discuss.pynq.io/u/shariethernet)\
**Post date:** [February 25, 2022, 8:50am UTC](https://discuss.pynq.io/t/variable-frequency-controlled-in-python-pynq-for-custom-axi-ip/3696/3 "2022-02-25T08:50:22Z")

</div>

Thanks for the response @marioruiz
