rehsd Posted November 17, 2021 Share Posted November 17, 2021 What is the recommended approach to measure durations in C code in MicroBlaze on an Arty A7? I would like to store a start time (like clock()) and compare it to an end time to calculate a duration. time.h, xtime_l.h, other? Thanks! Link to comment Share on other sites More sharing options...
0 JColvin Posted November 19, 2021 Share Posted November 19, 2021 Hi @rehsd, I believe xtime_l should work for you. Alternatively you can also add in an AXI timer or counter IP into your design which would give you that sort of functionality in your design. Let me know if you have any questions. Thanks, JColvin Link to comment Share on other sites More sharing options...
0 rehsd Posted November 19, 2021 Author Share Posted November 19, 2021 (edited) Thanks, @JColvin. Can you tell me how to properly include it in my MicroBlaze project. When I add the include line and try to compile, I get the following. ../src/main.c:8:10: fatal error: xtime_l.h: No such file or directory 8 | #include "xtime_l.h" | ^~~~~~~~~~~ compilation terminated. I found this article about adding libraries and paths, but my UI doesn't seem to have the same options. I have several versions of the files on my drive, but I'm not sure which one I should use. Possibly, xtime_l isn't supported on MicroBlaze? Thank you! Edited November 19, 2021 by rehsd Link to comment Share on other sites More sharing options...
0 rehsd Posted November 29, 2021 Author Share Posted November 29, 2021 Update: I wasn't able to find a way to measure time in MicroBlaze on the A7-100T. As far as I can tell, it's a device limitation. I was able to implement a solution in VHDL and pass the measurement to MicroBlaze. Link to comment Share on other sites More sharing options...
Question
rehsd
What is the recommended approach to measure durations in C code in MicroBlaze on an Arty A7? I would like to store a start time (like clock()) and compare it to an end time to calculate a duration. time.h, xtime_l.h, other? Thanks!
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now