comp.lang.ada
 help / color / mirror / Atom feed
* Gnat cross-compiler for m68k, PowerPc
@ 2002-08-29  9:14 David Brown
  2002-08-29 14:41 ` Pat Rogers
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: David Brown @ 2002-08-29  9:14 UTC (permalink / raw)


I've been looking at Ada as an alternative language (to C/C++) for embedded
systems programming.  The two platforms I am most interested in are the m68k
(specifically, the 68332 chip with the CPU32 core) and PowerPc (MPC565).  At
the moment I use gcc for the 68332, and I expect to do the same for the
MPC565 when we start working with it.  I can see a number of benifits of
using Ada instead of C, but before I delve too deeply into learning it, I
hope someone can tell me if I'm going in the right direction.  Both these
chips have gcc ports, so am I right in thinking that it's just a matter of
the ada libraries, since gnat uses a target-independant front-end tied to
the gcc back-end ?  I'd be grateful for some pointers as to where to get
started on the tools - I will be using w2k as the main host (I'm quite happy
with building the compiler from source under cygwin - I've done it for other
gcc crosses) and hopefully Linux (if I can get hold of a second PC :-).  I'm
not expecting to use any OS on the systems -although it might be interesting
to try RTEMS, I'd also like to be able to build Ada programs that are not
dependant on any OS.

Out of curiosity, is Ada practical for smaller chips?  We also use the
msp430 (16-bit) and the avr (8-bit), both of which have gcc ports.  Is it
realistic to use Ada for these chips?  A serious RTOS like RTEMS is
certainly out of the question here.

Thanks.






^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Gnat cross-compiler for m68k, PowerPc
  2002-08-29  9:14 Gnat cross-compiler for m68k, PowerPc David Brown
@ 2002-08-29 14:41 ` Pat Rogers
  2002-08-29 18:36 ` Randy Brukardt
  2002-08-30 23:43 ` Samuel Tardieu
  2 siblings, 0 replies; 5+ messages in thread
From: Pat Rogers @ 2002-08-29 14:41 UTC (permalink / raw)


"David Brown" <david@no.westcontrol.spam.com> wrote in message
news:akkoav$rvv$1@news.netpower.no...
> I've been looking at Ada as an alternative language (to C/C++) for
embedded
> systems programming.

Potentially a very wise move. From both a technical and an economic
point of view that could make a lot of sense.

> <snip> but before I delve too deeply into learning it, I
> hope someone can tell me if I'm going in the right direction.  Both
these
> chips have gcc ports, so am I right in thinking that it's just a
matter of
> the ada libraries, since gnat uses a target-independant front-end
tied to
> the gcc back-end ?  I'd be grateful for some pointers as to where to
get
> started on the tools -

It isn't as simple as that, but close.  You definitely should contact
the makers of GNAT to set up a free evaluation agreement. The whole
purpose of such an agreement is to answer just these kinds of
questions.  The address should be sales@gnat.com

> I'm not expecting to use any OS on the systems -although it might be
interesting
> to try RTEMS, I'd also like to be able to build Ada programs that
are not
> dependant on any OS.

If it is the case that you do not require the "extras" that an RTOS
would provide (which is perfectly reasonable), you will not have to
write code that is dependent on an RTOS if one is used.  That's one of
the great things about Ada -- the language has the required
functionality built into the standard.

Hope this helps,


