Forum Discussion
Altera_Forum
Honored Contributor
16 years agoA lots of cycles are used by the Nios processor for the function calls (registers saved on the stack, jump, stack space allocation...) and function execution (instructions and data fetch, results write...), but the action that probably takes the most time is the I/O generated by the printf() call.
I recommend to use the IO_RD/WR macros to access your component, or to use the alt_remap_uncached() routine if you prefer to use pointers. If you don't, the CPU can read data from its cache rather than your components and you'll have strange results.