Fix SMP compile-time error when disabling supervisor

When generating SMP configuration with supervisor disable, the
compiler stucks at waiting for the signal from
`externalSupervisorInterrupt`, which is generated conditionally
based on `withSupervisor` option.
This commit is contained in:
Gongqi Huang 2024-03-09 20:49:37 -05:00
parent e52251d88c
commit 26d6f61d49
2 changed files with 8 additions and 1 deletions

View File

@ -53,6 +53,11 @@ case class VexRiscvConfig(){
case None => false
}
def withSupervisor = find(classOf[CsrPlugin]) match {
case Some(x) => x.config.supervisorGen
case None => false
}
def FLEN = if(withRvd) 64 else if(withRvf) 32 else 0
//Default Stageables

View File

@ -206,7 +206,9 @@ class VexRiscvSmpClusterWithPeripherals(p : VexRiscvSmpClusterParameter) extends
plic.priorityWidth.load(2)
plic.mapping.load(PlicMapping.sifive)
plic.addTarget(core.cpu.externalInterrupt)
plic.addTarget(core.cpu.externalSupervisorInterrupt)
if(core.cpu.config.withSupervisor) {
plic.addTarget(core.cpu.externalSupervisorInterrupt)
}
List(clint.logic, core.cpu.logic).produce {
for (plugin <- core.cpu.config.plugins) plugin match {
case plugin: CsrPlugin if plugin.utime != null => plugin.utime := clint.logic.io.time