Philipp Klaus Krause | 20 Jul 13:20 2016
Picon

STM8 Dhrystone performance - new record at 0.355 DMIPS / Mhz using SDCC

ST marketing materials put STM8 Dhrystone performance at 0.29 DMIPS / Mhz.

However, when actually compiling the Dhrystone benchmark with different
C compilers optimizing for speed, the picture is a bit different:

Raisonance is at 0.289 DMIPS / Mhz and Cosmic at 0.296 DMIPS / Mhz, both
very close to the 0.29 DMIPS / Mhz stated by ST.
IAR outperforms them, and acheives 0.347 DMIPS / Mhz. All these numbers
are from the comparison at http://colecovision.eu/stm8/compilers.shtml,
which uses mid-2016 compilers.

SDCC used to perform worse at Dhrystone: SDCC 3.5.0 from last year only
achieves 0.151 DMIPS / Mhz. SDCC 3.6.0 was released on the 12th of June
2016 and improves this to 0.167 DMIPS / Mhz, still far worse than the
other compilers.

But current development versions of SDCC do much better: Revision #9652
is now at 0.355 DMIPS / Mhz. That means that SDCC went from worst to
best in a very short time. Besides the huge improvement in Dhrystone
scores, there was also a small reduction in Dhrystone code size.

Philipp

P.S.: Dhrystone was compiled using strong optimization for code speed:
sdcc -mstm8 -c -DNOSTRUCTASSIGN --max-allocs-per-node 100000
--opt-code-speed

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
(Continue reading)

Peter Urban | 7 Jul 11:58 2016
Picon

modulo operation malfunction on pic14 (P16F886)

Hello everyone!

I am certain that there is an issue with _moduchar at pic14 lib. I attached the generated assembly instructions of my function. The fault arises after _moduchar is called. The value of pos (after pos %= UART_REC_BUF_LEN;) is wrong, as it turns out to be zero in cases where it should contain a different value.  That means:

pos = 2;
pos %= 5;

results in: pos = 0

I intentionally loaded the values from the struct uart_rec_buffer into local variables for debugging reasons. Don't wonder...

The code calling _moduchar is executed inside my main-loop and might be interrupted by an ISR. Does this cause such problems? That is the only thing I am not sure about.

Can you tell me where to find the assembly for _moduchar (in my system)? I would like to supply you with the block of code (I can only find the c version).

I had to change all modulo operations to if/then in order to get rid of this bug. This means faster assembly code, but I think this bug should be identified (or at least communicated to other) and fixed.


Best regards,

Peter


sdcc --version
SDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8 3.5.0 #9253 (Jun 20 2015) (MINGW64)

_fifo_dequeue    ;Function start
; 2 exit points
;    .line    198; "uart.c"    uint8_t pos = uart_rec_buffer.begin;
    BANKSEL    _uart_rec_buffer
    MOVF    (_uart_rec_buffer + 5),W
;    .line    199; "uart.c"    unsigned char c = uart_rec_buffer.data[pos];
    BANKSEL    r0x1014
    MOVWF    r0x1014
    ADDLW    (_uart_rec_buffer + 0)
    MOVWF    r0x1015
    MOVLW    high (_uart_rec_buffer + 0)
    BTFSC    STATUS,0
    ADDLW    0x01
    MOVWF    r0x1016
    MOVF    r0x1015,W
    BANKSEL    FSR
    MOVWF    FSR
    BCF    STATUS,7
    BANKSEL    r0x1016
    BTFSC    r0x1016,0
    BSF    STATUS,7
    BANKSEL    INDF
    MOVF    INDF,W
    BANKSEL    r0x1017
    MOVWF    r0x1017
;    .line    203; "uart.c"    uart_rec_buffer.data[pos] = PROTOCOL_NON_ECHO_DUMMY;
    MOVF    r0x1014,W
    ADDLW    (_uart_rec_buffer + 0)
    MOVWF    r0x1015
    MOVLW    high (_uart_rec_buffer + 0)
    BTFSC    STATUS,0
    ADDLW    0x01
    MOVWF    r0x1016
    MOVF    r0x1015,W
    BANKSEL    FSR
    MOVWF    FSR
    BCF    STATUS,7
    BANKSEL    r0x1016
    BTFSC    r0x1016,0
    BSF    STATUS,7
    MOVLW    0x00
    BANKSEL    INDF
    MOVWF    INDF
;    .line    205; "uart.c"    ++pos;
    BANKSEL    r0x1014
    INCF    r0x1014,F
