-
Notifications
You must be signed in to change notification settings - Fork 72
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 for module parameters #106
Comments
A complication is handling the quoting for string parameters, simulators differ a bit there. |
I forgot to mention I opened PR #108 for this. Each simulator would necessarily have its own |
Perhaps we should keep this open for now as a TODO for supporting this in other simulators |
Added task list with current simulator support. Btw, does cocotb-test not support modelsim? |
It does need to add this ;-) |
Also might want to consider forcing sim_env to lowercase when reading the env var |
https://github.com/cocotb/cocotb/blob/master/examples/matrix_multiplier/tests/Makefile contains command line options for more simulators. |
Nice. I would be happy to write the code, but I do not have access to any of those simulators so I cannot test it. |
I can test everything but Aldec. |
Also, what are your opinions on using f-strings? |
Like them of course, but cocotb still wants to keep Python 3.5 compatibility for the 1.4 version(s) (release end of this year), because Ubuntu 16.04 ships with it by default and is supported until March/'April next year. So end of this year after the start of the 1.5 (or 2.0?) development cycle we will be able to use f-strings. |
cocotb still supports 3.5 but ... |
Ah, I see, they were introduced in 3.6 and so that could cause compatibility problems. |
Just opened #110, if you guys want to test that, it would be great. |
Related question: what's the best way to get some of these parameters to python before the simulation itself starts, specifically so they can be used when setting up TestFactory? |
Hmm, I basically did the same thing, except I prefixed the env vars with |
I made a custom function that dumps the params and other tb/ip config to a yaml file in some kind of uniform way. The cocotb testbench can read it back. |
Support for setting module parameters should be added. Different simulators need module parameters passed through in different ways - different command line switches are used, and some require them in
SIM_ARGS
, some inCOMPILE_ARGS
.Icarus verilog accepts module parameters in
COMPILE_ARGS
as-P toplevel.PARAM=value
. Verilator accepts module parameters inCOMPILE_ARGS
as-GPARAM=value
. No idea about other simulators.Having a standardized way to support this in cocotb-test would be very convenient, perhaps via a
module_params
dict passed toSimulator.__init__()
.Current simulator support:
The text was updated successfully, but these errors were encountered: