DSPRelated.com
Forums

Urgent Help Required: CLK_gethtime

Started by itti...@gmail.com June 23, 2008
ittiam,

You might want to read the TI document: spru301c.pdf

It contains all the basic and detailed information needed to setup/use the statistics gathering
tools, like the CLK_gethtime function.

R. Williams
---------- Original Message -----------
From: Goku
To: "Jeff Brower"
Cc: c...
Sent: Tue, 24 Jun 2008 17:48:48 +0300
Subject: Re: [c6x] Urgent Help Required: CLK_gethtime

> Hello ,
>
> I have included rts6400.lib, but it is not defined in it, am using CCS 3.3
> Version, still getting the same error ," not able to resolve the symbol
> definition" .Could you let me know the details pls.
>
> Regards,
> Goku
>
> On Tue, Jun 24, 2008 at 5:21 PM, Jeff Brower wrote:
>
> > Goku-
> >
> >
> > Since i am benchmarking different applications which are ported from linux,
> > the linking is done with a makefile which has a huge code base, am using
> > cygwin and CCS compiler, but not the IDE, target is connected to a different
> > machine which has the CCS IDE, hence here i cant use the GUI interface, i
> > dont know how could i use Clk_gethtime without the CCS IDE GUI Bios Start,
> > could you pls let me know.
> >
> >
> > CLK_gethtime should be in the basic run-time library, rts64xx.lib (not sure
> > of that correct name, but look for rts64-something).
> >
> >
> > Error: _CLK_gethtime undefined symbol.
> >
> > I could see that Clk_gethtime library is missing , if i add the libraries
> > like bios.a64 and others , they tend to say that there are many other
> > symbols which are not defined.
> >
> >
> > bios.a64 sounds to me like an RTDX library... nothing to do with CLK_xx
> > functions.
> >
> > TI's code-gen tools for Linux are new and not widely used. I would suggest
> > that you build using standard CCS v3.3 on a Win machine, and test that
> > output code first. Since you have a "huge" code base, it's a good idea to
> > eliminate any possible build error, library version, link error, etc.
> >
> > Think about it this way -- TI didn't have Linux based code-gen tools until
> > recently (last couple of years). So that means since 1996, when they
> > acquired GoDSP (Code Composer), they've been pouring manpower and millions
> > into Win code-gen tools, not Linux. Which one do you think is more reliable
> > and widely used?
> >
> > -Jeff
> >
> >
> > On Tue, Jun 24, 2008 at 2:21 AM, Richard Williams
> > wrote:
> >>
> >> ittiam,
> >>
> >> from your description, it is rather obvious that some libraries are
> >> missing (assuming that the
> >> compile operations worked with no errors.)
> >>
> >> If you would post the names of the functions that are not found by the
> >> linker, we could possibly
> >> assist you in determing which libraries are missing.
> >>
> >> BTW:
> >> why are you using cgywin, etc rather than the CCS IDE for the compile/link
> >> operations?
> >>
> >> R. Williams
> >>
> >>
> >> ---------- Original Message -----------
> >> From: i...@gmail.com
> >> To: c...
> >> Sent: Mon, 23 Jun 2008 14:09:57 -0400
> >> Subject: [c6x] Urgent Help Required: CLK_gethtime
> >>
> >> > Hi all,
> >> >
> >> > Platform : DSK6416.
> >> > I have some problems regarding usage of BIOS with the header files ,all
> >> my source code are
> >> > compiled with Cygwin and TI C64x, this gives me the obj's which in turn
> >> i am linking using
> >> > the code composer, the problem is that i need to have this working with
> >> the BIOS
> >> > Clk_gethtime, if i use the function clk_gethtime with references of the
> >> libraries it says
> >> > that other references are missing, could anyone suggest me what are the
> >> header files that
> >> > need to be included to get the clk_gethtime working with proper
> >> references. How can i
> >> > start the bios if i cant use the GUI. Which are the header files that
> >> need to be
> >> > associated with it. The documentation regarding the Bios is very poor,
> >> it is not quite
> >> > clear about many aspects, if some one who had worked on BIOS could throw
> >> a limelight it
> >> > will be very helpfull for me .
> >> >
> >> > -BR
> >> > -Goku
> >> ------- End of Original Message -------
> >
> >
------- End of Original Message -------
Hello Dunn,

As you mentioned , i had configured the timer and running this piece of
code.

#include
#include
#include
#include
//#include
#include "basecfg.h"
extern far TIMER_Handle hTimer1;
#define TIMER_CNT_REG 0x01980008
void main(void)
{
unsigned int start,over_head,i;
unsigned int stop,stop_profile,start_profile;
TIMER_start(hTimer1);
start_profile = *(volatile Uint32 *) TIMER_CNT_REG;
start = TIMER_getCount(hTimer1);
for(i=0;i<100000000;i++)
{
i=i+2;
}

stop_profile = *(volatile Uint32 *) TIMER_CNT_REG;
stop = TIMER_getCount(hTimer1);
over_head = (stop_profile - start_profile);
printf("start: %d\n", start);
printf("stop: %d\n", stop);
printf("cycles: %d\n", stop - start);

printf("start: %d\n", start_profile);
printf("stop: %d\n", stop_profile);
printf("cycles: %d\n", over_head);

}
Results:
1. without the loop
start: 110
stop: 135
cycles: 25

start: 62
stop: 130
cycles: 68

2. With the loop.

start: 110
stop: 135
cycles: 25

start: 62
stop: 130
cycles: 68

The Configuration is done with the help of the GUI .cdb, where in Source for
the Clock = CPU/8 with initial value set Control Register 0x000003C1,
Period Register: 0x00002000.

If i insert a function call in the main the timer value rapidly increases
or decreases whenever the same program is run many time with huge variation.

Can you explain why the variation of the clock cycles happen?

Now that i am not using Bios , wanted to know whether this is the ideal
method to Benchmark DSK 6416. Kindly help.

Regards,
Goku
On Tue, Jun 24, 2008 at 7:01 PM, Michael Dunn
wrote:

> Goku,
>
> On 6/24/08, Goku wrote:
>
>> Hi All,
>>
>> Can i configure the timer without the BIOS Support, earlier many people
>> have told that without the BIOS configured correctly timer cant be started ,
>> the sequence need to be completed before it could be used. Can you confirm
>> pls.
> Absolutely incorrect. If you are benchmarking 'non-BIOS code' you can
> access the timer directly - if you build with BIOS, you are actually adding
> an RTOS.
>
> I believe that you can find timer init code in the archives - I don't
> remember if there are any examples in CCS. Once you get it running, all that
> you need to do is a mem read to get the count.
>
> mikedunn
>
> Regards,
>> Goku
>>
>> On Tue, Jun 24, 2008 at 6:14 PM, Michael Dunn
>> wrote:
>>
>>> Goku,
>>>
>>> On 6/24/08, Jeff Brower wrote:
>>>>
>>>> Goku-
>>>>
>>>>
>>>> Since i am benchmarking different applications which are ported from
>>>> linux, the linking is done with a makefile which has a huge code base, am
>>>> using cygwin and CCS compiler, but not the IDE, target is connected to a
>>>> different machine which has the CCS IDE, hence here i cant use the GUI
>>>> interface, i dont know how could i use Clk_gethtime without the CCS IDE GUI
>>>> Bios Start, could you pls let me know.
>>>>
>>>>
>>> Now that I am paying attention to what you are saying :-)
>>> Do not use the Clk_gethtime BIOS function. All that you really need to do
>>> is:
>>> 1. Configure the timer
>>> 2. read the timer
>>> This will add minimum impact to your actual code performance.
>>>
>>>
>>>
>>> CLK_gethtime should be in the basic run-time library, rts64xx.lib
>>>> (not sure of that correct name, but look for rts64-something).
>>>>
>>>>
>>> This is actually a DSP/BIOS function which means that you have to add
>>> BIOS to use it - a bad idea for this purpose.
>>>
>>>
>>>>
>>>> Error: _CLK_gethtime undefined symbol.
>>>>
>>>> I could see that Clk_gethtime library is missing , if i add the
>>>> libraries like bios.a64 and others , they tend to say that there are many
>>>> other symbols which are not defined.
>>>>
>>>>
>>>> bios.a64 sounds to me like an RTDX library... nothing to do with CLK_xx
>>>> functions.
>>>>
>>>> TI's code-gen tools for Linux are new and not widely used. I would
>>>> suggest that you build using standard CCS v3.3 on a Win machine, and test
>>>> that output code first. Since you have a "huge" code base, it's a good idea
>>>> to eliminate any possible build error, library version, link error, etc.
>>>>
>>>> Think about it this way -- TI didn't have Linux based code-gen tools
>>>> until recently (last couple of years). So that means since 1996, when they
>>>> acquired GoDSP (Code Composer), they've been pouring manpower and millions
>>>> into Win code-gen tools, not Linux. Which one do you think is more reliable
>>>> and widely used?
>>>>
>>>
>>> FYI - TI has been shipping Solaris compilers since the beginning of 'DSP
>>> time' and Linux compilers [at least for the c6000] for about 5-6 years
>>> although it hasn't been publicized. I am aware of a couple of very large
>>> companies that use these to build their production products.
>>>
>>> mikedunn
>>>
>>>
>>>
>>> -Jeff
>>>>
>>>>
>>>> On Tue, Jun 24, 2008 at 2:21 AM, Richard Williams <
>>>> r...@lewiscounty.com> wrote:
>>>>>
>>>>> ittiam,
>>>>>
>>>>> from your description, it is rather obvious that some libraries are
>>>>> missing (assuming that the
>>>>> compile operations worked with no errors.)
>>>>>
>>>>> If you would post the names of the functions that are not found by the
>>>>> linker, we could possibly
>>>>> assist you in determing which libraries are missing.
>>>>>
>>>>> BTW:
>>>>> why are you using cgywin, etc rather than the CCS IDE for the
>>>>> compile/link operations?
>>>>>
>>>>> R. Williams
>>>>>
>>>>>
>>>>> ---------- Original Message -----------
>>>>> From: i...@gmail.com
>>>>> To: c...
>>>>> Sent: Mon, 23 Jun 2008 14:09:57 -0400
>>>>> Subject: [c6x] Urgent Help Required: CLK_gethtime
>>>>>
>>>>> > Hi all,
>>>>> >
>>>>> > Platform : DSK6416.
>>>>> > I have some problems regarding usage of BIOS with the header files
>>>>> ,all my source code are
>>>>> > compiled with Cygwin and TI C64x, this gives me the obj's which in
>>>>> turn i am linking using
>>>>> > the code composer, the problem is that i need to have this working
>>>>> with the BIOS
>>>>> > Clk_gethtime, if i use the function clk_gethtime with references of
>>>>> the libraries it says
>>>>> > that other references are missing, could anyone suggest me what are
>>>>> the header files that
>>>>> > need to be included to get the clk_gethtime working with proper
>>>>> references. How can i
>>>>> > start the bios if i cant use the GUI. Which are the header files that
>>>>> need to be
>>>>> > associated with it. The documentation regarding the Bios is very
>>>>> poor, it is not quite
>>>>> > clear about many aspects, if some one who had worked on BIOS could
>>>>> throw a limelight it
>>>>> > will be very helpfull for me .
>>>>> >
>>>>> > -BR
>>>>> > -Goku
>>>>>
>>>>> ------- End of Original Message -------
>>>>>
>>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> www.dsprelated.com/blogs-1/nf/Mike_Dunn.php
>>>
> --
> www.dsprelated.com/blogs-1/nf/Mike_Dunn.php
>
Hi ,

In continuation with previous message, the results which are presented are
with and without the for loop in the main, as per my understanding more CPU
cycles are required to execute the loop even then the are remaining
constant, and i dont know the reason why the timer value difference is still
the same.

On Tue, Jun 24, 2008 at 10:13 PM, Goku wrote:

> Hello Dunn,
>
> As you mentioned , i had configured the timer and running this piece of
> code.
>
> #include
> #include
> #include
> #include
> //#include
> #include "basecfg.h"
> extern far TIMER_Handle hTimer1;
> #define TIMER_CNT_REG 0x01980008
> void main(void)
> {
> unsigned int start,over_head,i;
> unsigned int stop,stop_profile,start_profile;
> TIMER_start(hTimer1);
> start_profile = *(volatile Uint32 *) TIMER_CNT_REG;
> start = TIMER_getCount(hTimer1);
> for(i=0;i<100000000;i++)
> {
> i=i+2;
> }
>
> stop_profile = *(volatile Uint32 *) TIMER_CNT_REG;
> stop = TIMER_getCount(hTimer1);
> over_head = (stop_profile - start_profile);
> printf("start: %d\n", start);
> printf("stop: %d\n", stop);
> printf("cycles: %d\n", stop - start);
>
> printf("start: %d\n", start_profile);
> printf("stop: %d\n", stop_profile);
> printf("cycles: %d\n", over_head);
>
> }
> Results:
> 1. without the loop
> start: 110
> stop: 135
> cycles: 25
>
> start: 62
> stop: 130
> cycles: 68
>
> 2. With the loop.
>
> start: 110
> stop: 135
> cycles: 25
>
> start: 62
> stop: 130
> cycles: 68
>
> The Configuration is done with the help of the GUI .cdb, where in Source
> for the Clock = CPU/8 with initial value set Control Register 0x000003C1,
> Period Register: 0x00002000.
>
> If i insert a function call in the main the timer value rapidly increases
> or decreases whenever the same program is run many time with huge variation.
>
> Can you explain why the variation of the clock cycles happen?
>
> Now that i am not using Bios , wanted to know whether this is the ideal
> method to Benchmark DSK 6416. Kindly help.
>
> Regards,
> Goku
>
> On Tue, Jun 24, 2008 at 7:01 PM, Michael Dunn
> wrote:
>
>> Goku,
>>
>> On 6/24/08, Goku wrote:
>>
>>> Hi All,
>>>
>>> Can i configure the timer without the BIOS Support, earlier many people
>>> have told that without the BIOS configured correctly timer cant be started ,
>>> the sequence need to be completed before it could be used. Can you confirm
>>> pls.
>> Absolutely incorrect. If you are benchmarking 'non-BIOS code' you can
>> access the timer directly - if you build with BIOS, you are actually adding
>> an RTOS.
>>
>> I believe that you can find timer init code in the archives - I don't
>> remember if there are any examples in CCS. Once you get it running, all that
>> you need to do is a mem read to get the count.
>>
>> mikedunn
>>
>> Regards,
>>> Goku
>>>
>>> On Tue, Jun 24, 2008 at 6:14 PM, Michael Dunn
>>> wrote:
>>>
>>>> Goku,
>>>>
>>>> On 6/24/08, Jeff Brower wrote:
>>>>>
>>>>> Goku-
>>>>>
>>>>>
>>>>> Since i am benchmarking different applications which are ported from
>>>>> linux, the linking is done with a makefile which has a huge code base, am
>>>>> using cygwin and CCS compiler, but not the IDE, target is connected to a
>>>>> different machine which has the CCS IDE, hence here i cant use the GUI
>>>>> interface, i dont know how could i use Clk_gethtime without the CCS IDE GUI
>>>>> Bios Start, could you pls let me know.
>>>>>
>>>>>
>>>> Now that I am paying attention to what you are saying :-)
>>>> Do not use the Clk_gethtime BIOS function. All that you really need to
>>>> do is:
>>>> 1. Configure the timer
>>>> 2. read the timer
>>>> This will add minimum impact to your actual code performance.
>>>>
>>>>
>>>>
>>>> CLK_gethtime should be in the basic run-time library, rts64xx.lib
>>>>> (not sure of that correct name, but look for rts64-something).
>>>>>
>>>>>
>>>> This is actually a DSP/BIOS function which means that you have to add
>>>> BIOS to use it - a bad idea for this purpose.
>>>>
>>>>
>>>>>
>>>>> Error: _CLK_gethtime undefined symbol.
>>>>>
>>>>> I could see that Clk_gethtime library is missing , if i add the
>>>>> libraries like bios.a64 and others , they tend to say that there are many
>>>>> other symbols which are not defined.
>>>>>
>>>>>
>>>>> bios.a64 sounds to me like an RTDX library... nothing to do with CLK_xx
>>>>> functions.
>>>>>
>>>>> TI's code-gen tools for Linux are new and not widely used. I would
>>>>> suggest that you build using standard CCS v3.3 on a Win machine, and test
>>>>> that output code first. Since you have a "huge" code base, it's a good idea
>>>>> to eliminate any possible build error, library version, link error, etc.
>>>>>
>>>>> Think about it this way -- TI didn't have Linux based code-gen tools
>>>>> until recently (last couple of years). So that means since 1996, when they
>>>>> acquired GoDSP (Code Composer), they've been pouring manpower and millions
>>>>> into Win code-gen tools, not Linux. Which one do you think is more reliable
>>>>> and widely used?
>>>>>
>>>>
>>>> FYI - TI has been shipping Solaris compilers since the beginning of 'DSP
>>>> time' and Linux compilers [at least for the c6000] for about 5-6 years
>>>> although it hasn't been publicized. I am aware of a couple of very large
>>>> companies that use these to build their production products.
>>>>
>>>> mikedunn
>>>>
>>>>
>>>>
>>>> -Jeff
>>>>>
>>>>>
>>>>> On Tue, Jun 24, 2008 at 2:21 AM, Richard Williams <
>>>>> r...@lewiscounty.com> wrote:
>>>>>>
>>>>>> ittiam,
>>>>>>
>>>>>> from your description, it is rather obvious that some libraries are
>>>>>> missing (assuming that the
>>>>>> compile operations worked with no errors.)
>>>>>>
>>>>>> If you would post the names of the functions that are not found by the
>>>>>> linker, we could possibly
>>>>>> assist you in determing which libraries are missing.
>>>>>>
>>>>>> BTW:
>>>>>> why are you using cgywin, etc rather than the CCS IDE for the
>>>>>> compile/link operations?
>>>>>>
>>>>>> R. Williams
>>>>>>
>>>>>>
>>>>>> ---------- Original Message -----------
>>>>>> From: i...@gmail.com
>>>>>> To: c...
>>>>>> Sent: Mon, 23 Jun 2008 14:09:57 -0400
>>>>>> Subject: [c6x] Urgent Help Required: CLK_gethtime
>>>>>>
>>>>>> > Hi all,
>>>>>> >
>>>>>> > Platform : DSK6416.
>>>>>> > I have some problems regarding usage of BIOS with the header files
>>>>>> ,all my source code are
>>>>>> > compiled with Cygwin and TI C64x, this gives me the obj's which in
>>>>>> turn i am linking using
>>>>>> > the code composer, the problem is that i need to have this working
>>>>>> with the BIOS
>>>>>> > Clk_gethtime, if i use the function clk_gethtime with references of
>>>>>> the libraries it says
>>>>>> > that other references are missing, could anyone suggest me what are
>>>>>> the header files that
>>>>>> > need to be included to get the clk_gethtime working with proper
>>>>>> references. How can i
>>>>>> > start the bios if i cant use the GUI. Which are the header files
>>>>>> that need to be
>>>>>> > associated with it. The documentation regarding the Bios is very
>>>>>> poor, it is not quite
>>>>>> > clear about many aspects, if some one who had worked on BIOS could
>>>>>> throw a limelight it
>>>>>> > will be very helpfull for me .
>>>>>> >
>>>>>> > -BR
>>>>>> > -Goku
>>>>>>
>>>>>> ------- End of Original Message -------
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> www.dsprelated.com/blogs-1/nf/Mike_Dunn.php
>>>>
>>>
>>>
>> --
>> www.dsprelated.com/blogs-1/nf/Mike_Dunn.php
>>
Goku,

On 6/24/08, Goku wrote:
>
> Hello Dunn,
>
> As you mentioned , i had configured the timer and running this piece of
> code.
>
> #include
> #include
> #include
> #include
> //#include
> #include "basecfg.h"
> extern far TIMER_Handle hTimer1;
> #define TIMER_CNT_REG 0x01980008
> void main(void)
> {
> unsigned int start,over_head,i;
> unsigned int stop,stop_profile,start_profile;
> TIMER_start(hTimer1);
> start_profile = *(volatile Uint32 *) TIMER_CNT_REG;
> start = TIMER_getCount(hTimer1);
> for(i=0;i<100000000;i++)
> {
> i=i+2;
> }
>
> stop_profile = *(volatile Uint32 *) TIMER_CNT_REG;
> stop = TIMER_getCount(hTimer1);
> over_head = (stop_profile - start_profile);
> printf("start: %d\n", start);
> printf("stop: %d\n", stop);
> printf("cycles: %d\n", stop - start);
>
> printf("start: %d\n", start_profile);
> printf("stop: %d\n", stop_profile);
> printf("cycles: %d\n", over_head);
>
> }
> Results:
> 1. without the loop
> start: 110
> stop: 135
> cycles: 25
>
> start: 62
> stop: 130
> cycles: 68
>
> 2. With the loop.
>
> start: 110
> stop: 135
> cycles: 25
>
> start: 62
> stop: 130
> cycles: 68
Did you compile with optimization?? If yes, the code generator could have
thrown out your loop. If you reference i after the loop [like a printf], it
will not throw it out if that is the problem.

The Configuration is done with the help of the GUI .cdb, where in Source for
> the Clock = CPU/8 with initial value set Control Register 0x000003C1,
> Period Register: 0x00002000.
>
> If i insert a function call in the main the timer value rapidly increases
> or decreases whenever the same program is run many time with huge variation.
>
> Can you explain why the variation of the clock cycles happen?
Are you talking about your simple example or some 'real code'. Fort 'real
code', program flow, cache hits/misses, conflict stalls, and a few more
things I am sure.

Now that i am not using Bios , wanted to know whether this is the ideal
> method to Benchmark DSK 6416. Kindly help.
It depends on what you are trying to profile. For this method [or actually
any profiling], make sure that there is never a 'printf' [or any stdio]
between profile points. To keep overhead simple, you can do the following.
1. initialize and start the counter to run continuously
2. create a global array of structures one entry per profile point -
myTime.start,myTime.stop
3. at the profile points use
'gTimeCounts[n].myTime.start=TIMER_getCount(hTimer1)', etc.
4. You can tweak it to only get the first, second, etc or use a different
format to get 10 samples, etc.

You can also profile through CCS to get a good overview and then profile
individual functions as needed.

mikedunn

Regards,
> Goku
> On Tue, Jun 24, 2008 at 7:01 PM, Michael Dunn
> wrote:
>
>> Goku,
>>
>> On 6/24/08, Goku wrote:
>>
>>> Hi All,
>>>
>>> Can i configure the timer without the BIOS Support, earlier many people
>>> have told that without the BIOS configured correctly timer cant be started ,
>>> the sequence need to be completed before it could be used. Can you confirm
>>> pls.
>> Absolutely incorrect. If you are benchmarking 'non-BIOS code' you can
>> access the timer directly - if you build with BIOS, you are actually adding
>> an RTOS.
>>
>> I believe that you can find timer init code in the archives - I don't
>> remember if there are any examples in CCS. Once you get it running, all that
>> you need to do is a mem read to get the count.
>>
>> mikedunn
>>
>> Regards,
>>> Goku
>>>
>>> On Tue, Jun 24, 2008 at 6:14 PM, Michael Dunn
>>> wrote:
>>>
>>>> Goku,
>>>>
>>>> On 6/24/08, Jeff Brower wrote:
>>>>>
>>>>> Goku-
>>>>>
>>>>>
>>>>> Since i am benchmarking different applications which are ported from
>>>>> linux, the linking is done with a makefile which has a huge code base, am
>>>>> using cygwin and CCS compiler, but not the IDE, target is connected to a
>>>>> different machine which has the CCS IDE, hence here i cant use the GUI
>>>>> interface, i dont know how could i use Clk_gethtime without the CCS IDE GUI
>>>>> Bios Start, could you pls let me know.
>>>>>
>>>>>
>>>> Now that I am paying attention to what you are saying :-)
>>>> Do not use the Clk_gethtime BIOS function. All that you really need to
>>>> do is:
>>>> 1. Configure the timer
>>>> 2. read the timer
>>>> This will add minimum impact to your actual code performance.
>>>>
>>>>
>>>>
>>>> CLK_gethtime should be in the basic run-time library, rts64xx.lib
>>>>> (not sure of that correct name, but look for rts64-something).
>>>>>
>>>>>
>>>> This is actually a DSP/BIOS function which means that you have to add
>>>> BIOS to use it - a bad idea for this purpose.
>>>>
>>>>
>>>>>
>>>>> Error: _CLK_gethtime undefined symbol.
>>>>>
>>>>> I could see that Clk_gethtime library is missing , if i add the
>>>>> libraries like bios.a64 and others , they tend to say that there are many
>>>>> other symbols which are not defined.
>>>>>
>>>>>
>>>>> bios.a64 sounds to me like an RTDX library... nothing to do with CLK_xx
>>>>> functions.
>>>>>
>>>>> TI's code-gen tools for Linux are new and not widely used. I would
>>>>> suggest that you build using standard CCS v3.3 on a Win machine, and test
>>>>> that output code first. Since you have a "huge" code base, it's a good idea
>>>>> to eliminate any possible build error, library version, link error, etc.
>>>>>
>>>>> Think about it this way -- TI didn't have Linux based code-gen tools
>>>>> until recently (last couple of years). So that means since 1996, when they
>>>>> acquired GoDSP (Code Composer), they've been pouring manpower and millions
>>>>> into Win code-gen tools, not Linux. Which one do you think is more reliable
>>>>> and widely used?
>>>>>
>>>>
>>>> FYI - TI has been shipping Solaris compilers since the beginning of 'DSP
>>>> time' and Linux compilers [at least for the c6000] for about 5-6 years
>>>> although it hasn't been publicized. I am aware of a couple of very large
>>>> companies that use these to build their production products.
>>>>
>>>> mikedunn
>>>>
>>>>
>>>>
>>>> -Jeff
>>>>>
>>>>>
>>>>> On Tue, Jun 24, 2008 at 2:21 AM, Richard Williams <
>>>>> r...@lewiscounty.com> wrote:
>>>>>>
>>>>>> ittiam,
>>>>>>
>>>>>> from your description, it is rather obvious that some libraries are
>>>>>> missing (assuming that the
>>>>>> compile operations worked with no errors.)
>>>>>>
>>>>>> If you would post the names of the functions that are not found by the
>>>>>> linker, we could possibly
>>>>>> assist you in determing which libraries are missing.
>>>>>>
>>>>>> BTW:
>>>>>> why are you using cgywin, etc rather than the CCS IDE for the
>>>>>> compile/link operations?
>>>>>>
>>>>>> R. Williams
>>>>>>
>>>>>>
>>>>>> ---------- Original Message -----------
>>>>>> From: i...@gmail.com
>>>>>> To: c...
>>>>>> Sent: Mon, 23 Jun 2008 14:09:57 -0400
>>>>>> Subject: [c6x] Urgent Help Required: CLK_gethtime
>>>>>>
>>>>>> > Hi all,
>>>>>> >
>>>>>> > Platform : DSK6416.
>>>>>> > I have some problems regarding usage of BIOS with the header files
>>>>>> ,all my source code are
>>>>>> > compiled with Cygwin and TI C64x, this gives me the obj's which in
>>>>>> turn i am linking using
>>>>>> > the code composer, the problem is that i need to have this working
>>>>>> with the BIOS
>>>>>> > Clk_gethtime, if i use the function clk_gethtime with references of
>>>>>> the libraries it says
>>>>>> > that other references are missing, could anyone suggest me what are
>>>>>> the header files that
>>>>>> > need to be included to get the clk_gethtime working with proper
>>>>>> references. How can i
>>>>>> > start the bios if i cant use the GUI. Which are the header files
>>>>>> that need to be
>>>>>> > associated with it. The documentation regarding the Bios is very
>>>>>> poor, it is not quite
>>>>>> > clear about many aspects, if some one who had worked on BIOS could
>>>>>> throw a limelight it
>>>>>> > will be very helpfull for me .
>>>>>> >
>>>>>> > -BR
>>>>>> > -Goku
>>>>>>
>>>>>> ------- End of Original Message -------
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> www.dsprelated.com/blogs-1/nf/Mike_Dunn.php
>>>>
>>>
>>>
>> --
>> www.dsprelated.com/blogs-1/nf/Mike_Dunn.php
>>
--
www.dsprelated.com/blogs-1/nf/Mike_Dunn.php
ittiam,

the variable 'i' is not being used, nor is the calculation within the loop.
There fore, especially with any optimization by the compiler, the loop and the variable 'i' will be
optimized out.
That is why the clock counts are the same irregardless of the presence of the loop in the source code.

One possibility is to reference the 'i' variable after the loop, for instance in a 'print' statement.
Another possibility is to put the 'must itterate' pragma before the loop.

R. Williams
---------- Original Message -----------
From: Goku
To: "Michael Dunn"
Cc: "Jeff Brower" , c...
Sent: Tue, 24 Jun 2008 22:13:45 +0300
Subject: Re: [c6x] Urgent Help Required: CLK_gethtime

> Hello Dunn,
>
> As you mentioned , i had configured the timer and running this piece of
> code.
>
> #include
> #include
> #include
> #include
> //#include
> #include "basecfg.h"
> extern far TIMER_Handle hTimer1;
> #define TIMER_CNT_REG 0x01980008
> void main(void)
> {
> unsigned int start,over_head,i;
> unsigned int stop,stop_profile,start_profile;
> TIMER_start(hTimer1);
> start_profile = *(volatile Uint32 *) TIMER_CNT_REG;
> start = TIMER_getCount(hTimer1);
> for(i=0;i<100000000;i++)
> {
> i=i+2;
> }
>
> stop_profile = *(volatile Uint32 *) TIMER_CNT_REG;
> stop = TIMER_getCount(hTimer1);
> over_head = (stop_profile - start_profile);
> printf("start: %d\n", start);
> printf("stop: %d\n", stop);
> printf("cycles: %d\n", stop - start);
>
> printf("start: %d\n", start_profile);
> printf("stop: %d\n", stop_profile);
> printf("cycles: %d\n", over_head);
>
> }
> Results:
> 1. without the loop
> start: 110
> stop: 135
> cycles: 25
>
> start: 62
> stop: 130
> cycles: 68
>
> 2. With the loop.
>
> start: 110
> stop: 135
> cycles: 25
>
> start: 62
> stop: 130
> cycles: 68
>
> The Configuration is done with the help of the GUI .cdb, where in Source for
> the Clock = CPU/8 with initial value set Control Register 0x000003C1,
> Period Register: 0x00002000.
>
> If i insert a function call in the main the timer value rapidly increases
> or decreases whenever the same program is run many time with huge variation.
>
> Can you explain why the variation of the clock cycles happen?
>
> Now that i am not using Bios , wanted to know whether this is the ideal
> method to Benchmark DSK 6416. Kindly help.
>
> Regards,
> Goku
>
> On Tue, Jun 24, 2008 at 7:01 PM, Michael Dunn
> wrote:
>
> > Goku,
> >
> > On 6/24/08, Goku wrote:
> >
> >> Hi All,
> >>
> >> Can i configure the timer without the BIOS Support, earlier many people
> >> have told that without the BIOS configured correctly timer cant be started ,
> >> the sequence need to be completed before it could be used. Can you confirm
> >> pls.
> >
> >
> > Absolutely incorrect. If you are benchmarking 'non-BIOS code' you can
> > access the timer directly - if you build with BIOS, you are actually adding
> > an RTOS.
> >
> > I believe that you can find timer init code in the archives - I don't
> > remember if there are any examples in CCS. Once you get it running, all that
> > you need to do is a mem read to get the count.
> >
> > mikedunn
> >
> > Regards,
> >> Goku
> >>
> >> On Tue, Jun 24, 2008 at 6:14 PM, Michael Dunn
> >> wrote:
> >>
> >>> Goku,
> >>>
> >>> On 6/24/08, Jeff Brower wrote:
> >>>>
> >>>> Goku-
> >>>>
> >>>>
> >>>> Since i am benchmarking different applications which are ported from
> >>>> linux, the linking is done with a makefile which has a huge code base, am
> >>>> using cygwin and CCS compiler, but not the IDE, target is connected to a
> >>>> different machine which has the CCS IDE, hence here i cant use the GUI
> >>>> interface, i dont know how could i use Clk_gethtime without the CCS IDE GUI
> >>>> Bios Start, could you pls let me know.
> >>>>
> >>>>
> >>> Now that I am paying attention to what you are saying :-)
> >>> Do not use the Clk_gethtime BIOS function. All that you really need to do
> >>> is:
> >>> 1. Configure the timer
> >>> 2. read the timer
> >>> This will add minimum impact to your actual code performance.
> >>>
> >>>
> >>>
> >>> CLK_gethtime should be in the basic run-time library, rts64xx.lib
> >>>> (not sure of that correct name, but look for rts64-something).
> >>>>
> >>>>
> >>> This is actually a DSP/BIOS function which means that you have to add
> >>> BIOS to use it - a bad idea for this purpose.
> >>>
> >>>
> >>>>
> >>>> Error: _CLK_gethtime undefined symbol.
> >>>>
> >>>> I could see that Clk_gethtime library is missing , if i add the
> >>>> libraries like bios.a64 and others , they tend to say that there are many
> >>>> other symbols which are not defined.
> >>>>
> >>>>
> >>>> bios.a64 sounds to me like an RTDX library... nothing to do with CLK_xx
> >>>> functions.
> >>>>
> >>>> TI's code-gen tools for Linux are new and not widely used. I would
> >>>> suggest that you build using standard CCS v3.3 on a Win machine, and test
> >>>> that output code first. Since you have a "huge" code base, it's a good idea
> >>>> to eliminate any possible build error, library version, link error, etc.
> >>>>
> >>>> Think about it this way -- TI didn't have Linux based code-gen tools
> >>>> until recently (last couple of years). So that means since 1996, when they
> >>>> acquired GoDSP (Code Composer), they've been pouring manpower and millions
> >>>> into Win code-gen tools, not Linux. Which one do you think is more reliable
> >>>> and widely used?
> >>>>
> >>>
> >>> FYI - TI has been shipping Solaris compilers since the beginning of 'DSP
> >>> time' and Linux compilers [at least for the c6000] for about 5-6 years
> >>> although it hasn't been publicized. I am aware of a couple of very large
> >>> companies that use these to build their production products.
> >>>
> >>> mikedunn
> >>>
> >>>
> >>>
> >>> -Jeff
> >>>>
> >>>>
> >>>> On Tue, Jun 24, 2008 at 2:21 AM, Richard Williams <
> >>>> r...@lewiscounty.com> wrote:
> >>>>>
> >>>>> ittiam,
> >>>>>
> >>>>> from your description, it is rather obvious that some libraries are
> >>>>> missing (assuming that the
> >>>>> compile operations worked with no errors.)
> >>>>>
> >>>>> If you would post the names of the functions that are not found by the
> >>>>> linker, we could possibly
> >>>>> assist you in determing which libraries are missing.
> >>>>>
> >>>>> BTW:
> >>>>> why are you using cgywin, etc rather than the CCS IDE for the
> >>>>> compile/link operations?
> >>>>>
> >>>>> R. Williams
> >>>>>
> >>>>>
> >>>>> ---------- Original Message -----------
> >>>>> From: i...@gmail.com
> >>>>> To: c...
> >>>>> Sent: Mon, 23 Jun 2008 14:09:57 -0400
> >>>>> Subject: [c6x] Urgent Help Required: CLK_gethtime
> >>>>>
> >>>>> > Hi all,
> >>>>> >
> >>>>> > Platform : DSK6416.
> >>>>> > I have some problems regarding usage of BIOS with the header files
> >>>>> ,all my source code are
> >>>>> > compiled with Cygwin and TI C64x, this gives me the obj's which in
> >>>>> turn i am linking using
> >>>>> > the code composer, the problem is that i need to have this working
> >>>>> with the BIOS
> >>>>> > Clk_gethtime, if i use the function clk_gethtime with references of
> >>>>> the libraries it says
> >>>>> > that other references are missing, could anyone suggest me what are
> >>>>> the header files that
> >>>>> > need to be included to get the clk_gethtime working with proper
> >>>>> references. How can i
> >>>>> > start the bios if i cant use the GUI. Which are the header files that
> >>>>> need to be
> >>>>> > associated with it. The documentation regarding the Bios is very
> >>>>> poor, it is not quite
> >>>>> > clear about many aspects, if some one who had worked on BIOS could
> >>>>> throw a limelight it
> >>>>> > will be very helpfull for me .
> >>>>> >
> >>>>> > -BR
> >>>>> > -Goku
> >>>>>
> >>>>> ------- End of Original Message -------
> >>>>>
> >>>>>
> >>>>
> >>>
> >>>
> >>>
> >>> --
> >>> www.dsprelated.com/blogs-1/nf/Mike_Dunn.php
> >>>
> >>
> >>
> >
> >
> > --
> > www.dsprelated.com/blogs-1/nf/Mike_Dunn.php
> >
------- End of Original Message -------
Hello Dunn,

