-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to Amaranth 0.5 #278
Conversation
20f58e7
to
0ac7d28
Compare
I think this is ready for review now. I decided to drop the I also decided to skip porting away from Otherwise it's all fairly simple changes from the list here: https://amaranth-lang.org/docs/amaranth/latest/changes.html#migrating-from-version-0-4 |
luna/gateware/debug/ila.py
Outdated
@@ -77,7 +78,7 @@ def __init__(self, *, signals, sample_depth, domain="sync", sample_rate=60e6, sa | |||
# | |||
# Create a backing store for our samples. | |||
# | |||
self.mem = Memory(width=self.sample_width, depth=sample_depth, name="ila_buffer") | |||
self.mem = Memory(shape=Shape(self.sample_width), depth=sample_depth, init=[]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not necessary to explicitly construct a Shape
here, any shape-like can be used, and since that includes integers, you can simply just pass shape=self.sample_width
. shape
is effectively a superset of the old width
argument.
This goes for the other Memory
instances in this commit as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, thanks!
We're also going to need a smol change to diff --git a/luna/gateware/usb/request/windows/ms_descriptor.py b/luna/gateware/usb/request/windows/ms_descriptor.py
index b89f188..a6b5493 100644
--- a/luna/gateware/usb/request/windows/ms_descriptor.py
+++ b/luna/gateware/usb/request/windows/ms_descriptor.py
@@ -184,7 +184,7 @@ class GetMicrosoftDescriptorHandlerBlock(Elaboratable):
rom_content, descriptor_max_length, max_index, min_index = self.generate_rom_content()
m.submodules.rom = rom = Memory(shape=32, depth=len(rom_content), init=rom_content)
- rom_read_port = rom.read_port(transparent=False)
+ rom_read_port = rom.read_port()
# Create convenience aliases to the upper and lower half of the ROM.
rom_upper_half = rom_read_port.data.word_select(1, 16) Amaranth 0.5 read ports are now not transparent by default, with transparency being set with the read_port(*, domain='sync', transparent_for=(), src_loc_at=0) |
Good catch, thanks! I've fixed that and also updated a use of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great, ready to merge!
Work-in-progress on updating to Amaranth 0.5:
reset=
withinit=
Pin
Update tests to remove uses ofadd_sync_process