Optimization

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.
Read More

Function pointers and their impact on stack analysis

Function pointers present a real problem for static code analysis, including when calculating stack usage. Understanding software stack requirements is an activity that is required for several standards/guidelines including DO-178B and DO-178C. Nevertheless function pointers are supported and therefore prevalent in most system-level languages (C and Ada both have them, whilst they are used all the time with C++).
Read More

Optimising for code size might not do what you expect - a GCC and PowerPC example

Getting tracing libraries to run on a new system is hard, but it's something that we regularly have to do here at Rapita as part of our support for timing analysis on diverse platforms. In the past few weeks I've been experimenting with creating a tracing library for Freescale's P4080DS development board, which comes fully loaded with an 8 core P4080 SoC and plenty of trace options, including Aurora based NEXUS tracing, multiple ethernet links and lots of DRAM.
Read More

Multi-core pitfalls: unintended code synchronization

Despite (or possibly because) multi-core systems development use the same programming languages, and largely similar design methods as single-core systems, migrating applications from single-core to multi-core systems can present some unexpected challenges.
Read More

Is your compiler smarter than an undergraduate?

Recently I chanced upon a discussion among some undergraduates studying Computer Science. They were debating whether programmers should routinely employ efficient bit-manipulation in their source code rather than trusting that the compiler will do a good job on a more straightforward representation of the algorithm. My initial thought was "why is this even a question these days?"
Read More

Pages