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

prepare template based on protocol #243

Open
glencoe opened this issue May 4, 2023 · 0 comments
Open

prepare template based on protocol #243

glencoe opened this issue May 4, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@glencoe
Copy link
Contributor

glencoe commented May 4, 2023

Fill template values that are already known from the protocol automatically.

Background

The only protocol we use right now already specifies several parameters.
These parameters have to be provided by the class implementing the layer via the port property.
However as a hw designer i currently still have to insert these values into the template myself every time. E.g. like this

config.parameters.update(
  {
    f"{signal}_width": f"{design.port[signal].width}"
    for signal in ("y", "x", "y_address", "x_address")
  }
)

Therefore i suggest we insert these values automatically before generating the code.
I'll call that automatic port protocol expansion.

Possible caveats

As a designer i can override a value by inserting it myself before it is inserted automatically.
But that also means one could override it accidentally and without notice.
To mitigate the risk we could later issue a warning in case the port protocol expansion does not find the expected template variables.

Any thoughts on this from @SuperChange001 and @telefonjoker100 ?

@glencoe glencoe added the enhancement New feature or request label May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant