avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] Re: Simulator for GCC Testing


From: Paulo Marques
Subject: Re: [avr-gcc-list] Re: Simulator for GCC Testing
Date: Mon, 14 Jan 2008 03:16:07 +0000
User-agent: Internet Messaging Program (IMP) H3 (4.1.2)

Quoting Andrew Hutchinson <address@hidden>:
[...]
The idea simulator for the testsuite is one that loads software and setting from command line and runs it quickly - minimal I/O emulation needed.

I ear you ;)

As you probably noticed in the other branch of this thread, I've already posted a first version of a very simple simulator. It runs directly from the command line and we can alter it in any way that helps using it to run the test suite.

Simple breakpoints - so that exit/abort can be output.

This should be easy to add: we just have to check at the main loop in the "execute()" function if we are going through a breakpoint address.

However, if the purpose of the break point is to just abort execution, we might be able to something better.

As it is, the simulator already exits when it finds a "rjmp -2" instruction, as this would be an endless loop anyway, since it doesn't have interrupts at all.

This simple hack catches the exit sequence for most programs.

If we can provide our own "exit()" function in the test program, we can do even better: we can make a simple function that just writes the exit code to a i/o port and have the simulator return that as its own exit code, to help automate scripts.

Control of maximum execution time is desirable.

I added a "program_cycles_limit" var that makes the simulator abort with exit code 2, when that number of cycles is reached. The simulator already uses exit code 1 for command line parse errors. This can all be changed, of course.

With the default value of 2000000000 (2 bilion), it takes about 80 seconds to timeout on my 3GHz P4, but this will depend somewhat on the actual code being executed.

But maybe it will be better to specify a timeout in "real" seconds, and not "simulated" seconds... I'll look into it.

For AVR, at least, I do not see a need to use gdb as front end for testing. So Avrora is somewhat attractive in this respect. I have yet to try simulavrxx.

Would you mind trying out avrtest?

It is still in its infant stages (or even less), but since you seem to already have a nice test setup, it should be easy to just run it.

To run it, just do "avrtest <binary image file>" and it will load the binary image file into flash and start simulating. You can try it with the demo included and just do "avrtest demo/demo.bin".

I'm attaching the latest version. The only opcodes missing are: EICALL, EIJMP, ESPM and SPM. These shouldn't matter for most programs, anyway.

Thanks,

--
Paulo Marques


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

Attachment: avrtest.tar.gz
Description: GNU Zip compressed data


reply via email to

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