Commit graph

1199 commits

Author SHA1 Message Date
Catherine 58721ee4fe hdl: implement constant-castable expressions.
See #755 and amaranth-lang/rfcs#4.
2023-02-27 22:38:38 +00:00
Catherine bef2052c1e hdl.ast: implement Value.__pos__. 2023-02-27 22:31:17 +00:00
Catherine 342fd5f8bd docs: fix doctests and run them in CI workflow. 2023-02-27 19:47:51 +00:00
Catherine 5d872096a7 docs/changes: link to RFC. 2023-02-27 18:28:52 +00:00
Catherine f602ce1f8f hdl.ast: deprecate Const.normalize.
Tracking issue #754.
2023-02-27 18:19:59 +00:00
Catherine fcc4f54367 lib.data: make Field() immutable.
Mutability of Field isn't specified by the RFC and can cause issues
if the objects stored in Layout subclasses are mutated. There isn't
any reason to do that (the subclasses themselves are mutable and
handle that correctly), so disallow it.
2023-02-21 17:58:28 +00:00
Catherine e2f0519774 docs: upgrade Sphinx. 2023-02-17 09:59:19 +00:00
Catherine 12a81f24bd docs/install: pip>=23.0 is required.
Fixes #745.
2023-02-16 22:09:14 +00:00
Catherine ca77de5ed3 docs/install: update deprecated pip syntax.
Fixes #750.
2023-02-16 20:41:31 +00:00
Catherine 7e3e10e733 lib.data: implement RFC 1 "Aggregate data structure library".
See amaranth-lang/rfcs#1.
2023-02-15 10:10:01 +00:00
Jean THOMAS a7fec279aa
hdl,back: add support for name= in property checks (Assert, ...).
Co-authored-by: Jean THOMAS <virgule@jeanthomas.me>
2023-02-12 11:21:31 +00:00
Catherine 666ee27fd0 build.run: ensure shell script is run with /bin/sh.
Fixes #665.
2023-02-06 17:08:39 +00:00
Catherine dafefa87a9 build.run: in BuildPlan.execute_local, always use LF line endings.
This way the files are written identically on *nix and Windows.

Fixes #732.
2023-02-04 23:31:34 +00:00
Catherine a704b1b218 vendor.xilinx: update build script template for prjxray. 2023-02-03 06:09:56 +00:00
Catherine fadc5ae4ca CI: update outdated actions. 2023-02-03 03:47:21 +00:00
Catherine 897400ee59 pyproject: relax amaranth-yosys dependency. 2023-02-03 02:40:25 +00:00
Catherine 37623c69a0 Configure git-archive to export information for setuptools_scm.
This requires git>=2.32.0.
2023-02-02 23:43:33 +00:00
Catherine 732d62eb24 Move most of setup.py to pyproject.toml.
The custom setuptools_scm configuration is removed. It was buggy (for
the case of a dirty worktree exactly at the tag, it did not append
`+dirty`) and otherwise is only different from node-and-timestamp by
appending `.dirty` instead of `.dYYYYMMDDHHMMSS`. The latter is
preferable anyway.
2023-02-02 23:21:16 +00:00
Catherine cd7dfeee31 CI: add 3.12-dev. 2023-02-02 19:46:19 +00:00
Catherine 9102738274 Update authorship notice. 2023-01-31 21:51:43 +00:00
Catherine 5a79c351e3 Remove features deprecated in version 0.3. 2023-01-31 21:38:27 +00:00
Catherine 47551e8c71 Add PEP 518 pyproject.toml.
See also commits:
 * 7fca037f (adding it)
 * 416b2531 (reverting it)
 * a2ef4cb6 (adding it)
 * 810c19dd (reverting it)

Third time's the charm?
2023-01-31 19:48:54 +00:00
Catherine 7bf15bc466 back.rtlil: do not add src attribute to cases if emit_src=False.
Fixes #706.
2023-01-31 19:10:32 +00:00
Catherine de8846ea84 Update README. 2023-01-31 18:41:06 +00:00
Catherine 7044e09110 hdl.ast: remove Shape<>tuple comparisons.
See #691.

I missed this in commit 29502442.
2023-01-31 15:23:06 +00:00
Catherine f133646e9b Remove all remaining code references to nmigen and the namespace.
Closes #741.
2023-01-31 13:49:13 +00:00
Catherine 29502442fb hdl.ast: remove Shape<>tuple casts.
Closes #691.
2023-01-31 12:58:29 +00:00
Catherine 309f647c0e Update documentation and changelog to reflect existing changes. 2023-01-31 12:57:44 +00:00
Catherine aaec7e0d27 tracer: return default name on unrecognized opcode.
The default name is more commonly returned on code such as:

    x, y = Signal(), Signal()

The case where the opcode is not recognized is only encountered
when older Amaranth is ran on a newer Python interpreter (with more
opcodes).

Returning None instead of a name here caused issues in the RTLIL
backend, which would incorrectly use $\d+ names for ports, since
the RTLIL backend assumed the name of a signal is always a string.

Fixes #733.
2023-01-31 10:34:57 +00:00
Catherine 2ca421dea8 back.rtlil: add assertions guarding against $\d+ port names.
See #733.
2023-01-31 10:34:57 +00:00
Bastian Löher 64b96e143b
vendor.xilinx: Add support for more parts when using Symbiflow. 2023-01-23 19:26:58 +00:00
Arusekk de6b69370f hdl.ast: Do not warn on int Enums in Cat.
This aligns with the behavior for plain Enums.
2023-01-22 23:40:39 +00:00
Arusekk 58a0c68279 hdl.ast: allow typed int enums in Value.cast. 2023-01-22 23:40:39 +00:00
J. Neuschäfer 91d4513682
Fix several typos. NFC. 2023-01-20 19:48:29 +00:00
Bastian Löher 427c82fcbc
hdl.ast: handle Repl in ValueKey.
Fixes #735.
2023-01-16 23:16:37 +00:00
Gwenhael Goavec-Merou e3b2ba4316
vendor.xilinx: add support for Xray-based toolchain. 2022-12-13 20:09:57 +00:00
Bastian Löher 0a1ba22050
vendor.xilinx: update symbiflow toolchain scripts. 2022-12-01 20:00:48 +00:00
Adam Greig af7c11441d Use all-uppercase toolchain_env_var names.
Accepts previous case for backwards compatibility.

Fixes #728.
2022-11-16 02:37:53 +00:00
Emil J db24a14b57
lib.coding: remove GrayDecoder apparent comb loop for consistency 2022-11-03 11:51:26 +00:00
Robert Baruch beb1b38c1a
doc: update tutorial links (to Amaranth versions). 2022-10-27 23:04:56 +00:00
Marcelina Kościelnicka f6385bc57a CI: change Python 3.11-dev to 3.11. 2022-10-27 20:00:16 +00:00
Marcelina Kościelnicka a9f1c35cb1 _toolchain.cxx: fix use of distutils.ccompiler on newer setuptools.
Starting with setuptools 64.0.2, the monkeypatching process performed as
part of its bootstrap no longer imports distutils.ccompiler, causing an
AttributeError.
2022-10-27 10:16:25 +00:00
Alan Vekselman 9857039a6b hdl.ast: fix non-existing variable in SignalKey.__lt__ 2022-10-05 23:53:33 +00:00
Jin Xue 3a51b61284
sim._pyrtl: translate ArrayProxy to pattern matching when supported.
Current the value compiler translates ArrayProxy into if-elif trees 
which can cause the compiler to crash due to deep recursion (#359).

After this commit, it instead translates them into pattern matching 
when it is supported (on Python >= 3.10) to avoid this problem.
2022-09-24 10:22:47 +00:00
Mrmaxmeier c4be739d48 sim._pyrtl: work around Python's new integer-string conversion limits
Formatting large ints to decimal raises an ValueError in Python versions
that include a mitigation for CVE-2020-10735. Formatting to hexadecimal
instead avoids the algorithmic complexity and is not impacted by the
new conversion limits.

Note that the simulator already rejects very large values, but the
integer-string conversion limits trigger in cases that previously
worked.
2022-09-24 07:40:15 +00:00
Catherine da26f1c915 hdl,back,sim: accept .as_signed() and .as_unsigned() on LHS.
These operators are ignored when they are encountered on LHS, as
the signedness of the assignment target does not matter in Amaranth.
.as_signed() appears on LHS of assigns to signed aggregate fields.
2022-09-24 07:19:47 +00:00
Catherine 90fcbfc357 hdl.ast: improve style of {Shape,Value}Castable doc. NFC. 2022-09-24 07:19:32 +00:00
Catherine bf16acf2f0 hdl.ast: implement ShapeCastable (like ValueCastable).
Refs #693.
2022-09-24 07:19:03 +00:00
Catherine 0723f6bac9 hdl.ast: recursively cast ValueCastable objects to values. 2022-09-24 07:18:57 +00:00
Catherine 3b799481f7 CI: fix build on Python 3.17. 2022-09-24 06:46:28 +00:00