cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Observer
Observer
20,729 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
Highlighted
Xilinx Employee
Xilinx Employee
20,687 Views
Registered: ‎08-15-2007

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

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
Highlighted
Explorer
Explorer
20,658 Views
Registered: ‎08-13-2007

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

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
Highlighted
Xilinx Employee
Xilinx Employee
20,646 Views
Registered: ‎08-15-2007

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,615 Views
Registered: ‎08-13-2007

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

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
Highlighted
20,512 Views
Registered: ‎09-02-2007

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