Skip to content

Commit

Permalink
Merge pull request #397 from cherrypiejam/fix-smp-supervisor
Browse files Browse the repository at this point in the history
Fix SMP compile-time error when disabling supervisor option
  • Loading branch information
Dolu1990 committed Mar 10, 2024
2 parents e52251d + 26d6f61 commit 6aeb6d4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/main/scala/vexriscv/VexRiscv.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/main/scala/vexriscv/demo/smp/VexRiscvSmpCluster.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6aeb6d4

Please sign in to comment.