simulavr-devel
[Top][All Lists]
Advanced

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

Re: [Simulavr-devel] Re: interrupt flag/enable bits update


From: Theodore A. Roth
Subject: Re: [Simulavr-devel] Re: interrupt flag/enable bits update
Date: Sat, 29 Nov 2003 17:26:05 -0800 (PST)

On Sat, 29 Nov 2003, John Regehr wrote:

> > Speaking of inlining, I've got a huge patch that inlines many of the small
> > wrapper functions. My tests show that it gives about a 10% speed increase.
> > I'm not gonig to commit until I get Keith's patches in though (hopefully
> > this weekend).
> 
> Still speaking of inlining, the other day my group released a tool that
> does cross-module inlining for C programs:
> 
>   http://www.cs.utah.edu/flux/knit/cmi.html
> 
> Unfortunately something in simulavr tickles a bug in the C parser, I've
> told the author about the bug and hopefully he'll fix it soon.
> 
> The tool is pretty cool: it slurps in a bunch of C files, does some
> renaming to avoid conflicts, does a topological sort based on the
> callgraph, and then spits out everything in a big C file so that gcc's
> inlining can really go crazy.
> 
> Once everything is working, if it gets a respectable speedup on simulavr,
> an option would be to distribute a "flattened" version of simulavr along
> with the regular sources that folks who care about performance could use.

Sounds interesting. Let me know when you get it working and what kind of 
improvements you see.

> 
> In the meantime I want to figure out how to benchmark simulavr.  The
> timing information that it prints is good, but what I'd like to do is
> write some AVR code in C that will cause simulavr to terminate its
> simulation run after doing some processing.  Is there some way to do this?
> I seem to remember that simulavr used to terminate when it hit a "sleep"
> instruction but it doesn't seem to anymore.

Funny you should ask. I just committed a patch the other day that lets me do 
exactly that:

2003-11-27  Theodore A. Roth  <address@hidden>
                                                                                
        * simulavr.1.in: Document new options.
        Add new usb support to device list.
        * doc/simulavr.texi: Document new options.
        * src/main.c: Reorder usage strings to improve readability.
        Add stub for --clock-freq option.
        Add --breakpoint option and implement it.

I wanted to have simulavr terminate when it hits a breakpoint to more
accurately test the level of improvement of the inlining patch. This is
trivial for devices that support the 'BREAK' instruction, but not so for
those that don't. So, I added the --breakpoint option. You just pass the
code address to break on and when simulavr hits the break, it exits.
Obviously, this only holds when not running in gdbserver mode.

It would be much easier if gcc would let you insert a BREAK insn for all 
devices.

The next thing I need to do it hook this into the regression system. The 
regression system needs to compile a test program and then run it until it 
hits a breakpoint. The test program should have multiple loops labeled like 
PASS_DONE, FAILn_DONE, etc. The sim will need to spit out which address it 
terminated on and the harness can parse that to see if the test passed or 
not. The hard part is taking the rom image and figuring out where the break 
points should be set at. I'm not quite ready to start implementing this yet 
though, still hashing it out in my head.

Ted Roth





reply via email to

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