Commit graph

30 commits

Author SHA1 Message Date
Jean-François Nguyen 496432edaa Implement RFC 30: Component metadata.
Co-authored-by: Catherine <whitequark@whitequark.org>
2024-05-10 13:17:24 +00:00
Catherine 3c6f46717b lib.wiring: allow reset-less signals in interfaces.
This check was originally added out of abundance of caution, but since
then it was observed that reset-less-ness is purely an implementation
detail (see #1220), and furthermore it interferes with adaptation of
`FIFOInterface`` signals (where `[rw]_data` are reset-less) for RFC 61.
2024-04-03 12:01:48 +00:00
Catherine 11ec35d258 lib.wiring: remove unnecessary flipping in Signature.flatten. 2024-03-15 10:35:50 +00:00
Amelia Cuss a586df89ad lib.wiring.connect: diagnostic when no connection made.
If a connect() call results in no connections being made, and it's
because there were no outputs specified at all, issue an error.
Tests enumerate cases per
https://github.com/amaranth-lang/amaranth/pull/1153#issuecomment-1962810678.

Co-authored-by: Catherine <whitequark@whitequark.org>
2024-02-25 09:33:46 +00:00
Wanda 24a392887a Implement RFC 43: Rename reset= to init=. 2024-02-15 22:52:24 +00:00
Wanda 0da439cce1 hdl._ast: deprecate ValueCastable.lowermethod. 2024-02-13 05:06:06 +00:00
Wanda 45dbce13df hdl: consistently use "comb" for combinatorial domain.
Fixes #1097.
2024-02-09 19:32:55 +00:00
Wanda 6e06fc013f hdl.ir: associate statements with domains.
Fixes #1079.
2024-02-09 05:33:16 +00:00
Catherine 5dd1223cf8 amaranth.hdl: start all private names with an underscore.
This change completes commit 9dc0617e and makes all the tests pass.
It corresponds with the ongoing langauge reference documentation effort.

Fixes #781.
2024-01-30 17:20:45 +00:00
Catherine a2aa07cbc7 lib.wiring: document amaranth-lang/rfcs#2. WIP
Co-authored-by: Charlotte <charlotte@hrzn.ee>
2023-12-11 22:57:30 +00:00
Jean-François Nguyen d154bddf17 lib.wiring: preserve insertion order in SignatureMembers.__iter__. 2023-12-11 22:34:57 +00:00
Wanda 8e6ae9e6e0 Implement RFC 38: Component signature immutability.
Fixes #996.
2023-12-11 19:51:32 +00:00
Wanda 6ad0d21cc9 Implement RFC 37: Make `Signature` immutable.
Fixes #995.
2023-12-11 19:01:32 +00:00
Catherine b9c2404f22 lib.wiring: make values of In and Out be strings "In" and "Out".
Their `str()` and `repr()` values are already that; and the 0 and 1
don't make sense. The RFC leaves it unspecified.
2023-12-11 18:04:37 +00:00
Wanda 422ba9ea51 lib.wiring: use tracer to obtain default Signature path and src_loc.
Fixes #987.
2023-12-07 21:50:34 +00:00
Catherine 120375dabe lib.wiring: fix __repr__ for PureInterface subclasses.
Fixes #988.
2023-12-05 04:46:11 +00:00
Wanda 0cdcab0fbb Implement RFC 34: Rename amaranth.lib.wiring.Interface to PureInterface. 2023-12-04 21:41:47 +00:00
Wanda ab6503e352 lib.wiring: add __repr__ to Interface. 2023-12-03 02:00:20 +00:00
Catherine 04f906965a lib.wiring: in is_compliant(sig, obj), check that obj is an interface object with that signature.
Fixes #935.
2023-11-27 18:50:41 +00:00
Catherine 8b48af6de8 lib.wiring: make sig.members += actually work. 2023-11-27 15:42:24 +00:00
Catherine a2e87b370e lib.wiring: fix typo in Signature.flatten. 2023-11-27 15:42:24 +00:00
Catherine 74e613b49d lib.wiring: expand flipped object forwarding to respect @property and del.
Although `@property` is the most common case, any descriptors are now
properly supported.

The special casing of methods goes away as they work by having functions
implement the descriptor protocol. (`__get__` has some special behavior
to make this possible.)

This is some of the most cursed code I have ever written, yet it is
obviously necessary.
2023-11-26 12:53:59 +00:00
William D. Jones abd74ead55 lib.wiring: flip sub-interfaces accessed via FlippedInterface. 2023-11-22 03:07:41 +00:00
Wanda e53d78474f test_lib_wiring: squash UnusedElaboratable warnings. 2023-10-24 20:18:16 +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
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 87fbcedecf lib.wiring: implement Signature.flatten. 2023-09-04 19:05:49 +00:00
Catherine f28b20fc84 lib.wiring: ensure flipped(flipped(intf)) is intf. 2023-09-01 05:42:04 +00:00
Catherine 44d5fac01c lib.wiring: fix equality of FlippedSignature with other object.
Fixes #882.
2023-08-31 19:26:07 +00:00
Catherine 4ffadff20d lib.wiring: implement amaranth-lang/rfcs#2.
Co-authored-by: Charlotte <charlotte@lottia.net>
2023-08-22 16:22:09 +00:00