Key Characteristics

Note: originally posted year 2000.

ERC32 Ada has a compact high-performance run-time system that is considerably smaller and faster than others we have evaluated. Some time ago, we looked at another GNAT-based compiler using the RTEMS real-time kernel and compared its performance with ERC32 Ada. The results are summarized in this report.

The information was prepared December 1999 in response to a query from a customer who was already using the “free” ERC32 compiler from ESTEC.  We compared the latest compilation system from ESTEC – erc32ccs Version 2.0.7, dated November 26, 1999, with ERC32 Ada Version 1.2.

Methods

For code size, we measured program size. That is the size of the linked executable program, which includes all instructions, read-only data, and static data. The size does not include the stack or the heap.

We measured the size using the ‘size’ utility, erc-coff-size for ERC32 Ada, and sparc-rtems-size for erc32ccs.

For execution time we used the ERC32 simulator and the ERC32’s real-time clock. Both compilation systems initialize the clock to tick at one microsecond, so we had the capability of measuring quite short periods of time with a resolution of one microsecond.

The results that show execution time give the raw times, followed by the times adjusted to account for the differing clock speed: the ERC32 Ada simulator runs at 10MHz (the speed of the Saab Ericsson DEM32 board), and the ERC32CCS simulator runs at 14MHz.

Program Size

The program size is the number of bytes of PROM that the program requires. The size omits the run-time data areas such as the stack, but does include the code and data needed to initialize the static variable data area.

Table 1: Code Sizes
Benchmark Description Erc32ccs total size in bytes ERC32 Ada total size in bytes Ratio
T1 Null program 152404 4640 32:1
T2 Null program with delay statement 277692 8912 31:1
T3 Null program with task 249692 9632 25:1
T4 Null program with protected object 244604 9400 26:1
Eg1 Small (264 lines) real-time application program that uses tasks and protected objects 333532 18856 18:1

Protected Types

We measured the execution time of several calls of a trivial protected object. These times give you an idea of the overhead of using protected types in your real-time system.

Table 2: Execution Times for Protected Types
Test Description ERC32CCS time in microseconds at 14MHz ERC32CCS time adjusted to 10MHz ERC32 Ada time in microseconds at 10MHz Ratio
B1 Trivial protected procedure call 210 294 14 21:1
B2 Trivial protected function call 182 255 17 15:1
B3 Trivial (non-blocking) protected entry call 242 338 17 20:1
B4 Time from call of protected procedure to exit from corresponding entry call 591 827 111 7.5:1

Ada.Synchronous_Task_Control

The predefined package Ada.Synchronous_Task_Control offers an alternative to protected types that requires less run-time support and is potentially much quicker.

Table 3: Timings for Ada.Synchronous_Task_Control
Test Description ERC32CCS result in microseconds at 14MHz ERC32CCS result normalized to 10MHz ERC32 Ada result in microseconds at 10MHz Ratio
1 Set_True and switch to waiting higher priority task 617 863 106 8:1
2 Suspend_Until_True with flag already true 394 551 5 110:1

General Comments

Switching from one Ada task to another requires the run-time system to save most of the 160 ERC32 registers for the current task, and then to restore the registers for the new task. The time to do this with the time to manage the register cache mechanism form a lower limit to the context switch time for any multi-tasking code. Some improvement could be made for programs that do not use floating point arithmetic, by omitting the code to save and restore the 32 floating-point registers. This is a run-time system configuration option.

Leave a Reply

Your email address will not be published. Required fields are marked *