I have optimization on i.e o2, which tells that the loop wont be considered
? other question is that when i am using API's of CSL am getting
different cycle count, and if i am referring to directly to a Mem Loc of the
timer, am getting different result, which one is correct ?

Regards,
Goku

On Tue, Jun 24, 2008 at 10:58 PM, Michael Dunn
wrote:

> Goku,
>
> On 6/24/08, Goku wrote:
>
>> Hello Dunn,
>>
>> As you mentioned , i had configured the timer and running this piece of
>> code.
>>
>> #include
>> #include
>> #include
>> #include
>> //#include
>> #include "basecfg.h"
>> extern far TIMER_Handle hTimer1;
>> #define TIMER_CNT_REG 0x01980008
>> void main(void)
>> {
>> unsigned int start,over_head,i;
>> unsigned int stop,stop_profile,start_profile;
>> TIMER_start(hTimer1);
>> start_profile = *(volatile Uint32 *) TIMER_CNT_REG;
>> start = TIMER_getCount(hTimer1);
>> for(i=0;i<100000000;i++)
>> {
>> i=i+2;
>> }
>>
>> stop_profile = *(volatile Uint32 *) TIMER_CNT_REG;
>> stop = TIMER_getCount(hTimer1);
>> over_head = (stop_profile - start_profile);
>> printf("start: %d\n", start);
>> printf("stop: %d\n", stop);
>> printf("cycles: %d\n", stop - start);
>>
>> printf("start: %d\n", start_profile);
>> printf("stop: %d\n", stop_profile);
>> printf("cycles: %d\n", over_head);
>>
>> }
>> Results:
>> 1. without the loop
>> start: 110
>> stop: 135
>> cycles: 25
>>
>> start: 62
>> stop: 130
>> cycles: 68
>>
>> 2. With the loop.
>>
>> start: 110
>> stop: 135
>> cycles: 25
>>
>> start: 62
>> stop: 130
>> cycles: 68
> Did you compile with optimization?? If yes, the code generator could have
> thrown out your loop. If you reference i after the loop [like a printf], it
> will not throw it out if that is the problem.
>
> The Configuration is done with the help of the GUI .cdb, where in Source
>> for the Clock = CPU/8 with initial value set Control Register 0x000003C1,
>> Period Register: 0x00002000.
>>
>> If i insert a function call in the main the timer value rapidly increases
>> or decreases whenever the same program is run many time with huge variation.
>>
>> Can you explain why the variation of the clock cycles happen?
> Are you talking about your simple example or some 'real code'. Fort 'real
> code', program flow, cache hits/misses, conflict stalls, and a few more
> things I am sure.
>
> Now that i am not using Bios , wanted to know whether this is the ideal
>> method to Benchmark DSK 6416. Kindly help.
> It depends on what you are trying to profile. For this method [or actually
> any profiling], make sure that there is never a 'printf' [or any stdio]
> between profile points. To keep overhead simple, you can do the following.
> 1. initialize and start the counter to run continuously
> 2. create a global array of structures one entry per profile point -
> myTime.start,myTime.stop
> 3. at the profile points use
> 'gTimeCounts[n].myTime.start=TIMER_getCount(hTimer1)', etc.
> 4. You can tweak it to only get the first, second, etc or use a different
> format to get 10 samples, etc.
>
> You can also profile through CCS to get a good overview and then profile
> individual functions as needed.
>
> mikedunn
>
> Regards,
>> Goku
>> On Tue, Jun 24, 2008 at 7:01 PM, Michael Dunn
>> wrote:
>>
>>> Goku,
>>>
>>> On 6/24/08, Goku wrote:
>>>
>>>> Hi All,
>>>>
>>>> Can i configure the timer without the BIOS Support, earlier many people
>>>> have told that without the BIOS configured correctly timer cant be started ,
>>>> the sequence need to be completed before it could be used. Can you confirm
>>>> pls.
>>>
>>>
>>> Absolutely incorrect. If you are benchmarking 'non-BIOS code' you can
>>> access the timer directly - if you build with BIOS, you are actually adding
>>> an RTOS.
>>>
>>> I believe that you can find timer init code in the archives - I don't
>>> remember if there are any examples in CCS. Once you get it running, all that
>>> you need to do is a mem read to get the count.
>>>
>>> mikedunn
>>>
>>> Regards,
>>>> Goku
>>>>
>>>> On Tue, Jun 24, 2008 at 6:14 PM, Michael Dunn
>>>> wrote:
>>>>
>>>>> Goku,
>>>>>
>>>>> On 6/24/08, Jeff Brower wrote:
>>>>>>
>>>>>> Goku-
>>>>>>
>>>>>>
>>>>>> Since i am benchmarking different applications which are ported from
>>>>>> linux, the linking is done with a makefile which has a huge code base, am
>>>>>> using cygwin and CCS compiler, but not the IDE, target is connected to a
>>>>>> different machine which has the CCS IDE, hence here i cant use the GUI
>>>>>> interface, i dont know how could i use Clk_gethtime without the CCS IDE GUI
>>>>>> Bios Start, could you pls let me know.
>>>>>>
>>>>>>
>>>>> Now that I am paying attention to what you are saying :-)
>>>>> Do not use the Clk_gethtime BIOS function. All that you really need to
>>>>> do is:
>>>>> 1. Configure the timer
>>>>> 2. read the timer
>>>>> This will add minimum impact to your actual code performance.
>>>>>
>>>>>
>>>>>
>>>>> CLK_gethtime should be in the basic run-time library, rts64xx.lib
>>>>>> (not sure of that correct name, but look for rts64-something).
>>>>>>
>>>>>>
>>>>> This is actually a DSP/BIOS function which means that you have to add
>>>>> BIOS to use it - a bad idea for this purpose.
>>>>>
>>>>>
>>>>>>
>>>>>> Error: _CLK_gethtime undefined symbol.
>>>>>>
>>>>>> I could see that Clk_gethtime library is missing , if i add the
>>>>>> libraries like bios.a64 and others , they tend to say that there are many
>>>>>> other symbols which are not defined.
>>>>>>
>>>>>>
>>>>>> bios.a64 sounds to me like an RTDX library... nothing to do with
>>>>>> CLK_xx functions.
>>>>>>
>>>>>> TI's code-gen tools for Linux are new and not widely used. I would
>>>>>> suggest that you build using standard CCS v3.3 on a Win machine, and test
>>>>>> that output code first. Since you have a "huge" code base, it's a good idea
>>>>>> to eliminate any possible build error, library version, link error, etc.
>>>>>>
>>>>>> Think about it this way -- TI didn't have Linux based code-gen tools
>>>>>> until recently (last couple of years). So that means since 1996, when they
>>>>>> acquired GoDSP (Code Composer), they've been pouring manpower and millions
>>>>>> into Win code-gen tools, not Linux. Which one do you think is more reliable
>>>>>> and widely used?
>>>>>>
>>>>>
>>>>> FYI - TI has been shipping Solaris compilers since the beginning of
>>>>> 'DSP time' and Linux compilers [at least for the c6000] for about 5-6 years
>>>>> although it hasn't been publicized. I am aware of a couple of very large
>>>>> companies that use these to build their production products.
>>>>>
>>>>> mikedunn
>>>>>
>>>>>
>>>>>
>>>>> -Jeff
>>>>>>
>>>>>>
>>>>>> On Tue, Jun 24, 2008 at 2:21 AM, Richard Williams <
>>>>>> r...@lewiscounty.com> wrote:
>>>>>>>
>>>>>>> ittiam,
>>>>>>>
>>>>>>> from your description, it is rather obvious that some libraries are
>>>>>>> missing (assuming that the
>>>>>>> compile operations worked with no errors.)
>>>>>>>
>>>>>>> If you would post the names of the functions that are not found by
>>>>>>> the linker, we could possibly
>>>>>>> assist you in determing which libraries are missing.
>>>>>>>
>>>>>>> BTW:
>>>>>>> why are you using cgywin, etc rather than the CCS IDE for the
>>>>>>> compile/link operations?
>>>>>>>
>>>>>>> R. Williams
>>>>>>>
>>>>>>>
>>>>>>> ---------- Original Message -----------
>>>>>>> From: i...@gmail.com
>>>>>>> To: c...
>>>>>>> Sent: Mon, 23 Jun 2008 14:09:57 -0400
>>>>>>> Subject: [c6x] Urgent Help Required: CLK_gethtime
>>>>>>>
>>>>>>> > Hi all,
>>>>>>> >
>>>>>>> > Platform : DSK6416.
>>>>>>> > I have some problems regarding usage of BIOS with the header files
>>>>>>> ,all my source code are
>>>>>>> > compiled with Cygwin and TI C64x, this gives me the obj's which in
>>>>>>> turn i am linking using
>>>>>>> > the code composer, the problem is that i need to have this working
>>>>>>> with the BIOS
>>>>>>> > Clk_gethtime, if i use the function clk_gethtime with references of
>>>>>>> the libraries it says
>>>>>>> > that other references are missing, could anyone suggest me what are
>>>>>>> the header files that
>>>>>>> > need to be included to get the clk_gethtime working with proper
>>>>>>> references. How can i
>>>>>>> > start the bios if i cant use the GUI. Which are the header files
>>>>>>> that need to be
>>>>>>> > associated with it. The documentation regarding the Bios is very
>>>>>>> poor, it is not quite
>>>>>>> > clear about many aspects, if some one who had worked on BIOS could
>>>>>>> throw a limelight it
>>>>>>> > will be very helpfull for me .
>>>>>>> >
>>>>>>> > -BR
>>>>>>> > -Goku
>>>>>>>
>>>>>>> ------- End of Original Message -------
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> www.dsprelated.com/blogs-1/nf/Mike_Dunn.php
>>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> www.dsprelated.com/blogs-1/nf/Mike_Dunn.php
>>>
> --
> www.dsprelated.com/blogs-1/nf/Mike_Dunn.php
>
Goku,

