Commit graph

1451 commits

Author SHA1 Message Date
Wanda 00699f7c41 lib.enum: allow using functional syntax for enum creation.
Fixes #910.
2023-10-21 05:46:12 +00:00
Wanda dacbd9dfb0 docs: upgrade Sphinx. 2023-10-20 15:47:56 +00:00
Catherine 7e254b8657 build.res: fix issue #937. 2023-10-20 15:08:10 +00:00
Wanda 1159e52921 tracer: recognize Python 3.13's CALL_KW opcode. 2023-10-20 14:45:11 +00:00
Nelson Gauthier bc316b41a8 lib.io: Pin.oe should have Flow.Out 2023-10-20 13:41:36 +00:00
Vegard Storheil Eriksen 392ead8d00 lib.data: return View from .const() 2023-10-10 09:59:37 +00:00
Catherine 7582ec301c CI: fix YoWASP cache key calculation. 2023-10-09 00:27:49 +00:00
Catherine ac68453fe4 CI: require tests to pass on 3.12, test on 3.13-dev. 2023-10-09 00:27:49 +00:00
Wanda 470477a88f lib.wiring: fix Component.signature on subclasses without annotations.
On Python <3.10, classes without annotations do not get an
`__annotations__` member at all, so the `getattr` on a subclass falls
back to the parent class `__annotations__`, attempting to create
signature members twice.  Fix that by looking at the `__dict__` instead.
2023-10-08 22:49:47 +00:00
Jean-François Nguyen c7da6c1292 lib.wiring: add Interface to __all__. 2023-10-05 14:11:38 +00:00
Wanda ccf7aaf00d sim._pyrtl: fix masking for bitwise operands and muxes.
Fixes #926.
2023-10-05 12:26:47 +00:00
Catherine cce4e4462e build.plat: allow removing src attributes from RTLIL output.
This is important for Glasgow, which uses RTLIL hash as cache key,
and expects it to be stable between CI jobs.
2023-10-05 01:51:20 +00:00
Wanda c9416674d1 hdl.mem: fix transparent read handling for simple write ports.
Fixes #922.
2023-10-03 09:39:32 +00:00
David SPORN 0c3ada6250 Reference to my series of articles 2023-09-28 09:51:48 +00:00
Nelson Gauthier 8c56b2033f lib.wiring: Remove superfluous method alias 2023-09-27 17:50:33 +00:00
Catherine ec9da2d4d6 lib.wiring: Component.signature should not be a class method.
While the capability of providing signatures for components that are not
parametric is useful, most Amaranth gateware is heavily parameterized,
and the capability is not worth making most subclasses Liskov-incompatible
with the base class (where the derived class would not provide `signature`
as a class method anymore).
2023-09-27 11:32:06 +00:00
Catherine a90bc7b91a lib.wiring: create flipped interface from flipped signature.
Fixes #914.

Co-authored-by: Nelson Gauthier <nelson.gauthier@gmail.com>
2023-09-27 11:17:29 +00:00
Catherine b871f2ad79 pyproject: use yowasp-yosys for tests.
This change means that tests will succeed even if the system Yosys binary is broken.
yices2 must still be present on the system.
2023-09-27 11:17:29 +00:00
Catherine fcafad1f70 hdl.ir: Elaboratable does not need ABCMeta as its metaclass.
This was introduced in commit 44711b7d, and was never used within
Amaranth itself. While technically a breaking change I think this
will not cause enough breakage to warrant a deprecation cycle
(nor can we make this a deprecation this without a lot of work).
2023-09-25 17:19:48 +00:00
Catherine 04b542a626 vendor._gowin: fix typo. 2023-09-25 14:15:11 +00:00
Catherine 57933b974d ast: fix pylance's type inference on Value._rhs_signals(). NFC 2023-09-25 14:15:11 +00:00
Catherine e6ec0be889 examples,docs: ensure amaranth-boards is available as a dev dependency. 2023-09-25 14:15:11 +00:00
Catherine d27681b157 vendor.GowinPlatform: account for rouding error in frequency calculation. 2023-09-25 08:41:49 +00:00
Catherine 47851c2328 vendor.GowinPlatform: fix fencepost error in oscillator range.
Python ranges are half-open (exclusive).
2023-09-25 08:41:49 +00:00
Catherine bfd62569c8 vendor.GowinPlatform: improve oscillator frequency diagnostic. 2023-09-25 08:41:49 +00:00
Wanda 05cb82b8fc ast: fix const-castable expression handling in Signal(reset=).
The code to accept const-castable expressions was previously added in
0c4fda92fe, but it was untested and had
a few bugs.

Fixes #911.
2023-09-24 02:46:43 +00:00
crzwdjk 11d5bb19eb vendor._lattice_ice40: add an icepack_opts override
Add an icepack_opts override in case the user wants to pass
extra options to icepack as part of the build process.
2023-09-13 20:05:01 +00:00
Catherine ecba1a1863 back.rtlil: put hierarchy in module name instead of an attribute.
The attribute sees essentially no use and the information is much
better served by putting it in the module name. In addition this
means that the entire tree can be renamed simply by renaming the top
module.

Tools like GTKWave show the names of the instances, not the modules,
so they are not affected by the longer names.
2023-09-13 12:46:46 +00:00
Catherine d32ca04326 pyproject: migrate to PDM build backend.
`.git_archival.txt` and the functionality of deriving SCM version
from a GitHub generated archive is removed pending implementation of
pdm-project/pdm-backend#194.
2023-09-12 01:40:48 +00:00
Catherine a9d03805ff lib.io: add a deprecation warning on Pin.eq.
This will stop working once `Pin` is no longer inheriting from
`Record`.
2023-09-05 14:07:33 +00:00
Catherine 1d3a62093b docs/changes: call out backwards incompatibility with Pin. 2023-09-05 14:07:33 +00:00
Catherine 6683c3a916 hdl.mem: fix INIT parameter of emitted $mem_v2 cell.
Unspecified memory slots are initialized to zero, not uninitialized.
2023-09-05 13:25:55 +00:00
Catherine c53eee961c back.rtlil: fix MEMID parameter to match $mem_v2 cell name. 2023-09-05 13:25:55 +00:00
Catherine 525c7e2be0 back.rtlil: do not translate empty subfragments at all.
It was thought previously (by me) that adding a wire that does
nothing to an empty subfragment is enough to prevent it from being
treated as a blackbox. This is enough for Yosys but not Vivado.
Another workaround could probably be used that satisfies both, but
instead let's just not translate any empty subfragments.

This doesn't account for the case of the empty toplevel, but that
does not seem worth addressing.

Fixes #899.
2023-09-05 06:29:57 +00:00
Catherine 4e078322a0 lib.io: make Pin an interface object.
Tracking #879.

The directions of signals in `Pin` make it convenient to use a pin
signature in a component, such as in:

    class LEDDriver(Component):
        pins: Out(Signature({"o": Out(1)}))

    led_driver = LEDDriver()
    connect(led_driver.pins, platform.request("led"))

The `platform.request` call, correspondingly, returns a flipped `Pin`
object.
2023-09-04 20:48:36 +00:00
Catherine 33c2246311 back.{verilog,rtlil}: in convert(), accept a Component without ports.
Closes #883.
2023-09-04 19:05:49 +00:00
Catherine 87fbcedecf lib.wiring: implement Signature.flatten. 2023-09-04 19:05:49 +00:00
Catherine f135226a79 hdl: disallow signed(0) values with unclear semantics.
Fixes #807.
2023-09-03 04:37:59 +00:00
Catherine 21b5451036 ast: ensure Part offset is unsigned.
Co-authored-by: Marcelina Kościelnicka <mwk@0x04.net>
2023-09-03 04:25:08 +00:00
Marcelina Kościelnicka 8c4a15ab92 hdl.mem: lower Memory directly to $mem_v2 RTLIL cell.
The design decision of using split memory ports in the internal
representation (copied from Yosys) was misguided and caused no end
of misery. Remove any uses of `$memrd`/`$memwr` and lower memories
directly to a combined memory cell, currently the RTLIL one.
2023-09-03 03:27:51 +00:00
Catherine fc85feb30d docs/changes: document deprecation of Record. 2023-09-01 06:48:28 +00:00
Catherine f28b20fc84 lib.wiring: ensure flipped(flipped(intf)) is intf. 2023-09-01 05:42:04 +00:00
Catherine 5a17f94fdc hdl.rec: deprecate in favor of lib.data and lib.wiring.
Tracking #879.
2023-09-01 04:20:16 +00:00
Catherine 7f1397b281 vendor/*: add missing __all__.
This broke code that did e.g.

    from amaranth.vendor.xilinx import *

which is common in amaranth-boards.
2023-09-01 01:30:46 +00:00
Catherine cd4ea96bd1 Implement RFC 19: Remove amaranth.lib.scheduler 2023-09-01 00:56:12 +00:00
Catherine b172d63160 docs/changes: minor cleanups and improvements. 2023-09-01 00:37:48 +00:00
Catherine 796068a192 Implement RFC 18: Reorganize vendor platforms 2023-09-01 00:37:48 +00:00
Catherine 88cbf30128 lib.wiring: use is for type comparison in Component.
This avoids running custom `__eq__` implementations, which could
cause issues such as #882.
2023-08-31 19:26:07 +00:00
Catherine 44d5fac01c lib.wiring: fix equality of FlippedSignature with other object.
Fixes #882.
2023-08-31 19:26:07 +00:00
Catherine cfd4f9c84e docs/enum: emphasize that shape= is optional. 2023-08-31 02:16:26 +00:00