--
Patrick Rogers                       Consulting and Training in:
http://www.classwide.com       Real-Time/OO Languages
progers@classwide.com        Hard Deadline Schedulability Analysis
(281)648-3165                          Software Fault Tolerance





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Gnat cross-compiler for m68k, PowerPc
  2002-08-29  9:14 Gnat cross-compiler for m68k, PowerPc David Brown
  2002-08-29 14:41 ` Pat Rogers
@ 2002-08-29 18:36 ` Randy Brukardt
  2002-08-30 23:43 ` Samuel Tardieu
  2 siblings, 0 replies; 5+ messages in thread
From: Randy Brukardt @ 2002-08-29 18:36 UTC (permalink / raw)


David Brown wrote in message ...

>Out of curiosity, is Ada practical for smaller chips?  We also use the
>msp430 (16-bit) and the avr (8-bit), both of which have gcc ports.  Is
it
>realistic to use Ada for these chips?  A serious RTOS like RTEMS is
>certainly out of the question here.

Ada is certainly practical on 16-bit chips. We still support our Ada 83
compiler on the 80186 and the like. The better question is whether you
can find a practical implementation for your target. I have no idea
whether GNAT would be practical on a 16-bit target, for instance (our
compilers were designed from the ground up for small targets).

It certainly is technically possible to use Ada on an 8-bit machine. Our
original compilers were for the 8080A/8085/Z80 family. But a compiler
for such a processor has to keep a tight grip on the size of the
runtime, and that can be fairly complex. (We partitioned the runtime so
that a program that didn't need any floating point operations, for
example, didn't need to include the math packages.)

We'd be happy to discuss 8 and 16-bit Ada compilers with anyone that's
interested. But, like Robert, we're not interested in doing something
just because somebody says it is a good idea...


              Randy Brukardt.






^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Gnat cross-compiler for m68k, PowerPc
  2002-08-29  9:14 Gnat cross-compiler for m68k, PowerPc David Brown
  2002-08-29 14:41 ` Pat Rogers
  2002-08-29 18:36 ` Randy Brukardt
@ 2002-08-30 23:43 ` Samuel Tardieu
  2002-09-02  9:09   ` David Brown
  2 siblings, 1 reply; 5+ messages in thread
From: Samuel Tardieu @ 2002-08-30 23:43 UTC (permalink / raw)


>>>>> "David" == David Brown <david@no.westcontrol.spam.com> writes:

David> I'm not expecting to use any OS on the systems -although it
David> might be interesting to try RTEMS, I'd also like to be able to
David> build Ada programs that are not dependant on any OS.

Back in 1996-1998, our team used RTEMS + GNAT on a Motorola 68360
(quite similar to the 68332 you are thinking of) robot and it was a
great success. Both GNAT and RTEMS performed very well.

David> Out of curiosity, is Ada practical for smaller chips?  We also
David> use the msp430 (16-bit) and the avr (8-bit), both of which have
David> gcc ports.  Is it realistic to use Ada for these chips?  A
David> serious RTOS like RTEMS is certainly out of the question here.

Even if other persons will say it fits well, I would personally
recommend against using Ada on the smallest devices, as you may easily
get frustrated by the tiny amount of code you will be able to put on
board (the same holds for C). If you have to use a smaller processor,
you may feel more comfortable with a language such as Forth which is
closer to the metal and lets you use all the (low) power available (at
the expense of not having all the nice Ada features such as type
checking).

  Sam
-- 
Samuel Tardieu -- sam@rfc1149.net -- http://www.rfc1149.net/sam



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Gnat cross-compiler for m68k, PowerPc
  2002-08-30 23:43 ` Samuel Tardieu
@ 2002-09-02  9:09   ` David Brown
  0 siblings, 0 replies; 5+ messages in thread
From: David Brown @ 2002-09-02  9:09 UTC (permalink / raw)



"Samuel Tardieu" <sam@rfc1149.net> wrote in message
news:87vg5rdib6.fsf@inf.enst.fr...
> >>>>> "David" == David Brown <david@no.westcontrol.spam.com> writes:
>
> David> I'm not expecting to use any OS on the systems -although it
> David> might be interesting to try RTEMS, I'd also like to be able to
> David> build Ada programs that are not dependant on any OS.
>
> Back in 1996-1998, our team used RTEMS + GNAT on a Motorola 68360
> (quite similar to the 68332 you are thinking of) robot and it was a
> great success. Both GNAT and RTEMS performed very well.
>

I'm definitely going to give this a go - it looks like RTEMS is going to be
the easiest way to get things going with Ada on my systems.  It may turn out
that I don't use RTEMS in the end, but I'll get the tools from there (and it
may turn out that I *do* use RTEMS, even for my C programming).

> David> Out of curiosity, is Ada practical for smaller chips?  We also
> David> use the msp430 (16-bit) and the avr (8-bit), both of which have
> David> gcc ports.  Is it realistic to use Ada for these chips?  A
> David> serious RTOS like RTEMS is certainly out of the question here.
>
> Even if other persons will say it fits well, I would personally
> recommend against using Ada on the smallest devices, as you may easily
> get frustrated by the tiny amount of code you will be able to put on
> board (the same holds for C). If you have to use a smaller processor,
> you may feel more comfortable with a language such as Forth which is
> closer to the metal and lets you use all the (low) power available (at
> the expense of not having all the nice Ada features such as type
> checking).
>

Forth has always struct me as a nice idea, but it is in desperate need of an
overhall.  But I'm used to small micros - I've programmed many systems where
the only practical language is assembly, given the space and the CPU
architecture.  However, devices like the avr and msp430 are well suiting to
higher-level languages (at least C), and there are parts with 64 k or 128 k
flash, which is plenty of code space.  But I'll try things out on the bigger
68k device first, and see whether Ada is something I can use to improve my
work (my guess is it will, if I put in enough time learning it).






^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-09-02  9:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-29  9:14 Gnat cross-compiler for m68k, PowerPc David Brown
2002-08-29 14:41 ` Pat Rogers
2002-08-29 18:36 ` Randy Brukardt
2002-08-30 23:43 ` Samuel Tardieu
2002-09-02  9:09   ` David Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox