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

Allow dependent platform attributes #132

Closed
whitequark opened this issue Jul 7, 2019 · 2 comments
Closed

Allow dependent platform attributes #132

whitequark opened this issue Jul 7, 2019 · 2 comments

Comments

@whitequark
Copy link
Contributor

It's fairly common that developer boards have banks with switchable voltage, e.g. m-labs/nmigen-boards#15. It is definitely possible to add resources in __init__ to set these up, but it is more elegant to support this natively, using something like:

resources = [
    Resource("user_led", 7, ..., Attrs(IOSTANDARD=bank2_iostandard)),
]

def bank2_iostandard(self):
    if self.JP12 == "2V5":
        return "LVCMOS25"
    else:
        return "LVCMOS33"
@mithro
Copy link

mithro commented Jul 7, 2019

FYI - I did something very hacky like this here -> https://github.com/timvideos/litex-buildenv/blob/de58bffaa909696827ca552f392f034c57c09467/platforms/atlys.py#L8-L45 to also support the Digilent Atlys board.

@whitequark
Copy link
Contributor Author

That's pretty much the same thing as I suggest but more verbose.

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

No branches or pull requests

2 participants