cancel
Showing results for 
Search instead for 
Did you mean: 

The impression of the STM8

Vyacheslav Azarov
Associate III
Posted on November 09, 2016 at 05:10

After spending a little comparative analysis of the code generated by the compiler  SDCC for various 8-bit microcontrollers, I was surprised. Efficiency STM8 outside of competition. In my opinion this is the best among the 8 bit microcontrollers. And now I'm plan to use it in some of the technical solutions in the future.

Excellent!

#efficiency-code #efficiency-code-compiler-cosmic
4 REPLIES 4
John7
Associate II
Posted on November 24, 2016 at 17:35

Hi Viachelav,

I also look into the generated code to check compiler and CPU architecture efficency.

I was also pleasently suprised with the COSMIC compiler.

Furthermore, the STM8 value line is loaded with features.

MCU's with less features from other manufacturers cost more.

Cheers,

John7

Vyacheslav Azarov
Associate III
Posted on November 28, 2016 at 07:06

Hello John7, thanks for reply.

Yes, it is very attractive concept. Context free processor allow very fast switch between processes. But this feature do not supported in accessible compilers. I studied IAR and SDCC. IAR compiler have excellent optimisation for complex algorithms  but  have huge execution context with virtual registers. SDCC used global stack for storage local data, that is encouraging, but have some annoying bugs. The next step will be COSMIC, when I will get the license.

...

COSMIC compiler may be that what me need!

Viacheslav

Posted on December 05, 2016 at 23:57

On one hand, the latest Cosmic release generates faster code than the latest SDCC release (though IAR does even better):

http://colecovision.eu/stm8/compilers.shtml

On the other hand, recent development versions of SDCC generate really fast code:

https://community.st.com/0D50X00009Xki9LSAR

So I'd expect SDCC 3.7.0 (probably to be released in the first half of 2017) to generate faster code than Cosmic.

Philipp

Posted on December 06, 2016 at 05:49

Thanks, it is very interested. But I prefer analyse by learning result. IAR is best. However, COSMIC and SDCC have advantages,  though have a few minor flaws in the optimisation. For the systems with very small memory they more preferable, by my view.  Based on the charts, is possible that Raisonance is most preferred for the small controllers, however I no studied it.

This is example of lack of the optimisation by COSMIC compiler:

 222        ; 35 unsigned get(void)

 222        ; 36 {

 223                         switch    .text

 224  005f               f_get:

 226  005f 89                pushw    x

 227       00000002      OFST:    set    2

 230        ; 38     result = private_var;

 232  0060 ce0000            ldw      x,_private_var

 234        ; 39     return result;

 238  0063 5b02              addw      sp, ♯ 2

 239  0065 87                retf