From: Peter Amey <peter.amey@praxis-cs.co.uk>
Subject: Re: Is it possible to build an Ada cross-compiler for an 8-bit embedded target now that gcc 3.X has support for Ada?
Date: Fri, 14 Nov 2003 09:53:09 +0000
Date: 2003-11-14T09:53:09+00:00 [thread overview]
Message-ID: <bp28mb$1iodo4$1@ID-69815.news.uni-berlin.de> (raw)
In-Reply-To: <zgRsb.200$co2.10332@nnrp1.ozemail.com.au>
Peter Milliken wrote:
> Subject pretty much says it all.
>
> Now that you can build an Ada compiler using gcc 3.X (well, according
to the
> build instructions of gcc 3.x :-)), I began to wonder whether it was
> possible to build a cross-compiler for an 8-bit target processor. The
8-bit
> processor family in question is already supported by gcc (I believe).
Peter,
Given that there is already a C compiler for your target, one approach
might be to _design_ in Ada and then use an Ada->C compiler/translator
to convert the design to C for compilation. In practice you can tie the
translator and C compiler so tightly together that it looks like an Ada
compiler.
The biggest problem with this approach in general is the size of the
run-time library you need to support all of Ada (esp. tasking, exception
handling etc.) and writing such a library for a small processor. We
have had some success in avoiding these problems by using SPARK as the
design language. This gives several benefits:
1. SPARK is designed to need zero (or at least very little) run-time
library support so all the generated C is directly and easily traceable
back to some SPARK source statement.
2. Using the SPARK tools you can easily prove the code to be exception
free (e.g. no range violations) and this means the translation can be
greatly simplified because it does not have to include the run-time
checks that a full Ada compiler would place in the code. The SPARK
tools can be told how big your C int is, for example, and can ensure
there are no overflows in the translated code.
3. You can do a great deal of strong verification on the SPARK "design
model" before generating the C and therefore greatly reduce the cost of
the testing process.
We have submitted a paper to Ada Europe 2004 on this topic.
regards
Peter
------------------------------------------------------------
Peter Amey Principal Consultant
Praxis Critical Systems
20, Manvers St. +44 (0)1225 466991
Bath www.praxis-cs.co.uk
BA1 1PX www.sparkada.com
------------------------------------------------------------
next prev parent reply other threads:[~2003-11-14 9:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-13 19:50 Is it possible to build an Ada cross-compiler for an 8-bit embedded target now that gcc 3.X has support for Ada? Peter Milliken
2003-11-13 21:02 ` Peter Milliken
2003-11-14 9:53 ` Peter Amey [this message]
2003-11-14 18:59 ` Mike Silva
2003-11-14 19:52 ` Martin Dowie
2003-11-17 21:57 ` Randy Brukardt
2003-11-18 16:03 ` Stephen Leake
2003-11-18 20:17 ` Randy Brukardt
2003-11-18 22:10 ` Stephen Leake
2003-11-19 20:12 ` Randy Brukardt
2003-11-19 22:23 ` Chad R. Meiners
2003-11-18 19:55 ` Peter Milliken
2003-11-18 20:11 ` Randy Brukardt
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox