or1200处理器中的特殊寄存器

本文详细介绍了OR1200软核处理器中的特殊寄存器,包括11组中的VR、UPR、NPC、SR等重要寄存器的功能、访问权限及其在用户模式和特权模式下的差异。同时,提到了OR1200在特殊寄存器实现上的差异,如未实现的性能计数单元和所有特殊寄存器在用户模式下均可读取的情况。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

以下内容摘自《步步惊芯——软核处理器内部设计分析》一书


      OR1200中的寄存器分为两类:通用寄存器r0-r31、特殊寄存器。特殊寄存器又分为11组,在本书第1.3.3节简单地列出了所有的特殊寄存器组。从列表中可以发现除第0组外的其余特殊寄存器组都是与具体的硬件模块相关联的,比如:第2组特殊寄存器与指令MMU有关、第4组特殊寄存器与指令缓存ICache有关、第9组特殊寄存器与中断控制单元PIC有关。

      OR1200有两种工作模式:用户模式、特权模式,在这两种模式下对特殊寄存器的访问权限不同,第0组特殊寄存器中的SR寄存器的SM位(即SR[SM])决定了OR1200当前处于何种模式,其值为1表示OR1200处于特权模式,其值为0表示OR1200处于用户模式。表5.1列出了每一组特殊寄存器中具体的寄存器,以及在两种模式下的访问权限。




      有如下几点说明:

      (1)其中的读写权限是OR1200手册中描述的,也是OpenRISC 1000架构所设计的,但在OR1200的实现中没有按照设计实现,比如在表5.1中有的特殊寄存器在用户模式下是不能读取的,在OR1200中并没有考虑到这一点,所有的特殊寄存器都可以在用户模式下读取。我们在分析SPRS模块的时候会发现这一点。

开源处理器源代码,学习优秀的代码编写 ////////////////////////////////////////////////////////////////////// //// //// //// OR1200's ALU //// //// //// //// This file is part of the OpenRISC 1200 project //// //// http://www.opencores.org/cores/or1k/ //// //// //// //// Description //// //// ALU //// //// //// //// To Do: //// //// - make it smaller and faster //// //// //// //// Author(s): //// //// - Damjan Lampret, lampret@opencores.org //// //// //// ////////////////////////////////////////////////////////////////////// //// //// //// Copyright (C) 2000 Authors and OPENCORES.ORG //// //// //// //// This source file may be used and distributed without //// //// restriction provided that this copyright statement is not //// //// removed from the file and that any derivative work contains //// //// the original copyright notice and the associated disclaimer. //// //// //// //// This source file is free software; you can redistribute it //// //// and/or modify it under the terms of the GNU Lesser General //// //// Public License as published by the Free Software Foundation; //// //// either version 2.1 of the License, or (at your option) any //// //// later version. //// //// //// //// This source is distributed in the hope that it will be //// //// useful, but WITHOUT ANY WARRANTY; without even the implied //// //// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR //// //// PURPOSE. See the GNU Lesser General Public License for more //// //// details. //// //// //// //// You should have received a copy of the GNU Lesser General //// //// Public License along with this source; if not, download it //// //// from http://www.opencores.org/lgpl.shtml //// //// //// //////////////////////////////////////////////////////////////////////
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值