This is the mail archive of the
cgen@sources.redhat.com
mailing list for the CGEN project.
Re: cgen fundamentals
- From: Ben Elliston <bje at redhat dot com>
- To: cgen at sources dot redhat dot com
- Date: 19 Dec 2002 12:22:01 +1100
- Subject: Re: cgen fundamentals
- Organization: Red Hat Asia-Pacific Pty Ltd
- References: <200212181823.41189.dfcarney@net-itech.com>
Hi David. Welcome.
>>>>> "David" == David Carney <dfcarney@net-itech.com> writes:
David> I was referred to cgen by a member of the binutils mailing
David> list (Nick Clifton). Being (virtually) a complete newbie to
David> Scheme programming and cgen, I have a number of fairly
David> fundamental questions that are likely best answered through
David> this list, rather than trying to find information on the
David> web...
This is probably the first mistake of most newcomers to CGEN -- it is
not necessary to know Scheme to write a CGEN port (although a
Scheme-aware editor can help!). The CGEN input language just looks a
lot like Scheme, but in trying to treat them as equivalent, you'll get
yourself into more trouble than if you just consider your task to
learn ".cpu" ;-)
David> two week teaching myself the basics of scheme, but I'm still
David> confused about the exactly purpose of cgen. I.e. what's the
David> purpose of a 'gas' versus an 'opcodes' port? What does cgen
David> actually produce (and how do I produce and use it) ? How do
David> files created with cgen interface with binutils?
CGEN is a framework, in which CGEN applications run. There are a
handful of these now: an opcodes table generator, a simulator kernel
generator, and so on. If you just want to port binutils, you need
only concern yourself with generating the opcodes/* files. The GNU
binutils "opcodes" directory has Makefile fragments for other ports
(like fr30) that can be duplicated almost verbatim. These Makefile
fragment are responsible for running CGEN for you and depositing the
output files in the opcodes/ source directory. I would suggest you
focus on writing your CPU description first and then work out how to
run it from opcodes/Makefile.
Please feel free to ask more questions on this otherwise quiet list!
Cheers, Ben