Forum Discussion
Altera_Forum
Honored Contributor
11 years agoIf you create an INIT() macro, then it will be invoked from alt_sys_init() before main() executes. The HAL will supply your macro with the correct# define'd value. Your initialization function can then locally store the base address and use that local value in all of your subsequent functions.
http://www.altera.com/literature/hb/nios2/n2sw_nii52005.pdf You can't really do this if you intend to have multiple instances of your hardware block in your FPGA.