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

Support passing vlogparams to Genus #459

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jfrimmel
Copy link

Note: this is written from the viewpoint of a FuseSoC user, but this applies to all usages of edalize itself.

FuseSoC already accepts vlogparams for the genus backend/tool, but does not write them to any TCL-file or other way to access it from the user-defined Genus script. Therefore one could not easily add parameters to the top-level module when synthesizing with Genus, effectively rendering them unusable.

In order to resolve this issue, this commit creates new variable called ELABORATE_PARAMETERS, which is set unconditionally. Its value is constructed in such a way, that the value can be passed directly to the elaborate-command inside the user-supplied Genus TCL script like so:

elaborate -parameters "$ELABORATE_PARAMETERS" "$TOP_MODULE"

This way, the user-supplied TCL-script can be kept generic (without the need for special-casing parameter) and FuseSoC makes use of the defined parameters.

@jfrimmel
Copy link
Author

Note, that genus.py already advertised support for vlogparams:

argtypes = ["vlogdefine", "vlogparam", "generic"]

@olofk
Copy link
Owner

olofk commented Feb 13, 2025

There are several issues with the genus interface and should be rewritten from scratch for the Flow API. I have other things I need to focus on right now though, but this is high on my TODO list.

@olofk
Copy link
Owner

olofk commented Feb 13, 2025

Ah! Missed that this was a PR and not an issue and that you had provided a fix. I'm generally sceptic towards adding more features to the backends using the old Tool API though since I would like to focus people's energy on deprecating these old backends to reduce the maintenance burden for me. I would also like to have a test case to verify that it works both with and without parameters set.

But first of all, we need to make sure it passes the regression tests. Right now it's failing the formatting check. Make sure you have pre-commit set up for Edalize development https://edalize.readthedocs.io/en/latest/dev/setup.html

_Note_: this is written from the viewpoint of a FuseSoC user, but this
applies to all usages of edalize itself.

FuseSoC already accepts `vlogparam`s for the `genus` backend/tool, but
does not write them to any TCL-file or other way to access it from the
user-defined Genus script. Therefore one could not easily add parameters
to the top-level module when synthesizing with Genus, effectively ren-
dering them unusable.

In order to resolve this issue, this commit creates new variable called
`ELABORATE_PARAMETERS`, which is set unconditionally. Its value is
constructed in such a way, that the value can be passed directly to the
`elaborate`-command inside the user-supplied Genus TCL script like so:
```tcl
elaborate -parameters "$ELABORATE_PARAMETERS" "$TOP_MODULE"
```
This way, the user-supplied TCL-script can be kept generic (without the
need for special-casing parameter) and FuseSoC makes use of the defined
parameters.
@jfrimmel jfrimmel force-pushed the vlogparam-support-for-genus branch from 2759689 to d8600f4 Compare February 13, 2025 21:11
@jfrimmel
Copy link
Author

I've corrected the formatting, which is the easy part 😉

What would have to be done to convert ithe Genus backend to the new flow API? Are there any developer instructions?

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