Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#367 Support for 'unitfied' memory spaces

closed
Maarten Brock
5
2012-06-02
2012-06-01
Koliada
No

All ChipCon (now TI) CCXXXX 8051 implementations have some form of unified memory architecture.

This means that flash can be read as part of a unified xdata space.

Unified memory allows constants to remain in flash rather than ram.

Whereas placement of the CONST segment by the linker can accommodate this, the following code;

unsigned a;
const unsigned b = (unsigned) &a;

Where b is a constant handle to global variable fails to compile (all models).

The reason for this failure is unclear - it generates error 2: Initializer element is not constant

Which is clearly incorrect.

Discussion

  • Maarten Brock
    Maarten Brock
    2012-06-02

    On the mcs51 constants always stay in code memory (flash). They are read using MOVC instructions. So I'm not sure what you're asking for here. And how is the unified memory involved in this?

    The other problem you already reported as bug 3531375.

     
  • Maarten Brock
    Maarten Brock
    2012-06-02

    • assigned_to: nobody --> maartenbrock
    • status: open --> pending
     
  • Koliada
    Koliada
    2012-06-02

    • status: pending --> open
     
  • Koliada
    Koliada
    2012-06-02

    It was a wild guess - the behavior seemed different if for const....

    It would seem this behavior is additional to 3531375.

     
  • Maarten Brock
    Maarten Brock
    2012-06-02

    • status: open --> pending
     
  • Maarten Brock
    Maarten Brock
    2012-06-02

    > It was a wild guess - the behavior seemed different if for const....

    What was? And what was different?

    > It would seem this behavior is additional to 3531375.

    What behaviour?

    Are you trying to be vague on purpose? You're asking for unified memory spaces, but what is exactly that you would like to see?

    Currently unified code and xdata is supported, but you must tell the linker no to use overlapping addresses with --code-loc and --xram-loc.

    I see no relationship with bug 3531375 so please keep it out of this request.

     
  • Koliada
    Koliada
    2012-06-02

    • status: pending --> open
     
  • Koliada
    Koliada
    2012-06-02

    The errant behavior here is;

    unsigned a;
    const unsigned b = (unsigned) &a;

    which incorrectly does not compile in >all< models.

    I, apparently mistakenly, attributed that to some feature deficiency.

    I previously reported bug 3531375 in that the following code:

    unsigned a;
    unsigned b = (unsigned) &a;

    Does not compile in >large< model - this is bug 3531375

    The only difference between these two pieces of errant code is one uses const and the other doesn't and hence my assertion that they are related.

    If the const is not confusing the handling of data spaces, then this feature request is moot.

     
  • Maarten Brock
    Maarten Brock
    2012-06-02

    Thank you for your answer and for extending bug 3531375 with this one. I had not noticed the small differences, esp. since I was looking for a feature request here instead of a bug report.

    So there is no feature request and I therefore close it.

     
  • Maarten Brock
    Maarten Brock
    2012-06-02

    • status: open --> closed