From 65e6f6054bcab77d4b93621a5cd47fab5cc67f1f Mon Sep 17 00:00:00 2001 From: bunnie Date: Sun, 4 Oct 2020 15:34:58 +0800 Subject: [PATCH] Add ASID field to SATP ASID field is missing from the SATP which causes compatibility issues with Xous. While this patch resolves the Xous issue, it has not been tested on Linux. --- src/main/scala/vexriscv/plugin/MmuPlugin.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/scala/vexriscv/plugin/MmuPlugin.scala b/src/main/scala/vexriscv/plugin/MmuPlugin.scala index 9dedde5..49e402d 100644 --- a/src/main/scala/vexriscv/plugin/MmuPlugin.scala +++ b/src/main/scala/vexriscv/plugin/MmuPlugin.scala @@ -91,11 +91,12 @@ class MmuPlugin(ioRange : UInt => Bool, } val satp = new Area { val mode = RegInit(False) + val asid = Reg(Bits(9 bits)) val ppn = Reg(UInt(20 bits)) } for(offset <- List(CSR.MSTATUS, CSR.SSTATUS)) csrService.rw(offset, 19 -> status.mxr, 18 -> status.sum, 17 -> status.mprv) - csrService.rw(CSR.SATP, 31 -> satp.mode, 0 -> satp.ppn) + csrService.rw(CSR.SATP, 31 -> satp.mode, 22 -> satp.asid, 0 -> satp.ppn) } val core = pipeline plug new Area {