comp.lang.ada
 help / color / mirror / Atom feed
From: Ken Garlington <GarlingtonKE@lmtas.lmco.com>
Subject: Re: New GNAT ports (was Re: Ada and Automotive Industry)
Date: 1997/01/09
Date: 1997-01-09T00:00:00+00:00	[thread overview]
Message-ID: <32D534D0.7074@lmtas.lmco.com> (raw)
In-Reply-To: 5avfqo$it9$1@goanna.cs.rmit.edu.au


Richard A. O'Keefe wrote:
> 
> Ken Garlington <GarlingtonKE@lmtas.lmco.com> writes:
> >Couldn't this be handled via a combination of existing Ada support
> >(address clauses, etc.) plus linker support?
> >I don't know if you want to specify origins for
> >random code; usually, it's for a logically related set of
> >code/data/literals, or for a specific object.
> 
> The only reason that I bothered about the placement of code at all
> was that the 8051 book I was studying included a memory test program
> that did this.  According to the Ada 83 LRM I had handy, you _couldn't_
> supply address clauses for code.

As Dr. Dewar has already responded, you can (and we have) done this in
Ada 83.
In general, ROM tests can be done in Ada 83 (and in Ada 95, with the
ability
to manipulate addresses, it can be done _portably_ ;) Usually, rather
than attempting to place the Ada objects to be tested at certain areas,
we perform
address manipulations to scan a given area of memory, where the regions
are
specified as constants not related to the placement of Ada objects.

_RAM_ tests, on the other hand, are a little interesting in Ada (and a
lot
of other high-order languages). Consider, for example, a non-destructive
RAM
test involving writing a value to RAM, reading the value back, and
making sure
they match. A typical algorithm is to break RAM into blocks of a
particular size,
reserve one block for the RAM test, and then do the following:

  Test(Reserved_Block);
  for Block_Index in All_Blocks loop
    Reserved_Block := RAM_Block(Block_Index);
    Test(RAM_Block(Block_Index));
    RAM_Block(Block_Index) := Reserved_Block;
  end loop;

What gets interesting is that the stack and heap are going to be
destroyed as a part
of this procedure. If Test tries to access the stack/heap while it's
overwritten...
bad business! Perhaps

   pragma (Local_Values_in_Registers_Only)

would help? :)

Usually, we write such a routine in assembly. Since it's such a small
part of the
total system, the maintenance impacts are negligible.

> I suggested a pragma because it seemed
> to me that they were the _right_ way to add things like that; that
> specific pragma wouldn't change the meaning of the code, so could be
> stripped out for testing elsewhere.  When you are trying to make a
> case that "language X can solve problem Y", opponents sometimes
> regard appeal to "linker support" as a copout.

Realistically, however, there are always some low-level operations
that will require linker support, regardless of the language, for any
language which allows the compilation of components at different times.
So, I would say that someone who makes such an objection isn't going to
be swayed by any reasonable argument.

--
LMTAS - The Fighter Enterprise - "Our Brand Means Quality"
For job listings, other info: http://www.lmtas.com or
http://www.lmco.com




  parent reply	other threads:[~1997-01-09  0:00 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-12-24  0:00 New GNAT ports (was Re: Ada and Automotive Industry) Robert Dewar
1996-12-27  0:00 ` New GNAT ports John Howard
1997-01-07  0:00 ` New GNAT ports (was Re: Ada and Automotive Industry) Richard A. O'Keefe
1997-01-07  0:00   ` Ken Garlington
1997-01-08  0:00     ` Richard A. O'Keefe
1997-01-08  0:00       ` Robert Dewar
1997-01-09  0:00         ` Richard A. O'Keefe
1997-01-11  0:00           ` Robert Dewar
1997-01-11  0:00         ` Addresses of Subprograms (was: New GNAT ports) Larry Kilgallen
1997-01-13  0:00           ` Larry Kilgallen
1997-01-14  0:00             ` Richard A. O'Keefe
1997-01-14  0:00               ` Fergus Henderson
1997-01-15  0:00             ` Richard Kenner
1997-01-09  0:00       ` Ken Garlington [this message]
1997-01-07  0:00   ` New GNAT ports (was Re: Ada and Automotive Industry) Robert Dewar
1997-01-08  0:00     ` Ken Garlington
1997-01-08  0:00     ` Richard A. O'Keefe
1997-01-08  0:00       ` Robert Dewar
1997-01-07  0:00   ` Robert A Duff
1997-01-07  0:00     ` Robert Dewar
1997-01-08  0:00     ` Richard A. O'Keefe
1997-01-09  0:00       ` Dr. Peter E. Obermayer
1997-01-08  0:00   ` Karl Cooper
1997-01-08  0:00     ` Robert Dewar
1997-01-09  0:00     ` Richard A. O'Keefe
1997-01-09  0:00       ` Robert Dewar
1997-01-09  0:00   ` Robert I. Eachus
1997-01-10  0:00   ` Robert I. Eachus
1997-01-11  0:00     ` Robert Dewar
1997-01-13  0:00       ` Richard A. O'Keefe
replies disabled

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