Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/21/11 19:13
Modified:
  02/21/11 19:42

Read: times


 
#181221 - Snake, as a dubious benchmark
I took a program I wrote last year for general amusement, Snake, http://www.8052.com/forum/thread/173380 , and tried to "port" it to an ARM - a Cortex-M3 (namely LPC1768), as a sort of a benchmark. (The game has already been "ported" to AVR back then by a friend of mine).

The results:
       8051/SDCC  AVR/gcc  ARM/gcc
FLASH       3566     3954     4584
RAM           85       70      132

Some remarks:

  • SDCC used the small model (all variables in internal RAM), gcc in both cases was used with the -Os optimisation on (funnily, in both cases the -O3 switch (supposed to be the tighter space optimisation) caused the code to be inflated almost twice)
  • SDCC is known to re-allocate RAM for local variables in non-overlapping functions poorly
  • the program was written specifically with 8-bitters, limited RAM, and the SDCC parameter passing method in mind, which might have its influence on the results
  • the AVR code actually used 184 bytes of RAM, but that was caused by unoptimal placement of constant data into RAM (these data go to FLASH using __code in SDCC and const in arm-gcc); the RAM usage I indicated above was deduced of this data, but placing them into FLASH would mean to use a couple of library functions which together with the data would increase FLASH usage by maybe 200-300 bytes
  • for ARM, the low-level LCD part had to be modified by adding additional delays, and also I wired it up in 4-bit mode which means somewhat more code (still I sc***ed up the startup as it sometimes starts in 1-line mode, but I don't have any intention to find the problem now)



Now we all know very well what exactly is the value of benchmarks... :-)

JW

[EDIT] Sorry, I did not realize that the link to the AVR port above is subject to login to that site (a local Slovak/Czech mcu-related site) - however, this video (which I hope does not require registration) demonstrates its functionality in simulated environment

[EDIT2] Another sorry, I ****ed the ARM code usage (including some debug info), incorrectly posting it as 5968 bytes

List of 7 messages in thread
TopicAuthorDate
Snake, as a dubious benchmark            01/01/70 00:00      
   especially when ---            01/01/70 00:00      
      mentioned in the "header" of the table            01/01/70 00:00      
   more data            01/01/70 00:00      
      Bit banding?            01/01/70 00:00      
         no            01/01/70 00:00      
            Barrel shifter            01/01/70 00:00      

Back to Subject List