Identifying Optimization Candidates

In an earlier post (http://www.rapitasystems.com/blog/a_five_step_process_for_optimization) we suggested that identifying optimization candidates is an important step in making an optimization. It's important because choosing good candidates helps to minimize the amount of technical work changing and testing the optimized system.

This post introduces some techniques to choose candidate functions for optimization.

Explaining the concept of "execution time"

The execution time of a piece of code (say an RTOS task) is the amount of time that the processor spends executing that code.

Execution time must exclude any time spent doing "other things" such as handling interrupts and, in the case of RTOS-based systems, executing other tasks.

The concept is different to elapsed or "wall clock time". This measures how long the task takes from beginning to end, ignoring internal issues like context switches and interrupts. Yet another name for elapsed time is "response time".

Installing Targetlink 2.6, GCC 2.95.2 and Axiom MPC555

We've had this web page up on the Rapita Systems website for some time now. As it seems to be of interest to quite a few visitors, we've decided to move it into the blog.

Installing GCC 2.95.2 for Targetlink (Windows)

This procedure details a step by step installation of GCC 2.95.2 for Targetlink 2.6 on Windows.

1. Download: cygwin; PowerPC GNU Toolkit v2.05; newlib-1.13.0.zip

2. Install cygwin c:\cygwin

3. Install PpcElfInstall.exe in c:\cygwin

4. Unzip newlib-1.13.0.zip in c:\cygwin\home\user

Achieving real-time performance improvements within the SPARK framework

RapiTime is the only commercial tool on the market suitable for optimising reactive, real-time software, where average case performance is irrelevant and the worst-case performance must be studied.

Working on SPARK projects has highlighted an issue which we decided to bring to your attention. When RapiTime highlights potential optimisation candidates, we are informed that the code may be inefficient but it conforms to SPARK guidelines.

An introduction to Modified Condition/Decision Coverage (MC/DC)

Modified Condition/Decision Coverage (MC/DC) is a method of ensuring adequate testing for safety-critical software. At its core lies the idea that if a choice can be made, all the possible factors (conditions) which contribute to that choice (decision) must be tested.

For instance, if I want to decide what to wear one day, my choice of whether to put on a jacket might be broken down into the following decision:

Jacket = Cold ∨ Raining ∨ Windy

Real-Time Taskset Generation and the WATERS workshop

I recently presented a paper at the WATERS 2010 workshop held during the Euromicro Technical Committee on Real-Time Systems (ECRTS) conference. The aim of the WATERS workshop was to showcase tools being used by real-time researchers to make published results easier to reproduce and compare.

My paper applied Roger Stafford's randfixedsum algorithm to taskset generation. The aim of this work is to enable fair test case generation for assessing schedulability tests and design space exploration (e.g. task allocation) algorithms.

Inserting binary values into C

This is an old C programmers trick for binary literals in C and is taken from a posting by Tom Torfs (http://groups.google.com/group/comp.arch.embedded/msg/9d430b6d3da12c8f?p...). It is particularly useful in a mixed C/Ada environment because Ada allows binary literals and you may wish to move one or more into C when doing optimisation or other development. The trick is to take a binary literal, pretend it is a hex value and then combine the hex nibbles into binary digits.

This particular version provides link time protection against passing in a non-binary value:

  

Conditional code without branches

The difficulty of showing that real-time software safely executes within an allotted time budget arises from the variability of code execution time. Some of this variation arises from hardware effects but a great deal arises from different paths through software. We can reduce and even eliminate this variation at the expense of increased code size and average-case performance.

Consider the following expression for saturating arithmetic:

uint32 double_uint32( uint32 x )
{
   if( x > MAX / 2 )
   {
      x = MAX;
   }
   else
   {
      x *= 2;
   }
   return x;
}

Code coverage for applications running on Windows

I was recently asked by a customer if they could use RapiTime to analyse a program compiled for Windows using GCC and CygWin. The answer, with a few caveats, is yes!

Demonstrating how to “Rewind” backwards and forwards through recorded traces with RapiTime 2.3

Rapita’s Dr Paul Emberson recently travelled to Cambridge to demo one of the new features from the latest version of RapiTime at The Embedded Masterclass 2010. Here he explains his thoughts on the day and the emerging benefits of the new software.

Syndicate content