Time and cycle count relation on the TI C6416
CASTalk.com Forum Index CASTalk.com
Discussion of DSP, FPGA, storage and embedded system.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web castalk.com
Time and cycle count relation on the TI C6416

 
Post new topic   Reply to topic    CASTalk.com Forum Index -> DSP
Author Message
maikeru
Guest





Posted: Fri Dec 17, 2004 4:44 am    Post subject: Time and cycle count relation on the TI C6416 Reply with quote

Hi all,

I got a question about timing and benchmarking on a TMS320C6000 series
DSP, to be more specific the C6416 running at 720MHz.
I have a project here that has to process images in realtime.
To check that, I basically use STS objects that I put before and after
the function that processes the images.
(usual stuff: STS_set(&STS_xx, CLK_gethtime()); and STS_delta(&STS_xx,
CLK_gethtime());)
So what is unclear to me is actually the results that I get from those
STS objects. They return the cycle count that has occured between the
two STS_objects, as far as I could find in the documentation. I also
know that I have to multipy this output by the factor 8 (on the C64x)
when I want to have the instruction count that has occured.

Lets say for example I get a cycle count of 3 000 000, does that equal
a time of 0.0041 seconds (on the C6416)? Or do I have to consider
something else (like the instruction count)?

My question is now, how do I get an accurate measurement of
milliseconds out of that. Right now I use this statement and I'm not
sure if it is correct:
start = (CLK_getltime() * (CLK_getprd())) / CLK_countspms();
[ ... function to be profiled ..]
finish = (CLK_getltime() * (CLK_getprd())) / CLK_countspms();
LOG_printf(&trace, "time = %d", finish - start);

I hope somebody can clear this up to me, because I'm a bit confused w/
how to actually measure the time between the two events.
Thanks for helping me out,

Cheers,

Maikeru
Back to top
Brad Griffis
Guest





Posted: Fri Dec 17, 2004 4:44 am    Post subject: Re: Time and cycle count relation on the TI C6416 Reply with quote

Do you need to actually use that statistics info in your code or are you
just trying to do a little profiling of your functions?

The CLK_gethtime() call simply returns the value of the CPU timer being used
as the time base for BIOS. That timer runs at a speed of CPU/8 (on 64xx
DSPs) which is why you need to multiply that result by 8 in order to find
out how many CPU clocks have elapsed. The CLK_getltime() call returns the
value of the BIOS internal "tick" counter. A "tick" occurs every time your
BIOS interrupt occurs (typically 1ms and is determined in the clock manager
section of the cdb).

Approximately how long is this code you're profiling? If it's long enough
that you are measuring it in milliseconds then you could probably just use
the CLK_getltime() and do just a straight difference to determine how many
milliseconds it takes. If your system tick is set up as 1 ms this will be
especially easy! If you need to get a lot finer resolution then use
CLK_gethtime() and convert your result into microseconds. I think you can
configure the STS viewing window to do it for you.

Brad

"maikeru" <mmatter@gmx.tm> wrote in message
news:1103248431.719547.68870@z14g2000cwz.googlegroups.com...
Quote:
Hi all,

I got a question about timing and benchmarking on a TMS320C6000 series
DSP, to be more specific the C6416 running at 720MHz.
I have a project here that has to process images in realtime.
To check that, I basically use STS objects that I put before and after
the function that processes the images.
(usual stuff: STS_set(&STS_xx, CLK_gethtime()); and STS_delta(&STS_xx,
CLK_gethtime());)
So what is unclear to me is actually the results that I get from those
STS objects. They return the cycle count that has occured between the
two STS_objects, as far as I could find in the documentation. I also
know that I have to multipy this output by the factor 8 (on the C64x)
when I want to have the instruction count that has occured.

Lets say for example I get a cycle count of 3 000 000, does that equal
a time of 0.0041 seconds (on the C6416)? Or do I have to consider
something else (like the instruction count)?

My question is now, how do I get an accurate measurement of
milliseconds out of that. Right now I use this statement and I'm not
sure if it is correct:
start = (CLK_getltime() * (CLK_getprd())) / CLK_countspms();
[ ... function to be profiled ..]
finish = (CLK_getltime() * (CLK_getprd())) / CLK_countspms();
LOG_printf(&trace, "time = %d", finish - start);

I hope somebody can clear this up to me, because I'm a bit confused w/
how to actually measure the time between the two events.
Thanks for helping me out,

Cheers,

Maikeru
Back to top
maikeru
Guest





Posted: Fri Dec 17, 2004 4:44 am    Post subject: Re: Time and cycle count relation on the TI C6416 Reply with quote

Hi Brad,

thx for the quick answer. I will try that tomorrow. The code should be
long enough to get it in milliseconds. It was just a bit confusing out
of the TI documentation. This documentation said that the timer
register is increased like every 4 cylces and not 8. That was the main
part that was confusing me. But w/ the explanation that it runs w/
CPU/8 everything is clear.

Thank you.

Mike
Back to top
 
Post new topic   Reply to topic    CASTalk.com Forum Index -> DSP All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




VoIP Electronics Powered by phpBB