Skip to content

Commit 6dc7c27

Browse files
committed
docs/guide: fix a bunch of TODOs.
1 parent 77e41cc commit 6dc7c27

File tree

1 file changed

+6
-19
lines changed

1 file changed

+6
-19
lines changed

docs/guide.rst

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,7 @@ Any Python value that implements the :class:`ShapeCastable` interface can extend
255255
Value casting
256256
=============
257257

258-
Like shapes, values may be *cast* from other objects, which are called *value-like*. Casting to values allows objects that are not provided by Amaranth, such as integers or enumeration members, to be used in Amaranth expressions directly. Values are value-like objects as well.
259-
260-
.. TODO: link to ValueCastable
258+
Like shapes, values may be *cast* from other objects, which are called *value-like*. Casting to values allows objects that are not provided by Amaranth, such as integers or enumeration members, to be used in Amaranth expressions directly. Custom value-like objects can be defined by implementing the :class:`~amaranth.hdl.ValueCastable` interface. Values are value-like objects as well.
261259

262260
Casting to a value can be done explicitly with :meth:`Value.cast`, but is usually implicit, since value-like objects are accepted anywhere values are.
263261

@@ -422,9 +420,7 @@ Signals :ref:`assigned <lang-assigns>` in a :ref:`combinatorial <lang-comb>` dom
422420
Reset-less signals
423421
------------------
424422

425-
Signals assigned in a :ref:`synchronous <lang-sync>` domain can be *resettable* or *reset-less*, specified with the ``reset_less=`` parameter. If the parameter is not specified, signals are resettable by default. Resettable signals assume their :ref:`initial value <lang-initial>` on explicit reset, which can be asserted via the clock domain or by using ``ResetInserter``. Reset-less signals are not affected by explicit reset.
426-
427-
.. TODO: link to clock domain and ResetInserter docs
423+
Signals assigned in a :ref:`synchronous <lang-sync>` domain can be *resettable* or *reset-less*, specified with the ``reset_less=`` parameter. If the parameter is not specified, signals are resettable by default. Resettable signals assume their :ref:`initial value <lang-initial>` on explicit reset, which can be asserted via the :ref:`clock domain <lang-clockdomains>` or by :ref:`modifying control flow <lang-controlinserter>` with :class:`ResetInserter`. Reset-less signals are not affected by explicit reset.
428424

429425
Signals assigned in a :ref:`combinatorial <lang-comb>` domain are not affected by the ``reset_less`` parameter.
430426

@@ -774,8 +770,6 @@ The ``.as_signed()`` and ``.as_unsigned()`` conversion operators reinterpret the
774770

775771
For example, ``(pc + imm[:7].as_signed()).as_unsigned()`` sign-extends the 7 least significant bits of ``imm`` to the width of ``pc``, performs the addition, and produces an unsigned result.
776772

777-
.. TODO: more general shape conversion? https://github.com/amaranth-lang/amaranth/issues/381
778-
779773

780774
.. _lang-muxop:
781775

@@ -993,8 +987,6 @@ Control flow
993987

994988
Although it is possible to write any decision tree as a combination of :ref:`assignments <lang-assigns>` and :ref:`choice expressions <lang-muxop>`, Amaranth provides *control flow syntax* tailored for this task: :ref:`If/Elif/Else <lang-if>`, :ref:`Switch/Case <lang-switch>`, and :ref:`FSM/State <lang-fsm>`. The control flow syntax uses :py:`with` blocks (it is implemented using :ref:`context managers <python:context-managers>`), for example:
995989

996-
.. TODO: link to relevant subsections
997-
998990
.. testcode::
999991

1000992
timer = Signal(8)
@@ -1133,8 +1125,6 @@ Case comparison, where a single value is examined against several different *pat
11331125
with m.Default():
11341126
m.d.comb += too_big.eq(1)
11351127

1136-
.. TODO: diagnostic for `Case` blocks after `Default`?
1137-
11381128
Within a single :py:`Switch` block, the statements within at most one block will be active at any time. This will be the first :py:`Case` block in the order of definition whose pattern :ref:`matches <lang-matchop>` the value, or the first :py:`Default` block, whichever is earlier.
11391129

11401130
If a :py:`Default` block is present, or the patterns in the :py:`Case` blocks cover every possible :py:`Switch` value, then the statements within exactly one block will be active at any time, and the sequence as a whole is called a *full condition*.
@@ -1275,9 +1265,7 @@ A combinatorial signal that is computed directly or indirectly based on its own
12751265
Synchronous evaluation
12761266
======================
12771267

1278-
Signals in synchronous :ref:`control domains <lang-domains>` change whenever the *active edge* (a 0-to-1 or 1-to-0 transition, configured when :ref:`creating the domain <lang-clockdomains>`) occurs on the clock of the synchronous domain. In addition, the signals in clock domains with an asynchronous reset change when such a reset is asserted. The final value of a synchronous signal is equal to its :ref:`initial value <lang-initial>` if the reset (of any type) is asserted, or to its current value updated by the :ref:`active assignments <lang-active>` in the :ref:`assignment order <lang-assignorder>` otherwise. Synchronous signals always hold state.
1279-
1280-
.. TODO: link to clock domains
1268+
Signals in synchronous :ref:`control domains <lang-domains>` change whenever the *active edge* (a 0-to-1 or 1-to-0 transition, configured when :ref:`creating the domain <lang-clockdomains>`) occurs on the clock of the synchronous domain. In addition, the signals in :ref:`clock domains <lang-clockdomains>` with an asynchronous reset change when such a reset is asserted. The final value of a synchronous signal is equal to its :ref:`initial value <lang-initial>` if the reset (of any type) is asserted, or to its current value updated by the :ref:`active assignments <lang-active>` in the :ref:`assignment order <lang-assignorder>` otherwise. Synchronous signals always hold state.
12811269

12821270
Consider the following code:
12831271

@@ -1337,7 +1325,9 @@ A clock domain also has a reset signal, which can be accessed through the :attr:
13371325

13381326
m.domains.startup = ClockDomain(reset_less=True, local=True)
13391327

1340-
If a clock domain is defined in a module, all of its submodules can refer to that domain under the same name.
1328+
Signals in a reset-less clock domain can still be explicitly reset using the :class:`ResetInserter` :ref:`control flow modifier <lang-controlinserter>`.
1329+
1330+
If a clock domain is defined in a module, all of its :ref:`submodules <lang-submodules>` can refer to that domain under the same name.
13411331

13421332
.. warning::
13431333

@@ -1353,9 +1343,6 @@ If a clock domain is defined in a module, all of its submodules can refer to tha
13531343

13541344
A new asynchronous control set is necessary when some signals must change on a different active edge of a clock, at a different frequency, with a different phase, or when a different asynchronous reset signal is asserted.
13551345

1356-
.. TODO: mention that ResetInserter will add a reset even to a reset-less domain
1357-
.. TODO: link to hierarchy section
1358-
13591346

13601347
.. _lang-latesignals:
13611348

0 commit comments

Comments
 (0)