Forum Discussion
Altera_Forum
Honored Contributor
12 years agoProgramming NIOSII interfaced with custom component, using Avalon MM Interface
Hello Everyone, I am trying to interface NIOS II with a custom component using Avalon MM Inferface where NIOS acts as Master. During the C coding, how do i get access to the function to send/...
Altera_Forum
Honored Contributor
12 years agoI have used performance counter long time ago.Its look like that you are doing the same thing. Here is my code
PERF_RESET(PERFORMANCE_COUNTER_0_BASE); PERF_START_MEASURING(PERFORMANCE_COUNTER_0_BASE); PERF_BEGIN(PERFORMANCE_COUNTER_0_BASE,1); // Here is the code block to be tested. // I want to know the cycles consumed during this block. PERF_END(PERFORMANCE_COUNTER_0_BASE,1); int cycles = IORD(PERFORMANCE_COUNTER_0_BASE,4); //Read the value of counter.Note that offset is set to 4. If it is not working then your should design counter in your custom component and read it using avalon interface for the quick solution.