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

Implement RFC 18: Reorganize vendor platforms #873

Closed
2 tasks done
whitequark opened this issue Aug 22, 2023 · 2 comments · Fixed by #1002
Closed
2 tasks done

Implement RFC 18: Reorganize vendor platforms #873

whitequark opened this issue Aug 22, 2023 · 2 comments · Fixed by #1002
Labels
Milestone

Comments

@whitequark
Copy link
Member

whitequark commented Aug 22, 2023

RFC: https://amaranth-lang.org/rfcs/0018-reorganize-vendor-platforms.html

@whitequark whitequark added this to the 0.4 milestone Aug 22, 2023
@gatecat
Copy link

gatecat commented Aug 22, 2023

Some implementation questions I have:

  • how should the lazy loading work? just checking all the vendor modules to see which one the class is in, or having a class->module dict in the __init__.py? (not sure if there's a standard python paradigm here I just don't know and couldn't immediately find)
  • do we need backwards compatibility?
  • in amaranth-boards there's a bunch of from amaranth.vendor.lattice_ecp5 import *, this would be refactored to specific imports like from amaranth.vendor import LatticeECP5Platform?

@whitequark
Copy link
Member Author

  • having a class->module dict in the init.py?

I'm perfectly happy to have something like:

def __getattr__(self, name):
    if name == "XilinxPlatform":
        from ._xilinx import XilinxPlatform as platform_cls
    elif name == "...":
        ...
    return platform_cls
  • do we need backwards compatibility?

Yes. Please leave modules like vendor.xilinx which just import the right class, and issue a deprecation warning. They will be removed after Amaranth 0.4 is released.

  • in amaranth-boards there's a bunch of from amaranth.vendor.lattice_ecp5 import *, this would be refactored to specific imports like from amaranth.vendor import LatticeECP5Platform?

Yes

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

Successfully merging a pull request may close this issue.

2 participants