DSim Cloud allows you to configure your workspace through the use of a configuration file and environment variables.
Configuration File
Upon workspace initialization, a default YAML configuration file <local origin directory>/.mdc/config.yml will be created. This configuration file can be modified to add/edit your own environment variables, or edit some existing DSim Cloud environment variables. The modifications are entered in standard YAML syntax:
KEY: value
For more information on YAML, see The Official YAML Web Site.
Any saved changes to config.yml will take effect upon subsequent execution of DSim Cloud commands.
Package Configuration
A list of tools and libraries, known as packages, are available on the remote storage and can be accessed when executing commands on the remote compute. Available versions of these packages can be loaded by changing the default config.yml to include them.
A sample config.yml looks like this:
# Reference documentation: https://support.metrics.ca/hc/en-us/articles/9905737591565
toolchain:
environment-variables: # Define environment variables
# HELLO: world
packages: # Include packages
- name: ieee
version: "93"
# - name: quartus
# version: "22.2"
# - name: vivado
# version: "2022.1"
# - name: uvm
# version: "1.2"
dsim:
# version: "20220822.x.x" # Optional. Defaults to the latest version available. Uncomment to set a specific version.
If config.yml already exists in your local origin directory, it will not be overwritten with the default one upon workspace initialization. You can revert to the default config.yml by copying the one above, and/or keep a copy of your config.yml by renaming it.
To load a package, enter a valid version and uncomment the package entry. For example:
Unloaded package entry:
# - name: <abcd>
# version: "<xy.z>"
Loaded package entry:
- name: <abcd>
version: "<xy.z>"
Once loaded, a package cannot be unloaded, but its version can be changed by modifying its version field. Some packages include precompiled libraries, which will be mapped to your workspace when the packages are loaded.
See Introduction to DSim Cloud Packages for a list of available packages, their precompiled libraries (if any), and their valid versions.
When a package is loaded, an environment variable pointing to its location on the remote compute will be available for you to reference in your design.
Environment Variables
Environment variables can be entered in config.yml using standard YAML syntax:
ENVIRONMENT_VARIABLE: value
The following is a list of reserved environment variables used by DSim Cloud and are unchangeable by the user:
- DSIM_HOME
- HOME
- HOSTNAME
- IEEE_BASE
- IEEE_HOME
- LD_LIBRARY_PATH
- LLVM_HOME
- PATH
- SHLVL
- PWD
- QUARTUS_HOME
- QUARTUS_ROOTDIR
- STD_LIBS
- TOOLCHAIN_HOME
- UVM_HOME
- VIVADO_HOME
- XILINX_VIVADO
To display all current environment variables, enter:
mdc envs
For more information on mdc envs, see DSim Cloud CLI Tool envs command.
You can use the environment variables in DSim Cloud commands by wrapping them with % as follows:
%ENV_VAR%
You can use the environment variables in DSim file lists by preceding them with $ as follows:
$ENV_VAR
Example
Given the environment variables in your config.yml (and the existence of such files in your origin directory):
FILE_LIST: my_filelist.txt
WAVE_FILE: my_waves.vcd
WAVE_LIST: my_wave.list
Use them in DSim Cloud:
mdc dsim -a '-F %FILE_LIST% +acc+b -waves %WAVE_FILE% -wave-scope-specs %WAVE_LIST%'