Verification automation using Tcl in ModelSim

Joined
Dec 30, 2008
Messages
2
Reaction score
0
Hello All,

I am trying to figure out how to automate my verification environment using ModelSim. I want to do the following:

I want to be able to call a shell script, let's call it 'do_sim', that accepts the names of the tests that I want to run as arguments. So for example:
% do_sim test1 test2

Inside do_sim, would be the 'vsim' command to call ModelSim.

I have already written a tcl procedure, called 'run_tests', which accepts a list of tests, and runs them one after the other. I can manually invoke ModelSim on the command line, and then manually run the loaded tcl procedure 'run_tests', like this:

% vsim -c -do run_tests.tcl
ModelSim> run_tests test1 test2

But I want to do this all in one command. Does anyone know how to pass the arguments to the tcl procedure directly from the 'vsim' command? I've seen it done once before, but can't get it working.
 
Joined
Dec 30, 2008
Messages
2
Reaction score
0
In case anyone was curious, I got the answer directly from a Mentor engineer:

vsim -c -do "source run_tests.tcl; run_tests {test1 test2}"

And of course, this can all be wrapped in a shell script which takes the list containing {test1 test2} from the command line:

vsim -c -do "source run_tests.tcl; run_tests {$test_list}"

More and more customization can be done with additional command line options, such as to enable code coverage or wave logging, by adding more parameters to the procedure 'run_tests'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,531
Members
45,005
Latest member
MellisaSti

Latest Threads

Top