Skip to content

Commit

Permalink
HasTilesModuleImp should not extend HasPeripheryDebugModuleImp
Browse files Browse the repository at this point in the history
  • Loading branch information
sequencer committed Feb 27, 2023
1 parent c8bcd33 commit f2fc1e6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/main/scala/subsystem/HasTiles.scala
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ case class TileSlavePortParams(
trait HasTileInterruptSources
extends CanHavePeripheryPLIC
with CanHavePeripheryCLINT
with HasPeripheryDebug
with InstantiatesTiles
{ this: BaseSubsystem => // TODO ideally this bound would be softened to LazyModule
/** meipNode is used to create a single bit subsystem input in Configs without a PLIC */
Expand Down Expand Up @@ -134,7 +133,7 @@ trait HasTileInterruptSources
}

/** These are sources of "constants" that are driven into the tile.
*
*
* While they are not expected to change dyanmically while the tile is executing code,
* they may be either tied to a contant value or programmed during boot or reset.
* They need to be instantiated before tiles are attached within the subsystem containing them.
Expand Down Expand Up @@ -291,10 +290,14 @@ trait CanAttachTile {
// we stub out missing interrupts with constant sources here.

// 1. Debug interrupt is definitely asynchronous in all cases.
domain.tile.intInwardNode :=
context.debugOpt
.map { domain { IntSyncAsyncCrossingSink(3) } := _.intnode }
.getOrElse { NullIntSource() }
context match {
case c: HasPeripheryDebug =>
domain.tile.intInwardNode :=
c.debugOpt
.map { domain { IntSyncAsyncCrossingSink(3) } := _.intnode }
.getOrElse { NullIntSource() }
case _ =>
}

// 2. The CLINT and PLIC output interrupts are synchronous to the TileLink bus clock,
// so might need to be synchronized depending on the Tile's crossing type.
Expand Down Expand Up @@ -395,7 +398,7 @@ case class CloneTileAttachParams(
},
instantiatedTiles(sourceHart).asInstanceOf[TilePRCIDomain[TileType]]
)
tile_prci_domain
tile_prci_domain
}
}

Expand Down Expand Up @@ -440,7 +443,7 @@ trait HasTiles extends InstantiatesTiles with HasCoreMonitorBundles with Default
}

/** Provides some Chisel connectivity to certain tile IOs */
trait HasTilesModuleImp extends LazyModuleImp with HasPeripheryDebugModuleImp {
trait HasTilesModuleImp extends LazyModuleImp {
val outer: HasTiles with HasTileInterruptSources with HasTileInputConstants

val reset_vector = outer.tileResetVectorIONodes.zipWithIndex.map { case (n, i) => n.makeIO(s"reset_vector_$i") }
Expand Down
3 changes: 3 additions & 0 deletions src/main/scala/system/ExampleRocketSystem.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

package freechips.rocketchip.system

import freechips.rocketchip.devices.debug.{HasPeripheryDebug, HasPeripheryDebugModuleImp}
import org.chipsalliance.cde.config.Parameters
import freechips.rocketchip.subsystem._
import freechips.rocketchip.devices.tilelink._
Expand All @@ -13,6 +14,7 @@ class ExampleRocketSystem(implicit p: Parameters) extends RocketSubsystem
with CanHaveMasterAXI4MemPort
with CanHaveMasterAXI4MMIOPort
with CanHaveSlaveAXI4Port
with HasPeripheryDebug
{
// optionally add ROM devices
// Note that setting BootROMLocated will override the reset_vector for all tiles
Expand All @@ -26,3 +28,4 @@ class ExampleRocketSystemModuleImp[+L <: ExampleRocketSystem](_outer: L) extends
with HasRTCModuleImp
with HasExtInterruptsModuleImp
with DontTouch
with HasPeripheryDebugModuleImp

0 comments on commit f2fc1e6

Please sign in to comment.