Forum Discussion
Altera_Forum
Honored Contributor
21 years agofunction with "attribute"
Hi all,
Quartus 4.2 Nios 1.2 I want to place the fuction "prova()" in the memory named "onchip_memory": <div class='quotetop'>QUOTE </div> --- Quote Start --- void prova __attribute__ ((section ( ".onchip_memory"))) (void) { while(1){} } [/b] --- Quote End --- I get the compilation error: <div class='quotetop'>QUOTE </div> --- Quote Start --- ../hello_world.c:99: error: parse error before '(' token[/b] --- Quote End --- the line 99 is the line quoted. Any suggestions?2 Replies
- Altera_Forum
Honored Contributor
Hi Soin,
Put the 'attribute' in the declaration rather than the definition:
Regards, --Scottextern void prova (void) __attribute__ ((section ( ".onchip_memory"))); void prova (void) { while(1){} } - Altera_Forum
Honored Contributor
Yes it works!
Thank u very much! http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif