Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20705 Discussions

Interval Timer Timestamp Problem

Altera_Forum
Honored Contributor II
949 Views

Hey, 

 

I am trying to determine a baseline time for a particular application and then see what degree of speedup I can obtain my distributing the app across multiple cpus. 

 

I am getting conflicting results when I use the time_stamp API in my program. 

When I run the app on a single cpu hardware system, it results in a runtime of appoximately 40 seconds. If I run the same app ON A SINGLE CPU in a 5-cpu hardware system it results in a time of aproximately 15 seconds. This obviously doesn't match up which leads me to believe I'm doing something wrong. 

 

In both SOPC builder designs I've included an interval timer component named cpu0_timer (very creative). I've also set the system library setting "timestamp timer" to that timer component. My code is as basic as timing code gets and matches up with the example given in the altera documentation: 

 

[...] 

#include "sys/alt_timestamp.h" 

#include "alt_types.h" 

 

int main (void) 

int time1,time2; 

[...] 

 

alt_timestamp_start(); 

time1 = alt_timestamp(); 

[...] // do some work 

time2 = alt_timestamp(); 

 

//print out time2-time1/(ticks/sec) 

return 0; 

 

I would appreciate some direction or feedback as to what I'm doing wrong. I am using Nios IDE v8.0.  

I hope I explained that sufficiently... thanks for the help. 

0 Kudos
0 Replies
Reply