Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
21 years ago

Problems launching Nios II ISS

Launching the Nios II ISS generates the following error message:

Error! : Unable to load memory block at address 0x20 from ELF file Release/nios_program.elf

Fatal Error! : Memory map is not consistent with memory image file - check that file 'Release/nios_program.elf' is compiled and linked for system 'C:\qdesigns\NiosIICPU.ptf'

The exception address is set to the default value of 0x00000020 in SOPC Builder. (The reset address is at 0x00000000.)

It seems as if ISS is unable to find any executable code at the exception address/0x20. Do I need to supply my own exception handler, or what is it am I missing?

4 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    This error message appears when the ISS has detected that your elf file does not match the system described in your ptf file. What it is attempting to do (and failing), is load data from your elf file that should go into a chunk of memory, starting at address 0x20. Check that there is a memory peripheral at that address, and that your elf file has been built for that ptf file.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I managed to find the solution for this problem.

    In SOPC Builder, under the Nios II sub-menu ('More "cpu" Settings'):

    Changing the Exception Address from using the flash memory to SDRAM made ISS run properly.

    Apparently, using the flash memory for the exception address is illegal behaviour..
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    avatar,

    the iss doesn't model flash components, hence the failure to load data into it during initialisation.

    If you're would like to simulate flash as a block of memory instead, then you can edit the ptf file :

    . go the the flash module eg. Module ext_flash

    . edit the iss_module_name parameter value to read "altera_memory" ie.

    iss_model_name = "altera_memory";

    The iss supports simulation of the following peripherals:

    . memory (ram/rom)

    . avalon timer

    . avalon jtag uart

    . avalon uart

    Accesses to unsupported peripherals will be ignored.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    dayne,

    Thanks a lot for the helpful advice. This makes it possible for me to simulate the system the way I had originally intended to.