From: Sebastien Bourdeauducq Date: Mon, 22 Jul 2013 14:47:49 +0000 (+0200) Subject: doc/bus/CSR: add automatic CSR name info X-Git-Tag: 24jan2021_ls180~2099^2~513 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=aef78b239571fb3d4d10c28e5395138d8e622dee;p=litex.git doc/bus/CSR: add automatic CSR name info --- diff --git a/doc/bus.rst b/doc/bus.rst index 9f99a230..03f864ce 100644 --- a/doc/bus.rst +++ b/doc/bus.rst @@ -52,6 +52,8 @@ The lowest-level description of a register is provided by the ``CSR`` class, whi * ``re``, which is the strobe signal for ``r``. It is active for one cycle, after or during a write from the bus. ``r`` is only valid when ``re`` is high. * ``w``, which must provide at all times the value to be read from the bus. +Names of CSRs can be omitted if they can be extracted from the variable name. When using this automatic naming feature, prefixes ``_``, ``r_`` and ``_r_`` are removed. + Compound CSRs (which are transformed into ``CSR`` plus additional logic for implementation) provide additional features optimized for common applications. The ``CSRStatus`` class is meant to be used as a status register that is read-only from the CPU. The user design is expected to drive its ``status`` signal. The advantage of using ``CSRStatus`` instead of using ``CSR`` and driving ``w`` is that the width of ``CSRStatus`` can be arbitrary. Status registers larger than the bus word width are automatically broken down into several ``CSR`` registers to span several addresses. Be careful that the atomicity of reads is not guaranteed.