From: anon@anon.org (anon)
Subject: Re: Ravenscar-compliant bounded buffer
Date: Fri, 07 Sep 2007 11:56:51 GMT
Date: 2007-09-07T11:56:51+00:00 [thread overview]
Message-ID: <70bEi.74312$ax1.41120@bgtnsc05-news.ops.worldnet.att.net> (raw)
In-Reply-To: 1189113180.100290.51880@50g2000hsm.googlegroups.com
>Does GNAT provide somewhat simpler (smaller? faster?) runtime for
>programs that declare compliance with the Ravenscar profile?
The simple answer is No. Mostly it included in the GNAT PRO version
only.
The GPL/GNU GNAT Ada system has three main operating environments.
1) Normal "run-time system" (RTS) which handles most
non-mission critical partitions. Just compile/bind/link
and execute the programs.
2) Is defined in the GNAT manual as an obsolete feature, that is
using the "pragma No_Run_Time ;", but still works. In this
version, the user must supply the RTS subsystem that the
program requires. This does decrease the file size to about
25 % of the normal compile version and in some cases will
increase the performance with other pragma used. But the
programmer must write all procedures and functions for each
RTS package that the program uses.
A very simple example of this type of RTS version:
---------------
-- Hello.adb --
---------------
-- File size: using Ada.Text_IO => 251 KB
-- File size: using GNAT.IO => 192 KB
-- File size: using "pragma No_Run_Time"
-- with user create RTS package => 58 KB
--
-- Note: size may differ between operating systems and
-- GNAT versions but the concept is the same.
--
-- And due to decrease packages requirements and code
-- generated the performance will increase from using
-- Ada.Text_IO to GNAT.IO to the user define RTS subsystem.
--
-- compile => gcc -c put_line.c
-- gnat compile hello.adb
-- gnat bind hello.ali
-- gnat link hello.ali put_line.o
--
-- run => ./hello
--
---------------
-- Hello.adb --
---------------
pragma No_Run_Time ;
--
-- Ada.Text_IO aka Text_IO and GNAT.IO packages
-- are illegal with the usage of "No_Run_Time"
--
-- with Ada.Text_IO; use Ada.Text_IO;
-- with GNAT.IO ; use GNAT.IO ;
--
procedure Hello is
--
-- External link for put_line RTS subsystem package
-- Note: String needs to terminate with ascii.nul
--
-- comment out to use GNAT packages
--
procedure Put_Line ( Value : String ) ;
pragma Import ( C, Put_Line, "put_line" ) ;
begin
Put_Line ( "Hello World. Welcome to GNAT" & ASCII.NUL ) ;
end ;
/* ----------- */
/* put_line.c */
/* ----------- */
#include <stdio.h>
/* put_line -- run-time subsystem procedure */
void put_line ( value )
char * value ;
{
printf ( "%s\n", value ) ;
}
/* --eof-- */
3) Is the Ravenscar RTS. It can contains multiple packages each
fine tuned for Real-Time operating environment (RTOE) and the
full criteria of the DO-178B. The academic and GPL/GNU
versions do not meet the DO-178B criteria or have RTOE packages
for the Ravenscar profile.
The compiler does set the correct restrictions when using the
Ravenscar profile. And some of these restrictions will increase
the performance in some case. But linking is still done with the
Normal or "No Run Time" RTS, so the performance will be limited.
Now, there are a few other pragmas that can decrease the program's
file size or the amount its allocated during execution. Some of
these might increase the programs performance but it is normally
not enough to spend a great deal of time on. That is, unless
your allocating large block of memory for vector or matrix
project and need to speed up the allocation schemes. But you may
have to write the allocation routines.
Something you could try. The next time you write a program that
you thinks meet the Ravenscar profile designed add either the
"pragma Ravenscar ;" or some of the main Ravenscar profile
restrictions to your code. If your in class this might turn into
an extra assignment or it could be used in a later course.
n <1189113180.100290.51880@50g2000hsm.googlegroups.com>, Maciej Sobczak <see.my.homepage@gmail.com> writes:
>On 6 Wrz, 16:06, Robert A Duff <bobd...@shell01.TheWorld.com> wrote:
>
>> the whole
>> point is to be restrictive, so the run-time system can be simplified (as
>> compared to a run-time system that supports full Ada).
>
>Does GNAT provide somewhat simpler (smaller? faster?) runtime for
>programs that declare compliance with the Ravenscar profile?
>I'm not asking about the high-integrity edition of GNAT, but the
>"normal" one.
>
>--
>Maciej Sobczak
>http://www.msobczak.com/
>
next prev parent reply other threads:[~2007-09-07 11:56 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-04 13:53 Ravenscar-compliant bounded buffer Maciej Sobczak
2007-09-05 3:00 ` Steve
2007-09-05 7:38 ` Maciej Sobczak
2007-09-06 4:04 ` Steve
2007-09-06 14:06 ` Robert A Duff
2007-09-06 15:36 ` Dmitry A. Kazakov
2007-09-07 2:36 ` Robert A Duff
2007-09-06 21:13 ` Maciej Sobczak
2007-09-07 2:41 ` Robert A Duff
2007-09-07 11:56 ` anon [this message]
2007-09-07 19:44 ` Maciej Sobczak
2007-09-08 0:16 ` anon
2007-09-08 1:19 ` Larry Kilgallen
2007-09-08 5:13 ` anon
2007-09-08 22:06 ` Larry Kilgallen
2007-09-09 2:17 ` anon
2007-09-09 12:07 ` Larry Kilgallen
2007-09-09 13:10 ` Markus E L
2007-09-11 2:44 ` Randy Brukardt
2007-09-08 11:50 ` Niklas Holsti
2007-09-08 12:01 ` Pascal Obry
2007-09-08 17:13 ` anon
2007-09-08 17:11 ` anon
2007-09-08 19:14 ` Markus E L
2007-09-09 14:54 ` anon
2007-09-09 16:01 ` Markus E L
2007-09-09 10:38 ` Gautier
2007-09-09 11:41 ` anon
2007-09-09 13:19 ` Markus E L
2007-09-09 13:52 ` Pascal Obry
2007-09-09 15:22 ` anon
2007-09-09 16:03 ` Markus E L
2007-09-10 0:05 ` Larry Kilgallen
2007-09-10 3:10 ` Markus E L
2007-09-09 16:05 ` Markus E L
2007-09-09 18:40 ` Ed Falis
2007-09-09 19:11 ` Markus E L
2007-09-09 10:57 ` Gautier
2007-09-09 14:49 ` anon
2007-09-09 15:08 ` Pascal Obry
2007-09-09 15:38 ` Markus E L
2007-09-09 19:12 ` Niklas Holsti
2007-09-09 19:28 ` Ed Falis
2007-09-10 12:51 ` Colin Paul Gloster
2007-09-07 1:38 ` Steve
2007-09-07 2:47 ` Robert A Duff
2007-09-05 7:46 ` Dmitry A. Kazakov
2007-09-05 8:17 ` brodax
2007-09-05 8:30 ` Jean-Pierre Rosen
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox