rocket-chip复位向量的修改
rocket-chip系统复位后是从bootrom中进行启动的,这章我们将详细分析rocket-chip是如何调用bootrom模块的,最后还会对复位向量进行修改,即让rocket-chip不再从bootrom开始启动,而是从我们想要的地址进行启动。
bootrom模块的调用:
首先关注的scala文件是 /src/main/scala/system/ExampleRocketSystem.scala
package freechips.rocketchip.system
import Chisel._
import freechips.rocketchip.config.Parameters
import freechips.rocketchip.diplomacy._
import freechips.rocketchip.tilelink._
import freechips.rocketchip.subsystem._
import freechips.rocketchip.devices.tilelink._
import freechips.rocketchip.util.DontTouch
/** Example Top with periphery devices and ports, and a Rocket subsystem */
class ExampleRocketSystem(implicit p: Parameters) extends RocketSubsystem
with HasAsyncExtInterrupts
with CanHaveMasterAXI4MemPort
with CanHaveMasterAXI4MMIOPort
with CanHaveSlaveAXI4Port
with HasPeripheryBootROM {
override lazy val module = new ExampleRocketSystemModuleImp(this)
// Error device used for testing and to NACK invalid front port transactions
val error = LazyModule(new TLError(p(ErrorDeviceKey), sbus.beatBytes))
// always buffer the error device because no one cares about its latency
sbus.coupleTo("slave_named_error"){ error.node := TLBuffer() := _ }
}
class ExampleRocketSystemModuleImp[+L <: ExampleRocketSystem](_outer: L) extends RocketSubs

本文深入探讨了Rocket-Chip系统启动流程,详细分析了bootrom模块调用过程及复位向量的默认设置。通过修改Rocket-Chip源码,实现了自定义复位向量,使系统启动地址可控。
最低0.47元/天 解锁文章
114





