DSPRelated.com
Forums

The DSP runs at very low speed

Started by Coskun AYYILDIZ March 11, 2011
Hi everyone,

I am using DM3730 (having C64X+ in it) to run a simple for loop. What I see is
that the DSP is running at very very low speed.

I am using Blackhawk USB560 BP emulator and EVAL version of CCSv4 (without
BIOS). I runnnig the following piece of code.

#include
#include

void main()
{
int i, s1, s2, t;
s1 = time(NULL);
for(i = 0; i < 100000000; i++)
{}
s2 = time(NULL);
t = s2 - s1;
printf("t = %d s", t);
}

After executing this code, I see t = 14 s. It means that the DSP is running at 7
MHz. I would expect it to be 800 MHz.
What causes the DSP to run this much slowly? Is it because I am using the EVAL
version of CCS? Can anyone suggest me how I can fix it?

Besides, is there a way to learn the exact clock frequency of the DSP.

Best Regards,

Coskun
Coskun,

There are a couple of things to note here.

First, how are you converting that 'for' loop elapsed time into 7mhz?

Second, your code is not setting the PLL registers , so the CPU will by running
at the default speed (which is far less than the max speed available.)

What clock crystal is in your board?

R. Williams

---------- Original Message -----------
From: Coskun AYYILDIZ
To: c...
Sent: Fri, 11 Mar 2011 03:37:11 -0800 (PST)
Subject: [c6x] The DSP runs at very low speed

> Hi everyone,
>
> I am using DM3730 (having C64X+ in it) to run a simple for loop. What
> I see is that the DSP is running at very very low speed.
>
> I am using Blackhawk USB560 BP emulator and EVAL version of CCSv4
> (without BIOS). I runnnig the following piece of code.
>
> #include
> #include void main()
> {
> int i, s1, s2, t;
> s1 = time(NULL);
> for(i = 0; i < 100000000; i++)
> {}
> s2 = time(NULL);
> t = s2 - s1;
> printf("t = %d s", t);
> }
>
> After executing this code, I see t = 14 s. It means that the DSP is
> running at 7 MHz. I would expect it to be 800 MHz.
>
> What causes the DSP to run this much slowly? Is it because I am using
> the EVAL version of CCS? Can anyone suggest me how I can fix it?
>
> Besides, is there a way to learn the exact clock frequency of the DSP.
>
> Best Regards,
>
> Coskun
------- End of Original Message -------

_____________________________________
Hi,

Thanks for your reply.

>>First, how are you converting that 'for' loop elapsed time into 7mhz?

I get the 7MHz decision because, the for loop counts for 100.000.000 and it
takes it 14s to finish counting.
So, considering that one loop takes one cycle (maybe more), 100.000.000/14 7.1428..
It is an intuitive approach, maybe not exactly 7 MHz but surely less than what I
would expect.
Besides, now I read the TSCL and TSCH registers and see that the DSP is really
slow.

>>Second, your code is not setting the PLL registers , so the CPU will by
>>running at the default speed (which is far less than the max speed available.)

Yes, my code does not set any register. I couldnt actually figure out how to
make the DSP run at maximum speed by configuring the PLL register. How can I use
800MHz?

Thanks.

Best Regards

________________________________
From: Richard Williams
To: Coskun AYYILDIZ ; c...
Sent: Sun, March 13, 2011 2:10:54 AM
Subject: Re: [c6x] The DSP runs at very low speed
Coskun,

There are a couple of things to note here.

First, how are you converting that 'for' loop elapsed time into 7mhz?

Second, your code is not setting the PLL registers , so the CPU will by running
at the default speed (which is far less than the max speed available.)

What clock crystal is in your board?

R. Williams

---------- Original Message -----------
From: Coskun AYYILDIZ
To: c...
Sent: Fri, 11 Mar 2011 03:37:11 -0800 (PST)
Subject: [c6x] The DSP runs at very low speed

> Hi everyone,
>
> I am using DM3730 (having C64X+ in it) to run a simple for loop. What
> I see is that the DSP is running at very very low speed.
>
> I am using Blackhawk USB560 BP emulator and EVAL version of CCSv4
> (without BIOS). I runnnig the following piece of code.
>
> #include
> #include void main()
> {
> int i, s1, s2, t;
> s1 = time(NULL);
> for(i = 0; i < 100000000; i++)
> {}
> s2 = time(NULL);
> t = s2 - s1;
> printf("t = %d s", t);
> }
>
> After executing this code, I see t = 14 s. It means that the DSP is
> running at 7 MHz. I would expect it to be 800 MHz.
>
> What causes the DSP to run this much slowly? Is it because I am using
> the EVAL version of CCS? Can anyone suggest me how I can fix it?
>
> Besides, is there a way to learn the exact clock frequency of the DSP.
>
> Best Regards,
>
> Coskun
------- End of Original Message -------
Hello Coskun,

On 3/14/2011 4:22 AM, Coskun AYYILDIZ wrote:
> Hi,
>
> Thanks for your reply.
>
> />>First, how are you converting that 'for' loop elapsed time into 7mhz?/
> /
> /
> I get the 7MHz decision because, the for loop counts for 100.000.000
> and it takes it 14s to finish counting.
> So, considering that one loop takes one cycle (maybe more),
> 100.000.000/14 = 7.1428..
> It is an intuitive approach, maybe not exactly 7 MHz but surely less
> than what I would expect.
> Besides, now I read the TSCL and TSCH registers and see that the DSP
> is really slow.

Q1. Does the program actually take about 14 sec to run??
I am not sure what you mean when you say "now I read the TSCL and TSCH
registers and see that the DSP is really slow". TSCL/TSCH count
processor cycles - you will get the same count with a 100Mhz and 1Ghz clock.
I do not use do nothing loops... Make an asm listing to see what code is
being executed.
STDIO functions can be several hundred milliseconds off [I haven't seen
several thousand]. They stop the DSP and the PC will poll the DSP via
JTAG, get the command, then get the data from the PC, send it to the DSP
via JTAG, then run the DSP.
Your chip is a very complicated system with a highly optimized DSP.
Simple loops will yield poorer performance than complicated loops. In
order to perform a measurement you need to know WHAT is being executed
[the asm code] and HOW Long it takes. In order to determine 'how long',
you must have a known time reference OR output a signal that can be
observed.
Q2. Are you using a board that was purchased assembled or a custom design??
>
> />>Second, your code is not setting the PLL registers , so the CPU
> will by running at the default speed (which is far less than the max
> speed available.)/
> /
> /
> Yes, my code does not set any register. I couldnt actually figure out
> how to make the DSP run at maximum speed by configuring the PLL
> register. How can I use 800MHz?

You must know the crystal or clock frequency that is being fed to the
DSP before you can figure out how to program the registers.

mikedunn
>
> Thanks.
>
> Best Regards
>
>
> *From:* Richard Williams
> *To:* Coskun AYYILDIZ ; c...
> *Sent:* Sun, March 13, 2011 2:10:54 AM
> *Subject:* Re: [c6x] The DSP runs at very low speed
> Coskun,
>
> There are a couple of things to note here.
>
> First, how are you converting that 'for' loop elapsed time into 7mhz?
>
> Second, your code is not setting the PLL registers , so the CPU will
> by running
> at the default speed (which is far less than the max speed available.)
>
> What clock crystal is in your board?
>
> R. Williams
> ---------- Original Message -----------
> From: Coskun AYYILDIZ >
> To: c...
> Sent: Fri, 11 Mar 2011 03:37:11 -0800 (PST)
> Subject: [c6x] The DSP runs at very low speed
>
> > Hi everyone,
> >
> > I am using DM3730 (having C64X+ in it) to run a simple for loop. What
> > I see is that the DSP is running at very very low speed.
> >
> > I am using Blackhawk USB560 BP emulator and EVAL version of CCSv4
> > (without BIOS). I runnnig the following piece of code.
> >
> > #include
> > #include
> >
> > void main()
> > {
> > int i, s1, s2, t;
> > s1 = time(NULL);
> > for(i = 0; i < 100000000; i++)
> > {}
> > s2 = time(NULL);
> > t = s2 - s1;
> > printf("t = %d s", t);
> > }
> >
> > After executing this code, I see t = 14 s. It means that the DSP is
> > running at 7 MHz. I would expect it to be 800 MHz.
> >
> > What causes the DSP to run this much slowly? Is it because I am using
> > the EVAL version of CCS? Can anyone suggest me how I can fix it?
> >
> > Besides, is there a way to learn the exact clock frequency of the DSP.
> >
> > Best Regards,
> >
> > Coskun
> ------- End of Original Message -------
>