From 3cda18dfd0874015435418c0d1ce19347f881921 Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Wed, 10 Mar 2021 14:42:40 -0800 Subject: [PATCH 1/3] Give TileResetCtrl an AsyncReset --- src/main/scala/TileResetCtrl.scala | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/scala/TileResetCtrl.scala b/src/main/scala/TileResetCtrl.scala index 07e5fcb8..ebf3cf10 100644 --- a/src/main/scala/TileResetCtrl.scala +++ b/src/main/scala/TileResetCtrl.scala @@ -10,7 +10,7 @@ import freechips.rocketchip.regmapper._ import freechips.rocketchip.subsystem._ import freechips.rocketchip.util._ import freechips.rocketchip.tile._ -import freechips.rocketchip.prci.{ClockSinkDomain, ClockGroupIdentityNode} +import freechips.rocketchip.prci._ // initResetHarts: list of hartids which will stay in reset until its reset-ctrl register is cleared case class TileResetCtrlParams(initResetHarts: Seq[Int] = Nil, address: BigInt=0x100000, slaveWhere: TLBusWrapperLocation = PBUS) @@ -26,7 +26,7 @@ object TLTileResetCtrl { LazyModule(new TLTileResetCtrl(tlbus.beatBytes, resetCtrlParams, sys.tile_prci_domains)) } tlbus.toVariableWidthSlave(Some("tile-reset-ctrl")) { resetCtrl.node := TLBuffer() } - resetCtrl.tileResetProviderNode + resetCtrl } } @@ -34,12 +34,15 @@ class TLTileResetCtrl(w: Int, params: TileResetCtrlParams, tile_prci_domains: Se val device = new SimpleDevice("tile-reset-ctrl", Nil) val node = TLRegisterNode(Seq(AddressSet(params.address, 4096-1)), device, "reg/control", beatBytes=w) val tileResetProviderNode = ClockGroupIdentityNode() + val asyncResetSinkNode = ClockSinkNode(Seq(ClockSinkParameters())) lazy val module = new LazyModuleImp(this) { val nTiles = p(TilesLocated(InSubsystem)).size require (nTiles <= 4096) val r_tile_resets = (0 until nTiles).map({ i => - Module(new AsyncResetRegVec(w=1, init=(if (params.initResetHarts.contains(i)) 1 else 0))) + withReset (asyncResetSinkNode.in.head._1.reset) { + Module(new AsyncResetRegVec(w=1, init=(if (params.initResetHarts.contains(i)) 1 else 0))) + } }) node.regmap((0 until nTiles).map({ i => i -> Seq(RegField.rwReg(1, r_tile_resets(i).io)), @@ -54,7 +57,11 @@ class TLTileResetCtrl(w: Int, params: TileResetCtrlParams, tile_prci_domains: Se oD.reset := iD.reset for ((n, r) <- tileMap) { if (name.contains(n)) { - oD.reset := r.asBool || iD.reset.asBool + // Async because the reset coming out of the AsyncResetRegVec is + // clocked to the bus this is attached to, not the clock in this + // clock bundle. We expect a ClockGroupResetSynchronizer downstream + // to synchronize the resets + oD.reset := (r.asBool || iD.reset.asBool).asAsyncReset } } } From cca134d6f23b11d9ae3d3112bc409476bd461ff1 Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Thu, 11 Mar 2021 18:12:19 -0800 Subject: [PATCH 2/3] Directly pass async reset to tile in TileResetCtrl --- src/main/scala/TileResetCtrl.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/TileResetCtrl.scala b/src/main/scala/TileResetCtrl.scala index ebf3cf10..607a0028 100644 --- a/src/main/scala/TileResetCtrl.scala +++ b/src/main/scala/TileResetCtrl.scala @@ -61,7 +61,7 @@ class TLTileResetCtrl(w: Int, params: TileResetCtrlParams, tile_prci_domains: Se // clocked to the bus this is attached to, not the clock in this // clock bundle. We expect a ClockGroupResetSynchronizer downstream // to synchronize the resets - oD.reset := (r.asBool || iD.reset.asBool).asAsyncReset + oD.reset := r.asBool.asAsyncReset } } } From 592fa2030d05b0fbe4541630e7135c050eb785e9 Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Thu, 11 Mar 2021 22:31:59 -0800 Subject: [PATCH 3/3] Bump CY --- CHIPYARD.hash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHIPYARD.hash b/CHIPYARD.hash index 7c244581..0003ce48 100644 --- a/CHIPYARD.hash +++ b/CHIPYARD.hash @@ -1 +1 @@ -6b0d57d60690cc223013ea228b687b519b716c50 +c5cb8f13294f873da0dd62b25a4b8731b5337efb \ No newline at end of file