DSim Cloud Configuration
DSim Cloud allows you to configure your remote workspace through the use of a configuration file and environment variables.
Configuration File
Upon remote workspace start, a default YAML configuration file
<local workspace 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 mdc_config.yml will take effect upon subsequent execution of DSim Cloud CLI 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 workspace. 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:
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 mdc_config.yml already exists in your local workspace directory, it will not be overwritten with the default one upon remote workspace start. 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:
<div id="_name_abcd_"></div> # - name: <abcd> <div id="_version_xy_z_xy_z_abcd_"></div> # version: "<xy.z>"</xy.z></abcd>
Loaded package entry:
- name: <abcd> version: "<xy.z>"</xy.z></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 remote 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 workspace 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 remote workspace. Simply create custom configuration files following the same YAML syntax and use the --config | -c
switch in your DSim Cloud CLI 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 workspace directory. This enables you to switch between 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 dlib mdc dsim mdc dvhcom mdc dvlcom mdc dvhencrypt mdc dvlencrypt mdc list mdc envs
For example:
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
Environment variables can be entered in mdc_config.yml using standard YAML syntax:
ENVIRONMENT_VARIABLE: <span class="hljs-keyword">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
- IP_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 CLI 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 mdc_config.yml (and the existence of such files in your local workspace 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%'
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article