diff --git a/docs/Advanced-Concepts/Top-Testharness.rst b/docs/Advanced-Concepts/Top-Testharness.rst index e412eeff..483814e3 100644 --- a/docs/Advanced-Concepts/Top-Testharness.rst +++ b/docs/Advanced-Concepts/Top-Testharness.rst @@ -25,6 +25,8 @@ The default standard ``ChipTop`` provides a mimimal, barebones template for ``IO For tapeouts, integrating Analog IP, or other non-standard use cases, Chipyard supports specifying a custom ``ChipTop`` using the ``BuildTop`` key. An example of a custom ChipTop which uses non-standard IOCells is provided in `generators/chipyard/src/main/scala/example/CustomChipTop.scala `__ +You can also specify a fully custom ChipTop that does not use any RocketChip or Chipyard SoC components. An example of this is provided in `generators/chipyard/src/main/scala/example/EmptyChipTop.scala `__. The ``EmptyChipTop`` example can be built with ``make CONFIG=EmptyChipTopConfig TOP=EmptyChipTop``. + System/DigitalTop ------------------------- diff --git a/generators/chipyard/src/main/scala/config/NoCoreConfigs.scala b/generators/chipyard/src/main/scala/config/NoCoreConfigs.scala index 6647e516..23da9700 100644 --- a/generators/chipyard/src/main/scala/config/NoCoreConfigs.scala +++ b/generators/chipyard/src/main/scala/config/NoCoreConfigs.scala @@ -17,3 +17,9 @@ class NoCoresConfig extends Config( new chipyard.config.WithNoDebug ++ new chipyard.config.WithNoPLIC ++ new chipyard.config.AbstractConfig) + +// A config that uses a empty chiptop module with no rocket-chip soc components +class EmptyChipTopConfig extends Config( + new chipyard.example.WithEmptyChipTop ++ + new chipyard.config.AbstractConfig // since we aren't using rocket-chip, this doesn't do anything +) diff --git a/generators/chipyard/src/main/scala/example/EmptyChipTop.scala b/generators/chipyard/src/main/scala/example/EmptyChipTop.scala new file mode 100644 index 00000000..e2bb3f8c --- /dev/null +++ b/generators/chipyard/src/main/scala/example/EmptyChipTop.scala @@ -0,0 +1,21 @@ +package chipyard.example + +import chisel3._ + +import org.chipsalliance.cde.config._ +import freechips.rocketchip.diplomacy._ +import freechips.rocketchip.util.{DontTouch} + +import chipyard._ +import chipyard.harness.{BuildTop} + +class EmptyChipTop(implicit p: Parameters) extends LazyModule { + override lazy val module = new Impl + class Impl extends LazyRawModuleImp(this) with DontTouch { + // Your custom non-rocketchip-soc stuff here + } +} + +class WithEmptyChipTop extends Config((site, here, up) => { + case BuildTop => (p: Parameters) => new EmptyChipTop()(p) +}) diff --git a/generators/chipyard/src/main/scala/harness/HasHarnessInstantiators.scala b/generators/chipyard/src/main/scala/harness/HasHarnessInstantiators.scala index b8674623..1cb1e87d 100644 --- a/generators/chipyard/src/main/scala/harness/HasHarnessInstantiators.scala +++ b/generators/chipyard/src/main/scala/harness/HasHarnessInstantiators.scala @@ -99,6 +99,7 @@ trait HasHarnessInstantiators { if (p(DontTouchChipTopPorts)) { duts.map(_ match { case d: DontTouch => d.dontTouchPorts() + case _ => }) } diff --git a/scripts/split-mems-conf.py b/scripts/split-mems-conf.py index 351bb7b2..086aa450 100755 --- a/scripts/split-mems-conf.py +++ b/scripts/split-mems-conf.py @@ -70,7 +70,10 @@ if __name__ == "__main__": imhj_data = json.load(imhj) dut_root = bfs_find_root(imhj_data, args.dut_module_name) - dut_submodules = bfs_collect_submodules(dut_root) + if dut_root: + dut_submodules = bfs_collect_submodules(dut_root) + else: + dut_submodules = set() model_root = bfs_find_root(imhj_data, args.model_module_name) model_submodules = bfs_collect_submodules(model_root)