Charlotte
f4b013ac73
lib.data: no loop required, we return or die.
2023-07-02 05:31:42 +00:00
Charlotte
cdf8fcc32f
lib.enum: allow import * from amaranth.lib.enum
.
...
There's an actual `py_enum.member` (which we briefly overwrite our loop
index with (!)). We delete our `member`, but it's still in the
`__all__` that came from `py_enum`, so `import *` fails.
2023-06-29 04:24:38 +00:00
Adam Greig
45b9730786
Implement RFC 6: CRC Generator
...
See amaranth-lang/rfcs#6 and #681 .
2023-06-29 02:42:47 +00:00
Charlotte
60c2a1b4b8
sim._pyrtl: don't blow parser stack on older Pythons.
...
Python pre-3.9 can't handle parentheses nested this deeply.
* https://github.com/amaranth-lang/amaranth/pull/681 -- motivating
example.
* https://github.com/amaranth-lang/amaranth/pull/827 -- what added
enough extra parentheses to make this only break now.
* https://peps.python.org/pep-0617/ -- new parser as of 3.9.
2023-06-29 01:28:44 +00:00
Charlotte
fd4e25df42
test_sim: failing test case.
2023-06-29 01:28:44 +00:00
Catherine
b77e33f16a
Drop support for Python 3.7.
2023-06-28 14:50:30 +00:00
Charlotte
99417d6499
sim._pyrtl: mask bitwise binary operands.
...
Boolean negation produces negative integers, which when unmasked
drastically affects the result of these operations.
2023-06-24 06:34:48 +00:00
Charlotte
59a83cf7eb
test_sim: add failing test case for bitwise binary ops.
...
See https://github.com/amaranth-lang/amaranth/pull/826#event-9609577585 .
2023-06-24 06:34:48 +00:00
Charlotte
4ec9cbbffe
sim._pyrtl: py3.12+: convert to int before bitwise negating.
...
Amaranth bitwise negation `~` compiles to Python bitwise negation `~` in
simulation; the same holds for comparison operators such as `==`. Thus
an expression such as `~(a == b)` in simulation will compile to Python
that takes the bitwise negation of the comparison result, which will be
an actual bool.
On 3.12, the result is a `DeprecationWarning` emitted only at simulation
run-time.
When negating in simulation, coerce the value to an int. `mask` is
sufficient as we do no further arithmetic here.
2023-06-22 17:37:30 +00:00
Charlotte
63f9976267
tests.test_sim.SimulatorRegressionTestCase.test_bug_588: fix for Windows paths.
2023-06-22 03:52:55 +00:00
Charlotte
d218273b9b
hdl.ast: deprecate Repl
and remove from AST; add Value.replicate
.
2023-06-22 03:52:55 +00:00
Marcelina Kościelnicka
b1cce87630
hdl.ast: make Value.__abs__
return unsigned shape.
2023-06-07 23:20:26 +00:00
Marcelina Kościelnicka
51391be1ae
hdl.ast: ensure Value.cast
in Part
and Slice
constructors.
2023-06-07 19:53:16 +00:00
Marcelina Kościelnicka
1b0fb1afbc
hdl.ast: fix src_loc
for Slice
.
2023-06-07 19:52:14 +00:00
Marcelina Kościelnicka
3d3846e996
hdl.ast: fix ValueKey.__eq__
.
2023-06-07 15:32:21 +00:00
Catherine
20db537162
CI: add PyPy3.8 and PyPy3.9.
2023-06-07 14:51:46 +00:00
Catherine
46433268cd
docs/changes: update.
2023-06-07 13:50:04 +00:00
Marcelina Kościelnicka
1d5e090580
hdl.ast: fix shape for subtraction.
...
Fixes #813 .
2023-06-07 12:34:30 +00:00
Marcelina Kościelnicka
3180a17fd9
hdl.ast: fix Slice
validation.
...
Fixes #810 .
2023-06-07 12:26:36 +00:00
Marcelina Kościelnicka
c7984463c7
hdl.ast: fix range handling in Shape.cast
.
...
Fixes #803 .
2023-06-07 12:26:30 +00:00
Catherine
fcbc8bd46f
CI: enable building merge queue.
2023-06-07 13:22:38 +01:00
Marcelina Kościelnicka
a6e33abc5f
hdl.ast: guard rotate_*
against 0-width values.
...
Fixes #808 .
2023-06-07 12:12:24 +01:00
Marcelina Kościelnicka
656db317d2
hdl.ast: fix signed Const
normalization.
...
Fixes #805 .
2023-06-07 11:22:52 +01:00
psentee
0681cb77b1
pyproject: relax pyvcd requirement to include 0.4.
...
The only breaking change in 0.4 is dropping support for Python 3.6,
which Amaranth has already dropped. It also adds official support for
3.10 and 3.11.
3ad7340072/CHANGELOG.rst
2023-06-04 19:42:05 +00:00
Catherine
a4402b507f
hdl.dsl: py3.12+: turn off heuristic warning on ~True
and ~False
.
...
There is now an upstream deprecation warning for the same.
We don't have to duplicate it.
2023-06-02 13:45:15 +01:00
Catherine
58b8acac0d
_toolchain.cxx: remove.
...
This is causing issues on Python 3.12 and in any case should be
based on the Python `ziglang` package instead of this cursed
setuptools hack.
2023-06-02 13:45:15 +01:00
Marcelina Kościelnicka
c343e879d3
tracer: fix STORE_DEREF handling, add EXTENDED_ARG support.
...
This fixes the following issues:
- on Python 3.10 and earlier, storing to free variables is now handled
correctly
- on Python 3.11, `_varname_from_oparg` is now used, fixing problems
with cell variables that are also arguments
- on all supported versions, EXTENDED_ARG is now parsed, ensuring proper
handling for long functions
Fixes #792 .
2023-06-01 19:18:43 +01:00
Catherine
2a45d0e9ad
lib.data: warn if a field is shadowed by an attribute of the view.
...
Fixes #796 .
2023-05-31 13:27:20 +01:00
Catherine
f96604f667
lib.data: make all layouts immutable.
...
This is actually an existing correctness requirement (for the similar
reasons that ValueCastable.as_value() must always return the same
value every time) that for some reason wasn't respected.
2023-05-23 23:19:29 +01:00
Catherine
52b9d3f799
Implement RFC 15: Lifting shape-castable objects.
...
See amaranth-lang/rfcs#15 and #784 .
Note that this RFC breaks the existing syntax for initializing a view
with a new signal. Instances of `View(layout)` *must* be changed to
`Signal(layout)`.
2023-05-23 12:37:21 +01:00
Catherine
8af90620c0
CI: fix the document action for divergent branches.
...
This was never intended to merge anything.
2023-05-22 21:37:01 +01:00
Catherine
7d99981d57
Implement RFC 15: Lifting shape-castable objects.
...
See amaranth-lang/rfcs#15 and #784 .
Note that this RFC breaks the existing syntax for initializing a view
with a new signal. Instances of `View(layout)` *must* be changed to
`Signal(layout)`.
2023-05-15 19:42:12 +01:00
Jean-François Nguyen
e9975587bf
build.plat: replace -+ characters in _all_toolchain_env_vars.
...
Mixed-case variables are allowed since af7c1144
, but '-' or '+' must be
replaced to avoid invalid names (e.g. "$AMARANTH_ENV_oss-cad-suite").
2023-05-15 18:25:49 +01:00
Catherine
a70cfa05cd
lib.data: fix incorrect and very misleading example in documentation.
...
Found while working on amaranth/rfcs#15 . The new code is also robust
in the face of RFC 15 itself (the value returned by Signal will change
but that will save work for the programmer).
2023-05-15 10:55:44 +01:00
Catherine
54d5c4c047
Implement RFC 9: Constant initialization for shape-castable objects.
...
See amaranth-lang/rfcs#9 and #771 .
2023-05-12 23:41:57 +01:00
Catherine
ea5a150155
lib.data: fix documentation style. NFC
2023-05-12 23:41:57 +01:00
Catherine
7166455a6a
lib.data: implement extensibility as specified in RFC 8.
...
See amaranth-lang/rfcs#8 and #772 .
2023-05-12 20:03:08 +01:00
Catherine
68e292c681
lib.data: add reference documentation.
2023-05-12 19:54:47 +01:00
Catherine
a5ffa38e64
CI: fix publish-docs job.
2023-05-12 17:31:23 +00:00
Catherine
61a8f21319
CI: simplify publish-docs job.
2023-05-12 18:22:36 +01:00
Catherine
2d379d0010
CI: publish docs to GitHub pages in forks, per branch.
...
This is useful for previewing how documentation renders in a PR.
2023-05-12 18:22:36 +01:00
Catherine
4f70cd6294
CI: split document and publish steps, and skip publish in forks.
2023-05-12 18:22:36 +01:00
Catherine
4398575322
lib.enum: accept any const-castable expression as member value.
...
This behavior was introduced by amaranth-lang/rfcs#4. See #755 .
2023-05-12 16:39:02 +01:00
Catherine
bf8bbb0f63
lib.enum: check member value shapes before subclassing. NFCI
...
This commit is a preparation for accepting const-castable expressions
as enum member values.
See #755 .
2023-05-12 16:39:02 +01:00
Catherine
5f6b36e91f
Add a workaround for python-poetry/poetry#7702 .
2023-03-22 10:37:06 +00:00
Catherine
46e0a00a08
Add a workaround for setuptools erroring out on stale git checkouts.
2023-03-22 02:09:43 +00:00
Arusekk
5f094a23eb
hdl.ast: Test *Castable subclasses on definition.
...
The __init_subclass__ method fires on class definition rather than use.
It also has the bonus impact that no __new__ method is defined, so the
classes can be correctly detected as mix-in classes by modules such as
enum.
2023-03-21 23:22:47 +00:00
Josuah Demangeon
a0307c343d
docs: disambiguate Cat(a, b, ...) support for more than 2 arguments
...
I had this confusion while reading the doc.
Someone else also likely did:
https://github.com/bl0x/learn-fpga-amaranth/blob/main/06_alu/soc.py#L111
2023-03-21 14:16:27 +00:00
Catherine
80343d1c4c
hdl.ast: warn on fencepost error in Signal(range(x), reset=x)
.
...
Also, relax the language reference inset from "warning" to "note"
since this is no longer something developers have to keep in mind
explicitly.
2023-03-13 20:38:41 +00:00
Catherine
32eabd9372
hdl.ast: remove Value.__hash__
.
...
This is already undefined when defining `Value.__eq__`, and it makes
typecheckers (mypy, pyright/pylance) unhappy.
2023-03-06 19:44:53 +00:00