Skip to content

Commit

Permalink
Merge pull request #3639 from chipsalliance/named_domains
Browse files Browse the repository at this point in the history
Name the ClockDomains
  • Loading branch information
jerryz123 authored May 30, 2024
2 parents d9a3d99 + 3cec0f0 commit f43041d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/scala/devices/tilelink/BootROM.scala
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ object BootROM {
def attach(params: BootROMParams, subsystem: BaseSubsystem with HasHierarchicalElements with HasTileInputConstants, where: TLBusWrapperLocation)
(implicit p: Parameters): TLROM = {
val tlbus = subsystem.locateTLBusWrapper(where)
val bootROMDomainWrapper = tlbus.generateSynchronousDomain.suggestName("bootrom_domain")
val bootROMDomainWrapper = tlbus.generateSynchronousDomain("BootROM").suggestName("bootrom_domain")

val bootROMResetVectorSourceNode = BundleBridgeSource[UInt]()
lazy val contents = {
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/devices/tilelink/CLINT.scala
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class CLINT(params: CLINTParams, beatBytes: Int)(implicit p: Parameters) extends
trait CanHavePeripheryCLINT { this: BaseSubsystem =>
val (clintOpt, clintDomainOpt, clintTickOpt) = p(CLINTKey).map { params =>
val tlbus = locateTLBusWrapper(p(CLINTAttachKey).slaveWhere)
val clintDomainWrapper = tlbus.generateSynchronousDomain.suggestName("clint_domain")
val clintDomainWrapper = tlbus.generateSynchronousDomain("CLINT").suggestName("clint_domain")
val clint = clintDomainWrapper { LazyModule(new CLINT(params, tlbus.beatBytes)) }
clintDomainWrapper { clint.node := tlbus.coupleTo("clint") { TLFragmenter(tlbus) := _ } }
val clintTick = clintDomainWrapper { InModuleBody {
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/devices/tilelink/Plic.scala
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ class PLICFanIn(nDevices: Int, prioBits: Int) extends Module {
trait CanHavePeripheryPLIC { this: BaseSubsystem =>
val (plicOpt, plicDomainOpt) = p(PLICKey).map { params =>
val tlbus = locateTLBusWrapper(p(PLICAttachKey).slaveWhere)
val plicDomainWrapper = tlbus.generateSynchronousDomain.suggestName("plic_domain")
val plicDomainWrapper = tlbus.generateSynchronousDomain("PLIC").suggestName("plic_domain")

val plic = plicDomainWrapper { LazyModule(new TLPLIC(params, tlbus.beatBytes)) }
plicDomainWrapper { plic.node := tlbus.coupleTo("plic") { TLFragmenter(tlbus) := _ } }
Expand Down
2 changes: 2 additions & 0 deletions src/main/scala/prci/ClockDomain.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@ class ClockSinkDomain(val clockSinkParams: ClockSinkParameters)(implicit p: Para
def this(take: Option[ClockParameters] = None, name: Option[String] = None)(implicit p: Parameters) = this(ClockSinkParameters(take = take, name = name))
val clockNode = ClockSinkNode(Seq(clockSinkParams))
def clockBundle = clockNode.in.head._1
override lazy val desiredName = (clockSinkParams.name.toSeq :+ "ClockSinkDomain").mkString
}

class ClockSourceDomain(val clockSourceParams: ClockSourceParameters)(implicit p: Parameters) extends ClockDomain
{
def this(give: Option[ClockParameters] = None, name: Option[String] = None)(implicit p: Parameters) = this(ClockSourceParameters(give = give, name = name))
val clockNode = ClockSourceNode(Seq(clockSourceParams))
def clockBundle = clockNode.out.head._1
override lazy val desiredName = (clockSourceParams.name.toSeq :+ "ClockSourceDomain").mkString
}

abstract class ResetDomain(implicit p: Parameters) extends Domain with HasResetDomainCrossing
5 changes: 3 additions & 2 deletions src/main/scala/tilelink/BusWrapper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,12 @@ abstract class TLBusWrapper(params: HasTLBusParams, val busName: String)(implici
def unifyManagers: List[TLManagerParameters] = ManagerUnification(busView.manager.managers)
def crossOutHelper = this.crossOut(outwardNode)(ValName("bus_xing"))
def crossInHelper = this.crossIn(inwardNode)(ValName("bus_xing"))
def generateSynchronousDomain: ClockSinkDomain = {
val domain = LazyModule(new ClockSinkDomain(take = fixedClockOpt))
def generateSynchronousDomain(domainName: String): ClockSinkDomain = {
val domain = LazyModule(new ClockSinkDomain(take = fixedClockOpt, name = Some(domainName)))
domain.clockNode := fixedClockNode
domain
}
def generateSynchronousDomain: ClockSinkDomain = generateSynchronousDomain("")

protected val addressPrefixNexusNode = BundleBroadcast[UInt](registered = false, default = Some(() => 0.U(1.W)))

Expand Down

0 comments on commit f43041d

Please sign in to comment.