| ??? 10/23/07 17:21 Read: times Msg Score: +4 +4 Informative |
#146089 - Optimization Responding to: ???'s previous message |
I have posted some examples for SiLabs USB chips on SiLabs forum. These examples support Keil and SDCC. On this experience, I'm satisfied with the quality of both of these compilers.
But if pressed, Keil has richer optimization options than SDCC, and it appears in the object's code size and RAM usage. The code size of SDCC is greater around 10% than Keil, the RAM usage is almost comparable in these examples. Of course, this figure is altered depending on the structure of the source code. When the firmware has many deep nesting of subroutine calls, it may impact the RAM usage in SDCC; Keil applies call-tree optimization for RAM sharing, but SDCC takes just the leaf-node optimization. This difference may be significant in the development on the MCU with small code FLASH and RAM size. However, I stress that manual optimization of the source code is the first thing you have to do, before relying to the compiler optimization easily. For example, SiLabs' original example takes code/data = 2990/181 bytes, and it is reduced to 2305/163.1 in the manually-optimized version. More than 20% of code FLASH and 10% of RAM are saved, just by simplifying the logic flow, refining the usage of variables in the source code. The optimized version is even reinforced for better compliance to the USB spec. Tsuneo In these examples, most of source code is common (more than 97%), and the difference like endian is implemented with conditional compilation in pre-prosessor macro. The compiler options are the default one, either in Keil or SDCC. Keil - OPTIMIZE (8, SPEED) SDCC - ? (--opt-code-size or --opt-code-speed, but I don't see any change between these options, including no option) "Optimization of SiLabs USB examples in code size" http://www.cygnal.org/ubb/Forum9/HTML/000938.html |
| Topic | Author | Date |
| Keil vs SDCC | 01/01/70 00:00 | |
| Loaded question | 01/01/70 00:00 | |
| Compiler wars! | 01/01/70 00:00 | |
| support | 01/01/70 00:00 | |
| Support | 01/01/70 00:00 | |
| re: Andy: support | 01/01/70 00:00 | |
| Optimization | 01/01/70 00:00 | |
| good data, however .... | 01/01/70 00:00 | |
| Surely, but in the real application, | 01/01/70 00:00 | |
| that's the crux | 01/01/70 00:00 | |
Then, the required comparison is, | 01/01/70 00:00 | |
| My ha'pence worth | 01/01/70 00:00 | |
| Keil thrown in | 01/01/70 00:00 |



