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

Add options for preprocessor macros, module parameters and custom compile-time flags #27

Closed
ganoam opened this issue Aug 31, 2021 · 2 comments
Assignees

Comments

@ganoam
Copy link
Contributor

ganoam commented Aug 31, 2021

It would be useful to be able to set certain compile time flags in the dbt module decalarations. For example, setting a preprocessor variable (e.g. for conditional compilation of simulation-only code), for setting module parameters (e.g. simulate an arbitrator module with a configurable number o fmasters/slaves). The semantics for those functionalities depend on the simulator/synthesis tool:

Preprocessor macros:

  • Questa: vlog +define+<macrro_name>[=<macro_val>]
  • Xsim: xvlog --define <macro_name>[=<macro_val>]
  • Xilnix synthesis: synth_design -verilog_define <name>=<value>

Module parameters

  • Questa: vsim -G<param_name>=<param_value> (Note: runtime argument, not compile-time).
  • Xsim: There seems to be no good way. I'll investigate when I have time.
  • Xilnix synthesis: synth_design -generic <param_name>=<param_value>

In addition it would be nice to set custom simulator/synthesis tool specific flags.

I propose to add the following fields to hdl.Simulation:

  • Define: []string
  • Generic: []string
  • vlog_args: []string (ignored if using xsim)
  • xvlog_args: []string (ignored if using questa)

And the following to hdl.Bitstream:

  • Define: []string
  • Generic: []string
  • xsynth_args: []string

What's your opinions?

@paulhankin
Copy link

Maybe related: daedaleanai/dbt#96

(It's related in as much that in that issue I request a way to feed down configuration from the top-level to sub-rules. There are many differences).

@ganoam
Copy link
Contributor Author

ganoam commented Dec 9, 2021

All my dreams are comming true in #47. Thanks, Niels.

@ganoam ganoam closed this as completed Dec 9, 2021
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

No branches or pull requests

3 participants