;    .line    206; "uart.c"    pos %= UART_REC_BUF_LEN;
    MOVLW    0x05
    MOVWF    STK00
    MOVF    r0x1014,W
    PAGESEL    __moduchar
    CALL    __moduchar
    PAGESEL    $
;    .line    208; "uart.c"    uart_rec_buffer.begin = pos;
    BANKSEL    r0x1014
    MOVWF    r0x1014
    BANKSEL    _uart_rec_buffer
    MOVWF    (_uart_rec_buffer + 5)
;    .line    210; "uart.c"    --uart_rec_buffer.len;
    DECF    (_uart_rec_buffer + 7),W
    BANKSEL    r0x1015
    MOVWF    r0x1015
    BANKSEL    _uart_rec_buffer
    MOVWF    (_uart_rec_buffer + 7)
    .... (some debug output I cut out)
    BANKSEL    r0x1017
    MOVF    r0x1017,W
    RETURN
; exit point of _fifo_dequeue


------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Sdcc-user mailing list
Sdcc-user@...
https://lists.sourceforge.net/lists/listinfo/sdcc-user
Philipp Klaus Krause | 7 Jul 01:26 2016
Picon

8051-variant dev board recommendations

I'm looking for dev / eval boards for 8051-variants. Can anyone
recommend good/cheap boards that fit the following criteria:
* Enough XRAM. I'd need at least 2KB, but 5KB would be better.
* There should be free tools to get the program onto the MCU.

Ideally, I'd like to have boards for these 8051-variants:
* Intel 8052-like
* AMD 80C521-style dual dptr (DPL1 at 0x84, DPH1 at 0x85, DPS at 0x86.0)
* Philips P89C51R-style dual dptr (DPS at 0xa2.0)

Maybe also:
* Siemens SAB 80C517-like (8 dptr, DPSEL at 0x92, MDU)
* Infineon XC888-like (2 dptr, EO at 0xd0, MDU, Cordic)
* Other 8051-variants (multi-dptr styles, possible MDU)

Philipp

------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
Sab V | 4 Jul 13:57 2016
Picon

Using static inline function with assembly labels in SDCC (8051)

Hi,

I am trying to compile the following code:

static inline void uart_tx(char c)
{

    __asm
    jnb _EA,label1       
    setb _ea_hold       
    label1:
    __endasm'
}

void anotherfunction()
{
uart_tx(c);
}

In this case SDCC keeps complaining :
Error: <m> multiple definitions error
Error: <p> phase error: label location changing between passes 2 and 3

If I replace the labels to 0001$ , then the errors dont exist anymore. Is there any other way to use inline assembly with labels?




------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Sdcc-user mailing list
Sdcc-user@...
https://lists.sourceforge.net/lists/listinfo/sdcc-user
Maarten Brock | 5 Jun 20:22 2016
Picon

SDCC 3.6.0 Release Candidate 2

Hello SDCC followers,

Today the second Release Candidate (RC2) for SDCC 3.6.0 has been created.
As always it has been put online in our SourceForge File section.
https://sourceforge.net/projects/sdcc/files/

If you have the time, please verify it and report back with the positive
or negative results.

As Miss Piggy put it to C-3PO:
Watch it, Hardware!

Maarten Brock

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
Benjamin Larsson | 2 Jun 00:20 2016
Picon

Generating code for Silabs C8051F330

Hi, I am working on (re)writing firmware for a rfid reader (RDM6300). 
Initially I started this project with a C8051F300 mcu. To program the 
chip I wrote firmware for a hardware programmer plus I reused c2tool as 
host software:

https://github.com/merbanan/c2gen
https://github.com/merbanan/c2tool

When I got that working I started writing simple example code to get to 
know the mcu.

https://github.com/merbanan/C8051F300_examples

Everything worked fine. Then I switched to the C8051F330 mcu and all 
went to shit. Small examples worked somewhat but when compiling larger 
code sets things just stopped working. The mcu is just not behaving 
predictable. I have more then one hardware and they behave equally bad, 
so it is deterministically bad. To add to the insult my homebrew 
programmer didn't want to work with this chip either. Reading chip 
status worked but flash programming and dumping didn't. So I tried with 
the Keil tool chain and a proper programmer and things seem to behave 
better.

So how do I debug this issue further? I am so far that if I uncomment a 
call to a delay function things stop working. I am suspecting that sdcc 
or I am not setting up the hardware properly.