On 6/25/08, Goku wrote:
>
> Hello Dunn,
>
> I have optimization on i.e o2, which tells that the loop wont be considered
> ? other question is that when i am using API's of CSL am getting
> different cycle count, and if i am referring to directly to a Mem Loc of the
> timer, am getting different result, which one is correct ?
How much different?? If it is a small difference, the CSL may have some
additional overhead or the code is getting optimized differently. If it is
a very large difference, you may be reading two different counters.

You can have the compiler create the '.asm' files and look at the generated
code.

mikedunn

Regards,
> Goku
>
> On Tue, Jun 24, 2008 at 10:58 PM, Michael Dunn
> wrote:
>
>> Goku,
>>
>> On 6/24/08, Goku wrote:
>>
>>> Hello Dunn,
>>>
>>> As you mentioned , i had configured the timer and running this piece of
>>> code.
>>>
>>> #include
>>> #include
>>> #include
>>> #include
>>> //#include
>>> #include "basecfg.h"
>>> extern far TIMER_Handle hTimer1;
>>> #define TIMER_CNT_REG 0x01980008
>>> void main(void)
>>> {
>>> unsigned int start,over_head,i;
>>> unsigned int stop,stop_profile,start_profile;
>>> TIMER_start(hTimer1);
>>> start_profile = *(volatile Uint32 *) TIMER_CNT_REG;
>>> start = TIMER_getCount(hTimer1);
>>> for(i=0;i<100000000;i++)
>>> {
>>> i=i+2;
>>> }
>>>
>>> stop_profile = *(volatile Uint32 *) TIMER_CNT_REG;
>>> stop = TIMER_getCount(hTimer1);
>>> over_head = (stop_profile - start_profile);
>>> printf("start: %d\n", start);
>>> printf("stop: %d\n", stop);
>>> printf("cycles: %d\n", stop - start);
>>>
>>> printf("start: %d\n", start_profile);
>>> printf("stop: %d\n", stop_profile);
>>> printf("cycles: %d\n", over_head);
>>>
>>> }
>>> Results:
>>> 1. without the loop
>>> start: 110
>>> stop: 135
>>> cycles: 25
>>>
>>> start: 62
>>> stop: 130
>>> cycles: 68
>>>
>>> 2. With the loop.
>>>
>>> start: 110
>>> stop: 135
>>> cycles: 25
>>>
>>> start: 62
>>> stop: 130
>>> cycles: 68
>> Did you compile with optimization?? If yes, the code generator could have
>> thrown out your loop. If you reference i after the loop [like a printf], it
>> will not throw it out if that is the problem.
>>
>> The Configuration is done with the help of the GUI .cdb, where in Source
>>> for the Clock = CPU/8 with initial value set Control Register 0x000003C1,
>>> Period Register: 0x00002000.
>>>
>>> If i insert a function call in the main the timer value rapidly
>>> increases or decreases whenever the same program is run many time with huge
>>> variation.
>>> Can you explain why the variation of the clock cycles happen?
>> Are you talking about your simple example or some 'real code'. Fort 'real
>> code', program flow, cache hits/misses, conflict stalls, and a few more
>> things I am sure.
>>
>> Now that i am not using Bios , wanted to know whether this is the ideal
>>> method to Benchmark DSK 6416. Kindly help.
>> It depends on what you are trying to profile. For this method [or
>> actually any profiling], make sure that there is never a 'printf' [or any
>> stdio] between profile points. To keep overhead simple, you can do the
>> following.
>> 1. initialize and start the counter to run continuously
>> 2. create a global array of structures one entry per profile point -
>> myTime.start,myTime.stop
>> 3. at the profile points use
>> 'gTimeCounts[n].myTime.start=TIMER_getCount(hTimer1)', etc.
>> 4. You can tweak it to only get the first, second, etc or use a different
>> format to get 10 samples, etc.
>>
>> You can also profile through CCS to get a good overview and then profile
>> individual functions as needed.
>>
>> mikedunn
>>
>> Regards,
>>> Goku
>>>
>>>
>>> On Tue, Jun 24, 2008 at 7:01 PM, Michael Dunn
>>> wrote:
>>>
>>>> Goku,
>>>>
>>>> On 6/24/08, Goku wrote:
>>>>
>>>>> Hi All,
>>>>>
>>>>> Can i configure the timer without the BIOS Support, earlier many people
>>>>> have told that without the BIOS configured correctly timer cant be started ,
>>>>> the sequence need to be completed before it could be used. Can you confirm
>>>>> pls.
>>>>
>>>>
>>>> Absolutely incorrect. If you are benchmarking 'non-BIOS code' you can
>>>> access the timer directly - if you build with BIOS, you are actually adding
>>>> an RTOS.
>>>>
>>>> I believe that you can find timer init code in the archives - I don't
>>>> remember if there are any examples in CCS. Once you get it running, all that
>>>> you need to do is a mem read to get the count.
>>>>
>>>> mikedunn
>>>>
>>>> Regards,
>>>>> Goku
>>>>>
>>>>> On Tue, Jun 24, 2008 at 6:14 PM, Michael Dunn
>>>>> wrote:
>>>>>
>>>>>> Goku,
>>>>>>
>>>>>> On 6/24/08, Jeff Brower wrote:
>>>>>>>
>>>>>>> Goku-
>>>>>>>
>>>>>>>
>>>>>>> Since i am benchmarking different applications which are ported from
>>>>>>> linux, the linking is done with a makefile which has a huge code base, am
>>>>>>> using cygwin and CCS compiler, but not the IDE, target is connected to a
>>>>>>> different machine which has the CCS IDE, hence here i cant use the GUI
>>>>>>> interface, i dont know how could i use Clk_gethtime without the CCS IDE GUI
>>>>>>> Bios Start, could you pls let me know.
>>>>>>>
>>>>>>>
>>>>>> Now that I am paying attention to what you are saying :-)
>>>>>> Do not use the Clk_gethtime BIOS function. All that you really need to
>>>>>> do is:
>>>>>> 1. Configure the timer
>>>>>> 2. read the timer
>>>>>> This will add minimum impact to your actual code performance.
>>>>>>
>>>>>>
>>>>>>
>>>>>> CLK_gethtime should be in the basic run-time library, rts64xx.lib
>>>>>>> (not sure of that correct name, but look for rts64-something).
>>>>>>>
>>>>>>>
>>>>>> This is actually a DSP/BIOS function which means that you have to add
>>>>>> BIOS to use it - a bad idea for this purpose.
>>>>>>
>>>>>>
>>>>>>>
>>>>>>> Error: _CLK_gethtime undefined symbol.
>>>>>>>
>>>>>>> I could see that Clk_gethtime library is missing , if i add the
>>>>>>> libraries like bios.a64 and others , they tend to say that there are many
>>>>>>> other symbols which are not defined.
>>>>>>>
>>>>>>>
>>>>>>> bios.a64 sounds to me like an RTDX library... nothing to do with
>>>>>>> CLK_xx functions.
>>>>>>>
>>>>>>> TI's code-gen tools for Linux are new and not widely used. I would
>>>>>>> suggest that you build using standard CCS v3.3 on a Win machine, and test
>>>>>>> that output code first. Since you have a "huge" code base, it's a good idea
>>>>>>> to eliminate any possible build error, library version, link error, etc.
>>>>>>>
>>>>>>> Think about it this way -- TI didn't have Linux based code-gen tools
>>>>>>> until recently (last couple of years). So that means since 1996, when they
>>>>>>> acquired GoDSP (Code Composer), they've been pouring manpower and millions
>>>>>>> into Win code-gen tools, not Linux. Which one do you think is more reliable
>>>>>>> and widely used?
>>>>>>>
>>>>>>
>>>>>> FYI - TI has been shipping Solaris compilers since the beginning of
>>>>>> 'DSP time' and Linux compilers [at least for the c6000] for about 5-6 years
>>>>>> although it hasn't been publicized. I am aware of a couple of very large
>>>>>> companies that use these to build their production products.
>>>>>>
>>>>>> mikedunn
>>>>>>
>>>>>>
>>>>>>
>>>>>> -Jeff
>>>>>>>
>>>>>>>
>>>>>>> On Tue, Jun 24, 2008 at 2:21 AM, Richard Williams <
>>>>>>> r...@lewiscounty.com> wrote:
>>>>>>>>
>>>>>>>> ittiam,
>>>>>>>>
>>>>>>>> from your description, it is rather obvious that some libraries are
>>>>>>>> missing (assuming that the
>>>>>>>> compile operations worked with no errors.)
>>>>>>>>
>>>>>>>> If you would post the names of the functions that are not found by
>>>>>>>> the linker, we could possibly
>>>>>>>> assist you in determing which libraries are missing.
>>>>>>>>
>>>>>>>> BTW:
>>>>>>>> why are you using cgywin, etc rather than the CCS IDE for the
>>>>>>>> compile/link operations?
>>>>>>>>
>>>>>>>> R. Williams
>>>>>>>>
>>>>>>>>
>>>>>>>> ---------- Original Message -----------
>>>>>>>> From: i...@gmail.com
>>>>>>>> To: c...
>>>>>>>> Sent: Mon, 23 Jun 2008 14:09:57 -0400
>>>>>>>> Subject: [c6x] Urgent Help Required: CLK_gethtime
>>>>>>>>
>>>>>>>> > Hi all,
>>>>>>>> >
>>>>>>>> > Platform : DSK6416.
>>>>>>>> > I have some problems regarding usage of BIOS with the header files
>>>>>>>> ,all my source code are
>>>>>>>> > compiled with Cygwin and TI C64x, this gives me the obj's which in
>>>>>>>> turn i am linking using
>>>>>>>> > the code composer, the problem is that i need to have this working
>>>>>>>> with the BIOS
>>>>>>>> > Clk_gethtime, if i use the function clk_gethtime with references
>>>>>>>> of the libraries it says
>>>>>>>> > that other references are missing, could anyone suggest me what
>>>>>>>> are the header files that
>>>>>>>> > need to be included to get the clk_gethtime working with proper
>>>>>>>> references. How can i
>>>>>>>> > start the bios if i cant use the GUI. Which are the header files
>>>>>>>> that need to be
>>>>>>>> > associated with it. The documentation regarding the Bios is very
>>>>>>>> poor, it is not quite
>>>>>>>> > clear about many aspects, if some one who had worked on BIOS could
>>>>>>>> throw a limelight it
>>>>>>>> > will be very helpfull for me .
>>>>>>>> >
>>>>>>>> > -BR
>>>>>>>> > -Goku
>>>>>>>>
>>>>>>>> ------- End of Original Message -------
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> www.dsprelated.com/blogs-1/nf/Mike_Dunn.php
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> www.dsprelated.com/blogs-1/nf/Mike_Dunn.php
>>>>
>>>
>>>
>> --
>> www.dsprelated.com/blogs-1/nf/Mike_Dunn.php
>>
--
www.dsprelated.com/blogs-1/nf/Mike_Dunn.php
Goku-
> I have included rts6400.lib, but it is not defined in it, am using CCS 3.3 Version,
> still getting the same error ," not able to resolve the symbol definition" .Could
> you let me know the details pls.

