From d6aa58249eafd79288333e9eeed1794cf9ab400a Mon Sep 17 00:00:00 2001 From: Yangyu Chen Date: Thu, 17 Aug 2023 00:56:35 +0800 Subject: [PATCH] add WithNoSimulationTimeout --- src/main/scala/rocket/RocketCore.scala | 5 +++-- src/main/scala/subsystem/Configs.scala | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/scala/rocket/RocketCore.scala b/src/main/scala/rocket/RocketCore.scala index b1ef91c9758..d32e0d5b22a 100644 --- a/src/main/scala/rocket/RocketCore.scala +++ b/src/main/scala/rocket/RocketCore.scala @@ -55,7 +55,8 @@ case class RocketCoreParams( mulDiv: Option[MulDivParams] = Some(MulDivParams()), fpu: Option[FPUParams] = Some(FPUParams()), debugROB: Boolean = false, // if enabled, uses a C++ debug ROB to generate trace-with-wdata - haveCease: Boolean = true // non-standard CEASE instruction + haveCease: Boolean = true, // non-standard CEASE instruction + haveSimTimeout: Boolean = true // add plusarg for simulation timeout ) extends CoreParams { val lgPauseCycles = 5 val haveFSDirty = false @@ -1116,7 +1117,7 @@ class Rocket(tile: RocketTile)(implicit p: Parameters) extends CoreModule()(p) xrfWriteBundle.excpt := false.B xrfWriteBundle.priv_mode := csr.io.trace(0).priv - PlusArg.timeout( + if (rocketParams.haveSimTimeout) PlusArg.timeout( name = "max_core_cycles", docstring = "Kill the emulation after INT rdtime cycles. Off if 0." )(csr.io.time) diff --git a/src/main/scala/subsystem/Configs.scala b/src/main/scala/subsystem/Configs.scala index aaf2597e4b1..2f8a2abab29 100644 --- a/src/main/scala/subsystem/Configs.scala +++ b/src/main/scala/subsystem/Configs.scala @@ -456,6 +456,14 @@ class WithRocketCease(enable: Boolean = true) extends Config((site, here, up) => } }) +class WithNoSimulationTimeout extends Config((site, here, up) => { + case TilesLocated(InSubsystem) => up(TilesLocated(InSubsystem), site) map { + case tp: RocketTileAttachParams => tp.copy(tileParams = tp.tileParams.copy( + core = tp.tileParams.core.copy(haveSimTimeout = false))) + case t => t + } +}) + class WithBootROMFile(bootROMFile: String) extends Config((site, here, up) => { case BootROMLocated(x) => up(BootROMLocated(x), site).map(_.copy(contentFileName = bootROMFile)) })