simulavr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Simulavr-devel] simulavr and avr-gdb


From: Dave
Subject: Re: [Simulavr-devel] simulavr and avr-gdb
Date: Fri, 17 Feb 2006 12:18:00 -0800 (PST)

Hello,

I need to measure how many instructions it takes to run a certain routine using 
simulavr. The reason I'm trying to do is to see the execution time. I tried to 
set up a timer on my AVR butterfly, but my program takes only a few 
microseconds, so it's better if I can get the instruction count in simulation. 
My question is how can I set a counter in simulavr to count instructions? Thank 
you for your help!

Dave

Klaus Rudolph <address@hidden> wrote: Hi Dave,

> 
> 
> - how many instructions does it take to run a certain
> routine?

There is actually no profiling support for simulavr and also
not for simulavrxx. simulavrxx provide some statistics, especially
for interrupt latency and interrupt execution times. It should
be easy to write a function based statistic. Maybe it is simplier
to create a gprof output from the simulator and do the rest with 
the standard toolchain. But I was not able to get support from
gcc for that purpose. So I have not tried to implement that.

> - what is the memory layout of my data structures?
That needs not a debugger. Simply look in your elf-file.

> - how long does it take to run the whole program?
Same as first question :-)

> - where are my data structures located, in sram or in
Same as second question :-)

> flash?
Same as second question :-)

Do you know the nm instruction? There you get the address of each
located data/function of your elf file. with objdump you can 
look inside your code and can see the disassembly of all code parts.

Your question is not directly related to the simulator, so I would
please you to read the gcc/binutils documentation first. There
you find a lot of information regarding your questions. 
The simulation itself could do some statistics for you, but most of
your questions points to static parameters and needs not a debugger or
a simulator.

Typically simulatons are used to get more information for
heap usage (malloc/free, fragmentations...), interrupt latency problems,
stack usage and depth of nested irqs and so on.

I hope this helps :-)



Regards
   Klaus

-- 
DSL-Aktion wegen gro�er Nachfrage bis 28.2.2006 verl�ngert:
GMX DSL-Flatrate 1 Jahr kostenlos* http://www.gmx.net/de/go/dsl


                
---------------------------------
 Yahoo! Mail
 Use Photomail to share photos without annoying attachments.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]