This is the mail archive of the
gdb@sourceware.cygnus.com
mailing list for the GDB project.
Re: Writing a new simulator
- To: David Golombek <daveg at maker dot com>
- Subject: Re: Writing a new simulator
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Wed, 01 Dec 1999 20:53:49 +1100
- CC: gdb at sourceware dot cygnus dot com
- Organization: Cygnus Solutions
- References: <21vh6lj9mo.fsf@seattle143.maker.com>
David Golombek wrote:
>
> I'm examining using the simulator code packaged with GDB for the basis
> of a new simulator project. I haven't seen much discussion here about
> the simulator packages, but haven't seen any other lists that might be
> appropriate. If there is another list, please direct me towards it.
> I've read through a fair bit of the existing code, and wanted to ask
> some questions to make sure my assumptions are correct.
>
> This work is for a new processor, to which I've already ported the
> Binutils, GDB, and Gas. This is for a 32bit processor with a lot of
> special functional units, which are memory mapped.
>
> 1) It seems that using either the mips or the v850 code as an example
> it the best bet, using the same igen framework that they use. T/F?
Yes (along with the tic80 and d30v). The more recent simulators have
tended to use igen and (more importantly) the sim/common framework.
Another alternative would be to write your own simulator generator and
just exploit the common framework.
> 2) Reading the igen source, as well as the code in 'common', is the
> only existing documentation on igen. T/F?
Unfortunatly also true. The main igen documentation is in its header
files where it describes the syntax of each file.
> 3) Is there a good "ramp-up" methodology for writing a simulator, or
> do I need to write very large parts of it before its useful at all?
> IE, are there some pieces that I can implement first to get at least a
> simulator that will run, if not do anything, so that I can do
> piecewise implementation?
Yes. Doing something like copying an existing sim directory (v850?
tic80?) and then chopping it back to nothing is a good strategy. Just
be ruthless. Simulators like the v850 were originally built using a
gencode program and now many years later still show some of that in
their internals.
> 4) Are there any mail archives or any discussion saved anywhere of the
> previous simulator implementations? Just to give me a heads up on
> potential pit-falls, etc., that i may run into.
To be honest, outside of direct discussions with people I work with,
you're the first person to ask!
There is an old PSIM mailing list / web site (
http://sourceware.cygnus.com/psim/ however that doesn't cover any of the
the more recent sim/ developemnt.
enjoy,
Andrew