UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor zly
Visitor
3,985 Views
Registered: ‎08-16-2013

how to measure C program running time on microblaze standalone?

How can I measure the execution time of the C code on microblaze? no OS is used so I can not use desktop C funcions in time.h, do I have to use xps timer or axi timer? Can any one give a tutorial or example using xps timer to measure execution time?

0 Kudos
3 Replies
Historian
Historian
3,981 Views
Registered: ‎02-25-2008

Re: how to measure C program running time on microblaze standalone?


@zly wrote:

How can I measure the execution time of the C code on microblaze? no OS is used so I can not use desktop C funcions in time.h, do I have to use xps timer or axi timer? Can any one give a tutorial or example using xps timer to measure execution time?


The easiest way to do this is to set an output pin right before a particular function of interest is called, then clear it once the function returns, and monitor that pin on an oscilloscope.

----------------------------Yes, I do this for a living.
0 Kudos
Xilinx Employee
Xilinx Employee
3,964 Views
Registered: ‎08-02-2011

Re: how to measure C program running time on microblaze standalone?

0 Kudos
Adventurer
Adventurer
3,963 Views
Registered: ‎01-15-2013

Re: how to measure C program running time on microblaze standalone?

Hi,

You can make use of counters/timers. Start a timer at the start of the program and stop it just before finishing the program. Find the difference. Multiply the number with the time period of clock. I think microblaze runs in 100 MHz. So multiply with 1/(100*10^6).

Paul
0 Kudos