Update docs
This commit is contained in:
@@ -11,14 +11,14 @@ for exposing registers themselves, it's much easier to use RocketChip's
|
||||
``regmap`` interface, which can generate most of the glue logic.
|
||||
|
||||
For TileLink devices, you can use the ``regmap`` interface by extending
|
||||
the ``TLRegisterRouter`` class, as shown in :ref:`Adding An Accelerator/Device`,
|
||||
the ``TLRegisterRouter`` class, as shown in :ref:`mmio-accelerators`,
|
||||
or you can create a regular LazyModule and instantiate a ``TLRegisterNode``.
|
||||
This section will focus on the second method.
|
||||
|
||||
Basic Usage
|
||||
-----------
|
||||
|
||||
.. literalinclude:: ../../generators/example/src/main/scala/RegisterNodeExample.scala
|
||||
.. literalinclude:: ../../generators/chipyard/src/main/scala/RegisterNodeExample.scala
|
||||
:language: scala
|
||||
:start-after: DOC include start: MyDeviceController
|
||||
:end-before: DOC include end: MyDeviceController
|
||||
@@ -56,7 +56,7 @@ register. The ``RegField`` interface also provides support for reading
|
||||
and writing ``DecoupledIO`` interfaces. For instance, you can implement a
|
||||
hardware FIFO like so.
|
||||
|
||||
.. literalinclude:: ../../generators/example/src/main/scala/RegisterNodeExample.scala
|
||||
.. literalinclude:: ../../generators/chipyard/src/main/scala/RegisterNodeExample.scala
|
||||
:language: scala
|
||||
:start-after: DOC include start: MyQueueRegisters
|
||||
:end-before: DOC include end: MyQueueRegisters
|
||||
@@ -71,7 +71,7 @@ You need not specify both read and write for a register. You can also create
|
||||
read-only or write-only registers. So for the previous example, if you wanted
|
||||
enqueue and dequeue to use different addresses, you could write the following.
|
||||
|
||||
.. literalinclude:: ../../generators/example/src/main/scala/RegisterNodeExample.scala
|
||||
.. literalinclude:: ../../generators/chipyard/src/main/scala/RegisterNodeExample.scala
|
||||
:language: scala
|
||||
:start-after: DOC include start: MySeparateQueueRegisters
|
||||
:end-before: DOC include end: MySeparateQueueRegisters
|
||||
@@ -93,7 +93,7 @@ You can also create registers using functions. Say, for instance, that you
|
||||
want to create a counter that gets incremented on a write and decremented on
|
||||
a read.
|
||||
|
||||
.. literalinclude:: ../../generators/example/src/main/scala/RegisterNodeExample.scala
|
||||
.. literalinclude:: ../../generators/chipyard/src/main/scala/RegisterNodeExample.scala
|
||||
:language: scala
|
||||
:start-after: DOC include start: MyCounterRegisters
|
||||
:end-before: DOC include end: MyCounterRegisters
|
||||
@@ -107,7 +107,7 @@ You can also pass functions that decouple the read/write request and response.
|
||||
The request will appear as a decoupled input and the response as a decoupled
|
||||
output. So for instance, if we wanted to do this for the previous example.
|
||||
|
||||
.. literalinclude:: ../../generators/example/src/main/scala/RegisterNodeExample.scala
|
||||
.. literalinclude:: ../../generators/chipyard/src/main/scala/RegisterNodeExample.scala
|
||||
:language: scala
|
||||
:start-after: DOC include start: MyCounterReqRespRegisters
|
||||
:end-before: DOC include end: MyCounterReqRespRegisters
|
||||
@@ -131,7 +131,7 @@ change the protocol being used. For instance, in the first example in
|
||||
:ref:`Basic Usage`, you could simply change the ``TLRegisterNode`` to
|
||||
and ``AXI4RegisterNode``.
|
||||
|
||||
.. literalinclude:: ../../generators/example/src/main/scala/RegisterNodeExample.scala
|
||||
.. literalinclude:: ../../generators/chipyard/src/main/scala/RegisterNodeExample.scala
|
||||
:language: scala
|
||||
:start-after: DOC include start: MyAXI4DeviceController
|
||||
:end-before: DOC include end: MyAXI4DeviceController
|
||||
|
||||
Reference in New Issue
Block a user