Msg/MemoryNoDevice: Difference between revisions
From CPUlator Wiki
< Msg
Created page with "The computer system has a 32-bit address space (addresses are 32 bits, and there is 2<sup>32</sup> bytes = 4 gigabytes of address space), but usually only part of that space a..." |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
The computer system has a 32-bit address space (addresses are 32 bits, and there is 2<sup>32</sup> 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 tried to access a location within the address space that is not used by any memory or I/O devices. | The computer system has a 32-bit address space (addresses are 32 bits, and there is 2<sup>32</sup> 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 === | === Examples === | ||
Line 8: | Line 8: | ||
ldr r0, =0xe0000000 // Somewhere outside memory and I/O devices. | ldr r0, =0xe0000000 // Somewhere outside memory and I/O devices. | ||
ldr r1, [r0] // Where is this reading from? Nothing. | ldr r1, [r0] // Where is this reading from? Nothing. | ||
bx r0 // Branch to nowhere | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==== Nios II ==== | ==== Nios II ==== | ||
Line 15: | Line 17: | ||
movia r2, 0xe0000000 # Somewhere outside memory and I/O devices. | movia r2, 0xe0000000 # Somewhere outside memory and I/O devices. | ||
ldw r3, 0(r2) # Where is this reading from? Nothing. | ldw r3, 0(r2) # Where is this reading from? Nothing. | ||
jmp r2 # Branch to nowhere | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Note that these examples assume you're using a computer system other than the | 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 === | === Debugging === | ||
* Check the address used for the memory access. | * 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 [https://cpulator.01xz.net/doc/#callstack <b>Trace window</b>] (located in the same panel as the registers window by default) to look backwards in the program execution. | |||
=== Implementation === | === Implementation === | ||
For every memory access, 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 or | 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. | ||
{{DisableMsg|Memory access out of range}} | {{DisableMsg|Memory access out of range}} |
Latest revision as of 05:51, 11 March 2019
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.