From f01da9c73b42897c3bd49b92401063b84edb84ef Mon Sep 17 00:00:00 2001 From: Charles Papon Date: Mon, 13 Jan 2020 20:44:55 +0100 Subject: [PATCH] CsrPlugin add printCsr --- src/main/scala/vexriscv/plugin/CsrPlugin.scala | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/scala/vexriscv/plugin/CsrPlugin.scala b/src/main/scala/vexriscv/plugin/CsrPlugin.scala index 686293e..8759df5 100644 --- a/src/main/scala/vexriscv/plugin/CsrPlugin.scala +++ b/src/main/scala/vexriscv/plugin/CsrPlugin.scala @@ -368,6 +368,16 @@ class CsrPlugin(val config: CsrPluginConfig) extends Plugin[VexRiscv] with Excep val csrMapping = new CsrMapping() + //Print CSR mapping + def printCsr() { + for ((address, things) <- csrMapping.mapping) { + println("0x" + address.toHexString + " => ") + for (thing <- things) { + println(" - " + thing) + } + } + } + //Interruption and exception data model case class Delegator(var enable : Bool, privilege : Int) case class InterruptSpec(var cond : Bool, id : Int, privilege : Int, delegators : List[Delegator])