comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: Last chance handler on a PC
Date: Fri, 31 Jan 2020 14:30:06 +0200
Date: 2020-01-31T14:30:06+02:00	[thread overview]
Message-ID: <h9ikueFh84iU1@mid.individual.net> (raw)
In-Reply-To: <ly1rrfan56.fsf@pushface.org>

On 2020-01-31 13:19, Simon Wright wrote:
> Simon Wright <simon@pushface.org> writes:
> 
>> Niklas Holsti <niklas.holsti@tidorum.invalid> writes:
>>
>>> I had a similar elaboration problem some time ago in an embedded
>>> application, where I wanted to set up some HW error-trap handlers that
>>> I would like to be active also during elaboration, but I found no easy
>>> way to ensure that the trap-handling package would be elaborated
>>> before all other packages.
>>
>> Could you have used pragma Restrictions (No_Elaboration_Code); ?
>>
>> Or pragma No_Elaboration_Code_All --
>>     This is a program unit pragma (there is also an equivalent aspect of
>>     the same name) that establishes the restriction No_Elaboration_Code
>>     for the current unit and any extended main source units (body and
>>     subunits). It also has the effect of enforcing a transitive
>>     application of this aspect, so that if any unit is implicitly or
>>     explicitly with’ed by the current unit, it must also have the
>>     No_Elaboration_Code_All aspect set. It may be applied to package or
>>     subprogram specs or their generic versions.
>>
>> (I've done this in Cortex GNAT RTS, so that I could write the startup
>> code in Ada).
> 
> Sorry, that was stupid: you needed the package to have elaboration code
> so that it could set up the error-trap handlers!

Yes. Moreover, this application relied on elaboration for essentially 
all of its SW and HW initialization (after the startup code), which I 
thought worked well for the most part -- any package that accessed a 
particular HW part of the SoC "withed" the driver package for that HW 
part, and the elaboration of the driver package initialized the HW part.

However, we did have many elaboration circularity problems when we tried 
to use VectorCAST to define unit tests for this application, because the 
"test environments" constructed by VectorCAST added many dependencies. 
We ended up using VectorCAST only for measuring test coverage, while 
writing the unit test procedures directly in Ada.

-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
       .      @       .


      reply	other threads:[~2020-01-31 12:30 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-30  8:55 Last chance handler on a PC ahlan
2020-01-30  9:15 ` J-P. Rosen
2020-01-30  9:17 ` Egil H H
2020-01-30 19:27   ` ahlan
2020-01-31  5:53     ` J-P. Rosen
2020-01-31  7:00       ` Jeffrey R. Carter
2020-01-31  8:51         ` J-P. Rosen
2020-01-30  9:25 ` Dmitry A. Kazakov
2020-01-30 19:10 ` Lucretia
2020-01-30 19:35 ` ahlan
2020-01-30 20:02   ` Jeffrey R. Carter
2020-01-30 20:26     ` Niklas Holsti
2020-01-30 20:51       ` Jeffrey R. Carter
2020-01-30 21:32         ` Niklas Holsti
2020-01-31 11:12       ` Simon Wright
2020-01-31 11:19         ` Simon Wright
2020-01-31 12:30           ` Niklas Holsti [this message]
replies disabled

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