⚠️ [linker script] simplify memory configuration #375
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR changes the default linker script in order to provide a more flexible memory/section/region configuration.
sw/common/neorv32.ld
) now uses variables to define the section sizes and base addresses:The actual linker script's
MEMORY
section must not (!!!) be altered any longer.✨ By having variables for the sizes and base addresses, the setup-specific configuration can be made much simpler by just passing arguments to the application makefile.
Example to set the RAM section (DMEM) to 16kB during invocation of
make
:$ make USER_FLAGS+="-Wl,--defsym,__neorv32_rom_size=16k" clean_all exe
This allows to keep to code base clean (no need to change the linker script). All project-related configurations (ISA extensions, optimization, tuning flags, ...) including the memory layout can now be configured by a single project-local makefile of shell script.