-
Notifications
You must be signed in to change notification settings - Fork 176
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
amaranth.cli.main_runner : specify callbacks to setup verification and/or simulation #701
Comments
For the record, one can see how it looks like with real code : https://github.com/sporniket/amaranth_sandbox/tree/main/02_cell_of_tagged_value :
|
…ification and/or simulation' amaranth-lang#701
The current CLI functionality in Amaranth is not a particularly well designed API. It only provides the bare minimum functionality for the simplest of example programs at the moment. If it continues to be part of Amaranth, it will need major design changes. Given these upcoming changes, I don't think patching the current approach is appropriate. Another thing to look at would be #586, which proposes one of the features you've also proposed here. I think both issues should likely be superseded by a separate, more general pre-RFC discussing the CLI features that might fit people's interests and the goals of Amaranth itself. For your use I recommend reimplementing the functionality you're currently getting from the |
No problem, I am fairly new at this, so I proposed what worked for me while leveraging existing code. Now it's true that thinking deeper, the number of callback/hooks would becomes overwhelming (and the proper naming, too, is to be thought out), so a better mechanism is to be established. I am used to Junit (Java language), so I would be biased toward a decorator based mechanism to hook code. |
I am new to amaranth and follows the tutorials and video of @RobertBaruch. Now I am starting to use
main_runner
to have formal verification and simulation, and I realize that there is no mechanism to setup either action (assert/cover/... for verification ; process, clocks,... for simulation) when appropriate.I would add 2 named parameters to
main_runner
that are called back according to the situation :Then, a typical main for a module would be like :
edit: typos
The text was updated successfully, but these errors were encountered: