What is a memory model, and why is it needed?

A memory model is a way of organizing and defining how memory behaves. It provides a structure and a set of rules for you to follow as you configure how addresses, or regions of addresses, are accessed and used in your system.

The memory model provides attributes that you can apply to an address and it defines the rules associated with memory access ordering.

Consider a simple system with the address space:

                                                          A diagram showing simple address space.

The arrangement of memory regions in the address space is known as an address map. Here, the map contains:

  • Memory and peripherals.
  • In the memories, code and data.
  • Resources belonging to the OS and resources belonging to user applications. 

The way that you want the processor to interact with a peripheral is different to how it should interact with a memory. You will usually want to cache memories but not peripherals. Caching is where you store a copy of information from memory into a location (known as a cache) that's closer to the core and therefore faster for the core to access. Similarly, you will usually want the processor to block user access to kernel resources.

This diagram shows the address map with some different memory attributes that you might want to apply to the memory regions: 

A diagram showing address map for memory regions 

You need to be able to describe these different attributes to the processor, so that the processor accesses each location appropriately. 

Previous Next