debug: report UNSUPPORTED more consistently. Allow haltreq/resumereq to be R as well as W.
This commit is contained in:
parent
e1fe0f245b
commit
3fc75c2714
@ -329,6 +329,8 @@ class TLDebugModuleOuter(device: Device)(implicit p: Parameters) extends LazyMod
|
|||||||
when (DMCONTROLWrEn) {
|
when (DMCONTROLWrEn) {
|
||||||
DMCONTROLNxt.ndmreset := DMCONTROLWrData.ndmreset
|
DMCONTROLNxt.ndmreset := DMCONTROLWrData.ndmreset
|
||||||
DMCONTROLNxt.hartsel := DMCONTROLWrData.hartsel
|
DMCONTROLNxt.hartsel := DMCONTROLWrData.hartsel
|
||||||
|
DMCONTROLNxt.haltreq := DMCONTROLWrData.haltreq
|
||||||
|
DMCONTROLNxt.resumereq := DMCONTROLWrData.resumereq
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -937,6 +939,8 @@ class TLDebugModuleInner(device: Device, getNComponents: () => Int)(implicit p:
|
|||||||
val commandWrIsAccessRegister = (COMMANDWrData.cmdtype === DebugAbstractCommandType.AccessRegister.id.U)
|
val commandWrIsAccessRegister = (COMMANDWrData.cmdtype === DebugAbstractCommandType.AccessRegister.id.U)
|
||||||
val commandRegIsAccessRegister = (COMMANDReg.cmdtype === DebugAbstractCommandType.AccessRegister.id.U)
|
val commandRegIsAccessRegister = (COMMANDReg.cmdtype === DebugAbstractCommandType.AccessRegister.id.U)
|
||||||
|
|
||||||
|
val commandWrIsUnsupported = COMMANDWrEn && !commandWrIsAccessRegister;
|
||||||
|
|
||||||
val commandRegIsUnsupported = Wire(init = true.B)
|
val commandRegIsUnsupported = Wire(init = true.B)
|
||||||
val commandRegBadHaltResume = Wire(init = false.B)
|
val commandRegBadHaltResume = Wire(init = false.B)
|
||||||
when (commandRegIsAccessRegister) {
|
when (commandRegIsAccessRegister) {
|
||||||
@ -954,16 +958,20 @@ class TLDebugModuleInner(device: Device, getNComponents: () => Int)(implicit p:
|
|||||||
// -----------------------
|
// -----------------------
|
||||||
|
|
||||||
when (ctrlStateReg === CtrlState(Waiting)){
|
when (ctrlStateReg === CtrlState(Waiting)){
|
||||||
|
|
||||||
when (wrAccessRegisterCommand || regAccessRegisterCommand) {
|
when (wrAccessRegisterCommand || regAccessRegisterCommand) {
|
||||||
ctrlStateNxt := CtrlState(CheckGenerate)
|
ctrlStateNxt := CtrlState(CheckGenerate)
|
||||||
|
}.elsewhen (commandWrIsUnsupported) { // These checks are really on the command type.
|
||||||
|
errorUnsupported := true.B
|
||||||
|
}.elsewhen (autoexec && commandRegIsUnsupported) {
|
||||||
|
errorUnsupported := true.B
|
||||||
}
|
}
|
||||||
}.elsewhen (ctrlStateReg === CtrlState(CheckGenerate)){
|
}.elsewhen (ctrlStateReg === CtrlState(CheckGenerate)){
|
||||||
|
|
||||||
// We use this state to ensure that the COMMAND has been
|
// We use this state to ensure that the COMMAND has been
|
||||||
// registered by the time that we need to use it, to avoid
|
// registered by the time that we need to use it, to avoid
|
||||||
// generating it directly from the COMMANDWrData.
|
// generating it directly from the COMMANDWrData.
|
||||||
|
// This 'commandRegIsUnsupported' is really just checking the
|
||||||
|
// AccessRegisterCommand parameters (regno)
|
||||||
when (commandRegIsUnsupported) {
|
when (commandRegIsUnsupported) {
|
||||||
errorUnsupported := true.B
|
errorUnsupported := true.B
|
||||||
ctrlStateNxt := CtrlState(Waiting)
|
ctrlStateNxt := CtrlState(Waiting)
|
||||||
|
Loading…
Reference in New Issue
Block a user