DSPRelated.com
Forums

A problem in code execution speed

Started by msha...@yahoo.com January 9, 2007
Hi everyone,

I am involved in a DSP project with MATLAB and CCS, and my enquiry is as follows:

The above stated project has been implemented using Simulink (Embedded Target for the TI TMS320C6000 DSP Platform) in MATLAB 7.1 and CCS version 3.00 for downloading to the TMS320C6713 DSK.

It seems that adding the General TCM Decoder block in my model (in Simulink library browser) will cause a considerable decrease in code execution speed. (It can be found out by examining the CPU Load in CCS and Profile Report)(It increases about 70% in CPU Load and about 280% in Profile Report!!!)

It will be highly appreciated if any one presents me a solution for above-mentioned problem.

So many thanks.
Regards,
Maryam Shabro
Maryam Shabro-

> I am involved in a DSP project with MATLAB and CCS, and my enquiry
> is as follows:
>
> The above stated project has been implemented using Simulink (Embedded
> Target for the TI TMS320C6000 DSP Platform) in MATLAB 7.1 and CCS
> version 3.00 for downloading to the TMS320C6713 DSK.
>
> It seems that adding the General TCM Decoder block in my model (in
> Simulink library browser) will cause a considerable decrease in code
> execution speed. (It can be found out by examining the CPU Load in CCS
> and Profile Report)(It increases about 70% in CPU Load and about 280%
> in Profile Report!!!)
>
> It will be highly appreciated if any one presents me a solution for
> above-mentioned problem.

How many other blocks in the Simulink project are running on the DSP? Each block
causes DSP code to run, and if the block is connected to other Simulink blocks, may
require RTDX communication. The RTDX comm itself takes more CPU resources. With the
DSK 6713, communication is via the USB through a JTAG circuit, limited to about 128
kbps. This overhead can add up...

One suggestion to get a better understanding of what's happening would be add a "null
block" of some type; i.e. a block that transfers a good size chunk of data to/from
the DSP but just does minimal processing (e.g. add two arrays together). Then you
can separate the effect on CPU Load results of adding a block from actual DSP code.

-Jeff
Maryam-

> It should be mentioned that at the time being I am trying a
> simple model for the sake of finding out the solution of the
> stated problem. (The model and its related m file can be
> found as attachment)
>
> As it can be seen, there are some other blocks other than the
> General TCM Decoder and the mentioned model without the TCM
> Decoder shows no speed degradation i.e. in the profile
> report, the Max percent of base interval item does not
> exceed the value 5%. But after adding the TCM Decoder, the
> Max percent of base interval reaches to 291% !.

But did you *add* another block? The point is, the simulation may be running near
some limit of the DSP (memory, MIPS, etc). So if you add a small, simple block then
it could still be Ok. But if you add something with high MIPS requirement (such as
TCM decoder), then you could exceed the limit. In that case the status report could
be unreliable -- you may not be sure what's really happening.

You have to do some work to find the exact limit and how much margin you have.

> More over, it will be appreciated if you inform me what do
> you mean about the taking CPU resources by RTDX? Do you
> mean that CPU resources is wasted in spite of the fact that
> the From RTDX or To RTDX block is not being included in
> the model?

I mean that *any time* MATLAB sends data to/from the DSK 6713 board for processing,
then RTDX is involved. I.e. any DSP processing block that uses the DSK board that
you add to the diagram will require RTDX, by definition. A separate RTDX block (that
you can see in the diagram) would be a "probe"; i.e. some intermediate place in the
algorithm that you wish to display or record data.

-Jeff

> Jeff Brower wrote:
>
> Maryam Shabro-
>
> > I am involved in a DSP project with MATLAB and CCS, and my enquiry
> > is as follows:
> >
> > The above stated project has been implemented using Simulink (Embedded
> > Target for the TI TMS320C6000 DSP Platform) in MATLAB 7.1 and CCS
> > version 3.00 for downloading to the TMS320C6713 DSK.
> >
> > It seems that adding the General TCM Decoder block in my model (in
> > Simulink library browser) will cause a considerable decrease in code
> > execution speed. (It can be found out by examining the CPU Load in CCS
> > and Profile Report)(It increases about 70% in CPU Load and about 280%
> > in Profile Report!!!)
> >
> > It will be highly appreciated if any one presents me a solution for
> > above-mentioned problem.
>
> How many other blocks in the Simulink project are running on the DSP?
> Each block
> causes DSP code to run, and if the block is connected to other Simulink
> blocks, may
> require RTDX communication. The RTDX comm itself takes more CPU
> resources. With the
> DSK 6713, communication is via the USB through a JTAG circuit, limited to
> about 128
> kbps. This overhead can add up...
>
> One suggestion to get a better understanding of what's happening would be
> add a "null
> block" of some type; i.e. a block that transfers a good size chunk of
> data to/from
> the DSP but just does minimal processing (e.g. add two arrays together).
> Then you
> can separate the effect on CPU Load results of adding a block from actual
> DSP code.
>
> -Jeff
>