




已阅读5页,还剩5页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
在基于ARM的嵌入式应用系统中,存储系统通常是通过系统控制协处理器CP15完成的。CP15包含16个32位的寄存器,其编号为015。访问CP15寄存器的指令MCRARM寄存器到协处理器寄存器的数据传送MRC协处理器寄存器到ARM寄存器的数据传送MCR指令和MRC指令只能在处理器模式为系统模式时执行,在用户模式下执行MCR指令和MRC指令将会触发未定义指令的异常中断。MCR指令MCR指令将ARM处理器的寄存器中的数据传送到协处理器寄存器中。如果协处理器不能成功地执行该操作,将产生未定义的指令异常中断。指令语法格式MCR ,,MCR p15,0,,其中,为指令执行的条件码。当忽略时指令为无条件执行。为协处理器将执行的操作的操作码。对于CP15协处理器来说,永远为0b000,当不为0b000时,该指令操作结果不可预知。作为源寄存器的ARM寄存器,其值将被传送到协处理器寄存器中。作为目标寄存器的协处理器寄存器,其编号可能是C0,C1,C15。和两者组合决定对协处理器寄存器进行所需要的操作,如果没有指定,则将为为C0,opcode_2为0,否则可能导致不可预知的结果。The CRm field and opcode_2 field are used to specify a particular action when addressing registers.The opcode_1, opcode_2 and CRm fields should be zero, except when the values specified are used to select the desired operations, in all instructions which access CP15. Using other values will result in unpredictable behavior. Attempting to read from a non-readable register, or writing to a non-writable register will cause unpredictable results.使用示例下面的指令从ARM寄存器R4中中将数据传送到协处理器CP15的寄存器C1中。其中R4为ARM寄存器,存放源操作数,C1、C0为协处理器寄存器,为目标寄存器,opcode_1为0,opcode_2为0。MCRp15,0,R4,C1,C0,0MRC指令MRC指令将协处理器的寄存器中的数值传送到ARM处理器的寄存器中、如果协处理器不能成功地执行该操作,将产生未定义的指令异常中断。指令语法格式MRC ,,MRC p15,0,,参数用法同MCR指令CP15中的寄存器介绍Register(寄存器)ReadWriteC0ID Code (1)UnpredictableC0Catch type(1)UnpredictableC1ControlControlC2Translation table baseTranslation table baseC3Domain access controlDomain access controlC4UnpredictableUnpredictableC5Fault status(2)Fault status (2)C6Fault addressFault addressC7UnpredictableCache operationsC8UnpredictableTLB operationsC9Cache lockdown(2)Cache lockdown (2)C10TLB lock down(2)TLB lock down(2)C11UnpredictableUnpredictableC12UnpredictableUnpredictableC13Process IDProcess IDC14UnpredictableUnpredictableC15Test configurationTest configurationNotes:1.Register location 0 provides access to more than one register. The register accessed depends upon values of the opcode_2 field. See the register description for details.2.Separate register for instruction and data .See the register description for details.寄存器0:ID Code RegisterThis is a read-only register which returns a 32-bit device ID code这是一个只读寄存器,它存放微处理器的标识码。The ID code register is accessed by reading CP15 register 0 with the opcode_2 field set to any value other than 1(the CRm field should be zero when reading). For example:MRCp15, 0, Rd, C0, C0,0ID Code内容如下:Register bitsFunctionValue31:24Implementor0x41(A,表示Arm公司)23:20Specification revision0x119:16Architecture version(4T)0x2(ARM体系版本4T)15:4Part number0x9203:0Layout revision0x0寄存器0:Cache type registerThis is a read-only register which contains information about the size and architecture of the caches, allowing operating systems to establish how to perform such operations as cache cleaning and lockdown.这个只读寄存器包含了高速缓存的大小和类型。The cache type register is accessed by reading CP15 register 0 with the opcode_2 field set to 1.for example:MRCp15, 0, Rd, C0, C0,1; returns cache detailsThe format of cache type register (寄存器的数据格式如下)Register bitsFunctionValue31:29Reserved00028:25Cache type (缓存类型)011024Harvard/Unified1(defines Harvard cache)23:21Reserved00020:18Data Cache size(数据缓存大小)101(defines 16KB)17:15Data Cache associativity110(defines 64 way)14Reserved013:12Data Cache words per line10(defines 8 words per line)11:9Reserved000 8:6Instruction Cache size(指令缓存大小)101(defines 16KB)5:3Instruction Cache Associativity110(defines 64 way)2Reserved01:0Instruction Cache per line10(defines 8 words per line)寄存器1:Control register对该寄存器读写指令如下:MRCp15, 0, Rd, c1, c0, 0; read control registerMCRp15, 0, Rd, c1, c0, 0; write control register该寄存器功能如下表Registe bitsNameFunctionValue31iA bitAsynchronous clock select见时钟模式表30nF bitnotFastBus select 见时钟模式表29:15-ReservedRead = UnpredictableWrite = should be zero14RR bitRound robin replacement0 = Random replacement1 = Round robin replacement13V bitBase location of exception register(异常寄存器基地址)0 = Low address = 0x0000 00001 = High address = 0xFFFF 000012I bitInstruction cache enable0 = Instruction cache disable1 = Instruction cache enable11:10-ReservedRead = 00Write = 009RbitROM protection见图18SbitSystem protection见图17BbitBig-endian/little-endian0 = Little-endian operation1 = Big-endian operation6:3-ReservedRead = 1111Write = 11112C bitData cache enable0 = data cache disable1 = data cache enable1A bitAlignment fault enableData address alignment fault checking(地址对齐检查)0 =禁用地址对齐检查功能1 =使能地址对齐检查功能0M bitMMU enable0 = MMU disable1 = MMU enable时钟模式表Clocking mode(时钟模式)iAnFFastbus mode (快速总线模式)00Reserved10Synchronous (同步模式)01Asynchronous (异步模式)11 图1寄存器2:Translation Table Base(TTB) RegisterRegister bitsFunction31:14Pointer to first level translation table base . Read /write13:0ReservedRead = UnpredictableWrite = Should be zero访问C2寄存器指令如下:MRC p15, 0, Rd, C2, C0, 0 ; Read TTB registerMCR p15, 0, Rd, C2, C0, 0 ; Write TTB register该寄存器存放第一级转换表基地址。写入时,位13:0必须为0,读出时,位13:0的值不可预知。寄存器3:Domain Access Control Register寄存器3是可读写的域访问控制寄存器,分为16组,每组占用2个位访问该寄存器的指令如下:MRCp15, 0, Rd, C3, C0, 0;Read domain 15:0 access permissionsMCRp15, 0, Rd, C3, C0, 0;Read domain 15:0 access permissionsInterpreting Access Control Bits in Domain Access Control Register寄存器4:保留对该寄存器的读写会产生不可预料的结果。寄存器5:Fault Status Register寄存器6:Fault Address Register寄存器7:Cache Operations该寄存器是只写寄存器,用于管理指令缓存和数据缓存。对该寄存器的写操作所实现的功能,是通过MCR指令中的opcode_2和CRm两者的组合来选择的,具体组合如下。寄存器8:TLB OperationsRegister 8 is a write-only register used to manage the translation lookaside buffer(TLBs),the instruction TLB and the data TLB.Five TLB operations are defined and the function to be performed is selected by the opcode_2 and CRm fields in the MCR instruction used to write CP15 register 8.Writing other opcode_2 or CRm values id unpredictable. Reading from CP15 register 8 is u
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 时空穿越:地理信息系统(GIS)实践课教案
- 小熊开面馆450字(9篇)
- 个人在线教育平台运营合作
- 技术支持与服务外包合同协议书
- 早教老师专业知识培训课件
- 早教知识培训小结课件
- 农村生物技术合作研发保密协议
- 早教家长基础知识培训课件
- 早恋课件教学课件
- 2025年钳工(技师)职业技能鉴定试卷全真模拟试题
- 地质勘查钻探岩矿心管理通则
- D500-D505 2016年合订本防雷与接地图集
- 北邮社电机拖动与调速技术教学包课后题解
- 社区矫正法课件
- 学校门卫岗位职责及管理制度
- JJG 1105-2015氨气检测仪
- GB/T 8949-2008聚氨酯干法人造革
- GB/T 30544.1-2014纳米科技术语第1部分:核心术语
- 呆滞物料预防与处理(精益培训)
- 《中式面点制作第二版》教案高教版
- 看门狗定时器
评论
0/150
提交评论