10-13-2009 08:07 AM
xps_0_mb4_bram_cntlr : ORIGIN = 0x81418000, LENGTH = 0x00004000
10-14-2009 03:02 PM
Nothing forces a section to be read only.
Global data declared as 'const' is assumed to be read only. The compiler assigns such data to the .rodata section. You could assign the .rodata section to the BRAM in question in your linker script. While the compiler will complain if your software modifies something which was declared as 'const', it's "read only"ness is entirely a software construct. Software can still happily attempt to overwrite 'const' data.
Alternately, you can create your own unique section mapped to this bram (i.e. .rodata_bram) and use compiler directives in your source code to assign the specific hand-tailored global data you want to this section.
10-16-2009 01:38 PM
Thanks for your reply.You're right, the read-onlyness would not truely be enforced by the software tools. In the end we will create a custom BRAM IP that has one port read/write and the other port read only. I was hoping to use the linker to provide some level of checking that we were not trying to write to the read only port as I start coding. I wanted to try this global approach over using const since if I forget to make every pointer or type cast const it defeats the whole thing. Don't misundestand, I do use const all the time in my real code when called for, but what I'm trying to do now is just a stop-gap until we create the custom BRAM block. I just wanted to have a quick high level check.
I can live without it, but was hoping that by setting some linker flags I could have forced the compiler to do a "soft" check and throw an error or warning.