Forums

(Execution Cycles) Timing Budget for TI eZdspf2812

Started by vickykulkarni February 21, 2006
Hi guys

I am designing different algorithms on the DSP to work in real
time(filtering, fft etc). I wanted to know the best way to find out the
number of execution cycles/processor time/mips each software algorithm
takes. So what I need to figure out for example is if my sampling
frequency is 2 MHz and my clock is 150MHz, what is the highest order
filter and FFT i can design to run in real time. 

Does TI have any inbuilt functions to do this. I came across a 'clock'
function in C/C++ TMS320C28X DSP Compiler Users Guide. Its a function that
returns an approximation of the processor time used by the program. I have
tried to use it in my code, but havent been successful so far. I'm sure
someone on this group must have used this function. Any help is highly
appreciated. Thanks.

Best regards

Vikram

On Tue, 21 Feb 2006 18:25:59 -0600, "vickykulkarni"
<vickykulkarni@hotmail.com> wrote in comp.dsp:

> Hi guys > > I am designing different algorithms on the DSP to work in real > time(filtering, fft etc). I wanted to know the best way to find out the > number of execution cycles/processor time/mips each software algorithm > takes. So what I need to figure out for example is if my sampling > frequency is 2 MHz and my clock is 150MHz, what is the highest order > filter and FFT i can design to run in real time. > > Does TI have any inbuilt functions to do this. I came across a 'clock' > function in C/C++ TMS320C28X DSP Compiler Users Guide. Its a function that > returns an approximation of the processor time used by the program. I have > tried to use it in my code, but havent been successful so far. I'm sure > someone on this group must have used this function. Any help is highly > appreciated. Thanks. > > Best regards > > Vikram
There are two ways I use to make accurate timing measurements on the 2812. One requires a spare GPIO pin, set as an output. Set the pin high on entry to the routine, set it low again at the end. Connect an oscilloscope to the pin and you can directly measure the time. The other requires having one of the general purpose timers free. Start it with a reload value of 0 and running at full CPU clock speed. Define a few variables in internal RAM, like this: long start_time; long this_time; long fastest = 0x7fffffff; long slowest = 0; ...and add code to your routine like this: ...at the start: start_time = timer; ...then at the end: this_time = timer - start_time; if (this_time < fastest) { fastest = this_time; } if (this_time > slowest) { slowest = this_time; } That way you can look at the "fastest" and "slowest" times using the JTAG debugger. I'm typing this from memory without the actual code, which is at work, but you should be able to work it out from the pseudo code. -- Jack Klein Home: http://JK-Technology.Com FAQs for comp.lang.c http://c-faq.com/ comp.lang.c++ http://www.parashift.com/c++-faq-lite/ alt.comp.lang.learn.c-c++ http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html
>On Tue, 21 Feb 2006 18:25:59 -0600, "vickykulkarni" ><vickykulkarni@hotmail.com> wrote in comp.dsp: > >> Hi guys >> >> I am designing different algorithms on the DSP to work in real >> time(filtering, fft etc). I wanted to know the best way to find out
the
>> number of execution cycles/processor time/mips each software algorithm >> takes. So what I need to figure out for example is if my sampling >> frequency is 2 MHz and my clock is 150MHz, what is the highest order >> filter and FFT i can design to run in real time. >> >> Does TI have any inbuilt functions to do this. I came across a 'clock' >> function in C/C++ TMS320C28X DSP Compiler Users Guide. Its a function
that
>> returns an approximation of the processor time used by the program. I
have
>> tried to use it in my code, but havent been successful so far. I'm
sure
>> someone on this group must have used this function. Any help is highly >> appreciated. Thanks. >> >> Best regards >> >> Vikram > >There are two ways I use to make accurate timing measurements on the >2812. One requires a spare GPIO pin, set as an output. Set the pin >high on entry to the routine, set it low again at the end. Connect an >oscilloscope to the pin and you can directly measure the time. > >The other requires having one of the general purpose timers free. >Start it with a reload value of 0 and running at full CPU clock speed. > >Define a few variables in internal RAM, like this: > >long start_time; >long this_time; >long fastest = 0x7fffffff; >long slowest = 0; > >...and add code to your routine like this: > >...at the start: > >start_time = timer; > >...then at the end: > >this_time = timer - start_time; > >if (this_time < fastest) >{ > fastest = this_time; >} > >if (this_time > slowest) >{ > slowest = this_time; >} > >That way you can look at the "fastest" and "slowest" times using the >JTAG debugger. > >I'm typing this from memory without the actual code, which is at work, >but you should be able to work it out from the pseudo code. > >-- >Jack Klein >Home: http://JK-Technology.Com >FAQs for >comp.lang.c http://c-faq.com/ >comp.lang.c++ http://www.parashift.com/c++-faq-lite/ >alt.comp.lang.learn.c-c++ >http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html >
Thanks Jack. I'll give it a shot. Thanks again.