DSim Cloud allows you to configure your workspace through the use of a configuration file and environment variables.
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:
For more information on YAML, see The Official YAML Web Site.
Any saved changes to mdc_config.yml will take effect upon subsequent execution of DSim Cloud commands.
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 mdc_config.yml to include them.
A sample mdc_config.yml looks like this:
# Reference documentation: https://support.metrics.ca/hc/en-us/articles/9905737591565
environment-variables: # Define environment variables
# HELLO: world
packages: # Include packages
- name: ieee
# - name: quartus
# version: "22.2"
# - name: vivado
# version: "2022.1"
# - name: uvm
# version: "1.2"
# version: "20220822.x.x" # Optional. Defaults to the latest version available. Uncomment to set a specific version.
If mdc_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 mdc_config.yml by copying the one above, and/or keep a copy of your mdc_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>
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.
Selecting a Custom Configuration File
Besides the default configuration file mdc_config.yml, you can select a custom configuration file to use for your workspace. Simply create custom configuration files following the same YAML syntax and use the
--config | -c switch in your DSim Cloud commands to select them. The switch accepts both absolute and relative paths (relative to the current directory). You can have as many configuration files as you like, and store them anywhere under your local origin directory. This enables you to switch between workspace configurations for different simulation scenarios. You must create your own custom configuration files (that can be based on the default configuration file), as only the default configuration file mdc_config.yml is provided. You must use the
-config | -c switch in every command that requires the custom configuration file, or the default configuration file will be used. This can be simplified by using an environment variable for the path to the custom configuration file.
Commands that use a configuration file:
mdc dsim -a '-F filelist.txt --config my_config.yml'
mdc ls -c configs/test_config.yml
mdc dlib -a 'ls --config my_project/configs/config_3.yml'
mdc dvlcom -a 'dut.v tb.sv -c mdc_config.yml'
Environment variables can be entered in mdc_config.yml using standard YAML syntax:
The following is a list of reserved environment variables used by DSim Cloud and are unchangeable by the user:
To display all current environment variables, enter:
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:
You can use the environment variables in DSim file lists by preceding them with $ as follows:
Given the environment variables in your mdc_config.yml (and the existence of such files in your origin directory):
Use them in DSim Cloud:
mdc dsim -a '-F %FILE_LIST% +acc+b -waves %WAVE_FILE% -wave-scope-specs %WAVE_LIST%'