-
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
Discussion: plus_args as a dict rather than a list #256
Comments
You can do |
Thank you for the quick response. vsim ... +x=1 +y=10 which means the script should add Please take a look at my local diff (which works for diff --git a/cocotb_test/simulator.py b/cocotb_test/simulator.py
index acf6f7d..6cb71f8 100644
--- a/cocotb_test/simulator.py
+++ b/cocotb_test/simulator.py
@@ -148,7 +148,7 @@ class Simulator:
self.simulation_args = sim_args + extra_args
if plus_args is None:
- plus_args = []
+ plus_args = {}
self.plus_args = plus_args
self.force_compile = force_compile
@@ -541,6 +541,9 @@ class Questa(Simulator):
def get_parameter_commands(self, parameters):
return [f"-g{name}={str(value)}" for name, value in parameters.items()]
+ def get_plus_args_commands(self, parameters):
+ return [f"+{name}={str(value)}" for name, value in parameters.items()]
+
def do_script(self):
do_script = ""
if self.waves:
@@ -599,6 +602,7 @@ class Questa(Simulator):
+ self.simulation_args
+ [as_tcl_value(v) for v in self.get_parameter_commands(self.parameters)]
+ self.toplevel
+ + [as_tcl_value(v) for v in self.get_plus_args_commands(self.plus_args)]
+ ["-do", do_script]
)
if self.verilog_sources: |
I will try to change this but not sure when. |
I have recently started working with
cocotb-test
, trying to get away from themakefile
method. It's amazing!plus_args:
My understanding of
plus_args
usage (PLUSARGS
in cocotb) is a way to send python parameters to python test - at least that's how I do it throughmakefile
(e.g. to sendx=1, y=10, etc
to python). These values are accessible in python undercocotb.plusargs
variable.If
what I think is true, shouldn'tplus_args
incocotb-test
be adict
(rather than a list) like below?And that means
in
simulator.py
underClass Questa(Simulator)
we may need another method likewhich is basically (almost) identical to
get_parameter_commands
.and then later we use this method like
Thank you in advance.
p.s. I'm using cocotb 1.8.1, cocotb-test 0.2.5 and python 3.10.14
The text was updated successfully, but these errors were encountered: