Plic映射器
PLIC映射器定义了PLIC(平台级中断控制器)的寄存器生成和访问。
PlicMapper.apply
(bus: BusSlaveFactory, mapping: PlicMapping)(gateways : Seq[PlicGateway], targets : Seq[PlicTarget])
PlicMapper的参数:
- bus:连接此控制器的总线 
- mapping:一个映射配置(见上文) 
- gateways:用于生成总线访问控制的PlicGateway(中断源)序列 
- targets:生成总线访问控制的PlicTarget序列(如:多核) 
它遵循riscv提供的接口:https://github.com/riscv/riscv-plic-spec/blob/master/riscv-plic.adoc
截至目前,有两种内存映射可用:
PlicMapping.sifive
遵循SiFive的PLIC映射(例如 E31核心复合手册 ),基本上是一个成熟的PLIC
PlicMapping.light
此映射生成更轻量级的PLIC,但代价是缺少一些可选特性:
- not reading the interrupt’s priority 
- not reading the interrupt’s pending bit (must use the claim/complete mechanism) 
- not reading the target’s threshold 
剩下的寄存器&逻辑会被生成.