-
Notifications
You must be signed in to change notification settings - Fork 681
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor how Configs parameterize the Top and TestHarnesses
- Loading branch information
Showing
34 changed files
with
919 additions
and
848 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
Oops, something went wrong.