Skip to content

Commit

Permalink
Use unmodified, possibly async reset for notification ports
Browse files Browse the repository at this point in the history
  • Loading branch information
ernie-sifive committed Aug 18, 2020
1 parent 7438f0b commit 1632925
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
4 changes: 4 additions & 0 deletions src/main/scala/subsystem/HasTiles.scala
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,10 @@ trait CanAttachTile {
domain {
domain.clockSinkNode := crossingParams.injectClockNode(context) := domain.clockNode
} := clockSource

domain {
domain.tile.externalClockSinkNode
} := clockSource
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/main/scala/tile/BaseTile.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import freechips.rocketchip.diplomaticobjectmodel.{HasLogicalTreeNode}
import freechips.rocketchip.diplomaticobjectmodel.logicaltree.{GenericLogicalTreeNode, LogicalTreeNode}

import freechips.rocketchip.interrupts._
import freechips.rocketchip.prci.{ClockSinkNode, ClockSinkParameters}
import freechips.rocketchip.rocket._
import freechips.rocketchip.tilelink._
import freechips.rocketchip.util._
Expand Down Expand Up @@ -282,6 +283,10 @@ abstract class BaseTile private (val crossing: ClockCrossingType, q: Parameters)
val bpwatchNode: BundleBridgeOutwardNode[Vec[BPWatch]] =
BundleBridgeNameNode("bpwatch") :*= bpwatchNexusNode := bpwatchSourceNode

/** Node to receive raw core_clock and core_reset */
val externalClockSinkNode = ClockSinkNode(Seq(ClockSinkParameters()))
def rawReset = externalClockSinkNode.in.head._1.reset

/** Helper function for connecting MMIO devices inside the tile to an xbar that will make them visible to external masters. */
def connectTLSlave(xbarNode: TLOutwardNode, node: TLNode, bytes: Int) {
DisableMonitors { implicit p =>
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/tile/Interrupts.scala
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ trait SourcesExternalNotifications { this: BaseTile =>

def reportHalt(could_halt: Option[Bool]) {
val (halt_and_catch_fire, _) = haltNode.out(0)
halt_and_catch_fire(0) := could_halt.map(RegEnable(true.B, false.B, _)).getOrElse(false.B)
halt_and_catch_fire(0) := could_halt.map(h => RegEnable(true.B, false.B, BlockDuringReset(h))).getOrElse(false.B)
}

def reportHalt(errors: Seq[CanHaveErrors]) {
Expand Down Expand Up @@ -116,6 +116,6 @@ trait SourcesExternalNotifications { this: BaseTile =>

def reportWFI(could_wfi: Option[Bool]) {
val (wfi, _) = wfiNode.out(0)
wfi(0) := could_wfi.map(RegNext(_, init=false.B)).getOrElse(false.B)
wfi(0) := could_wfi.map(w => RegNext(BlockDuringReset(w), init=false.B)).getOrElse(false.B)
}
}
21 changes: 12 additions & 9 deletions src/main/scala/tile/RocketTile.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package freechips.rocketchip.tile

import Chisel._
import chisel3.withReset
import freechips.rocketchip.config._
import freechips.rocketchip.devices.tilelink._
import freechips.rocketchip.diplomacy._
Expand Down Expand Up @@ -136,17 +137,19 @@ class RocketTileModuleImp(outer: RocketTile) extends BaseTileModuleImp(outer)

val core = Module(new Rocket(outer)(outer.p))

// Report unrecoverable error conditions; for now the only cause is cache ECC errors
outer.reportHalt(List(outer.dcache.module.io.errors))
withReset(outer.rawReset) { // use unmodified reset for notification ports
// Report unrecoverable error conditions; for now the only cause is cache ECC errors
outer.reportHalt(List(outer.dcache.module.io.errors))

// Report when the tile has ceased to retire instructions; for now the only cause is clock gating
outer.reportCease(outer.rocketParams.core.clockGate.option(
!outer.dcache.module.io.cpu.clock_enabled &&
!outer.frontend.module.io.cpu.clock_enabled &&
!ptw.io.dpath.clock_enabled &&
core.io.cease))
// Report when the tile has ceased to retire instructions; for now the only cause is clock gating
outer.reportCease(outer.rocketParams.core.clockGate.option(
!outer.dcache.module.io.cpu.clock_enabled &&
!outer.frontend.module.io.cpu.clock_enabled &&
!ptw.io.dpath.clock_enabled &&
core.io.cease))

outer.reportWFI(Some(core.io.wfi))
outer.reportWFI(Some(core.io.wfi))
}

outer.decodeCoreInterrupts(core.io.interrupts) // Decode the interrupt vector

Expand Down

0 comments on commit 1632925

Please sign in to comment.