General Optimizations This chapter contains general hints and instructions how to setup Processor Expert and beans to generate optimized code. The following optimization regards only the High or Low level beans, not the Peripheral Initialization beans. Disabling unused methodsNotice: These optimization are not usable for the MSITStore:C:\Program%20Files\Freescale\CodeWarrior%20for%20HCS12%20V4.7\Help\ProcessorExpert.chm::/BeanCategoriesInfo.html#LevelAbstraction">Peripheral Initialization Beans
When Processor Expert generates the code certain methods and events are enabled by default setting, even when the methods or events are not needed in the application, and thus while they are unused, its code still can take memory. Basically, the unused methods code is dead stripped by the linker but when the dependency among methods is complex some code should not be dead stripped. When useless methods or events are enabled the generated code can contain spare source code because of these unused methods or events. Moreover some methods can be replaced by more efficient methods that are for special purposes and therefore these methods are not enabled by default. Disabling unused beansDisable unused and test purpose beans or remove them from the project. Disabling of these beans is sufficient because the useless code is removed but the bean setting remains in the project. If these beans are required for later testing then add a new configuration to the project and disable these useless beans in the new configuration only (the previous configuration will be used when the application is tested again). Moreover if it is required to use the same bean with different setting in several configurations its possible to add one bean for each configuration with same name and different setting. Speed modesNotice: These optimizations are not usable for the MSITStore:C:\Program%20Files\Freescale\CodeWarrior%20for%20HCS12%20V4.7\Help\ProcessorExpert.chm::/BeanCategoriesInfo.html#LevelAbstraction">Peripheral Initialization Beans
Timed beans which depends on the CPU clock (such as timer, communication and conversion beans), may support speed modes defined in the CPU bean (in EXPERT view level). The Processor Expert allows the user to set closest values for the bean timing in all speed modes (if possible). If the requested timing is not supported by the bean, for example if the CPU clock is too low for the correct function of the bean, the bean can be disabled for the appropriate speed mode. The mode can be switched in the runtime by a CPU method. The bean timing is then automatically configured for the appropriate speed mode or the bean is disabled (according to the setting). Note, however, that use of speed modes adds extra code to the application. This code must be included to support different clock rates. See MSITStore:C:\Program%20Files\Freescale\CodeWarrior%20for%20HCS12%20V4.7\Help\ProcessorExpert.chm::/SpeedModes.html">speed mode details here. See MSITStore:C:\Program%20Files\Freescale\CodeWarrior%20for%20HCS12%20V4.7\Help\ProcessorExpert.chm::/configurationproperties.html">Configuration Inspector for more optimization settings. See chapter MSITStore:C:\Program%20Files\Freescale\CodeWarrior%20for%20HCS12%20V4.7\Help\ProcessorExpert.chm::/BeanOpts.html">Embedded Beans Optimizations for details on choosing and setting the beans to achieve optimized code.
This chapter contains general hints and instructions how to setup Processor Expert and beans to generate optimized code. The following optimization regards only the High or Low level beans, not the Peripheral Initialization beans. Disabling unused methodsNotice: These optimization are not usable for the MSITStore:C:\Program%20Files\Freescale\CodeWarrior%20for%20HCS12%20V4.7\Help\ProcessorExpert.chm::/BeanCategoriesInfo.html#LevelAbstraction">Peripheral Initialization Beans
When Processor Expert generates the code certain methods and events are enabled by default setting, even when the methods or events are not needed in the application, and thus while they are unused, its code still can take memory. Basically, the unused methods code is dead stripped by the linker but when the dependency among methods is complex some code should not be dead stripped. When useless methods or events are enabled the generated code can contain spare source code because of these unused methods or events. Moreover some methods can be replaced by more efficient methods that are for special purposes and therefore these methods are not enabled by default. Disabling unused beansDisable unused and test purpose beans or remove them from the project. Disabling of these beans is sufficient because the useless code is removed but the bean setting remains in the project. If these beans are required for later testing then add a new configuration to the project and disable these useless beans in the new configuration only (the previous configuration will be used when the application is tested again). Moreover if it is required to use the same bean with different setting in several configurations its possible to add one bean for each configuration with same name and different setting. Speed modesNotice: These optimizations are not usable for the MSITStore:C:\Program%20Files\Freescale\CodeWarrior%20for%20HCS12%20V4.7\Help\ProcessorExpert.chm::/BeanCategoriesInfo.html#LevelAbstraction">Peripheral Initialization Beans
Timed beans which depends on the CPU clock (such as timer, communication and conversion beans), may support speed modes defined in the CPU bean (in EXPERT view level). The Processor Expert allows the user to set closest values for the bean timing in all speed modes (if possible). If the requested timing is not supported by the bean, for example if the CPU clock is too low for the correct function of the bean, the bean can be disabled for the appropriate speed mode. The mode can be switched in the runtime by a CPU method. The bean timing is then automatically configured for the appropriate speed mode or the bean is disabled (according to the setting). Note, however, that use of speed modes adds extra code to the application. This code must be included to support different clock rates. See MSITStore:C:\Program%20Files\Freescale\CodeWarrior%20for%20HCS12%20V4.7\Help\ProcessorExpert.chm::/SpeedModes.html">speed mode details here. See MSITStore:C:\Program%20Files\Freescale\CodeWarrior%20for%20HCS12%20V4.7\Help\ProcessorExpert.chm::/configurationproperties.html">Configuration Inspector for more optimization settings. See chapter MSITStore:C:\Program%20Files\Freescale\CodeWarrior%20for%20HCS12%20V4.7\Help\ProcessorExpert.chm::/BeanOpts.html">Embedded Beans Optimizations for details on choosing and setting the beans to achieve optimized code.
|