toolchain icon indicating copy to clipboard operation
toolchain copied to clipboard

Add compiler option to for uncached object placement

Open petrokarashchenko opened this issue 4 years ago • 6 comments

If will be good if we can add compiler option for ARC to group all variables that are declared with __attribute__((uncached)) into a single sections ".ucdata" and ".ucbss" (similar to ".sbss" or ".sdata") so it will be possible to make section placement in linker script and handle cache alignment issue.

petrokarashchenko avatar Apr 29 '20 12:04 petrokarashchenko

Doesn't section attribute solve this issue?

claziss avatar Apr 29 '20 16:04 claziss

Some how yes. But in code the need to track all variables with uncached access gets risen. I mean if I typedef volatile __attribute__((uncached)) int uncached_int;, then in all places new type is used programmer need's not to forget to place section attribute, otherwise code get's screwed up. The better way will be having an option, so section attribute is added automatically to all variables declared with __attribute__((uncached)).

petrokarashchenko avatar Apr 29 '20 16:04 petrokarashchenko

I mean it will be good to have an option so section attribute to be added implicitly for all variables that are declared with uncached attribute. Similar to MetaWare compiler Uncached_in_own_section.

petrokarashchenko avatar Apr 29 '20 16:04 petrokarashchenko

It is just an idea. I just thought about -fdata-sections, so .ucdata. or .ucbss. can be appended. But I do not fully understand the effort that is needed to get such enchantment.

petrokarashchenko avatar Apr 29 '20 16:04 petrokarashchenko

Shouldn't be too much of a hassle.

claziss avatar Apr 30 '20 09:04 claziss

Hi @petrokarashchenko sorry for not solving this in 2020.09 as this one doesn't seem as a low-hanging fruit. Moving to the next release with hope to spend more time on that looking forward.

abrodkin avatar Oct 22 '20 10:10 abrodkin