_CLK_gethtime is defined in bios.a64, or similar depending on the DSP type. I think
it gets resolved to CLK_F_gethtime (function defined in asm code). bios.a64 file is
not an rtdx lib file; ignore my previous comment,

Mike and Richard's suggestions about simpler ways to benchmark and profile code are
accurate and useful. You should try those. If for some reason you still want to use
_CLK_gethtime, then you have to use it together with _CLK_getltime and also have to
deal with issues of timer wrap-around and interrupt enable/disable for _getltime.
This doc has a good explanation:

http://focus.ti.com/lit/an/spra829/spra829.pdf

-Jeff
> On Tue, Jun 24, 2008 at 5:21 PM, Jeff Brower wrote:
>
> Goku-
> > Since i am benchmarking different applications which are ported from
> > linux, the linking is done with a makefile which has a huge code base,
> > am using cygwin and CCS compiler, but not the IDE, target is connected
> > to a different machine which has the CCS IDE, hence here i cant use the
> > GUI interface, i dont know how could i use Clk_gethtime without the CCS
> > IDE GUI Bios Start, could you pls let me know.
> CLK_gethtime should be in the basic run-time library, rts64xx.lib (not
> sure of that correct name, but look for rts64-something).
> > Error: _CLK_gethtime undefined symbol.
> >
> > I could see that Clk_gethtime library is missing , if i add the
> > libraries like bios.a64 and others , they tend to say that there are
> > many other symbols which are not defined.
> bios.a64 sounds to me like an RTDX library... nothing to do with CLK_xx
> functions.
>
> TI's code-gen tools for Linux are new and not widely used. I would
> suggest that you build using standard CCS v3.3 on a Win machine, and test
> that output code first. Since you have a "huge" code base, it's a good
> idea to eliminate any possible build error, library version, link error,
> etc.
>
> Think about it this way -- TI didn't have Linux based code-gen tools
> until recently (last couple of years). So that means since 1996, when
> they acquired GoDSP (Code Composer), they've been pouring manpower and
> millions into Win code-gen tools, not Linux. Which one do you think is
> more reliable and widely used?
>
> -Jeff
> > On Tue, Jun 24, 2008 at 2:21 AM, Richard Williams
> > wrote:
> >
> > ittiam,
> >
> > from your description, it is rather obvious that some
> > libraries are missing (assuming that the
> > compile operations worked with no errors.)
> >
> > If you would post the names of the functions that are not
> > found by the linker, we could possibly
> > assist you in determing which libraries are missing.
> >
> > BTW:
> > why are you using cgywin, etc rather than the CCS IDE for the
> > compile/link operations?
> >
> > R. Williams
> >
> > ---------- Original Message -----------
> > From: i...@gmail.com
> > To: c...
> > Sent: Mon, 23 Jun 2008 14:09:57 -0400
> > Subject: [c6x] Urgent Help Required: CLK_gethtime
> >
> > > Hi all,
> > >
> > > Platform : DSK6416.
> > > I have some problems regarding usage of BIOS with the
> > header files ,all my source code are
> > > compiled with Cygwin and TI C64x, this gives me the obj's
> > which in turn i am linking using
> > > the code composer, the problem is that i need to have this
> > working with the BIOS
> > > Clk_gethtime, if i use the function clk_gethtime with
> > references of the libraries it says
> > > that other references are missing, could anyone suggest me
> > what are the header files that
> > > need to be included to get the clk_gethtime working with
> > proper references. How can i
> > > start the bios if i cant use the GUI. Which are the header
> > files that need to be
> > > associated with it. The documentation regarding the Bios is
> > very poor, it is not quite
> > > clear about many aspects, if some one who had worked on
> > BIOS could throw a limelight it
> > > will be very helpfull for me .
> > >
> > > -BR
> > > -Goku------- End of Original Message -------
> >
Hello,

I had configured the Timer as per Dunn, with the following configurations,
and i am experiencing huge amount of clock cycle differences for the
execution of the same code.

Please Could any one of you explain the same,

Code : MP3 Player.

Result :
Iterations = 1
-- Target Duration = 1417161654 X 8 Clock Cycles - > CPU/8 config for
the timer
Iterations = 2
-- Target Duration = 815201933 X 8 Clock Cycles - > CPU/8 config for the
timer
The same code was rerun after a successful reboot of the DSK 6416 and then i
got the result for Iteration 2 which is almost half of the cycles taken for
Iteration 1. When i was using the debugger CCS Singles step i could see that
the timer was overflowing in the timer register, even though i had set
values set for PRD : FFFFFFFF , CNT -> Start with a Reset, Clk-: Tick= 1000
Microseconds/Int, HWi_14 configured for Timer 0 , i could understand this
behaviour .
Can anyone pls let me know why there is a huge variation in the clock
cycles, all of my code resides in the SD RAM, and HWINIT_VEC are residing in
the Internal memory.

Regards,
Goku

On Thu, Jun 26, 2008 at 12:19 PM, Jeff Brower
wrote:

