Forum Discussion
Altera_Forum
Honored Contributor
12 years agoThe IORD_ALTERA_AVALON_PIO_DATA is translated into a single CPU instruction IIRC, so you will hardly find any faster method of reading a PIO.
I see several reasons that could explain what you are seeing. Either the PIO itself is slow (and if it is in a different clock domain, it will stall the CPU for several extra cycles), or there is an unknown bias in your test. It could be a bug in the way you are measuring time, or your test without the macro could be artificially faster because it was somewhat optimized by the compiler. (about the bug in time measurement system, it happened to me not so long ago. I was running a network benchmark, and couldn't understand inconsistent results in bandwidth measurements, until I figured out I had a 32-bit counter that rolled over). Please note that a softcore CPU isn't fast anyway, if you need to read data at a fast rate, you should consider using a DMA instead.