Skip to content
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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

miek
Copy link
Member

@miek miek commented Sep 17, 2024

Work-in-progress on updating to Amaranth 0.5:

  • Replace uses of amaranth.hdl.Memory with amaranth.lib.memory.Memory
  • Remove uses of Signal.width
  • Replace uses of reset= with init=
  • Remove uses of Pin
  • Update tests to remove uses of add_sync_process
  • ...

@antoinevg antoinevg mentioned this pull request Oct 17, 2024
@miek miek force-pushed the amaranth-0.5 branch 3 times, most recently from 20f58e7 to 0ac7d28 Compare January 3, 2025 12:57
@miek
Copy link
Member Author

miek commented Jan 3, 2025

I think this is ready for review now.

I decided to drop the synchronize helper in favour of less magic and because it was tied pretty closely to Pin/Record which are going away. Most of its uses were from unmaintained examples that depended on old hardware, that I've also removed.

I also decided to skip porting away from add_sync_process for now as refactoring all the tests is going to be a big job, and I'd rather leave that to a follow-up PR, so the test runs will have a deprecation warning relating to that.

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

@miek miek marked this pull request as ready for review January 3, 2025 14:54
@@ -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=[])
Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants