DSPRelated.com
Forums

Blackfin EZ-KIT Lite profiling

Started by igor_mikh July 31, 2003
Hello,

I'm porting a voice codec to Blackfin DSP (BF535).
Until recently I didn't have the Blackfin evaluation board (ADDS-
BF535-EZLITE).
So I used Visual DSP++ 3.1 for Blackfin to simulate the DSP and
evaluate
the codec performance. The cycle count that I obtained from simulation
was satisfactory.

Lately I received the BF535 EZ-KIT Lite board. Using the on-board USB
JTAG
connection, I launched the same DXE that I used in simulation.
It was quite a surprise that now the algorithm takes as many as
several times more cycles to perform. Besides that, according to wall
clock,
encoding a 20 ms frame took about 6 minutes!

The same behavior is reproducible with very simple code (say,
50 NOPs that should take 50 cycles), so the problem doesn't depend
on the code I run. It looks like that the on-board USB emulator adds
an overhead of several "communication" instructions per each "real"
instruction, and the clock (according to CYCLES register) doesn't
stop when the communication instructions are executed.

Could you please explain me what I'm doing wrong? Why the cycle count
becomes several times larger with the EZ-KIT?

Do I need an emulator to run my software in *actual* real-time?
If yes, what model would you recommend? HPPCI-ICE or APEX-ICE?

I have a Corelis JTAG PCI board. Can I use it with the EZ-KIT
or only ADI emulators will do?

Thanks in advance,
Igor




On Thu, 31 Jul 2003, igor_mikh wrote:

> I'm porting a voice codec to Blackfin DSP (BF535).
> Until recently I didn't have the Blackfin evaluation board (ADDS-
> BF535-EZLITE).
> So I used Visual DSP++ 3.1 for Blackfin to simulate the DSP and
> evaluate
> the codec performance. The cycle count that I obtained from simulation
> was satisfactory.
>
> Lately I received the BF535 EZ-KIT Lite board. Using the on-board USB
> JTAG
> connection, I launched the same DXE that I used in simulation.
> It was quite a surprise that now the algorithm takes as many as
> several times more cycles to perform. Besides that, according to wall
> clock,
> encoding a 20 ms frame took about 6 minutes!
>
> The same behavior is reproducible with very simple code (say,
> 50 NOPs that should take 50 cycles), so the problem doesn't depend
> on the code I run. It looks like that the on-board USB emulator adds
> an overhead of several "communication" instructions per each "real"
> instruction, and the clock (according to CYCLES register) doesn't
> stop when the communication instructions are executed.
>
> Could you please explain me what I'm doing wrong? Why the cycle count
> becomes several times larger with the EZ-KIT?

It sounds like it is single stepping rather than running to a break point.
I'm not familiar with the blackfin board or driver software, but you
should be able to set it up so that it runs in real time to some break
point, and it might even count clock cycles for you too. You'll have to
look into the manual and find out how to set up "run to break point".

> Do I need an emulator to run my software in *actual* real-time?
> If yes, what model would you recommend? HPPCI-ICE or APEX-ICE?

Maybe. I thought the usb-jtag was an emulator. If not, that's
good for me to know :-) Basicly you need to connect to the jtag port,
and the usb processor does just that. It may not allow run to break
point though.

> I have a Corelis JTAG PCI board. Can I use it with the EZ-KIT
> or only ADI emulators will do?

At this point ADI hasn't released any info on the blackfin jtag command
set, so only adi emulators will work.

Patience, persistence, truth,
Dr. mike




On Thu, 31 Jul 2003 Mike Rosing wrote :
>On Thu, 31 Jul 2003, igor_mikh wrote:
>
> > I'm porting a voice codec to Blackfin DSP (BF535).
> > Until recently I didn't have the Blackfin evaluation board
>(ADDS-
> > BF535-EZLITE).
> > So I used Visual DSP++ 3.1 for Blackfin to simulate the DSP
>and
> > evaluate
> > the codec performance. The cycle count that I obtained from
>simulation
> > was satisfactory.
> >
> > Lately I received the BF535 EZ-KIT Lite board. Using the
>on-board USB
> > JTAG
> > connection, I launched the same DXE that I used in
>simulation.
> > It was quite a surprise that now the algorithm takes as many
>as
> > several times more cycles to perform. Besides that, according
>to wall
> > clock,
> > encoding a 20 ms frame took about 6 minutes!
> >
> > The same behavior is reproducible with very simple code
>(say,
> > 50 NOPs that should take 50 cycles), so the problem doesn't
>depend
> > on the code I run. It looks like that the on-board USB
>emulator adds
> > an overhead of several "communication" instructions per each
>"real"
> > instruction, and the clock (according to CYCLES register)
>doesn't
> > stop when the communication instructions are executed.
> >
> > Could you please explain me what I'm doing wrong? Why the
>cycle count
> > becomes several times larger with the EZ-KIT?
>
>It sounds like it is single stepping rather than running to a
>break point.
>I'm not familiar with the blackfin board or driver software, but
>you
>should be able to set it up so that it runs in real time to some
>break
>point, and it might even count clock cycles for you too. You'll
>have to
>look into the manual and find out how to set up "run to break
>point".
>
> > Do I need an emulator to run my software in *actual*
>real-time?
> > If yes, what model would you recommend? HPPCI-ICE or
>APEX-ICE?
>
>Maybe. I thought the usb-jtag was an emulator. If not, that's
>good for me to know :-) Basicly you need to connect to the jtag
>port,
>and the usb processor does just that. It may not allow run to
>break
>point though.
>
> > I have a Corelis JTAG PCI board. Can I use it with the
>EZ-KIT
> > or only ADI emulators will do?
>
>At this point ADI hasn't released any info on the blackfin jtag
>command
>set, so only adi emulators will work.
>
>Patience, persistence, truth,
>Dr. mike
>


Hi Igor and Dr.Mike,
I am not worked on BF533 but instead worked on ADSP21535 which is
similar to BF533 that has less of onchip memory and speed. As Igor
says it gives more cycles then it actually gives.
U can check one by one as follows..
Check if U are still on the Simulator mode or EZ-KIT mode.
If You are in the Simulator mode then there is no question
regarding this,its obvious.
If you are in EZ-KIT mode then there is some problem sometimes.
Try restarting ur system,maybe due to the interaction between the
PC and the KIT may be slow. But when You see the actual cycles it
should be less.Its better always to see the Cycles Register and go
ahead with debugging.
If still persists then see if everything is in the internal
memory,the code,the data and all the required paramaters which are
MIPS crytical.
If the code is outside blackfin takes 7 cycles to get them.
similar with the data also.This is done using the linker file
available for You.
Check the manual as to where exactly the data banks has to be
assigned and go accordingly. Sometimes it may be required that the
data banks should be partitioned into many banks to use the full
effeciency of the processor.I mean to use the parallel
instructions provided.
If this also does not solve ur problem and still U have lots of
cycles there there is some problem in ur code. May be the code
goes into a loop where it ends after 6 mins. This happens
sometimes normally when You dont check for zero condition at the
initial start of the loop and try to decrement the variable and
feed it to the loop Counter. so what the loop counter gets is FFFF
instead of zero.Many do this mistake in trying to optimise the
code,even I did :-). As far as problems with break points are concerned yess it may
occur due to overlays.
but in this case the code is not executed till the next break
point,instead goes in the Error handler routine and get stuck
there. If ur code runs fine till the next break point then this is
not the problem of breatpoint. Anyway it i good to remove all the
breakpoint and run or keep less breakpoints.
I hope this will solve ur problem.

Rgrds,
Raj

___________________________________________________
Download the hottest & happening ringtones here!
OR SMS: Top tone to 7333
Click here now:
http://sms.rediff.com/cgi-bin/ringtone/ringhome.pl