Move clock tap to its own async domain
This commit is contained in:
@@ -10,18 +10,13 @@ import freechips.rocketchip.util._
|
|||||||
import freechips.rocketchip.tile._
|
import freechips.rocketchip.tile._
|
||||||
import freechips.rocketchip.prci._
|
import freechips.rocketchip.prci._
|
||||||
|
|
||||||
case class ClockTapParams(
|
case object ClockTapKey extends Field[Boolean](true)
|
||||||
busWhere: TLBusWrapperLocation = SBUS, // by default, tap the sbus clock as a debug clock
|
|
||||||
divider: Int = 16, // a fixed clock division ratio for the clock tap
|
|
||||||
)
|
|
||||||
|
|
||||||
case object ClockTapKey extends Field[Option[ClockTapParams]](Some(ClockTapParams()))
|
|
||||||
|
|
||||||
trait CanHaveClockTap { this: BaseSubsystem =>
|
trait CanHaveClockTap { this: BaseSubsystem =>
|
||||||
val clockTapNode = p(ClockTapKey).map { tapParams =>
|
require(p(SubsystemDriveAsyncClockGroupsKey).isEmpty, "Subsystem asyncClockGroups must be undriven")
|
||||||
|
val clockTapNode = Option.when(p(ClockTapKey)) {
|
||||||
val clockTap = ClockSinkNode(Seq(ClockSinkParameters(name=Some("clock_tap"))))
|
val clockTap = ClockSinkNode(Seq(ClockSinkParameters(name=Some("clock_tap"))))
|
||||||
val clockTapDivider = LazyModule(new ClockDivider(tapParams.divider))
|
clockTap := ClockGroup() := asyncClockGroupsNode
|
||||||
clockTap := clockTapDivider.node := locateTLBusWrapper(tapParams.busWhere).fixedClockNode
|
|
||||||
clockTap
|
clockTap
|
||||||
}
|
}
|
||||||
val clockTapIO = clockTapNode.map { node => InModuleBody {
|
val clockTapIO = clockTapNode.map { node => InModuleBody {
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ class AbstractConfig extends Config(
|
|||||||
new chipyard.clocking.WithClockTapIOCells ++ // Default generate a clock tapio
|
new chipyard.clocking.WithClockTapIOCells ++ // Default generate a clock tapio
|
||||||
new chipyard.clocking.WithPassthroughClockGenerator ++ // Default punch out IOs to the Harness
|
new chipyard.clocking.WithPassthroughClockGenerator ++ // Default punch out IOs to the Harness
|
||||||
new chipyard.clocking.WithClockGroupsCombinedByName(("uncore", // Default merge all the bus clocks
|
new chipyard.clocking.WithClockGroupsCombinedByName(("uncore", // Default merge all the bus clocks
|
||||||
Seq("sbus", "mbus", "pbus", "fbus", "cbus", "obus", "implicit"), Seq("tile"))) ++
|
Seq("sbus", "mbus", "pbus", "fbus", "cbus", "obus", "implicit", "clock_tap"), Seq("tile"))) ++
|
||||||
new chipyard.config.WithPeripheryBusFrequency(500.0) ++ // Default 500 MHz pbus
|
new chipyard.config.WithPeripheryBusFrequency(500.0) ++ // Default 500 MHz pbus
|
||||||
new chipyard.config.WithMemoryBusFrequency(500.0) ++ // Default 500 MHz mbus
|
new chipyard.config.WithMemoryBusFrequency(500.0) ++ // Default 500 MHz mbus
|
||||||
new chipyard.config.WithControlBusFrequency(500.0) ++ // Default 500 MHz cbus
|
new chipyard.config.WithControlBusFrequency(500.0) ++ // Default 500 MHz cbus
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ class MulticlockRocketConfig extends Config(
|
|||||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||||
// Frequency specifications
|
// Frequency specifications
|
||||||
new chipyard.config.WithTileFrequency(1000.0) ++ // Matches the maximum frequency of U540
|
new chipyard.config.WithTileFrequency(1000.0) ++ // Matches the maximum frequency of U540
|
||||||
new chipyard.clocking.WithClockGroupsCombinedByName(("uncore" , Seq("sbus", "cbus", "implicit"), Nil),
|
new chipyard.clocking.WithClockGroupsCombinedByName(("uncore" , Seq("sbus", "cbus", "implicit", "clock_tap"), Nil),
|
||||||
("periphery", Seq("pbus", "fbus"), Nil)) ++
|
("periphery", Seq("pbus", "fbus"), Nil)) ++
|
||||||
new chipyard.config.WithSystemBusFrequency(500.0) ++ // Matches the maximum frequency of U540
|
new chipyard.config.WithSystemBusFrequency(500.0) ++ // Matches the maximum frequency of U540
|
||||||
new chipyard.config.WithMemoryBusFrequency(500.0) ++ // Matches the maximum frequency of U540
|
new chipyard.config.WithMemoryBusFrequency(500.0) ++ // Matches the maximum frequency of U540
|
||||||
|
|||||||
@@ -130,5 +130,5 @@ class WithNoResetSynchronizers extends Config((site, here, up) => {
|
|||||||
|
|
||||||
// Remove any ClockTap ports in this system
|
// Remove any ClockTap ports in this system
|
||||||
class WithNoClockTap extends Config((site, here, up) => {
|
class WithNoClockTap extends Config((site, here, up) => {
|
||||||
case ClockTapKey => None
|
case ClockTapKey => false
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user