This adds an additional layer (ChipTop) between the System module and the TestHarness. The IOBinder API is now changed to take only a single parameter (an Any) and return a 3 things: The IO port(s), the IO cell(s), and a function to call inside the test harness, which is analogous to the old IOBinder function, except that it takes a TestHarness object as an argument instead of (clock, reset, success). * A new Top-level module, ChipTop, has been created. ChipTop instantiates a "system" module specified by BuildSystem. * BuildTop now builds a ChipTop dut module in the TestHarness by default * A new BuildSystem key has been added, which by default builds DigitalTop (previously just called Top) * The IOBinders API has changed. IOBinders are now called inside of ChipTop and return a tuple3 of (IO ports, IO cells, harness functions). The harness functions are now called inside the TestHarness (this is analogous to the previous IOBinder functions). * IO cell models have been included in ChipTop. These can be replaced with real IO cells for tapeout, or used as-is for simulation. * The default for the TOP make variable is now ChipTop (was Top)
40 lines
1.6 KiB
ReStructuredText
40 lines
1.6 KiB
ReStructuredText
.. _dma-devices:
|
|
|
|
Adding a DMA Device
|
|
===================
|
|
|
|
DMA devices are Tilelink widgets which act as masters. In other words,
|
|
DMA devices can send their own read and write requests to the chip's memory
|
|
system.
|
|
|
|
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/chipyard/src/main/scala/example/InitZero.scala
|
|
:language: scala
|
|
|
|
.. literalinclude:: ../../generators/chipyard/src/main/scala/DigitalTop.scala
|
|
:language: scala
|
|
:start-after: DOC include start: DigitalTop
|
|
:end-before: DOC include end: DigitalTop
|
|
|
|
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/chipyard/src/main/scala/example/InitZero.scala
|
|
:language: scala
|
|
:start-after: DOC include start: WithInitZero
|
|
:end-before: DOC include end: WithInitZero
|
|
|
|
.. literalinclude:: ../../generators/chipyard/src/main/scala/config/RocketConfigs.scala
|
|
:language: scala
|
|
:start-after: DOC include start: InitZeroRocketConfig
|
|
:end-before: DOC include end: InitZeroRocketConfig
|
|
|
|
|