diff --git a/.gitmodules b/.gitmodules index cae791dd..aab9a8f7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -127,4 +127,4 @@ url = https://github.com/ucb-bar/nvdla-workload.git [submodule "tools/dromajo/dromajo-src"] path = tools/dromajo/dromajo-src - url = https://github.com/abejgonzalez/dromajo.git + url = https://github.com/riscv-boom/dromajo.git diff --git a/docs/Advanced-Concepts/Debugging-BOOM.rst b/docs/Advanced-Concepts/Debugging-BOOM.rst new file mode 100644 index 00000000..1e61804c --- /dev/null +++ b/docs/Advanced-Concepts/Debugging-BOOM.rst @@ -0,0 +1,30 @@ +Debugging BOOM +====================== + +In addition to the default debugging techniques specified in :ref:`Debugging RTL`, +single-core BOOM designs can utilize the Dromajo co-simulator (see :ref:`Dromajo`) +to verify functionality. + +.. warning:: Dromajo currently only works in single-core BOOM systems without accelerators. + +.. warning:: Dromajo currently only works in VCS simulation and FireSim. + +Setting up Dromajo Co-simulation +-------------------------------------- + +Dromajo co-simulation is setup to work when two config fragments are added to a BOOM config. +First, a ``chipyard.config.WithTraceIO`` config fragment must be added so that BOOM's traceport is enabled. +Second, a ``chipyard.iobinders.WithSimDromajoBridge`` config fragment must be added to +connect the Dromajo co-simulator to the traceport. +Once both config fragments are added Dromajo should be enabled. + +To build/run Dromajo with a BOOM design, run your configuration the following make commands: + +.. code-block:: shell + + # build the default Dromajo BOOM config without waveform dumps + # replace "DromajoBoomConfig" with your particular config + make CONFIG=DromajoBoomConfig ENABLE_DROMAJO=1 + + # run a simulation with Dromajo + make CONFIG=DromajoBoomConfig ENABLE_DROMAJO=1 BINARY= run-binary diff --git a/docs/Advanced-Concepts/Debugging-RTL.rst b/docs/Advanced-Concepts/Debugging-RTL.rst index 86e5ced3..6831cc4a 100644 --- a/docs/Advanced-Concepts/Debugging-RTL.rst +++ b/docs/Advanced-Concepts/Debugging-RTL.rst @@ -86,29 +86,6 @@ identical program behavior. The torture utility can also be configured to run continuously for stress-testing. The torture utility exists within the ``utilities`` directory. -Dromajo Co-simulation for BOOM designs --------------------------------------- -Dromajo co-simulation is setup to work when two config. fragments are added to a BOOM config. -First, a ``chipyard.config.WithTraceIO`` config. fragment must be added so that BOOM's traceport is enabled. -Second, a ``chipyard.iobinders.WithSimDromajoBridge`` config. fragment must be added to -connect the Dromajo co-simulator to the traceport. -Once both config. fragments are added Dromajo should be enabled. - -To build/run Dromajo with a BOOM design, run your configuration the following make commands: - -.. code-block:: shell - - # build the default Dromajo BOOM config. without waveform dumps - # replace "DromajoBoomConfig" with your particular config - make CONFIG=DromajoBoomConfig ENABLE_DROMAJO=1 - - # run a simulation with Dromajo - make CONFIG=DromajoBoomConfig ENABLE_DROMAJO=1 BINARY= run-binary - -.. warning:: Dromajo currently only works in single-core BOOM systems without accelerators. - -.. warning:: Dromajo currently only works in VCS simulation and FireSim. - Firesim Debugging --------------------------- Chisel printfs, asserts, Dromajo co-simulation, and waveform generation are also available in FireSim diff --git a/docs/Advanced-Concepts/index.rst b/docs/Advanced-Concepts/index.rst index c13e569b..12b12716 100644 --- a/docs/Advanced-Concepts/index.rst +++ b/docs/Advanced-Concepts/index.rst @@ -11,6 +11,7 @@ They expect you to know about Chisel, Parameters, configs, etc. Top-Testharness Chip-Communication Debugging-RTL + Debugging-BOOM Resources CDEs diff --git a/docs/Chipyard-Basics/Chipyard-Components.rst b/docs/Chipyard-Basics/Chipyard-Components.rst index 7a89e93a..c24f81ed 100644 --- a/docs/Chipyard-Basics/Chipyard-Components.rst +++ b/docs/Chipyard-Basics/Chipyard-Components.rst @@ -80,7 +80,7 @@ Tools A Chisel library for writing custom signal processing hardware, as well as integrating custom signal processing hardware into an SoC (especially a Rocket-based SoC). **Dromajo** - A RV64GC emulator primarily used for co-simulation and was originally developed by Esperanto Technology. + A RV64GC emulator primarily used for co-simulation and was originally developed by Esperanto Technologies. See :ref:`Dromajo` for more information. Toolchains diff --git a/generators/boom b/generators/boom index 8c4ac6fd..f0caca8d 160000 --- a/generators/boom +++ b/generators/boom @@ -1 +1 @@ -Subproject commit 8c4ac6fd40b455387cec369080b9b47d6fd1466e +Subproject commit f0caca8d6bc98f3ccc7d8b9391b7f7c8efb2f879 diff --git a/generators/chipyard/src/main/scala/Subsystem.scala b/generators/chipyard/src/main/scala/Subsystem.scala index 4dfa7d73..99c31472 100644 --- a/generators/chipyard/src/main/scala/Subsystem.scala +++ b/generators/chipyard/src/main/scala/Subsystem.scala @@ -24,6 +24,8 @@ import freechips.rocketchip.amba.axi4._ import boom.common.{BoomTile, BoomTilesKey, BoomCrossingKey, BoomTileParams} import ariane.{ArianeTile, ArianeTilesKey, ArianeCrossingKey, ArianeTileParams} +import testchipip.{DromajoHelper} + trait HasChipyardTiles extends HasTiles with CanHavePeripheryPLIC with CanHavePeripheryCLINT @@ -106,27 +108,6 @@ class SubsystemModuleImp[+L <: Subsystem](_outer: L) extends BaseSubsystemModule ElaborationArtefacts.add("""core.config""", outer.tiles.map(x => x.module.toString).mkString("\n")) // Generate C header with relevant information for Dromajo - // THIS IS INCLUDED IN THE `dromajo_params.h` header file - var dromajoParams: String = "" - dromajoParams += "#ifndef DROMAJO_PARAMS_H" - dromajoParams += "\n#define DROMAJO_PARAMS_H" - dromajoParams += "\n\n" + "#define DROMAJO_RESET_VECTOR " + "\"" + "0x" + f"${p(BootROMParams).hang}%X" + "\"" - dromajoParams += "\n" + "#define DROMAJO_MMIO_START " + "\"" + "0x" + f"${p(BootROMParams).address + p(BootROMParams).size}%X" + "\"" - p(ExtMem) map { eP => - dromajoParams += "\n" + "#define DROMAJO_MMIO_END " + "\"" + "0x" + f"${eP.master.base}%X" + "\"" - // dromajo memory is in MiB chunks - dromajoParams += "\n" + "#define DROMAJO_MEM_SIZE " + "\"" + "0x" + f"${eP.master.size >> 20}%X" + "\"" - } - p(PLICKey) map { pP => - dromajoParams += "\n" + "#define DROMAJO_PLIC_BASE " + "\"" + "0x" + f"${pP.baseAddress}%X" + "\"" - dromajoParams += "\n" + "#define DROMAJO_PLIC_SIZE " + "\"" + "0x" + f"${PLICConsts.size(pP.maxHarts)}%X" + "\"" - } - p(CLINTKey) map { cP => - dromajoParams += "\n" + "#define DROMAJO_CLINT_BASE " + "\"" + "0x" + f"${cP.baseAddress}%X" + "\"" - dromajoParams += "\n" + "#define DROMAJO_CLINT_SIZE " + "\"" + "0x" + f"${CLINTConsts.size}%X" + "\"" - } - dromajoParams += "\n\n#endif" - - ElaborationArtefacts.add("""dromajo_params.h""", dromajoParams) - + // This is included in the `dromajo_params.h` header file + DromajoHelper.addArtefacts } diff --git a/generators/testchipip b/generators/testchipip index e43e818f..b02bd8ea 160000 --- a/generators/testchipip +++ b/generators/testchipip @@ -1 +1 @@ -Subproject commit e43e818f443764cb1a1bdaa243b5adc795083217 +Subproject commit b02bd8eacaffe425811bd3fd8ef7d30772ae3cb7 diff --git a/sims/firesim b/sims/firesim index 4e94c1a0..724a66b0 160000 --- a/sims/firesim +++ b/sims/firesim @@ -1 +1 @@ -Subproject commit 4e94c1a0131dc673f894c62f9a110637844a806a +Subproject commit 724a66b0f4430b02d7d5e83b419916250978ee01