From 489ae695fc8427b7dca264916ce6844f81d59e11 Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Thu, 1 Oct 2020 10:19:43 -0700 Subject: [PATCH 1/8] Add tile-resetter to all designs --- .../chipyard/src/main/scala/Clocks.scala | 18 +++++++++++++++--- generators/testchipip | 2 +- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/generators/chipyard/src/main/scala/Clocks.scala b/generators/chipyard/src/main/scala/Clocks.scala index 554e9905..8dfb9ac6 100644 --- a/generators/chipyard/src/main/scala/Clocks.scala +++ b/generators/chipyard/src/main/scala/Clocks.scala @@ -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} @@ -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 diff --git a/generators/testchipip b/generators/testchipip index bdca33ec..89b528de 160000 --- a/generators/testchipip +++ b/generators/testchipip @@ -1 +1 @@ -Subproject commit bdca33ec1684e6e00df2f5c9aebc0b41fb593585 +Subproject commit 89b528decffa8fd33f21dd7a6feabb639274f99a From 164617e2d64c716643dfff5925c450c502e9609f Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Thu, 1 Oct 2020 10:20:10 -0700 Subject: [PATCH 2/8] Fix no-mbus example design --- generators/chipyard/src/main/scala/config/RocketConfigs.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/generators/chipyard/src/main/scala/config/RocketConfigs.scala b/generators/chipyard/src/main/scala/config/RocketConfigs.scala index 11399a62..ab0e16ec 100644 --- a/generators/chipyard/src/main/scala/config/RocketConfigs.scala +++ b/generators/chipyard/src/main/scala/config/RocketConfigs.scala @@ -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 ++ From 79042e4ce86302a7335ab49e9c703a181a237bef Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Thu, 1 Oct 2020 10:21:43 -0700 Subject: [PATCH 3/8] Bump to support firesim simulation of no-AXI4DRAM designs --- generators/firechip/src/main/scala/BridgeBinders.scala | 9 +++++---- sims/firesim | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/generators/firechip/src/main/scala/BridgeBinders.scala b/generators/firechip/src/main/scala/BridgeBinders.scala index 653f8026..1f8bb418 100644 --- a/generators/firechip/src/main/scala/BridgeBinders.scala +++ b/generators/firechip/src/main/scala/BridgeBinders.scala @@ -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._ @@ -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 } diff --git a/sims/firesim b/sims/firesim index 801baeb9..ef615d35 160000 --- a/sims/firesim +++ b/sims/firesim @@ -1 +1 @@ -Subproject commit 801baeb901c207beb0511311e09ae10e0dbb8b5f +Subproject commit ef615d35da118e73f5128d373f17b80884100773 From 3d0022667a905321e4d0af8dc0f1b5672d330e10 Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Thu, 1 Oct 2020 22:43:43 -0700 Subject: [PATCH 4/8] Bump testchipip --- generators/testchipip | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/testchipip b/generators/testchipip index 89b528de..b3aa1bea 160000 --- a/generators/testchipip +++ b/generators/testchipip @@ -1 +1 @@ -Subproject commit 89b528decffa8fd33f21dd7a6feabb639274f99a +Subproject commit b3aa1bea536ee96a1e69796d35f7651a314c2f6a From 399b909dec01e32d6c122a626bebabf8c775bf54 Mon Sep 17 00:00:00 2001 From: Nathan Pemberton Date: Wed, 7 Oct 2020 20:50:26 -0400 Subject: [PATCH 5/8] Bump firemarshal to v1.10.0 --- software/firemarshal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/software/firemarshal b/software/firemarshal index 83b86610..45aebace 160000 --- a/software/firemarshal +++ b/software/firemarshal @@ -1 +1 @@ -Subproject commit 83b866104c6860b5d03989a6cf8439aa6934b398 +Subproject commit 45aebace86d3a46c357337a19d4c8e894a5d0ed4 From d71c3b6357597da5aca589ee0dda1b7e5f4fe79a Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Fri, 2 Oct 2020 11:22:55 -0700 Subject: [PATCH 6/8] Unify htif implementation with firesim --- generators/testchipip | 2 +- sims/firesim | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/generators/testchipip b/generators/testchipip index b3aa1bea..9cf31ace 160000 --- a/generators/testchipip +++ b/generators/testchipip @@ -1 +1 @@ -Subproject commit b3aa1bea536ee96a1e69796d35f7651a314c2f6a +Subproject commit 9cf31acea528543896f04457573454a3e51f1e6a diff --git a/sims/firesim b/sims/firesim index ef615d35..dd20a99f 160000 --- a/sims/firesim +++ b/sims/firesim @@ -1 +1 @@ -Subproject commit ef615d35da118e73f5128d373f17b80884100773 +Subproject commit dd20a99f33eba31ffa2d6c7e9fc914445224d4e9 From 25129c27ca20870518161228723e6d55fb31f9de Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Fri, 2 Oct 2020 13:07:42 -0700 Subject: [PATCH 7/8] Add testchip_fesvr to uncondtionally used resources --- generators/utilities/src/main/scala/Simulator.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/generators/utilities/src/main/scala/Simulator.scala b/generators/utilities/src/main/scala/Simulator.scala index b2982db7..02224fdb 100644 --- a/generators/utilities/src/main/scala/Simulator.scala +++ b/generators/utilities/src/main/scala/Simulator.scala @@ -83,6 +83,8 @@ object GenerateSimFiles extends App with HasGenerateSimConfig { } def resources(sim: Simulator): Seq[String] = Seq( "/testchipip/csrc/SimSerial.cc", + "/testchipip/csrc/testchip_fesvr.cc", + "/testchipip/csrc/testchip_fesvr.h", "/testchipip/csrc/SimDRAM.cc", "/testchipip/csrc/mm.h", "/testchipip/csrc/mm.cc", From 0c46ed167633ebe948ac746f9e0eccd9ab69b361 Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Fri, 9 Oct 2020 09:34:20 -0700 Subject: [PATCH 8/8] Rename testchip_fesvr to testchip_tsi --- generators/testchipip | 2 +- generators/utilities/src/main/scala/Simulator.scala | 4 ++-- sims/firesim | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/generators/testchipip b/generators/testchipip index 9cf31ace..56bfaa3f 160000 --- a/generators/testchipip +++ b/generators/testchipip @@ -1 +1 @@ -Subproject commit 9cf31acea528543896f04457573454a3e51f1e6a +Subproject commit 56bfaa3f9bcd11206d93fdfa3c8e7656665e462a diff --git a/generators/utilities/src/main/scala/Simulator.scala b/generators/utilities/src/main/scala/Simulator.scala index 02224fdb..f40ad032 100644 --- a/generators/utilities/src/main/scala/Simulator.scala +++ b/generators/utilities/src/main/scala/Simulator.scala @@ -83,8 +83,8 @@ object GenerateSimFiles extends App with HasGenerateSimConfig { } def resources(sim: Simulator): Seq[String] = Seq( "/testchipip/csrc/SimSerial.cc", - "/testchipip/csrc/testchip_fesvr.cc", - "/testchipip/csrc/testchip_fesvr.h", + "/testchipip/csrc/testchip_tsi.cc", + "/testchipip/csrc/testchip_tsi.h", "/testchipip/csrc/SimDRAM.cc", "/testchipip/csrc/mm.h", "/testchipip/csrc/mm.cc", diff --git a/sims/firesim b/sims/firesim index dd20a99f..6318184f 160000 --- a/sims/firesim +++ b/sims/firesim @@ -1 +1 @@ -Subproject commit dd20a99f33eba31ffa2d6c7e9fc914445224d4e9 +Subproject commit 6318184f304315a94b5eb5c670f0eec1a3205f59