Hi, I'm doing a comparison between BL51 and Lx51 to determine the code space savings- I'm a bit suprised to see that for the same project, Lx51 yields a code reduction of only 0.6%- I've enabled the AJMP/ACALL setting, and altered the optimisation levels (speaking of which, under Lx51 raising the optimsation levels from 9 to the 'new' levels of 10/11 actually increases the code size) Does anyone have any similar experience of this phenomena- or any suggestion as to what else I should try to get the touted 10-15% reductions available using LX51? I'm only using the 'BANKAREA' LX51 controls... Thanks David
How many bytes TOTAL is your program? Jon
Common area: 14553 (inc. 3345 bytes const data) Bank 0: 62646 Bank1: 47812 I'm interested-how is this useful?
Linker code packing and AJMP/ACALL substitution is not very effective on small applications (that's why I asked the application size). In fact, there are a NUMBER of things that can reduce the effectiveness of the optimizer.
Developers who get very little size reduction typically don't have much that can be optimized (lots of const data, tables, initialized variables, or just simply write optimal code to begin with). It's kind of ironic, isn't it that the better programmer you are, the less the optimizer helps. The Irony comes from the fact that if you are not very good, you will probably not work on projects large enough to need optimization. Erik
You should see a impact of at least 5% on a large application like yours. If you have not improvment, then you have most likely a configuration mistake of the toolchain. Maybe the optimization level is hard coded in some header file and overrules the command line settings.
I came to this discussion kind of late. I was looking to understand why level 10 and 11 seem to make my gnerated .BINs larger. My projects are pretty big, getting just up to the 64K limit of teh classic 8051 architecture. I have very carefully followed all optimization instructions. However, you said that I must have done somethign wrong if I do not see a 5%. Please hlep me find what I did wrong so I can get this benefit. I really need it in some of the bigger varients of my project.
"I was looking to understand why level 10 and 11 seem to make my gnerated .BINs larger" If you are able to select levels 10 & 11, I think you must have a product that is entitled to support (unless your support period has expired). In that case, you might be better off contacting Keil support direct. I seem to remember from a year or so back that there were some options that could "stick" when increasing the optimisation level; ie, when you thought you'd raised the whole project to level 10 or 11, there could be a few files left still with contradictory options. You can check the listing files for this.
View all questions in Keil forum