RISC-V:控制与状态寄存器(CSR)

RISC-V:控制与状态寄存器(CSR)

芯片示意图

管脚信息

名称 方向 类型 作用
interrupts input CoreInterrupts 输入:相关的中断信息
hartid input UInt 输入:硬件线程id
rw exchange 结构体 输入:指令 输出:操作的寄存器结果
decode exchange Vec(new CSRDecodeIO) 输入:指令 输出:异常控制线
csr_stall output Bool 输出:csr暂停(stall)
eret output Bool 是否执行call、break、ret
singleStep output Bool 输出:单步控制
status output MStatus 输出:mstatus情况
ptbr output PTBR 输出:翻译和保护寄存器情况
evec output UInt 输出:陷入地址
exception input Bool 输入:外部异常
retire input UInt 输入:是否有效
cause input UInt 输入:中断原因
pc input UInt 输入:当前pc值
tval input UInt 输入:引起异常的值
time output UInt 输出:进程执行周期
fcsr_rm output Bits 输出:浮点读舍入模式
fcsr_flags exchange Valid(Bits) 交换:浮点读异常标志
set_fs_dirty input Bool 输入:指定浮点脏标志
rocc_interrupt input Bool 输入:协处理器中断
interrupt output Bool 输出:判断是否发生中断
interrupt_cause output UInt 输出:判断发生中断的原因
bp output Vec(new BP) 输出:断点情况
pmp output Vec(new PMP) 输出:内存保护情况
counters exchange Vec(new PerfCounterIO) 输入:hpmcounter的inc 输出:hpmevent情况
csrw_counter output UInt 输出:使用的counter下标
inst input Vec(UInt) 输入:trace命令
trace output Vec(new TracedInstruction) 输出:trace情况
customCSRs exchange Vec(new CustomCSRIO) 交换:传统csr

流程说明

1.reg_mip寄存器

(1)reg_mip结构

class MIP(implicit p: Parameters) extends CoreBundle()(p)
    with HasCoreParameters {
  val lip = Vec(coreParams.nLocalInterrupts, Bool())
  val zero2 = Bool()
  val debug = Bool() // keep in sync with CSR.debugIntCause
  val zero1 = Bool()
  val rocc = Bool()
  val meip = Bool()
  val heip = Bool()
  val seip 
  • 3
    点赞
  • 37
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值