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: 
Observer vlogaras
Observer
20,384 Views
Registered: ‎08-20-2007

GPIO_performance

Has any one measured the cycles needed for a single I/O function using a GPIO peripheral with the PowerPC processor (Virtex-II Pro device). I have measured using a counter and i takes 115 cycles. I think these are a lot of cycles. Is there anything I can do to reduce the cycles?
0 Kudos
8 Replies
Xilinx Employee
Xilinx Employee
20,342 Views
Registered: ‎08-15-2007

Re: GPIO_performance

The performance can vary quite a bit depending on where you are executing your code (ie DDR, BRAM, OCM, etc) and how many clocks cycles it takes to execute your code. 
You can expect to see a delay of about 50 clock cycles when executing the code out of PLB BRAM.  You can increase your performance the most by optimizing your code (ie as few as instructions as possible, using pointers is probably the best for writing/reading to GPIO) and by using local memory (ie OCM, BRAM) as opposed to DDR.
Once the GPIO address is presented on the PLB bus it will take approximately 12 clocks before you see the output on the GPIO port.  This includes delay from the PLB bus, PLB2OPB Bridge, and OPB bus.  This performance can be improved by putting the GPIO on the PLB bus, this will save you approximately 8 clocks cycles. 
0 Kudos
Highlighted
Observer vlogaras
Observer
20,315 Views
Registered: ‎08-20-2007

Re: GPIO_performance

I had an improvement by using an OCM controller for the instruction memory (fitted in BRAMs). Now it takes 63 cycles for an I/O instruction. I am using the xgpio.h library and the XGpio_mSetDataReg() to output data to the OPB GPIO peripheral. Is there anything else I can do to speed up my I/O functions form the programmin side? It also takes 83 cycles to read from a DDR memory that is installed in my board.
0 Kudos
Explorer
Explorer
20,313 Views
Registered: ‎08-13-2007

Re: GPIO_performance

way to speed up:
 
1) do not use xilinx drivers
2) do not use xilinx drivers
3) do not use xilinx drivers
...
 
 
0 Kudos
Observer vlogaras
Observer
20,303 Views
Registered: ‎08-20-2007

Re: GPIO_performance

Dear xilant,
                    you have given me the same reply in the old Xilinx forums. Where can I find others drivers for PowerPC 405? I don't want to pay for them. My project is for my Msc thesis, so I have no money to spend!
0 Kudos
Xilinx Employee
Xilinx Employee
20,301 Views
Registered: ‎08-15-2007

Re: GPIO_performance

I would recommend using pointers for writing/reading to GPIO, here is an example:
 Xuint32 *addr = 0x40000000;  // Where 0x4000000 is the base address of the OPB GPIO
  *addr = 0xDEADBEEF;  // Writes 0xDEADBEEF to OPB GPIO Data pins
0 Kudos
Explorer
Explorer
20,270 Views
Registered: ‎08-13-2007

Re: GPIO_performance

Hi
 
by using no xilinx drivers I did mean in this case USE NO DRIVER
just write to the memory direct as has already been suggested.
 
Antti Lukats
0 Kudos
Observer vlogaras
Observer
20,265 Views
Registered: ‎08-20-2007

Re: GPIO_performance

Ok guys. Thanx very much for the replies. I will try to use pointers, but anyway, I still believe that the PowerPC has a low I/O performance.
0 Kudos
20,167 Views
Registered: ‎09-02-2007

Re: GPIO_performance

It's 20 years since I programmed C , but I seem to remember needing static in there as well ?
 
It might be only for reads, but something about the optomiser being too enfusiastic coms to mind.
 
0 Kudos