The e200z4 MMU Functional description

10.1 Overview
The memory management unit is a 32-bit Power ISA embedded category-compliant implementation, with
the following feature set:
• Virtual memory support
• 32-bit virtual and physical addresses
• 8-bit process identifier
16-entry fully associative TLB
• Hardware assist for TLB miss exceptions
• Per-entry multiple page size support from 1 Kbyte to 4 Gbyte
• Entry flush protection
• Software managed by tlbre, tlbwe, tlbsx, tlbsync, and tlbivax instructions
• Freescale EIS MMU architecture compliant
• Support for external control of entry matching for a subset of TID values to support non-intrusive
runtime mapping modifications

Figure 10-1.Virtual Address and TLB-Entry Compare Process

a . EA–Effective Addresses 虚拟地址
The MMU translates this effective address to a 32-bit real address which is then used for memory accesses.
The Power ISA embedded category architecture divides the effective (virtual) and real (physical) address space into pages. The page represents the granularity of effective address translation, permission control,and memory/cache attributes.
In order for an effective to real address translation to exist, a valid entry for the page containing the effective address must be in a ***translation lookaside buffer (TLB)***. Addresses for which no TLB entry exists (a TLB miss) cause instruction or data TLB errors.

Instruction accesses are generated by sequential instruction fetches or due to a change in program flow(branches and interrupts).
Data accesses are generated by load, store, and cache management instructions.
The e200 instruction fetch, branch, and load/store units generate 32-bit effective addresses.

b. EPN–Effective Page Number

Table 10-1. Page Size and EPN Field Comparison
On a TLB hit, the corresponding bits of the real page number (RPN) field are used to form the real address.
The e200z4 MMU supports twenty-three page sizes.

Figure 10-2. Effective to Real Address Translation Flow

a. RPN–real Page Number

10.3 Translation Lookaside Buffer

The Freescale EIS architecture defines support for zero or more TLBs in an implementation(执行), each with its own characteristics, and provides configuration information for software to query the existence and structure of the TLB(s) through a set of special purpose registers: MMUCFG, TLB0CFG, TLB1CFG, and so on.
By convention, (按规范)
TLB0 is used for a set associative(组合) TLB with fixed page sizes;
TLB1 is used for a fully associative TLB with variable page sizes;
and TLB2 is arbitrarily(专用于) defined by an implementation.
The e200z4 MMU supports a TLB that is fully associative and supports variable page sizes; thus it corresponds(与一致) to TLB1.
TLB1 consists of a 16-entry, fully associative CAM array with support for 23 page sizes. To perform a lookup, the CAM is searched in parallel for a matching TLB entry. The contents of this TLB entry are then concatenated(串级) with the page offset of the original effective address. The result constitutes(构成) the real (physical) address of the access. A hit to multiple TLB entries is considered to be a programming error. If this occurs, the TLB generates an invalid address but an exception will not be reported.



VLE – Variable-length encoding

10.7.3 MMU Assist Registers (MAS)

The e200z4 uses six special purpose registers (MAS0, MAS1, MAS2, MAS3, MAS4, and MAS6) to facilitate(促进) reading, writing, and searching the TLBs. The MAS registers can be read or written using the mfspr and mtspr instructions. The e200z4 does not implement the MAS5 register, present in other Freescale EIS designs, because the tlbsx instruction only searches based on a single SPID value.

Figure 10-9. MMU Assist Register 0 (MAS0):SPR - 624; Read/ Write; Reset - Unaffected


Figure 10-10. MMU Assist Register 1 (MAS1)

Table 10-10. MAS1—Descriptor Context and Configuration Control


Figure 10-11. MMU Assist Register 2 (MAS2)

Table 10-11. MAS2—EPN and Page Attributes

Figure 10-12. MMU Assist Register 3 (MAS3)

Table 10-12. MAS3—RPN and Access Control

应用

_tlballoc:
/*
* TLB1 allocated to internal RAM (0x40000000).
/
e_lis %r3, HI(TLB1_MAS0) /
e_lis 幅值/
mtspr 624, %r3 / MAS0 / /mtspr 读取地址624到R3上/
e_lis %r3, HI(TLB1_MAS1)
e_or2i %r3, LO(TLB1_MAS1) /e_or2i 逻辑或–加上/
mtspr 625, %r3 / MAS1 /
e_lis %r3, HI(TLB1_MAS2)
e_or2i %r3, LO(TLB1_MAS2)
mtspr 626, %r3 /
MAS2 /
e_lis %r3, HI(TLB1_MAS3)
e_or2i %r3, LO(TLB1_MAS3)
mtspr 627, %r3 /
MAS3 */
tlbwe /*tlbwe */

/*

  • TLB default settings.
    */
    #define TLB0_MAS0 (MAS0_TBLMAS_TBL | MAS0_ESEL(0))
    #define TLB0_MAS1 (MAS1_VALID | MAS1_IPROT | MAS1_TSISE_2M)
    #define TLB0_MAS2 (MAS2_EPN(0x00000000) | MAS2_VLE)
    #define TLB0_MAS3 (MAS3_RPN(0x00000000) |
    MAS3_UX | MAS3_SX | MAS3_UW | MAS3_SW |
    MAS3_UR | MAS3_SR)

#define TLB1_MAS0 (MAS0_TBLMAS_TBL | MAS0_ESEL(1))
#define TLB1_MAS1 (MAS1_VALID | MAS1_IPROT | MAS1_TSISE_256K)
#define TLB1_MAS2 (MAS2_EPN(0x40000000) | MAS2_VLE)
#define TLB1_MAS3 (MAS3_RPN(0x40000000) |
MAS3_UX | MAS3_SX | MAS3_UW | MAS3_SW |
MAS3_UR | MAS3_SR)

    e_lis                                               mtspr       624, %r3       读取地址624到R3上e_lis       %r3, HI(TLB1_MAS1)e_or2i      %r3, LO(TLB1_MAS1)  mtspr       625, %r3        /* MAS1 */e_lis       %r3, HI(TLB1_MAS2)e_or2i      %r3, LO(TLB1_MAS2)mtspr       626, %r3        /* MAS2 */e_lis       %r3, HI(TLB1_MAS3)e_or2i      %r3, LO(TLB1_MAS3)mtspr       627, %r3        /* MAS3 */tlbwe

a. tlbwe
The TLB1 array can be written by first writing the necessary information into MAS0–MAS3 using mtspr and then executing the tlbwe instruction. To write an entry into the TLB, the TLBSEL field in MAS0 must be set to ‘01’ and the ESEL bits in MAS0 must be set to point to the desired entry. When the tlbweinstruction is executed, the TLB entry information stored in MAS1–MAS3 will be written into the selected TLB entry.

3.18 Instruction Summary powerpc汇编指令集

3.18.1 Instruction Index Sorted by Mnemonic

Table 3-5. Instructions Sorted by Mnemonic




b 实现程序的跳转
bl 带返回地址的程序跳转

参考:
Memory Management Unit of e200z4RM in Chapter 10
Chapter 3 Instruction Model
MPC5643LRM

The e200z4 MMU 学习笔记相关推荐

  1. [mmu/cache]-ARM MMU的学习笔记-一篇就够了

    ★★★ 个人博客导读首页-点击此处 ★★★ . 说明: 在默认情况下,本文讲述的都是ARMV8-aarch64架构,linux kernel 64位 . 相关文章 1.ARM cache的学习笔记-一 ...

  2. [mmu/cache]-ARM cache的学习笔记-一篇就够了

    ★★★ 个人博客导读首页-点击此处 ★★★ . 说明: 在默认情况下,本文讲述的都是ARMV8-aarch64架构,linux kernel 64位 . 相关文章 1.ARM MMU的学习笔记-一篇就 ...

  3. Intel VT学习笔记(七)—— EPT物理地址转换

    Intel VT学习笔记(七)-- EPT物理地址转换 要点回顾 EPT 支持检测 9-9-9-9-12分页 实验:EPT物理地址转换 参考资料 要点回顾 在上一篇中,已经初步实现了最小VT框架,但实 ...

  4. ARMV8 datasheet学习笔记3:AArch64应用级体系结构

    1.前言 本文主要从应用的角度介绍ARMV8的编程模型和存储模型 2. AArch64应用级编程模型 从应用的角度看到的ARM处理器元素: 可见的元素(寄存器/指令) 说明 可见的寄存器 R0-R30 ...

  5. Cortex-M3学习笔记(一)

    Cortex-M3学习笔记(一) 首先,在学习Cortex-M3时,我们必须要知道必要的缩略语.整理如下:AMBA:先进单片机总线架构   ADK:AMBA设计套件 AHB:先进高性能总线    AH ...

  6. linux学习笔记 -- 系统编程

    系统编程 相关概念 概念 简易cpu结构 mmu内存管理单元 环境变量 PATH SHELL HOME LANG TERM getenv setenv unsetenv 进程控制 fork函数 get ...

  7. IMX6ULL学习笔记(18)——GPIO中断

    一.中断简介 相比 STM32 的 NVIC,IMX6ULL 的中断控制系统更复杂,它的中断管理器使用的是 GIC V2,GIC V2 的实现方式与我们熟知的 NVIC 差别较大. 1.1 GIC G ...

  8. 嵌入式之uboot源码分析-启动第一阶段学习笔记

    注: 以下的内容来自朱老师物联网大讲堂uboot部分课件 Uboot启动第一阶段start.S执行步骤 1.头文件包含 <config.h>(x210的各种宏定义) <version ...

  9. MIPS架构学习笔记

    MIPS架构学习笔记 来源: ChinaUnix博客 日期: 2007.03.13 23:18 (共有条评论) 我要评论 MIPS架构学习笔记                              ...

最新文章

  1. 谈谈“个人电子信息”的保护
  2. python读取excelsheet-python读取excel文件中所有sheet表格
  3. knllgobjinfo: MISSING Streams multi-version data dictionary!!! 的一次处理 (二)
  4. 安装 Window 10 for Linux 子系统教程(WSL)
  5. locate用主动还是被动_用英文形容地理位置lie、sit、locate、situate 怎样区别?
  6. 删除jar包中的指定文件
  7. Android开发之EditText监听软键盘清除(输入是否清除)
  8. IntelliJ IDEA 2021.1更新了好多实用功能,赶紧下载吧!
  9. 智能雷达物位计说明书_?浅谈人工检尺法和雷达液位计在油罐液位测量中的应用...
  10. 7zip File: How to Uncompress 7z files on Ubuntu, Debian, Fedora
  11. linux 拖动图标有拖影_想要实现元素拖动效果,但是一拖动出现禁止的图标
  12. 【数据结构与算法】浅析堆栈以及数据结构的堆和栈
  13. java runnable线程锁_多线程 java 同步 、锁 、 synchronized 、 Thread 、 Runnable
  14. 关于IE6,7下面的一些兼容性问题
  15. 手机游戏之Jad文件及MANIFEST.MF文件
  16. LaTeX 论文排版学习笔记(零基础)
  17. Spring Boot 动态设置数据库密码,密码加密,密码单独处理
  18. python菜鸟学习Day9(requests,套接字socket)
  19. 小白兔写话_看图写话小白兔
  20. 基于BPM的低代码平台如何选型

热门文章

  1. IOS开发入门(6)-自动布局(1)
  2. 关于uni.appd打包H5 图片在IOS 上不显示的问题
  3. CAD图层的顺序的调整
  4. ## 解决: IIS部署静态页面更新时html,js文件没有更新的问题
  5. 友情检测北京某大学网站
  6. 永磁同步直线电机驱动控制原理与matlab建模仿真
  7. matlab判断系统因果性,信号与系统如何判定一离散系统的因果稳定性
  8. SICK LMS511 LiDAR系统集成
  9. Python 爬虫 面试题
  10. 如何识一个人的技术能力和水平?