Languages

CommunityCategory: XMODELLaunching XMODEL simulations using a single run file rather than a set of individual commands

XMODEL

Launching XMODEL simulations using a single run file rather than a set of individual commands

SA Support Team Staff 2019-08-12

When you launch an XMODEL simulation using the 'xmodel' launcher script, the 'xmodel' script issues a series of commands performing compile/elaboration and simulation, depending on the SystemVerilog simulator of choice. For example, in case of using NC-Verilog, it issues:

ncverilog -elaborate …
ncverilog -R …

And in case of using VCS, it issues:

vcs …
simv …

(The detailed lists of arguments are omitted for brevity).

In my company, all SystemVerilog simulations are executed through a job scheduling platform like LSF. Since each submitted job experiences a waiting time in the queue, submitting the individual commands mentioned above as separate LSF jobs can increase the total waiting time. I think the better way is to list those commands in a single run script and submit that run script as a single LSF job. For instance, let’s say we name that run script which lists the commands inside as 'xmodel.run'. You can then submit this run script as an LSF job using the 'bsub' command:

bsub xmodel.run

Can I setup XMODEL so that it launches the simulation using a run script in this fashion?

1 Answers
Best Answer
SA Support Team Staff 2019-08-12

Yes, you can. The way the 'xmodel' launcher script executes the XMODEL simulations can be customized via the XMODEL configuration file, of which location is defined by the $XMODEL_CONFIG environment variable. For more general information, please refer to the following two links:

https://www.scianalog.com/support/manual/xmodel-simulation-launcher/
https://www.scianalog.com/support/community/question/432/

The list of available options and their default values can be found in the default configuration file, located in $XMODEL_HOME/etc/default_config.py. Among them, the options that can control the inquired operations are the following:

sim_cmd['ncverilog']['run_shell'] = ['csh', '-f']
sim_option['ncverilog']['use_runfile'] = False
sim_option['ncverilog']['runfile'] = 'xmodel.run'

where you can also use 'vcs', 'modelsim', or 'xcelium' instead of 'ncverilog'. And by doing so, you can control the operations for each individual simulator.

You can set these options as shown below to make the 'xmodel' launcher script generate a run script first and then execute it via a 'bsub' command rather than issuing the commands individually:

sim_cmd['ncverilog']['run_shell'] = ['bsub']
sim_option['ncverilog']['use_runfile'] = True
sim_option['ncverilog']['runfile'] = 'xmodel.run'

By setting the 'use_runfile' option to 'True', you are instructing the 'xmodel' script to use a run script. The name of the run script file is composed by concatenating the prefix defined by the 'runfile' option and the process ID number, in order to avoid name collisions among multiple run scripts.

The 'run_shell' option defines the command to execute the run script using a list of parsed tokens. For instance, if you want to add an option '-I' to the 'bsub' command like the following:

bsub -I xmodel.run

define the 'run_shell' option as shown below. Be careful not to use a single string 'bsub -I' since then the two words would be erroneously interpreted as a single token.

sim_cmd['ncverilog']['run_shell'] = ['bsub', '-I']