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 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
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:
{
"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 Variable | Description |
|---|---|
SIGASI_PROJECT_DIRECTORY | Absolute path of the project directory |
SIGASI_COMPILATION_LOG | Absolute path of the compilation.log file that is being populated |
SIGASI_TARGET_GENERATED_DIRECTORY | Absolute path to the directory that can be used for generated/output files in target scripts |
SIGASI_COMPILER_STUBS_DIRECTORY | Absolute path of the directory that contains the tool stubs |
SIGASI_TCL_SHELL | Absolute 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).