> Goku-
> I have included rts6400.lib, but it is not defined in it, am using CCS 3.3
> Version, still getting the same error ," not able to resolve the symbol
> definition" .Could you let me know the details pls.
> _CLK_gethtime is defined in bios.a64, or similar depending on the DSP
> type. I think it gets resolved to CLK_F_gethtime (function defined in asm
> code). bios.a64 file is not an rtdx lib file; ignore my previous comment,
>
> Mike and Richard's suggestions about simpler ways to benchmark and profile
> code are accurate and useful. You should try those. If for some reason you
> still want to use _CLK_gethtime, then you have to use it together with
> _CLK_getltime and also have to deal with issues of timer wrap-around and
> interrupt enable/disable for _getltime. This doc has a good explanation:
>
> http://focus.ti.com/lit/an/spra829/spra829.pdf
>
> -Jeff
> On Tue, Jun 24, 2008 at 5:21 PM, Jeff Brower
> wrote:
>>
>> Goku-
>>
>> Since i am benchmarking different applications which are ported from
>> linux, the linking is done with a makefile which has a huge code base, am
>> using cygwin and CCS compiler, but not the IDE, target is connected to a
>> different machine which has the CCS IDE, hence here i cant use the GUI
>> interface, i dont know how could i use Clk_gethtime without the CCS IDE GUI
>> Bios Start, could you pls let me know.
>> CLK_gethtime should be in the basic run-time library, rts64xx.lib (not
>> sure of that correct name, but look for rts64-something).
>> Error: _CLK_gethtime undefined symbol.
>>
>> I could see that Clk_gethtime library is missing , if i add the libraries
>> like bios.a64 and others , they tend to say that there are many other
>> symbols which are not defined.
>> bios.a64 sounds to me like an RTDX library... nothing to do with CLK_xx
>> functions.
>>
>> TI's code-gen tools for Linux are new and not widely used. I would
>> suggest that you build using standard CCS v3.3 on a Win machine, and test
>> that output code first. Since you have a "huge" code base, it's a good idea
>> to eliminate any possible build error, library version, link error, etc.
>>
>> Think about it this way -- TI didn't have Linux based code-gen tools until
>> recently (last couple of years). So that means since 1996, when they
>> acquired GoDSP (Code Composer), they've been pouring manpower and millions
>> into Win code-gen tools, not Linux. Which one do you think is more reliable
>> and widely used?
>>
>> -Jeff
>> On Tue, Jun 24, 2008 at 2:21 AM, Richard Williams
>> wrote:
>>>
>>> ittiam,
>>>
>>> from your description, it is rather obvious that some libraries are
>>> missing (assuming that the
>>> compile operations worked with no errors.)
>>>
>>> If you would post the names of the functions that are not found by the
>>> linker, we could possibly
>>> assist you in determing which libraries are missing.
>>>
>>> BTW:
>>> why are you using cgywin, etc rather than the CCS IDE for the
>>> compile/link operations?
>>>
>>> R. Williams
>>>
>>> ---------- Original Message -----------
>>> From: i...@gmail.com
>>> To: c...
>>> Sent: Mon, 23 Jun 2008 14:09:57 -0400
>>> Subject: [c6x] Urgent Help Required: CLK_gethtime
>>>
>>> > Hi all,
>>> >
>>> > Platform : DSK6416.
>>> > I have some problems regarding usage of BIOS with the header files ,all
>>> my source code are
>>> > compiled with Cygwin and TI C64x, this gives me the obj's which in turn
>>> i am linking using
>>> > the code composer, the problem is that i need to have this working with
>>> the BIOS
>>> > Clk_gethtime, if i use the function clk_gethtime with references of the
>>> libraries it says
>>> > that other references are missing, could anyone suggest me what are the
>>> header files that
>>> > need to be included to get the clk_gethtime working with proper
>>> references. How can i
>>> > start the bios if i cant use the GUI. Which are the header files that
>>> need to be
>>> > associated with it. The documentation regarding the Bios is very poor,
>>> it is not quite
>>> > clear about many aspects, if some one who had worked on BIOS could
>>> throw a limelight it
>>> > will be very helpfull for me .
>>> >
>>> > -BR
>>> > -Goku------- End of Original Message -------
>>>
>>>
Goku,

On 6/26/08, Goku wrote:
>
> Hello,
>
> I had configured the Timer as per Dunn, with the following configurations,
> and i am experiencing huge amount of clock cycle differences for the
> execution of the same code.
>
> Please Could any one of you explain the same,
>
> Code : MP3 Player.
>
> Result :
> Iterations = 1
> -- Target Duration = 1417161654 X 8 Clock Cycles - > CPU/8 config for
> the timer
>
> Iterations = 2
> -- Target Duration = 815201933 X 8 Clock Cycles - > CPU/8 config for
> the timer
> The same code was rerun after a successful reboot of the DSK 6416 and then
> i got the result for Iteration 2 which is almost half of the cycles taken
> for Iteration 1.
>

The very first pass will have nothing in L1 cache and you will get 100%
misses. Passes 2 and later should have similar times [assuming similat code
flow].

When i was using the debugger CCS Singles step i could see that the timer
> was overflowing in the timer register, even though i had set values set for
> PRD : FFFFFFFF , CNT -> Start with a Reset, Clk-: Tick= 1000
> Microseconds/Int, HWi_14 configured for Timer 0 , i could understand this
> behaviour .
>

The timer knows nothing about the CPU state and will not give reliable
numbers when you halt the DSP. If you want to manually profile a function,
use the 'profile clock' in CCS. It will update when you single step.

mikedunn

Can anyone pls let me know why there is a huge variation in the clock
> cycles, all of my code resides in the SD RAM, and HWINIT_VEC are residing in
> the Internal memory.
>
> Regards,
> Goku
> On Thu, Jun 26, 2008 at 12:19 PM, Jeff Brower
> wrote:
>
>> Goku-
>> I have included rts6400.lib, but it is not defined in it, am using CCS 3.3
>> Version, still getting the same error ," not able to resolve the symbol
>> definition" .Could you let me know the details pls.
>> _CLK_gethtime is defined in bios.a64, or similar depending on the DSP
>> type. I think it gets resolved to CLK_F_gethtime (function defined in asm
>> code). bios.a64 file is not an rtdx lib file; ignore my previous comment,
>>
>> Mike and Richard's suggestions about simpler ways to benchmark and profile
>> code are accurate and useful. You should try those. If for some reason you
>> still want to use _CLK_gethtime, then you have to use it together with
>> _CLK_getltime and also have to deal with issues of timer wrap-around and
>> interrupt enable/disable for _getltime. This doc has a good explanation:
>>
>> http://focus.ti.com/lit/an/spra829/spra829.pdf
>>
>> -Jeff
>> On Tue, Jun 24, 2008 at 5:21 PM, Jeff Brower
>> wrote:
>>>
>>> Goku-
>>>
>>> Since i am benchmarking different applications which are ported from
>>> linux, the linking is done with a makefile which has a huge code base, am
>>> using cygwin and CCS compiler, but not the IDE, target is connected to a
>>> different machine which has the CCS IDE, hence here i cant use the GUI
>>> interface, i dont know how could i use Clk_gethtime without the CCS IDE GUI
>>> Bios Start, could you pls let me know.
>>>
>>>
>>> CLK_gethtime should be in the basic run-time library, rts64xx.lib (not
>>> sure of that correct name, but look for rts64-something).
>>>
>>>
>>> Error: _CLK_gethtime undefined symbol.
>>>
>>> I could see that Clk_gethtime library is missing , if i add the libraries
>>> like bios.a64 and others , they tend to say that there are many other
>>> symbols which are not defined.
>>>
>>>
>>> bios.a64 sounds to me like an RTDX library... nothing to do with CLK_xx
>>> functions.
>>>
>>> TI's code-gen tools for Linux are new and not widely used. I would
>>> suggest that you build using standard CCS v3.3 on a Win machine, and test
>>> that output code first. Since you have a "huge" code base, it's a good idea
>>> to eliminate any possible build error, library version, link error, etc.
>>>
>>> Think about it this way -- TI didn't have Linux based code-gen tools
>>> until recently (last couple of years). So that means since 1996, when they
>>> acquired GoDSP (Code Composer), they've been pouring manpower and millions
>>> into Win code-gen tools, not Linux. Which one do you think is more reliable
>>> and widely used?
>>>
>>> -Jeff
>>>
>>>
>>> On Tue, Jun 24, 2008 at 2:21 AM, Richard Williams <
>>> r...@lewiscounty.com> wrote:
>>>>
>>>> ittiam,
>>>>
>>>> from your description, it is rather obvious that some libraries are
>>>> missing (assuming that the
>>>> compile operations worked with no errors.)
>>>>
>>>> If you would post the names of the functions that are not found by the
>>>> linker, we could possibly
>>>> assist you in determing which libraries are missing.
>>>>
>>>> BTW:
>>>> why are you using cgywin, etc rather than the CCS IDE for the
>>>> compile/link operations?
>>>>
>>>> R. Williams
>>>>
>>>> ---------- Original Message -----------
>>>> From: i...@gmail.com
>>>> To: c...
>>>> Sent: Mon, 23 Jun 2008 14:09:57 -0400
>>>> Subject: [c6x] Urgent Help Required: CLK_gethtime
>>>>
>>>> > Hi all,
>>>> >
>>>> > Platform : DSK6416.
>>>> > I have some problems regarding usage of BIOS with the header files
>>>> ,all my source code are
>>>> > compiled with Cygwin and TI C64x, this gives me the obj's which in
>>>> turn i am linking using
>>>> > the code composer, the problem is that i need to have this working
>>>> with the BIOS
>>>> > Clk_gethtime, if i use the function clk_gethtime with references of
>>>> the libraries it says
>>>> > that other references are missing, could anyone suggest me what are
>>>> the header files that
>>>> > need to be included to get the clk_gethtime working with proper
>>>> references. How can i
>>>> > start the bios if i cant use the GUI. Which are the header files that
>>>> need to be
>>>> > associated with it. The documentation regarding the Bios is very poor,
>>>> it is not quite
>>>> > clear about many aspects, if some one who had worked on BIOS could
>>>> throw a limelight it
>>>> > will be very helpfull for me .
>>>> >
>>>> > -BR
>>>> > -Goku------- End of Original Message -------
>>>>
>>>>

--
www.dsprelated.com/blogs-1/nf/Mike_Dunn.php