Hello, my name is Duck.
I learned the C language and was reading a certain firmware.
Then I came across the word MMU.
Apparently, I have only understood that it stands for "Memory Management Unit."
So I asked my senior.
Duck: "What is this MMU?"
Senior "MMU is for address translation between virtual memory and physical memory to start up a farm."
Duck "? ? ?"
There were so many words I was hearing for the first time that my head was about to explode.
So, I will explain the meaning of these words in two parts starting this time.
What is a memory address?
First of all, let's talk about memory addresses.
Memory has addresses, which can be called data addresses, and the CPU uses these addresses to perform operations based on the program.
Example: The data at address 1 is added to the data at address 2 and stored at address 3.
Using memory differently - address space
For example, consider the following handling of actual memory data in programs A B C
A square of memory does not represent a single piece of data, but a range of memory of a certain size (e.g., 4 KB).
In such a case, there is a risk of accidentally rewriting memory that should be used by another program.
In addition, the discontinuity makes it difficult to understand when determining the location of memory. Therefore, the problem is solved by converting the address of the actual memory so that it can be easily handled in the program.
- Physical Address : Address of actual memory (physical memory (RAM, etc.))
- Physical Address : Address of actual memory (physical memory (RAM, etc.))
- Virtual Address : Address of memory (virtual memory) used in the program
- Address Translation Convert : virtual memory and physical memory / MMU Address Translation
Thus, address conversion is performed between physical and virtual addresses.
This conversion is performed by the MMU.
By performing the conversion, addresses can be used continuously within the program.
The range of virtual addresses that can be used continuously in the program (the area surrounded by the same color in the figure) is called the address space.
In the next article, we will look at how the MMU performs address translation in more detail.
Additional Tips to Keep in Mind
The MMU is, of course, also included in ARM® systems, so it can be used in Altera's SoC devices.
And, to our surprise, it can also be used with Altera's Nios® II (soft-core processor).
The ARM Cortex-A9 is used in Altera's SoC devices.
This Cortex-A series requires the use of an MMU in order to use the cache. (I will write more about cache in another article.)
Nios II allows you to build your own CPU system with any combination of peripherals.
Since Nios II has MMU capability, you can use it.
The MMU and MPU (Memory Protection Unit) can be used separately, so you can choose the one that best suits your needs.
Incidentally, in Nios II, only one of the MMU and MPU can be enabled. Why is that?
I asked a senior,
He replied, "The MMU also has a protection function, so there is no need to bother using the MPU."
So the MMU has that aspect as well.
Let's find out how the address translation works in the next article.
New Engineer's Blush Blog Article List