MvH
Benjamin Larsson

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
Maarten Brock | 31 May 00:09 2016
Picon

SDCC 3.6.0 Release Candidate 1

Hello SDCC followers,

Today the first Release Candidate (RC1) for SDCC 3.6.0 has been created.
As always it has been put online in our SourceForge File section.
https://sourceforge.net/projects/sdcc/files/

If you have the time, please verify it and report back with the positive
or negative results.

As Miss Piggy put it to C-3PO:
Watch it, Hardware!

Maarten Brock

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
Philipp Klaus Krause | 22 May 23:58 2016
Picon

Comparing compilers for STM8

Hello,

I have started to write a short comparison of compilers targeting the
STM8. The current draft is at
http://www.colecovision.eu/stm8/compilers.shtml
However, I wonder what options should I use for the benchmarks?
Release defaults?
Strong optimization with a balanced optimization goal?
Optimization for code size?
Speed?

The current graphics in the draft are for strong optimization with a
balanced optimization goal, except for Raisonance, which doesn't have
balanced optimization, and thus optimizes for code size.

Anything else that should be included in the comparison?

Philipp

------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Sdcc-user mailing list
Sdcc-user@...
https://lists.sourceforge.net/lists/listinfo/sdcc-user
Philipp Klaus Krause | 15 May 14:09 2016
Picon

HC08/S08 with ELF output

In revision #9599, support for outputting the symbol table for ELF was
added.
To the S08/HC08 ELF users: Is this change useful for you? Does it break
anything for you?

Philipp

------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Sdcc-user mailing list
Sdcc-user@...
https://lists.sourceforge.net/lists/listinfo/sdcc-user
php mania | 14 May 16:33 2016
Picon

Using registers in C functions which are unused

Hi,

I am using the 8051 and am compiling using the SDCC. I have a C function which calls an assembly function. This assembly function needs to do a lot of tasks and I need to be able to use the registers as well as RAM to complete the task. However, I am not really sure how to find if these registers I am using is being used by some other function in the same C program. Is there anyway to access some registers and create some local variables and use them in my assembly program for a given function(I am inlining assembly) ?
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Sdcc-user mailing list
Sdcc-user@...
https://lists.sourceforge.net/lists/listinfo/sdcc-user
Maarten Brock | 8 May 14:10 2016
Picon

Re: [sdcc-devel] How do I pass data from a c file into an assembly file

Hello,

> Hi,
>
> Thanks a lot for the reply. It is mcs51. I guess I will take a look at
> that. What if I need to exchange more than a byte of data? Should I just
> increment the location pointed to by dpl? Is that how this works?

No, but again look at the generated assembly for something similar.

> Also another question and I find it rather strange. I am trying to
> pass pointers through functions in sdcc
>
> void a()
> {
>
> unsigned char a;
> a=some value
> b(&a);
> }
>
> void b(unsigned char *a )
> {
> *a='s';
> }
>
> I keep getting this error
>
>  warning 127: non-pointer type cast to generic pointer
> from type 'unsigned-char fixed'
>
> I have tried specifying __xdata, but it still throws the same error. Any
> ideas?

If you don't show the code that produces this error, we can't help. We
will not try to guess it.

And since you're not developing SDCC itself, could you please reply on the
user mailing list?

Maarten

> On Sun, May 8, 2016 at 11:06 AM, Erik Petrich <
> epetrich@...> wrote:
>
>>
>>
>> On Sun, 8 May 2016, Sab V wrote:
>>
>> > Hi,
>> >
>> > I have a C function which calls a function in c but written in
>> assembly
>> >
>> > void a()
>> > {
>> >
>> > callassembly(a);
>> >
>> > }
>> >
>> > void callassembly(char a)
>> > {
>> >
>> > //assembly level
>> >
>> > }
>> >
>> > How do I access the char a data in assembly. Also if I need to return
>> data back, how do I do this?
>>
>> You'll get a better answer if you could at least specify which
>> architecture you are compiling for. For hc08 and s08, a single parameter
>> of type char would be passed in the A register and a char return value
>> would also be passed in the A register. For mcs51 and ds390, it would be
>> the same except the DPL register would be used instead of A. For the Z80
>> family, the parameter is passed on the stack and the return value is
>> passed in the L register.
>>
>> You could also compile a simple function such as
>>
>>   char foo(char x)
>>   {
>>     return x+1;
>>   }
>>
>> to see how the parameter and return value are passed.
>>
>>    Erik

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z

Gmane