Jump to content
  • 0

Is there any way to measure time using MicroBlaze core in Vitis for Arty A7-100T?


zzzhhh

Question

I embedded a MicroBlaze core in the FPGA of Arty A7-100T board. To measure time spent by a piece of code run by MicroBlaze core in Vitis, I tried

#include <time.h>

clock_t start, end;
start=clock();
// code to be measured
end=clock();

But I received error

Quote

(.text+0x8): undefined reference to `times'

So, is there any API from Vitis SDK I can use to measure time using MicroBlaze core in Vitis for Arty A7-100T? If answer is no, is that because of the limitation of MicroBlaze? If so, if I replace MicroBlaze with some other processor core, say RISC-V, can I measure time in Vitis? Or, is there no hope at all to do time measurement using C code in Vitis on top of Artix-7 FPGA?

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Microblaze doesn't have a built-in counter by default - it implements sleep functions in software, using instructions with known durations, for example. You could use an AXI Timer/Counter and the xtmrctr driver.

xtime_l looks to be a Zynq-7000-specific driver and uses the built-in hardware timer featured by the A9 processor, I don't know why it might be showing up in a Microblaze BSP.

Thanks,

Arthur

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...