Jobs is a feature of DSim Cloud that enables you to automate simulations. A job can define any number of commands to perform compliation and simulation in the cloud. A job is defined in the local workspace of your local disk and is executed in the remote workspace of the remote disk. The local workspace is the contents of the folder where:
1. You first submitted your job by executing mdc job submit.
2. You initialized a workspace by executing mdc initialize.
All the files needed for your job must be within your local workspace. The entire local workspace is automatically synchronized to the remote workspace /remote/work everytime you execute
mdc job submit. If you want certain files to not be synchronized, modify the file mdc_ignore, as described in the section Ignoring File Patterns of DSim Cloud File Synchronization.
See Understanding Workspaces for details.
Unlike Interactive workspaces, you do not need to initialize DSim Cloud workspaces to use jobs. Remote cloud resources will be allocated and managed for you automatically when jobs are submitted and executed.
Jobs are created with job files, which are YAML files following YAML conventions. For example, let's examine carry_lookahead_adder.yml, shown below and can be downloaded from the carry_lookahead_adder design. Note the indentation and that all syntax is case-sensitive.
Sample Job File carry_lookahead_adder.yml
name: carry-lookahead-adder tasks: - name: compile-sv depends: [sim-vhdl-sv] commands: - dsim -genimage image_sv -F SystemVerilog/sim/filelist.txt +acc+b inputs: working: - name: sim-vhdl-sv.source path: / outputs: artifacts: - name: log-sv path: dsim.log working: - name: image-sv path: dsim_work/image_sv.so - name: sim-vhdl depends: [run-sv-3, sim-vhdl-sv] commands: - dvhcom -F VHDL/sim/filelist.txt - dsim -top work.carry_lookahead_adder_tb +acc+b -waves waves_vhdl.vcd inputs: working: - name: sim-vhdl-sv.source path: / outputs: artifacts: - name: waves-vhdl path: waves_vhdl.vcd - name: log-vhdl path: dsim.log - name: sim-vhdl-sv compute_size: s8 mdc_work: VHDL_SystemVerilog/sim/ commands: - dvhcom -F filelist_VHDL.txt - dvlcom -F filelist_SV.txt - dsim -top work.carry_lookahead_adder_tb +acc+b -waves waves_vhdl_sv.vcd outputs: working: - name: source path: / artifacts: - name: waves-vhdl-sv path: VHDL_SystemVerilog/sim/waves_vhdl_sv.vcd - name: log-vhdl-sv path: VHDL_SystemVerilog/sim/dsim.log - name: run-sv-1 depends: [compile-sv] commands: - dsim -image image_sv -waves waves_sv_1.vcd -sv_seed 1 inputs: working: - name: compile-sv.image-sv path: dsim_work/image_sv.so outputs: artifacts: - name: waves-sv-1 path: waves_sv_1.vcd - name: log-sv-1 path: dsim.log - name: run-sv-2 depends: [compile-sv] commands: - dsim -image image_sv -waves waves_sv_2.vcd -sv_seed 2 inputs: working: - name: compile-sv.image-sv path: dsim_work/image_sv.so outputs: artifacts: - name: waves-sv-2 path: waves_sv_2.vcd - name: log-sv-2 path: dsim.log - name: run-sv-3 depends: [compile-sv] commands: - dsim -image image_sv -waves waves_sv_3.vcd -sv_seed 3 inputs: working: - name: compile-sv.image-sv path: dsim_work/image_sv.so outputs: artifacts: - name: waves-sv-3 path: waves_sv_3.vcd - name: log-sv-3 path: dsim.log
Job File Properties
This is the name of the job. It does not have to match the job file name. Every time you submit the job file to run the job, a new auto-generated hash will be added to the name to form the unique job-id.
tasks: - name:
A job is comprised of tasks, which are executed by the remote compute in parallel unless otherwise specified by the
depends property. Each task should have a unique and descriptive name. The status of these tasks is obtained with the job-id. If there is an error in executing a task, all the following tasks are omitted and not executed.
The remote cloud compute configuration for the named task. Current options are
s8. If this optional line is absent, the task will be executed on an s4.
These are the DSim commands to be executed by the remote compute in the order they appear. Note that each DSim command is preceded by a
The path from where the commands should be executed, relative to the root of the local workspace. If this optional line is absent, all commands are executed from the remote workspace.
outputs: artifacts: - name: path:
Tasks can have artifacts, such as waveform files, simulation logs, and folders. Each artifact should have a unique name and path. The path is relative to the remote work directory. Artifacts can be downloaded using mdc job download. The file or folder will be compressed into a tar file before being downloaded to \<artifact-name>.tar.gz.
Specify the dependencies of each task. See the section Task Dependencies for details.
Tasks are executed in parallel unless they contain the
depends property. The value of the
depends property, given as an array of task names, specifies which task(s) must complete before the current task can be executed. All files required to execute a task must be passed to it by the previous task as
outputs.working are intermediate files that are removed upon job completion, ie. they are not available for download. To pass intermediate files between tasks, a task must specify its output with
outputs.working, and for a subsequent task to consume those outputs, it must specify its inputs with
Let's examine the following tasks from carry_lookahead_adder.yml to see how they're dependent:
- name: compile-sv depends: [sim-vhdl-sv] commands: - dsim -genimage image_sv -F SystemVerilog/sim/filelist.txt +acc+b inputs: working: - name: sim-vhdl-sv.source path: / outputs: artifacts: - name: log-sv path: dsim.log working: - name: image-sv path: dsim_work/image_sv.so
compile-sv depends on the task
sim-vhdl-sv and requires all the files from the local workspace. The files are passed to
sim-vhdl-sv. The path
/ indicates all folders and files of the remote work directory.
outputs.working are files passed to subsequent, dependent tasks. The path is relative to the remote work directory.
- name: run-sv-1 depends: [compile-sv] commands: - dsim -image image_sv -waves waves_sv_1.vcd -sv_seed 1 inputs: working: - name: compile-sv.image-sv path: dsim_work/image_sv.so
run-sv-1 depends on the task
compile-sv and requires only the image file generated by it. The file is passed to
compile-sv. The path is relative to the remote work directory.
run-sv-3 also depend on the task
compile-sv. This is how you can compile only once and run many times using the same image.
sim-vhdl depends on tasks
sim-vhdl-sv. This is how you can specify the order of task execution.
So instead of all tasks being executed in parallel, they will be executed in this order:
For more information on YAML, see The Official YAML Web Site.
Using Job Files
Create job files as YAML files with the extension .yml or .yaml using the above template. Put them anywhere in your local workspace. Use job commands to manage your jobs for regressions. Use job files for your regressions as shown in Tutorial: Regressions.