Forum Discussion
Altera_Forum
Honored Contributor
15 years agoGenerate a NIOS cpu without the instruction or data caches, instead add tightly coupled instruction and data blocks.
You can add read/write access to the 'code' memory over the Avalon bus, if you link your program appropriately (put .rodata with .data, and don't use gcc4! - switch statement jump tables end up in the wrong segment) this isn't actually necessary though! You need to avoid calling any code out of libc - it tends to pull in large tracts of unneeded stuff - in particular printf() pulls in all of stdio and malloc. The startup code supplied by altera also tends to pull in stdio. For absolute minimalism, you only need to set two registers (sp & gp) before jumping to that start of any C function. I've done this from within the linker script in order to avoid an additional source file - which the linker script would have to know about anyway.