UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Newbie hagen93
Newbie
5,753 Views
Registered: ‎09-23-2016

AXI GPIO too slow

Hi all,

 

I have a question regarding the AXI Interconnect and the AXI GPIO IP. First a few details regarding the Project that I am working on.

 

Right now I am using the ZYNQ 7020 rev C1 with PetaLinux and the build in UIO framework to access the registers of a memory-mapped device implemented in the zynq’s programmable logic fabric. The main goal is to send a command string from my PC to a custom zynq board via Ethernet and set the register values of the device based on the command string. So far so good.

 

I set up PetaLinux and wrote a simple C application and everything works fine, but it is too slow. Latency is really important for me.

 

For testing purposes I used the AXI Interconnect and the AXI GPIO to toggle a pin as fast as possible. I wrote a simple baremetal application with Xilinx SDK to make sure it had nothing to do with Linux. In the vivado project I set the FCLK_CLK0 to 50, 100 and 250 MHz and the frequency at which I am able to toggle the pin was 1.1 MHz, 2.2 MHz and 3.8 MHz.

 

My Question is how I can achieve higher frequencies (10MHz) using the AXI GPIO. Is it possible or am i doing something wrong?

 

 

Hope you guys can help me.
 
Thanks,


Hendrik

0 Kudos
5 Replies
Scholar u4223374
Scholar
5,738 Views
Registered: ‎04-26-2015

Re: AXI GPIO too slow

I'm not sure that toggling a pin over AXI via the PS is really a good idea.

 

If you need regular toggling (eg. PWM), use the AXI Timer IP (or write your own). Then you send it the relevant settings (speed non-critical) and let it generate cycle-accurate timing by itself. If the toggling is irregular (eg. bitbanging some odd communications protocol), I'd either write a custom bit of HDL code or stick a Microblaze (or Microblaze MCS) in there. Either would be more suitable for the task than the Zynq CPU.

 

 

0 Kudos
Teacher muzaffer
Teacher
5,722 Views
Registered: ‎03-31-2012

Re: AXI GPIO too slow

No you are not doing anything wrong AXI GP ports are very slow and they are not meant for closing any loop over the PS/PL interface but only for writing register values into PL.
If you want high throughput data transfer or tight control loop, you need to add that logic to PL (ie an axi master for data transfer or move the control logic to PL, potentially with HLS).
- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
0 Kudos
Newbie hagen93
Newbie
5,673 Views
Registered: ‎09-23-2016

Re: AXI GPIO too slow

Thanks for the reply,

 

To toggle the pins was just for testing purposes. In the end I’ll just have a few registers in the PL, which values I need to write and read relatively quickly. It won’t be streaming, but single random access of the registers.

 

You said I might need to move the control logic to PL. Which control logic do you mean? Do you know the maximum speed that could be achieved using axi gpio to write and read the registers?

 

Thanks again,

 

Hendrik

 

 

0 Kudos
Teacher muzaffer
Teacher
5,659 Views
Registered: ‎03-31-2012

Re: AXI GPIO too slow

@hagen93 

 

>> Which control logic do you mean?

The logic which will do "values I need to write and read relatively quickly" as you mention in your post. Between the reads and writes there has to be some logic which decides what to write based on what it reads. That piece of code should move to PL if it has to work "relatively quickly"

 

In my experience, each GP access can be done in 150-200 ns.

- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
0 Kudos
Adventurer
Adventurer
3,091 Views
Registered: ‎06-13-2017

Re: AXI GPIO too slow

I was also quite disappointed with ~2 MHz maximum toggling rate. However, it can be done about 5 times faster if instead of using AXI toggle them on MIO with <xgpiops.c>.

0 Kudos