Commit graph

1173 commits

Author SHA1 Message Date
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
Marcelina Kościelnicka db49294cf7 Add Python 3.11 to the CI matrix. 2022-06-30 18:20:18 +00:00
Marcelina Kościelnicka 851546bf2d tracer: add Python 3.11 support. 2022-06-30 18:20:18 +00:00
Catherine 8b85afa72e docs/changes: document OSCH available as default clock source. 2022-04-06 04:18:40 +00:00
jreyesr 9b8354e137
vendor.lattice_machxo_2_3l: add support for the internal oscillator, OSCH. 2022-04-06 04:12:52 +00:00
Irides f39ee6e014 docs/changes: document addition of debug_verilog override. 2022-04-06 00:57:19 +00:00
Irides ee9da63287 build/plat: implement an override disabling debug Verilog generation.
Currently debug Verilog generation can take many 10's of seconds.
A new override can now be passed as `AMARANTH_debug_verilog`=0 on
the environment or by setting the `debug_verilog` keyword argument
to `Platform.build()` or `Platform.prepare_toolchain()` to `False`.

Fixes #623.
2022-04-05 23:09:43 +00:00
Irides 9eb208c332 build/plat: improve handling of get_override().
The existing functionality of get_override was poorly specified and
ill-purposed for boolean flags. This change extracts the core
variable retrieval logic to a helper function and adds a new handler
`get_override_flag` which special cases boolean flags.

The new behavior will also perform type checking on kwargs and inform
the user of the desired type expected.
2022-04-05 23:09:43 +00:00
Catherine 07c6ea5af2 CI: test on PyPy 3.7 v7.3.3. 2022-04-04 09:49:10 +00:00
Catherine 64771a065a Drop support for Python 3.6. 2022-04-04 09:39:28 +00:00
Catherine 9a5a6142d9 setup: relax pyvcd version constraint to >=0.2.2,<0.4.
Fixes #690.
2022-04-04 09:21:11 +00:00
Irides 85d56a74a5 build.plat,setup: fix Jinja2 dependency.
Jinja2 version 2.11 has a broken dependency constraint that allows its
dependency on markupsafe to pull in a version that it is not actually
compatible with the interface of. Fix this by upgrading the dependency
to `~=3.0`. This requires a small patch to the code to replace the
deprecated `@jinja2.contextfunction` decorator with the replacement
`@jinja2.pass_context`since `@jinja2.contextfunction` is removed in
Jinja2 version 3.1.0.
2022-03-30 21:38:58 +00:00
Jean-François Nguyen f6253b3851 build.plat: use tool_env_var() in _toolchain_env_var. 2022-03-29 21:04:51 +00:00
Catherine 1f1d189441 build.run: pipeline SFTP operations to improve performance. 2022-03-17 05:38:58 +00:00
Catherine 4dea0b2d0f vendor.lattice_ecp5: on Diamond, only emit attributes if there are any. 2022-03-12 13:25:00 +00:00
Bastian Löher 02364a4fd7 sim: Fix clock phase in add_clock having to be specified in ps. 2022-02-04 16:46:52 +00:00
Alyssa Rosenzweig c83b51db6d back.verilog: Fix strip_internal_attrs
Fix the strip_internal_attrs parameter to verilog.convert by passing it
down the call stack as intended.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2022-01-27 06:42:59 +00:00
Tobias Müller c6dc08cbdd
setup: loosen dependency on Jinja2 version. 2022-01-17 19:28:46 +00:00
Catherine 7d611b8fc1 docs: update sphinxcontrib-platformpicker. 2022-01-02 05:19:50 +00:00
Catherine 4ae75c117f docs/tutorial: remove dead link. 2022-01-02 04:41:33 +00:00
Irides 5a4d45b599
back.rtlil: avoid sync process emission in RTLIL.
Avoiding emission of sync processes in RTLIL allows us to avoid a dependency on
matching the behavior expected by Yosys, which generally expects sync processes
in RTLIL to match those emitted by the output from its own Verilog parser.
This also simplifies the logic used in emitting RTLIL overall.

Combinatorial processes are still emitted however. Without these the RTLIL does
not have a high-level understanding of Switch statements, which significantly
diminishes the quality of emitted Verilog, as these are converted to `$mux`
cells in Yosys, which become `?` constructs when converted back to Verilog.

Fixes #603.
Fixes #672.
2022-01-01 18:18:33 +00:00
Catherine aa749567e4 docs: update sphinx-rtd-theme.
Incorporate the fix for readthedocs/sphinx_rtd_theme#1168.
2021-12-28 20:43:15 +00:00
Catherine 39a83f4d99 setup: fix documentation URL for releases. 2021-12-16 18:02:11 +00:00
Catherine e2b3e8caf9 CI: publish documentation at https://amaranth-lang.org/docs/amaranth/ 2021-12-16 17:51:53 +00:00
Catherine a243e0443e CI: publish documentation for tagged commits. 2021-12-16 17:46:01 +00:00
Catherine e156ac62c5 docs: don't call Python modules "packages". 2021-12-16 17:46:01 +00:00
Irides 538c14116c sim.pysim: use "bench" as a top level root for testbench signals.
Fixes #561.
2021-12-16 15:46:05 +00:00