DSPRelated.com
Forums

C6713 MIPS Measurement Issue

Started by xiyo...@yahoo.com July 2, 2010
Hi C6x Group members,

I'm trying testing the MIPS of C6713 on DSK6713. I have a simple loop-back program to get an audio sample from A/D then output to D/A. There is some delay between input and output so I can figure out the MIPS. Why can I only execute maximum 3000 times of (a+b) for this delay? So for 8kHz sampling rate, the MIPS is only 3000*8000$MIPS.

Anything wrong with my program?

Thanks,

David

_____________________________________
David-

> I'm trying testing the MIPS of C6713 on DSK6713. I have a
> simple loop-back program to get an audio sample from A/D
> then output to D/A. There is some delay between input and
> output so I can figure out the MIPS. Why can I only execute
> maximum 3000 times of (a+b) for this delay? So for 8kHz
> sampling rate, the MIPS is only 3000*8000$MIPS.
>
> Anything wrong with my program?

1) In your test, is "a+b" a few lines of C code? If so then you have to look at the generated assembly code in order
to count actual instructions. MIPS = millions of *instructions* per second, not lines of code.

2) Are you using the DSK6713_AIC23_write() and DSK6713_AIC23_read() functions dsk6713.h and dsk6713_aic23.h? If so
these functions using polling to determine when audio input samples are available (or output register is empty), which
means your test program is wasting most of its time waiting on flag ("ready") bits to toggle.

-Jeff

_____________________________________
xiyong,

How can we tell if anything is wrong with your program when we do not have the
source for your program?

Are you saying that your program is echoing both the left and right channel and
you are only able to execute 3000 instruction cycles between the 1/8000 second
interrupts?

Is your program using polling or interrupts?
Is your program using EDMA/DMA for both input and output?
...

BTW:
Are you using the 'trace' abilities to track the number of cycles between
interrupts?

R. Williams

R. Williams

---------- Original Message -----------
From: x...@yahoo.com
To: c...
Sent: Fri, 02 Jul 2010 16:05:16 -0400
Subject: [c6x] C6713 MIPS Measurement Issue

> Hi C6x Group members,
>
> I'm trying testing the MIPS of C6713 on DSK6713. I have a simple loop-
> back program to get an audio sample from A/D then output to D/A. There
> is some delay between input and output so I can figure out the MIPS.
> Why can I only execute maximum 3000 times of (a+b) for this delay? So
> for 8kHz sampling rate, the MIPS is only 3000*8000$MIPS.
>
> Anything wrong with my program?
>
> Thanks,
>
> David
------- End of Original Message -------

_____________________________________
Hi William,

Thanks for the reply.

My main source code is

void main()
{
long i=0, k;

DSK6713_init();
hCodec=DSK6713_AIC23_openCodec(0,&config);
DSK6713_AIC23_setFreq(hCodec, DSK6713_AIC23_FREQ_8KHZ);

while(1) {
while(!DSK6713_AIC23_read(hCodec, &mySample));
for(k=0;k<3000;k++) {
i=i+1;
}
while(!DSK6713_AIC23_write(hCodec, mySample));
}
}

Here, a sample is read from A/D and sent to D/A. I just tried to measure how many instructions (cycles) I can insert between the sample reading and sending so I can know how much program load I can put there (for example, a long tap IIR filtering, or other complicated processing). But anyhow I can only increase to 3000 for the "for(k=0,...)" loop. Within 3000, I can hear the microphone voice loops to the headphone clearly, but if it's more than 3000, the voice started to be distorted until nothing is heard. If this is the case, the MIPS is too low for me to do some complicated processing between samples. Can anyone have any idea what's wrong with my program and MIPS calculation?

Thanks,

Xiyong

--- On Sat, 7/3/10, Richard Williams wrote:

> From: Richard Williams
> Subject: Re: [c6x] C6713 MIPS Measurement Issue
> To: x...@yahoo.com, c...
> Date: Saturday, July 3, 2010, 12:23 AM
> xiyong,
>
> How can we tell if anything is wrong with your program when
> we do not have the
> source for your program?
>
> Are you saying that your program is echoing both the left
> and right channel and
> you are only able to execute 3000 instruction cycles
> between the 1/8000 second
> interrupts?
>
> Is your program using polling or interrupts?
> Is your program using EDMA/DMA for both input and output?
> ...
>
> BTW:
> Are you using the 'trace' abilities to track the number of
> cycles between
> interrupts?
>
> R. Williams
>
> R. Williams
>
> ---------- Original Message -----------
> From: x...@yahoo.com
> To: c...
> Sent: Fri, 02 Jul 2010 16:05:16 -0400
> Subject: [c6x] C6713 MIPS Measurement Issue
>
> > Hi C6x Group members,
> >
> > I'm trying testing the MIPS of C6713 on DSK6713. I
> have a simple loop-
> > back program to get an audio sample from A/D then
> output to D/A. There
> > is some delay between input and output so I can figure
> out the MIPS.
> > Why can I only execute maximum 3000 times of (a+b) for
> this delay? So
> > for 8kHz sampling rate, the MIPS is only
> 3000*8000$MIPS.
> >
> > Anything wrong with my program?
> >
> > Thanks,
> >
> > David
> ------- End of Original Message -------

_____________________________________
Xiyong,

Most of the CPU cycles are being consumed by the two wait loops.
The actual available loop time is approximately 1/8000 second.

DSK6713_AIC23_read() and DSK6713_AIC23_write() are both implemented internally
as polling operations.
To get a realistic idea of how much code can be included, those calls to
DSK6713...() need to be eliminated/ replaced by interrupt handlers
Then start a timer upon entry to the 'read' interrupt and stop the timer upon
exit from the 'write' interrupt.
R. Williams

---------- Original Message -----------
From: Xiyong Zhang
To: c..., Richard Williams
Sent: Tue, 6 Jul 2010 10:43:41 -0700 (PDT)
Subject: Re: [c6x] C6713 MIPS Measurement Issue

> Hi William,
>
> Thanks for the reply.
>
> My main source code is
>
> void main()
> {
> long i=0, k;
>
> DSK6713_init();
> hCodec=DSK6713_AIC23_openCodec(0,&config);
> DSK6713_AIC23_setFreq(hCodec, DSK6713_AIC23_FREQ_8KHZ);
>
> while(1) {
> while(!DSK6713_AIC23_read(hCodec, &mySample));
> for(k=0;k<3000;k++) {
> i=i+1;
> }
> while(!DSK6713_AIC23_write(hCodec, mySample));
> }
> }
>
> Here, a sample is read from A/D and sent to D/A. I just tried to
> measure how many instructions (cycles) I can insert between the sample
> reading and sending so I can know how much program load I can put
> there (for example, a long tap IIR filtering, or other complicated
> processing). But anyhow I can only increase to 3000 for the "for(k=0,
> ...)" loop. Within 3000, I can hear the microphone voice loops to the
> headphone clearly, but if it's more than 3000, the voice started to be
> distorted until nothing is heard. If this is the case, the MIPS is too
> low for me to do some complicated processing between samples. Can
> anyone have any idea what's wrong with my program and MIPS calculation?
>
> Thanks,
>
> Xiyong
>
> --- On Sat, 7/3/10, Richard Williams wrote:
>
> > From: Richard Williams
> > Subject: Re: [c6x] C6713 MIPS Measurement Issue
> > To: x...@yahoo.com, c...
> > Date: Saturday, July 3, 2010, 12:23 AM
> > xiyong,
> >
> > How can we tell if anything is wrong with your program when
> > we do not have the
> > source for your program?
> >
> > Are you saying that your program is echoing both the left
> > and right channel and
> > you are only able to execute 3000 instruction cycles
> > between the 1/8000 second
> > interrupts?
> >
> > Is your program using polling or interrupts?
> > Is your program using EDMA/DMA for both input and output?
> > ...
> >
> > BTW:
> > Are you using the 'trace' abilities to track the number of
> > cycles between
> > interrupts?
> >
> > R. Williams
> >
> > R. Williams
> >
> >
> >
> > ---------- Original Message -----------
> > From: x...@yahoo.com
> > To: c...
> > Sent: Fri, 02 Jul 2010 16:05:16 -0400
> > Subject: [c6x] C6713 MIPS Measurement Issue
> >
> > > Hi C6x Group members,
> > >
> > > I'm trying testing the MIPS of C6713 on DSK6713. I
> > have a simple loop-
> > > back program to get an audio sample from A/D then
> > output to D/A. There
> > > is some delay between input and output so I can figure
> > out the MIPS.
> > > Why can I only execute maximum 3000 times of (a+b) for
> > this delay? So
> > > for 8kHz sampling rate, the MIPS is only
> > 3000*8000$MIPS.
> > >
> > > Anything wrong with my program?
> > >
> > > Thanks,
> > >
> > > David
> > ------- End of Original Message -------
> >
> >
------- End of Original Message -------

_____________________________________