Home arrow Features arrow Omniscient Code Generation for 8-, 16- and 32-bit Microcontrollers
Omniscient Code Generation for 8-, 16- and 32-bit Microcontrollers Print E-mail
Jul 01 2008
advertisement:

C-language programs are usually developed by teams of engineers who are often geographically dispersed, leading to redundant code and inconsistent variable declarations between modules. Traditional compilation technology compiles each module separately with no regard for what goes on in the other modules and with no information about how pointers, stacks, variables and functions are used throughout the whole program. Traditional compilers tend to over-allocate memory space for pointers, stacks and registers. They are unable to fully exploit the wide variety of memory maps, and register and stack configurations available in today’s microcontrollers. All too often, the programmer must resort to manual optimizations that compromise portability (Figure 1).

Click to enlarge
Figure 1. Conventional compilation.

Click to enlarge
The engineer, too, must often specify an MCU with more resources and higher cost than are really required. In a worst-case situation, the design may have to be migrated from an 8-bit MCU to a more complex, expensive, and powerhungry 32-bit device because an otherwise ideal microcontroller does not have enough memory resources to accommodate the final program. Increasing onchip flash from 8 KBytes to 16 KBytes adds 20 cents to 50 cents to the BOM.

“Omniscient Code Generation”

A new compiler technology, called Omniscient Code Generation (OCG), cuts the code footprint by as much as half and frees up 10% to 15% of SRAM resources.

Rather than relying on the linker to uncover errors between independently compiled modules, an OCG compiler completes the initial stages of compilation for each module separately. Then it compiles each module to an intermediate code file that represents a more abstract view of each module before producing any machine instructions or allocating any registers (Figure 2).



 

Dedicated to helping you design better products in a digital world... your guide to the latest tools & techniques for digital prototyping, simulation, and analysis of the real-world performance of your ideas.

Visit the Digital Design Center

>> Most Searched

>> Newsletter

Subscribe today to receive the INSIDER, a FREE e-mail newsletter from NASA Tech Briefs featuring exclusive previews of upcoming articles, late breaking NASA and industry news, hot products and design ideas, links to online resources, and much more.

Your name:

Your email:

Please Subscribe me to the Insider