Skip to content

Commit

Permalink
prci: move ClockGroupDriverParameters to prci
Browse files Browse the repository at this point in the history
  • Loading branch information
hcook committed Jan 22, 2020
1 parent 926abd9 commit 1449344
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
8 changes: 8 additions & 0 deletions src/main/scala/prci/ClockParameters.scala
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,11 @@ case class ClockGroupEdgeParameters(

val bundle = ClockGroupBundleParameters(members.map(_.bundle))
}

// Used to create simple clock group drivers that just use the Chisel implicit clock
case class ClockGroupDriverParameters(num: Int = 1) {
def driveFromImplicitClock(groups: ClockGroupEphemeralNode)(implicit p: Parameters): Unit = {
val dummyClockGroupSourceNode: ClockGroupSourceNode = SimpleClockGroupSource(num)
groups :*= dummyClockGroupSourceNode
}
}
13 changes: 3 additions & 10 deletions src/main/scala/subsystem/BaseSubsystem.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ case object BankedL2Key extends Field(BankedL2Params())

case object BuildSystemBus extends Field[Parameters => SystemBus](p => new SystemBus(p(SystemBusKey))(p))

case object SubsystemDriveAsyncClockGroupsKey extends Field[Option[ClockGroupDriverParameters]](Some(ClockGroupDriverParameters(1)))
case object AsyncClockGroupsKey extends Field[ClockGroupEphemeralNode](ClockGroupEphemeralNode()(ValName("async_clock_groups")))

/** BareSubsystem is the root class for creating a subsystem */
abstract class BareSubsystem(implicit p: Parameters) extends LazyModule with BindingScope {
lazy val dts = DTS(bindingTree)
Expand Down Expand Up @@ -50,16 +53,6 @@ trait Attachable extends LazyScope
val ibus: InterruptBusWrapper
}

case class ClockGroupDriverParams(num: Int = 1) {
def driveFromImplicitClock(groups: ClockGroupEphemeralNode)(implicit p: Parameters): Unit = {
val dummyClockGroupSourceNode: ClockGroupSourceNode = SimpleClockGroupSource(num)
groups :*= dummyClockGroupSourceNode
}
}

case object SubsystemDriveAsyncClockGroupsKey extends Field[Option[ClockGroupDriverParams]](Some(ClockGroupDriverParams(1)))
case object AsyncClockGroupsKey extends Field[ClockGroupEphemeralNode](ClockGroupEphemeralNode()(ValName("async_clock_groups")))

trait HasBusAttachmentFunction {
type BusAttachmentFunction = PartialFunction[BaseSubsystemBusAttachment, TLBusWrapper]
def attach: BusAttachmentFunction
Expand Down

0 comments on commit 1449344

Please sign in to comment.