Skip to content

Commit

Permalink
Refactor how Configs parameterize the Top and TestHarnesses
Browse files Browse the repository at this point in the history
  • Loading branch information
jerryz123 committed Jan 16, 2020
1 parent 612f1d5 commit 757eb76
Show file tree
Hide file tree
Showing 34 changed files with 919 additions and 848 deletions.
2 changes: 1 addition & 1 deletion .circleci/defaults.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ mapping["example"]="SUB_PROJECT=example"
mapping["boomrocketexample"]="SUB_PROJECT=example CONFIG=LargeBoomAndRocketConfig"
mapping["boom"]="SUB_PROJECT=example CONFIG=SmallBoomConfig"
mapping["rocketchip"]="SUB_PROJECT=rocketchip"
mapping["blockdevrocketchip"]="SUB_PROJECT=example CONFIG=SimBlockDeviceRocketConfig TOP=TopWithBlockDevice"
mapping["blockdevrocketchip"]="SUB_PROJECT=example CONFIG=SimBlockDeviceRocketConfig"
mapping["hwacha"]="SUB_PROJECT=example CONFIG=HwachaRocketConfig"
mapping["gemmini"]="SUB_PROJECT=example CONFIG=GemminiRocketConfig"
mapping["tracegen"]="SUB_PROJECT=tracegen CONFIG=NonBlockingTraceGenL2Config"
Expand Down
1 change: 1 addition & 0 deletions docs/Chipyard-Basics/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Hit next to get started!
:caption: Chipyard Basics:

Chipyard-Components
Development-Ecosystem
Configs-Parameters-Mixins
Initial-Repo-Setup

Expand Down
261 changes: 0 additions & 261 deletions docs/Customization/Adding-An-Accelerator.rst

This file was deleted.

38 changes: 38 additions & 0 deletions docs/Customization/Custom-Chisel.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
.. _custom_chisel:

Integrating into the Generator Build System
===========================================

While developing, you want to include Chisel code in a submodule so that it can be shared by different projects.
To add a submodule to the Chipyard framework, make sure that your project is organized as follows.

.. code-block:: none
yourproject/
build.sbt
src/main/scala/
YourFile.scala
Put this in a git repository and make it accessible.
Then add it as a submodule to under the following directory hierarchy: ``generators/yourproject``.

.. code-block:: shell
cd generators/
git submodule add https://git-repository.com/yourproject.git
Then add ``yourproject`` to the Chipyard top-level build.sbt file.

.. code-block:: scala
lazy val yourproject = (project in file("generators/yourproject")).settings(commonSettings).dependsOn(rocketchip)
You can then import the classes defined in the submodule in a new project if
you add it as a dependency. For instance, if you want to use this code in
the ``example`` project, change the final line in build.sbt to the following.

.. code-block:: scala
lazy val example = (project in file(".")).settings(commonSettings).dependsOn(testchipip, yourproject)
35 changes: 35 additions & 0 deletions docs/Customization/DMA-Devices.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.. _dma-devices:

Adding a DMA Device
===================

For IO devices or accelerators (like a disk or network driver), instead of
having the CPU poll data from the device, we may want to have the device write
directly to the coherent memory system instead. For example, here is a device
that writes zeros to the memory at a configured address.

.. literalinclude:: ../../generators/example/src/main/scala/InitZero.scala
:language: scala

.. literalinclude:: ../../generators/example/src/main/scala/Top.scala
:language: scala
:start-after: DOC include start: Top
:end-before: DOC include end: Top

We use ``TLHelper.makeClientNode`` to create a TileLink client node for us.
We then connect the client node to the memory system through the front bus (fbus).
For more info on creating TileLink client nodes, take a look at :ref:`Client Node`.

Once we've created our top-level module including the DMA widget, we can create a configuration for it as we did before.

.. literalinclude:: ../../generators/example/src/main/scala/ConfigMixins.scala
:language: scala
:start-after: DOC include start: WithInitZero
:end-before: DOC include end: WithInitZero

.. literalinclude:: ../../generators/example/src/main/scala/RocketConfigs.scala
:language: scala
:start-after: DOC include start: InitZeroRocketConfig
:end-before: DOC include end: InitZeroRocketConfig


Loading

0 comments on commit 757eb76

Please sign in to comment.