Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1465,6 +1465,41 @@ init
halt
```

##### System Bus
The EmbeddedRiscvJtag plugin can also be configured to support system bus accesses per the RISC-V Debug Specification v1.0. This allows memory access without impacting CPU execution and can be handy when a debug host is regularly polling (e.g. RTT logging).

```scala
new EmbeddedRiscvJtag(
p = DebugTransportModuleParameter(
addressWidth = 7,
version = 1,
idle = 7
),
withTunneling = false,
withTap = true,
withSysBus = true
)
```

Then connect `sysBus` to your logic just like a data bus (`sysBus` is a `DBusSimpleBus`).

```scala
var debugSysBus: Axi4Shared = null

...

for (plugin <- cpuConfig.plugins) plugin match {
case plugin: EmbeddedRiscvJtag => {
debugSysBus = plugin.sysBus.toAxi4Shared()
}
case _ =>
}

...

// Connect debugSysBus to a crossbar, etc.
```

#### YamlPlugin

This plugin offers a service to other plugins to generate a useful Yaml file describing the CPU configuration. It contains, for instance, the sequence of instructions required
Expand Down
23 changes: 20 additions & 3 deletions src/main/scala/vexriscv/plugin/EmbeddedRiscvJtag.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class EmbeddedRiscvJtag(var p : DebugTransportModuleParameter,
var debugCd : ClockDomain = null,
var jtagCd : ClockDomain = null,
var withTap : Boolean = true,
var withTunneling : Boolean = false
var withTunneling : Boolean = false,
var withSysBus : Boolean = false
) extends Plugin[VexRiscv] with VexRiscvRegressionArg{


Expand All @@ -25,6 +26,7 @@ class EmbeddedRiscvJtag(var p : DebugTransportModuleParameter,
var jtag : Jtag = null
var jtagInstruction : JtagTapInstructionCtrl = null
var ndmreset : Bool = null
var sysBus : DBusSimpleBus = null


def setDebugCd(cd : ClockDomain) : this.type = {debugCd = cd; this}
Expand All @@ -48,9 +50,24 @@ class EmbeddedRiscvJtag(var p : DebugTransportModuleParameter,
xlen = XLEN,
flen = pipeline.config.FLEN,
withFpuRegAccess = pipeline.config.FLEN == 64
))
)
)),
withSysBus = withSysBus
),
)
if (withSysBus) {
sysBus = master(DBusSimpleBus())

sysBus.cmd.valid := dm.io.sysBus.cmd.valid
dm.io.sysBus.cmd.ready := sysBus.cmd.ready
sysBus.cmd.payload.wr := dm.io.sysBus.cmd.wr
sysBus.cmd.payload.address := dm.io.sysBus.cmd.address
sysBus.cmd.payload.data := dm.io.sysBus.cmd.data
sysBus.cmd.payload.size := dm.io.sysBus.cmd.size

dm.io.sysBus.rsp.ready := sysBus.rsp.ready
dm.io.sysBus.rsp.error := sysBus.rsp.error
dm.io.sysBus.rsp.data := sysBus.rsp.data
}

ndmreset := dm.io.ndmreset

Expand Down
Loading