Forum Discussion
Altera_Forum
Honored Contributor
13 years agotimes() always returns 1 in NIOS II
Hi, I am trying to measure the process execution time using the following code... # include <stdlib.h># include "sys/alt_stdio.h"# include <sys/alt_alarm.h># include "sys/times.h"# inclu...
Altera_Forum
Honored Contributor
13 years agoDunno, the altera timer block is horrendously over-complicated and needs lots of clock cycoles to do anything at all (not least because it is a 16bit slave!).
I used a simple 32bit up-counter connected to an avalon slave for performance cycle counting (one avalon cycle to read), the same slave also has a millisecond up-counter we use for actual timers. I was then able to determine/verify the actual cycle counts for most instructions - although signaltap did show one or two things I hadn't noticed!