Hi,
Is there a way to pass parameter to "do file" in the command line in vsim?
Intuitively, it will be something like this
usr@host>vsim tb_dm -c -do mysim.do 1144
(the 1144 is the parameter to be passed into mysim.do)
but it doesn't work...
Hi,
Is there a way to pass parameter to "do file" in the command line in vsim?
Intuitively, it will be something like this
usr@host>vsim tb_dm -c -do mysim.do 1144
(the 1144 is the parameter to be passed into mysim.do)
but it doesn't work...
It doesn't work because Tcl treats "mysim.do" and "1144" as two completely separate arguments to the [vsim] command. So "mysim.do" is treated as the value of the "-do" option, and "1144" is an orphan.
I can't remember the exact behaviour of the -do option, but you could make it work a slightly different way. The "-do" can be given either the name of a script, or a complete command. So this will be OK:
vsim tb_dm -c -do "do mysim.do 1144"
Note that the command goes in quotes. Tcl programmers might expect to use curly brackets instead, but if you're using Windows the OS command shell will smash it up into separate words. The double-quotes protect the Tcl command from processing by the shell.
HTH
It works! My script is much cleaner now. :D
Thanks.
Have something to add? Share your thoughts — no account required.
Ask the community — no account required