• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Functional Verification
  3. How to pass environment variables exported from pre_session_script...

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 66
  • Views 2574
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to pass environment variables exported from pre_session_script to pre_group_script and run_script in vManager?

lscmarsh
lscmarsh 9 months ago

My vsif goes like this:

session vm_example_sessions { 
// Default sessions directory
top_dir : path/to/top_dir;
output_mode: terminal ;
// Try to use NC as DRM
drm: <text>nc</text>;
// Setup Simulation Env
pre_session_script : "path/to/vm_tb_setup.sh" ;
};

// Define test group and default simulation attributes for the group
group example_tests {

// compile once for test group
pre_group_script : "path/to/vm_compile_script.sh" ;
// run script to launch simulation
run_script : "path/to/vm_run_script.sh" ;
...
};

My pre_session_script:

#!/bin/sh

# Example of environment variable set
export RESULTS_HOME=$(pwd)
echo "RESULTS_HOME = $RESULTS_HOME"

My pre_group_script:

#!/bin/sh

echo "RESULTS_HOME check: $RESULTS_HOME"
# when executed:
# RESULTS_HOME check:

My run_script:

Is there a way to pass env variables from pre_session_script to the succeeding group and test scripts? I know I can source all the env variables before launching the VSIF but, I want to make VSIF source all of them instead.

  • Cancel
  • StephenH
    StephenH 9 months ago

    Every "*_script" attribute (run_script, pre_session_script etc) is run in isolation with no way to share environment between scripts. This is by design, because each script might be executing on a different host machine.

    There is an "sve_name" attribute which defines the path to a script that can be sourced before each other script gets executed. The file must be Bourne Shell (bash) compatible, so use "export var=value" format rather than "setenv var value".

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information