Forum Discussion

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

NIOS II ISS Simulator error

Hi all,

I'm getting this error when running a simple application: the application works fine; at a given point I need to change the stack pointer to another (fresh, never used) location.

At that point, I try to pop a word from the (new) stack, and I get the following error:

cpu:nios2ModelRun: ERROR: [676037] load word access to address 0x1fff784 returned uninitialized memory (valid mask=0x0)

I think the reason for this error is that the location was never written before, and so the ISS simulator gives an Error (that is more a warning than an error, isn't it?).

I solved the issue simply wiping out all the memory from symbol "end" to the current value of the sp register, but I don't think that it is the best way to do O:-)

Is it possible to disable that "unused memory" check on the ISS?

Thanks,

Paolo

3 Replies

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

    hi,

    you're right in identifying that the iss is being over cautious by erroring on unitialized memory accesses. This has been identified as a problem and will be addressed in the next version. As a workaround for now though, edit the "clear_x_bits_ld_non_bypass" parameter and set it to 1 in the ptf file. This parameter should be located within the WIZARD_SCRIPT_ARGUMENTS for the nios2 module.

    This will cause the errors to be output as warnings instead, so your program won't error out.

    If you would like to suppress all the warnings altogether, when running the iss, go to the menu bar:

    Run->Run... and select the launch configuration for your project (identified by the project name). Select the ISS Settings tab, and uncheck the Warning tick box.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I wouldn't characterize the ISS as being over cautious at all. One of the main benefits of running on a simulator is that it can easily catch this sort of error in you code. It can be very hard to find these sort of errors when running on real hardware: the uninitialized value might not cause a problem most of the time (but it surely will during product demos!).

    If your code is reading values off the stack that it hasn't set, it could potentially signal a problem (unless, as in this trivial case, you don't actually use the data).
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    the iss is arguably being over cautious because it always errors out on uninitialized memory accesses. While this is certainly useful most of the time, in the trivial case where the data read isn't actually used, having the iss error out thus preventing further execution is not ideal.

    The next version will address this issue by offering the user the option to error, warn or suppress this message.