Debug Controls (#639)
* debug: Bump OpenOCD version to one that drives resets and sets cmderr appropriately. * debug: Export the dmactive and ndreset signals to the top level and drive reset as intended in the TestHarness.
This commit is contained in:
parent
716533f77f
commit
d2c1bdc2ce
@ -218,7 +218,7 @@ stamps/%/emulator-torture-$(TORTURE_CONFIG).stamp: stamps/%/emulator-debug.stamp
|
|||||||
#OPENOCD_HEAD ?= riscv
|
#OPENOCD_HEAD ?= riscv
|
||||||
OPENOCD_INSTALL ?= $(abspath $(TOP))/openocd-install
|
OPENOCD_INSTALL ?= $(abspath $(TOP))/openocd-install
|
||||||
#OPENOCD_VERSION = $(shell git ls-remote http://github.com/sifive/openocd.git $(OPENOCD_HEAD) | awk '{print $$1}')
|
#OPENOCD_VERSION = $(shell git ls-remote http://github.com/sifive/openocd.git $(OPENOCD_HEAD) | awk '{print $$1}')
|
||||||
OPENOCD_VERSION = 7df6804934c13590fffb98012a3728225bd21c99
|
OPENOCD_VERSION = c7a204b93abbbc286486967588449e7773fe09ac
|
||||||
|
|
||||||
OPENOCD_DIR = $(OPENOCD_INSTALL)_$(OPENOCD_VERSION)/
|
OPENOCD_DIR = $(OPENOCD_INSTALL)_$(OPENOCD_VERSION)/
|
||||||
|
|
||||||
|
@ -37,6 +37,8 @@ trait CoreplexRISCVPlatformBundle extends CoreplexNetworkBundle {
|
|||||||
val debug = new ClockedDMIIO().flip
|
val debug = new ClockedDMIIO().flip
|
||||||
val rtcToggle = Bool(INPUT)
|
val rtcToggle = Bool(INPUT)
|
||||||
val resetVector = UInt(INPUT, p(XLen))
|
val resetVector = UInt(INPUT, p(XLen))
|
||||||
|
val ndreset = Bool(OUTPUT)
|
||||||
|
val dmactive = Bool(OUTPUT)
|
||||||
}
|
}
|
||||||
|
|
||||||
trait CoreplexRISCVPlatformModule extends CoreplexNetworkModule {
|
trait CoreplexRISCVPlatformModule extends CoreplexNetworkModule {
|
||||||
@ -47,10 +49,8 @@ trait CoreplexRISCVPlatformModule extends CoreplexNetworkModule {
|
|||||||
// TODO in inheriting traits: Set this to something meaningful, e.g. "component is in reset or powered down"
|
// TODO in inheriting traits: Set this to something meaningful, e.g. "component is in reset or powered down"
|
||||||
val nDebugComponents = outer.debug.intnode.bundleOut.size
|
val nDebugComponents = outer.debug.intnode.bundleOut.size
|
||||||
outer.debug.module.io.ctrl.debugUnavail := Vec.fill(nDebugComponents){Bool(false)}
|
outer.debug.module.io.ctrl.debugUnavail := Vec.fill(nDebugComponents){Bool(false)}
|
||||||
// TODO in inheriting traits: Use these values in your power and reset controls.
|
io.dmactive := outer.debug.module.io.ctrl.dmactive
|
||||||
// TODO Or move these signals to Coreplex Top Level
|
io.ndreset := outer.debug.module.io.ctrl.ndreset
|
||||||
// ... := outer.debug.module.io.ctrl.dmactive
|
|
||||||
// ... := outer.debug.module.io.ctrl.ndreset
|
|
||||||
|
|
||||||
// Synchronize the rtc into the coreplex
|
// Synchronize the rtc into the coreplex
|
||||||
val rtcSync = ShiftRegister(io.rtcToggle, 3)
|
val rtcSync = ShiftRegister(io.rtcToggle, 3)
|
||||||
|
@ -80,6 +80,8 @@ trait PeripheryDebugBundle extends HasTopLevelNetworksBundle {
|
|||||||
val jtag = (p(IncludeJtagDTM)).option(new JTAGIO(hasTRSTn = false).flip)
|
val jtag = (p(IncludeJtagDTM)).option(new JTAGIO(hasTRSTn = false).flip)
|
||||||
val jtag_reset = (p(IncludeJtagDTM)).option(Bool(INPUT))
|
val jtag_reset = (p(IncludeJtagDTM)).option(Bool(INPUT))
|
||||||
|
|
||||||
|
val ndreset = Bool(OUTPUT)
|
||||||
|
val dmactive = Bool(OUTPUT)
|
||||||
}
|
}
|
||||||
|
|
||||||
trait PeripheryDebugModule extends HasTopLevelNetworksModule {
|
trait PeripheryDebugModule extends HasTopLevelNetworksModule {
|
||||||
@ -100,6 +102,10 @@ trait PeripheryDebugModule extends HasTopLevelNetworksModule {
|
|||||||
outer.coreplex.module.io.debug.dmiClock := io.jtag.get.TCK
|
outer.coreplex.module.io.debug.dmiClock := io.jtag.get.TCK
|
||||||
outer.coreplex.module.io.debug.dmiReset := ResetCatchAndSync(io.jtag.get.TCK, io.jtag_reset.get, "dmiResetCatch")
|
outer.coreplex.module.io.debug.dmiReset := ResetCatchAndSync(io.jtag.get.TCK, io.jtag_reset.get, "dmiResetCatch")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
io.ndreset := outer.coreplex.module.io.ndreset
|
||||||
|
io.dmactive := outer.coreplex.module.io.dmactive
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Real-time clock is based on RTCPeriod relative to Top clock
|
/// Real-time clock is based on RTCPeriod relative to Top clock
|
||||||
|
@ -14,7 +14,10 @@ class TestHarness()(implicit p: Parameters) extends Module {
|
|||||||
val io = new Bundle {
|
val io = new Bundle {
|
||||||
val success = Bool(OUTPUT)
|
val success = Bool(OUTPUT)
|
||||||
}
|
}
|
||||||
|
|
||||||
val dut = Module(LazyModule(new ExampleRocketTop).module)
|
val dut = Module(LazyModule(new ExampleRocketTop).module)
|
||||||
|
dut.reset := reset | dut.io.ndreset
|
||||||
|
|
||||||
|
|
||||||
dut.io.interrupts := UInt(0)
|
dut.io.interrupts := UInt(0)
|
||||||
|
|
||||||
|
@ -215,7 +215,7 @@ class DebugInternalBundle ()(implicit val p: Parameters) extends ParameterizedBu
|
|||||||
class DebugCtrlBundle (nComponents: Int)(implicit val p: Parameters) extends ParameterizedBundle()(p) {
|
class DebugCtrlBundle (nComponents: Int)(implicit val p: Parameters) extends ParameterizedBundle()(p) {
|
||||||
val debugUnavail = Vec(nComponents, Bool()).asInput
|
val debugUnavail = Vec(nComponents, Bool()).asInput
|
||||||
val ndreset = Bool(OUTPUT)
|
val ndreset = Bool(OUTPUT)
|
||||||
val debugActive = Bool(OUTPUT)
|
val dmactive = Bool(OUTPUT)
|
||||||
}
|
}
|
||||||
|
|
||||||
//*****************************************
|
//*****************************************
|
||||||
@ -404,7 +404,7 @@ class TLDebugModuleOuter(device: Device)(implicit p: Parameters) extends LazyMod
|
|||||||
io.innerCtrl.bits.resumereq := DMCONTROLWrData.resumereq
|
io.innerCtrl.bits.resumereq := DMCONTROLWrData.resumereq
|
||||||
|
|
||||||
io.ctrl.ndreset := DMCONTROLReg.ndmreset
|
io.ctrl.ndreset := DMCONTROLReg.ndmreset
|
||||||
io.ctrl.debugActive := DMCONTROLReg.dmactive
|
io.ctrl.dmactive := DMCONTROLReg.dmactive
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1109,7 +1109,7 @@ class TLDebugModule(implicit p: Parameters) extends LazyModule {
|
|||||||
dmOuter.module.clock := io.dmi.dmiClock
|
dmOuter.module.clock := io.dmi.dmiClock
|
||||||
|
|
||||||
dmInner.module.io.innerCtrl := dmOuter.module.io.innerCtrl
|
dmInner.module.io.innerCtrl := dmOuter.module.io.innerCtrl
|
||||||
dmInner.module.io.dmactive := dmOuter.module.io.ctrl.debugActive
|
dmInner.module.io.dmactive := dmOuter.module.io.ctrl.dmactive
|
||||||
dmInner.module.io.debugUnavail := io.ctrl.debugUnavail
|
dmInner.module.io.debugUnavail := io.ctrl.debugUnavail
|
||||||
|
|
||||||
io.ctrl <> dmOuter.module.io.ctrl
|
io.ctrl <> dmOuter.module.io.ctrl
|
||||||
|
Loading…
Reference in New Issue
Block a user