Contact us Start a Trial

Environment Variables

To improve the flexibility of your project configuration, you can both use and define additional environment variables using Sigasi. You can set environment variables at 4 locations: at system level, in the workspace, in the project and in the target. If a variable is set in multiple locations, the value set at a later location takes precedence, e.g. project environment variables override system environment variables and workspace environment variables.

System environment variables are the environment variables you know: the environment variables associated with the Sigasi process. You can inspect these by using the env command in your VS Code terminal. As explained by the Terminal: Show Environment Contributions command in the command palette, though, that command outputs some extra variables.

For the other locations, note that the order of definition is important: you can use previous local definitions (supported formats: $ENV_VAR, ${ENV_VAR}, ${ENV_VAR:default_value}) to define the next.

To modify the environment easily without restarting VS Code, you can use Workspace environment variables. These are customized using the sigasi.server.customProjectVariables setting.

Project environment variables allow for environment variables that should remain the same, no matter on which system or VS Code installation you open a project on. You specify them in the project configuration. For example, you could set the UVM version and home for all targets:

JSON
{
    "name": "Environment Variables",
    "environment": {
        "UVM_VERSION": "1.2",
        "UVM_HOME": "${VCS_HOME}/etc/uvm-${UVM_VERSION}",
        "UVM_SRC": "${UVM_HOME}/src"
    },
    "targets": {
        "testbench1": {
            // ...
        },
        "testbench2": {
            // ...
        }
    }
}

Target environment variables apply to a single target inside a project. They are useful for defining an environment e.g. for the commands in Scripted targets.

In addition to environment variables defined above, Sigasi makes the following environment variables available in the interpreter:

Environment VariableDescription
SIGASI_PROJECT_DIRECTORYAbsolute path of the project directory
SIGASI_COMPILATION_LOGAbsolute path of the compilation.log file that is being populated
SIGASI_TARGET_GENERATED_DIRECTORYAbsolute path to the directory that can be used for generated/output files in target scripts
SIGASI_COMPILER_STUBS_DIRECTORYAbsolute path of the directory that contains the tool stubs
SIGASI_TCL_SHELLAbsolute path of the TCL interpreter used for TCL commands in scripted targets

Actual values of all environment variables during compiler invocations in target commands can be found in the compilation.log file (can be opened using Code Lenses in the project.sigasi file).