8051 Compiler Gets 55% More DMIPS/MHz with 30-50% Smaller Code - Embedded.com

8051 Compiler Gets 55% More DMIPS/MHz with 30-50% Smaller Code

Acacia Ridge, Queensland, Australia – HI-TECH Software today launched an “omniscient” ANSI C compiler that increases DMIPS/MHz and cuts the power drain of Silicon Labs' 8051-based mixed-signal MCU families, including the ultra low-power, single-cell C8051F9XX devices.

HI-TECH C PRO for the Silicon Labs 8051 MCU Family reduces interrupt latency, code size and SRAM usage by dynamically optimizing context size and register coverage across all modules of a C-language program.

The result is both better code density and fewer instructions cycles required to execute the program. Fewer instruction cycles means the CPU can spend more time in sleep mode, further reducing the already low power consumption of Silicon Labs' devices.

Using Silicon Labs' Dhrystone V1.1 benchmark and a 22.11 MHz clock, HI-TECH's OCG compiler achieves 55% more DMIPS/MHz, and 49% smaller code size than any non-OCG compiler. It compiles Silicon Labs' Ethernet boot loader with 30% smaller code and 20% less SRAM usage.

It uses “omniscient code generation” (OCG) technology that collects comprehensive data on every register, stack, pointer, object and variable declaration across the entire program. It uses this information to optimize register usage, stack allocations and pointers across the whole program. It also ensures consistent variable and object declarations between modules and deletes unused variables and functions.

Compilers without OCG compile each code module independently, without information from the other parts of the program. Since they do not have information about which registers are used throughout the whole program, they often must save all eight general purpose registers, as well as other on-chip resources for every interrupt.

This process requires as many as 48 clock cycles. In contrast, an OCG compiler has comprehensive information about every variable, register, and pointer throughout the entire program. Since it knows exactly which registers will be used for any interrupt, it can determine the context size dynamically, based on the state of the program at the time of compilation.

Code generated by an OCG compiler may not need to save any registers during an interrupt routine, thereby saving up to 48 cycles that are wasted by a non-OCG compiler.

Code generated for Silicon Labs single-cell C80519XXF by a non-OCG compiler results in an average of 108 cycles to execute the interrupt service routine and main loop overhead for each sample of data. The maximum number of cycles is 135, requiring a clock rate of 1.08 MHz. However 1.08 MHz is not the correct multiple of the 115,200 baud rate, so the clock must be increased to 1.1152MHz. At this clock rate the C8051F9xx consume an average of 248?A.

Compiling the same program with HI-TECH C PRO results in code that executes in 93 cycles, with a maximum of 110 cycles and a clock rate of 880 kHz. Achieving the correct multiple of the baud rate results in clock rate of 921.6 kHz. At this clock rate, the C8015F9XX consumes an average of 202?A or 22% less than the device executing the non-OCG code.

HI-TECH's C PRO compiler has been integrated into Silicon Labs IDE, as well as most 3rd-party development tools. HI-TECH C PRO runs on multiple platforms including Windows (2000, XP, Vista 32/64) Linux and Mac OS X.

The compiler supporting Silicon Labs C8051 is available with full source code to all library routines, including a run-time start-up module that is automatically customized for the code each time the compiler is run. There are no restrictions or limitations on use of executable library code.

HI-TECH C PRO for the Silicon Labs 8051 MCU Family is available now for $1195, through December 31, 2008, after which it will retail for $1495. It includes, free of charge, HI-TECH Priority Access (HPA) -12 months access to updates and technical support -as well as a 30 day money back guarantee. Multi-user, and educational user discounts are available.

A fully functional 45-day evaluation version of HI-TECH C PRO for the Silicon Labs 8051 MCU Family is available for download, free of charge, at HI-TECH's website silabs.htsoft.com.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.