Topic: Code compressor
Q : Why CodeCompressor? Can't you just optimize the compiler better?
A : CodeCompressor does something the compiler cannot do, because it has an overall view of the application (C code, Assembler Code, libraried and whatever else might be included) that the compiler cannot have because it works on one source file at a time.
That's why CodeCompressor will always recduce the code size, even when used with a highly optimizing compiler.
Note that most of the compression techniques used by CodeCompressor are already used by the compiler (example: factorization): it's just that the scope of the optimization is different.
__________________________________________________________________________________________________
Q : How do I start CodeCompressor ?
A : CodeCompressor is started by clicking on the compressor incon is the icons bar. For CodeCompressor to work properly make sure that the 'Generate PostOptimizing information' box is checked in Project ¦ Target.
__________________________________________________________________________________________________
Q : How do I use CodeCompressor in Interactive Mode ?
A : To use CodeCompressor in interactive mode you need to check the 'Interactive' box in Options¦Project¦CodeCompressor¦General.
Once this box is checked, when you click on the compressor icon, CodeCompressor is started in interactive mode: a CodeCompressor window is automatically displayed that guides you through the possible optimizations. Note that the once some optimizations are performed, you are debugging the optimized code directly: this means you have reduced features for what concern single step and variable watch/inspection, because some debug information are lost in the compression process.
__________________________________________________________________________________________________
Q : How do I use CodeCompressor in Automatic Mode ?
A : To use CodeCompressor in Automatic mode you need to check the 'Automatic' box in Options¦Project¦CodeCompressor¦General. In the same menu you have to choose which of the possible optimizations you want to perform (usually all of them, to get the best compression)
Once this box is checked, when you click on the compressor icon, your project is rebuilt and compressed according to the options you have selected. The result of the compression is saved as project_name_CC in .aof/.bin/.hex format according to the options you have selected in Options¦Project¦CodeCompressor¦Save. Note that, when you start debugging, the uncompressed version of the project is loaded: this is because the compressed version has limited debug information in it and therefore is not intended for debug. If, for any reason, you want to debug the compressed version directly, you should use the Interactive' mode.
__________________________________________________________________________________________________
Q : Does a demo version of CodeCompressor exist? Which are its limitations?
A : A demo version of CodeCompressor is included with the demo version of 8051 development tools available for free download at www.raisonance.com.
CodeCompressor is limited in that you can compress the code but you can't save it in any format.
__________________________________________________________________________________________________
Q : Is it possible to use CodeCompressor with the Keil compiler/other 8051 compilers?
A : No. CodeCompressor needs special information to work (example: distinction between code and constants) that are generated only by the Raisonance toolchain.
Note however, that, because Raisonance compiler is compatible with C51 it is quite easy to recompile existing sources with the Raisonance toolchain and to compress them afterwards.
__________________________________________________________________________________________________
Q : My application is sligthly bigger than 64kb: can I compress it and see if it becomes <64kb ?
A : You need a workaround here, because, if the application is >64kb, the linker will generate an error and will not allow you to run CodeCompressor altogether.
The workaround is as follows:
* Reduce temporarily the size of one of the modules, in such a way that it has as little impact as possible on the overall application (for example, if you have big tables in code memory, reduce their size)
* Run CodeCompressor on the applications, which is now <64kb and will become even snaller after CodeCompressor
* Re-include the original version of the module you have artificially downsized, directly in HEX, and see if the overall application now fits in 64k
This procedure is quite complex, but it is, at present, the only way to compress a program from >64k to <64k.
__________________________________________________________________________________________________
Q : I get the "Undefined Blocks" error and CodeCompressor does not work. Why?
A : "Undefined Blocks" means that CodeCompressor is missing some important information about some parts of the code to be compresses and therefore cannot do its work.
Possible causes are:
* You didn't check the "Genarate Post Optimization Information" box in Options|target
* You are using a path for libraries that is different from the standard one and that does not contain a sub-directory called CcLib with the CodeCompressor-specific libraries: in this case CodeCompressor will automatically try to use the default libraries, but they don't contains the Post Optimization information, hence the error. Either copy the ride/lib/cclib directory under your own or put your libraries in the default directory
RAISONANCE - 17, avenue Jean Kuntzmann - F-38330 Montbonnot St Martin - FRANCE
There are 10 types of people in the world: Those who understand binary, and those who don't.