Languages

CommunityCategory: XMODELExecuting XMODEL with Different Verilog Commands

XMODEL

Executing XMODEL with Different Verilog Commands

SA Support Team Staff 2015-10-02

My company uses customized wrapper scripts to execute Verilog simulations. For instance, we can execute ncverilog only via LSF using a wrapper script called ncverilog_bsub. However, the xmodel launcher script seems to call ncverilog directly on the local machine. Is there a way to change this behavior?

1 Answers
Best Answer
SA Support Team Staff 2015-10-03

Yes, there is! You just need to change the XMODEL configuration settings.
The basic configuration settings of XMODEL are defined in a Python file located in $XMODEL_HOME/etc/default_config.py. Here, $XMODEL_HOME is the directory path where XMODEL package is installed. One way to change configuration settings is to edit this file directly. However, we don’t recommend this since then you would have to make the same modifications every time you install a new version of XMODEL.
Here is our recommended way illustrated for the case of changing the NC-verilog command from ncverilog to ncverilog_bsub as in the question:
1) First, create a new configuration file (e.g. named my_config.py) in a separate directory. For instance, a parent directory of $XMODEL_HOME would be a good choice (i.e. a place that does not belong to any particular version of XMODEL). The content of this new file is:

#!/usr/bin/env xmodelpy
"""
CONFIG my_config.py

A custom configuration file for my own use.
"""

# inherit all the default settings in the default_config.py
from default_config import *

# override the command name for executing NC-Verilog
sim_cmd['ncverilog']['ncverilog'] = 'ncverilog_bsub'
sim_cmd['ncverilog']['ncelab'] = 'ncverilog_bsub'
sim_cmd['ncverilog']['ncsim'] = 'ncverilog_bsub'

2) Second, set the environment variable named “XMODEL_CONFIG” to define the location of this new configuration file.
For instance, for a bash-like shell:

export    XMODEL_CONFIG=/PATH/my_config.py

And for a csh-like shell:

setenv    XMODEL_CONFIG   /PATH/my_config.py

Here, you need to put the absolute path to the new file my_config.py in place of “/PATH/”. The best way is to insert this definition to where you define the other environment variables such as XMODEL_HOME, XMODEL_SIMULATOR, etc.

3) Now you have made all the necessary changes. To check its effect, try executing the xmodel launcher script with a -command option as shown below:

xmodel --command