Skip to content

Commit

Permalink
Merge pull request #682 from ucb-bar/clocking-features
Browse files Browse the repository at this point in the history
Add tile-reset control registers | multiclock fixes
  • Loading branch information
jerryz123 committed Oct 8, 2020
2 parents bf8dbaa + 3d00226 commit b583276
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 9 deletions.
18 changes: 15 additions & 3 deletions generators/chipyard/src/main/scala/Clocks.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ import chisel3._
import scala.collection.mutable.{ArrayBuffer}

import freechips.rocketchip.prci._
import freechips.rocketchip.subsystem.{BaseSubsystem, SubsystemDriveAsyncClockGroupsKey}
import freechips.rocketchip.subsystem.{BaseSubsystem, SubsystemDriveAsyncClockGroupsKey, InstantiatesTiles}
import freechips.rocketchip.config.{Parameters, Field, Config}
import freechips.rocketchip.diplomacy.{OutwardNodeHandle, InModuleBody, LazyModule}
import freechips.rocketchip.util.{ResetCatchAndSync, Pow2ClockDivider}

import barstools.iocell.chisel._
import testchipip.{TLTileResetCtrl}

import chipyard.clocking.{DividerOnlyClockGenerator, ClockGroupNamePrefixer, ClockGroupFrequencySpecifier}

Expand Down Expand Up @@ -109,9 +110,20 @@ object ClockingSchemeGenerators {
l.asyncClockGroupsNode
}

// Add a control register for each tile's reset
val resetSetter = chiptop.lazySystem match {
case sys: BaseSubsystem with InstantiatesTiles => TLTileResetCtrl(sys)
case _ => ClockGroupEphemeralNode()
}

val aggregator = LazyModule(new ClockGroupAggregator("allClocks")).node
chiptop.implicitClockSinkNode := ClockGroup() := aggregator
systemAsyncClockGroup := ClockGroupNamePrefixer() := aggregator
(chiptop.implicitClockSinkNode
:= ClockGroup()
:= aggregator)
(systemAsyncClockGroup
:= resetSetter
:= ClockGroupNamePrefixer()
:= aggregator)

val referenceClockSource = ClockSourceNode(Seq(ClockSourceParameters()))
(aggregator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ class LoopbackNICRocketConfig extends Config(

// DOC include start: l1scratchpadrocket
class ScratchpadOnlyRocketConfig extends Config(
new testchipip.WithSerialPBusMem ++
new freechips.rocketchip.subsystem.WithNMemoryChannels(0) ++ // remove offchip mem port
new freechips.rocketchip.subsystem.WithNBanks(0) ++
new freechips.rocketchip.subsystem.WithNoMemPort ++
Expand Down
9 changes: 5 additions & 4 deletions generators/firechip/src/main/scala/BridgeBinders.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import freechips.rocketchip.config.{Field, Config, Parameters}
import freechips.rocketchip.diplomacy.{LazyModule}
import freechips.rocketchip.devices.debug.{Debug, HasPeripheryDebugModuleImp}
import freechips.rocketchip.amba.axi4.{AXI4Bundle}
import freechips.rocketchip.subsystem.{CanHaveMasterAXI4MemPort, HasExtInterruptsModuleImp, BaseSubsystem, HasTilesModuleImp}
import freechips.rocketchip.subsystem.{CanHaveMasterAXI4MemPort, HasExtInterruptsModuleImp, BaseSubsystem, HasTilesModuleImp, ExtMem}
import freechips.rocketchip.tile.{RocketTile}
import sifive.blocks.devices.uart._

Expand Down Expand Up @@ -67,9 +67,10 @@ class WithFireSimIOCellModels extends Config((site, here, up) => {

class WithSerialBridge extends OverrideHarnessBinder({
(system: CanHavePeripheryTLSerial, th: HasHarnessSignalReferences, ports: Seq[ClockedIO[SerialIO]]) => {
ports.map { p =>
val ram = SerialAdapter.connectHarnessRAM(system.serdesser.get, p, th.harnessReset)
SerialBridge(p.clock, ram.module.io.tsi_ser, MainMemoryConsts.globalName)(GetSystemParameters(system))
ports.map { port =>
implicit val p = GetSystemParameters(system)
val ram = SerialAdapter.connectHarnessRAM(system.serdesser.get, port, th.harnessReset)
SerialBridge(port.clock, ram.module.io.tsi_ser, p(ExtMem).map(_ => MainMemoryConsts.globalName))
}
Nil
}
Expand Down
2 changes: 1 addition & 1 deletion generators/testchipip

0 comments on commit b583276

Please sign in to comment.