- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
my aim is to see how many clock cycles it takes for my C code to execute. How can I do this?. I have no block design file, I'm using an verliog code as top level design, and a C code to download into processor and make the fucntion(verilog+c code) to work. It works perfectly, which I want. My question, is.. How can I know How many clock cycles it takes for my C code to execute the function(logic) which I want?. waiting for your reply guys. thanks, AnaLink Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you're using NIOS 2 there is a profiler component (performance counter unit) you can add to your system. I've never used it myself so I don't know how it works.
I guess you could make one of those yourself, a write to a sopc component would start a counter and then with another write stop it and read out the value. A start and stop of the timer would give you an estimate of the avalon overhead. You could also use a timer in your NIOS 2 core to see how long time the program takes to execute and then estimate the number of cycles. I hope this helps- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks, i will try it out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
should I give the base address of PERFORMANCE_COUNTER_0_BASE, or wil it get it automatically from system.h, If I dont declare it gives me an error saying " first use of this function" PERFORMANCE_COUNTER_0_BASE If I declare this with its base address like. # define PERFORMANCE_COUNTER_0_BASE 0x00021000 it builds and runs but I get an output where the output runs like : yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy why is this because of ?. waiting for your reply. thanks, Anand- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't know, as I said I never needed to use it. There should be some documentation for the component somewhere on Alteras homepage. If you don't need exact statistics you can try the other methods I suggested.
//Ola
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page