Msg/MemoryNoDevice

From CPUlator Wiki

< Msg

The computer system has a 32-bit address space (addresses are 32 bits, and there is 232 bytes = 4 gigabytes of address space), but usually only part of that space actually contains memory or I/O devices. This message tells you that a memory access (or instruction fetch) tried to access a location within the address space that is not used by any memory or I/O devices.

Examples

ARMv7

.global _start
_start:
	ldr r0, =0xe0000000		// Somewhere outside memory and I/O devices.
    ldr r1, [r0]			// Where is this reading from? Nothing.

    bx r0					// Branch to nowhere

Nios II

.global _start
_start:
	movia r2, 0xe0000000	# Somewhere outside memory and I/O devices.
    ldw r3, 0(r2)			# Where is this reading from? Nothing.

    jmp r2					# Branch to nowhere

Note that these examples assume you're using a computer system other than the "generic" systems, which have 4 GB memory mapped to the entire 32-bit address space. Since there is memory mapped to the entire address space, there are no addresses that are mapped to nothing.

Debugging

  • Check the address used for the memory access.
  • For instruction fetches, it means that the PC value is very incorrect. This is often caused by a branch with an incorrect target address. To find the offending branch, try using the Trace window (located in the same panel as the registers window by default) to look backwards in the program execution.

Implementation

For every memory access (including instruction fetches), the simulator needs to find the memory or I/O device that services the address used by the request, and complains if none is found. This warning is generated while executing the load, store, or instruction fetch.

Disabling this message

This debugging check can be disabled in the Debugging Checks section of the Settings box: Memory access out of range.