sim: document.

This commit includes additional non-documentation changes, related to
issues found while documenting it:
- `Simulator.run_until()` no longer accepts a `run_passive=` argument.
  Passive no longer exist and in any case defaulting to `False` does not
  make a lot of sense from an API perspective.
- `add_clock()`'s `phase=` argument, when specified, no longer has
  `period/2` added to it. This wasn't the documented behavior in first
  place and it makes no sense to do that.
- `add_clock()` raises a `NameError` if a clock domain does not exist,
  instead of `ValueError`.
- `add_clock()` raises a `DriverConflict` if a clock domain is already
  being driven by a clock, instead of `ValueError`.
- GTKWave is no longer a part of the installation instructions, and both
  Surfer and GTKWave are recommended (in this order).
This commit is contained in:
Catherine 2024-05-29 15:57:16 +00:00
parent 3c1060f7c7
commit 7870eb344b
16 changed files with 1181 additions and 224 deletions

View file

@ -171,21 +171,35 @@ However, the memory read port is also configured to be *transparent* relative to
Simulation
==========
++++++++++
.. todo::
There are two ways to interact with a memory array in a simulator: requesting a read and/or write port that is used only in a testbench, or directly reading and writing memory contents. In most cases, directly accessing memory contents using :meth:`MemoryData.__getitem__ <amaranth.hdl.MemoryData.__getitem__>` is more convenient.
This section will be written once the simulator itself is documented.
For example, this :doc:`testbench </simulator>` will clear the least significant bit of every memory row:
.. testcode::
async def testbench(ctx):
for index in len(memory.data):
ctx.set(memory.data[index], ctx.get(memory.data[index]) & ~1)
Memory description
==================
.. autoexception:: amaranth.hdl.AlreadyElaborated
:noindex:
:noindex:
..
:canonical: amaranth.hdl.AlreadyElaborated
(not available until `amaranth.hdl` documents it)
.. autoclass:: amaranth.hdl.MemoryData
..
:canonical: amaranth.hdl.MemoryData
(not available until `amaranth.hdl` documents it)
Memory component
================