|  | // Copyright lowRISC contributors. | 
|  | // Licensed under the Apache License, Version 2.0, see LICENSE for details. | 
|  | // SPDX-License-Identifier: Apache-2.0 | 
|  | { | 
|  | build_cmd:  "{job_prefix} dsim" | 
|  | run_cmd:    "{job_prefix} dsim" | 
|  |  | 
|  | build_opts: ["-work {build_dir}/dsim_out", | 
|  | "-genimage image", | 
|  | "-sv", | 
|  | // Set parallel compilation jobs limit | 
|  | "-j 12", | 
|  | // UVM | 
|  | "+incdir+{UVM_HOME}/src", | 
|  | "{UVM_HOME}/src/uvm_pkg.sv", | 
|  | // Add dpi/vpi include path. | 
|  | "-c-opts -I{DSIM_HOME}/../../include", | 
|  | // Needed for including "secded_enc.h". | 
|  | "-c-opts -I{build_dir}/src/lowrisc_dv_secded_enc_0", | 
|  | "-timescale 1ns/1ps", | 
|  | "-f {sv_flist}", | 
|  | // List multiple tops for the simulation. Prepend each top level with `-top`. | 
|  | "{eval_cmd} echo {sim_tops} | sed -E 's/(\\S+)/-top \\1/g'", | 
|  | "+incdir+{build_dir}", | 
|  | // TODO Remove buggy optimization when dsim fixes bug | 
|  | // https://gitlab.metrics.ca/google/google/-/issues/242. | 
|  | "-noopt-task-func", | 
|  | // Suppress following DSim errors and warnings: | 
|  | //   EnumMustBePositive - UVM 1.2 violates this | 
|  | "-suppress EnumMustBePositive"] | 
|  |  | 
|  | run_opts:   ["-work {build_dir}/dsim_out", | 
|  | "-image image", | 
|  | // UVM DPI | 
|  | "-sv_lib {DSIM_HOME}/lib/libuvm_dpi.so", | 
|  | "-sv_seed {seed}", | 
|  | // tell DSim to write line-buffered stdout (lines will be written in proper order) | 
|  | "-linebuf", | 
|  | "+UVM_TESTNAME={uvm_test}", | 
|  | "+UVM_TEST_SEQ={uvm_test_seq}"] | 
|  |  | 
|  | // Supported wave dumping formats (in order of preference). | 
|  | supported_wave_formats: ["vcd", "fst"] | 
|  |  | 
|  | // Default tcl script used when running the sim. Override if needed. | 
|  | run_script: "" | 
|  |  | 
|  | // TODO: refactor coverage configuration for DSim. | 
|  |  | 
|  | // COVERAGE related. | 
|  | cov_db_dir: "{scratch_path}/coverage/{build_mode}.vdb" | 
|  |  | 
|  | // Individual test specific coverage data - this will be deleted if the test fails | 
|  | // so that coverage from failing tests is not included in the final report. | 
|  | cov_db_test_dir_name: "{run_dir_name}.{seed}" | 
|  | cov_db_test_dir: "{cov_db_dir}/snps/coverage/db/testdata/{cov_db_test_dir_name}" | 
|  |  | 
|  | // Merging coverage. | 
|  | // "cov_db_dirs" is a special variable that appends all build directories in use. | 
|  | // It is constructed by the tool itself. | 
|  | cov_merge_dir:    "{scratch_path}/cov_merge" | 
|  | cov_merge_db_dir: "{cov_merge_dir}/merged.vdb" | 
|  | cov_merge_cmd:    "{job_prefix} urg" | 
|  | cov_merge_opts:   [] | 
|  |  | 
|  | // Generate coverage reports in text as well as html. | 
|  | cov_report_dir:   "{scratch_path}/cov_report" | 
|  | cov_report_cmd:   "{job_prefix} urg" | 
|  | cov_report_opts:  [] | 
|  | cov_report_txt:   "{cov_report_dir}/dashboard.txt" | 
|  | cov_report_page:  "dashboard.html" | 
|  |  | 
|  | // Analyzing coverage - this is done by invoking --cov-analyze switch. It opens up the | 
|  | // GUI for visual analysis. | 
|  | cov_analyze_dir:  "{scratch_path}/cov_analyze" | 
|  | cov_analyze_cmd:  "{job_prefix} verdi" | 
|  | cov_analyze_opts: ["-cov", | 
|  | "-covdir {cov_merge_db_dir}", | 
|  | "-line nocasedef", | 
|  | "-elfile {vcs_cov_excl_files}"] | 
|  |  | 
|  | // Vars that need to exported to the env. | 
|  | exports: [ | 
|  | { PATH: "{DSIM_HOME}:{PATH}" } | 
|  | { LD_LIBRARY_PATH: "{DSIM_HOME}/lib:{LD_LIBRARY_PATH}" } | 
|  | ] | 
|  |  | 
|  | // Defaults for DSim | 
|  | // TODO: there is currently no equivalent of "all" coverage metrics in DSim | 
|  | cov_metrics: "" | 
|  |  | 
|  | // pass and fail patterns | 
|  | build_fail_patterns: ["^=E:"] | 
|  | run_fail_patterns:   ["^=E:"] | 
|  |  | 
|  | // waveform | 
|  | probe_file: "dsim.probe" | 
|  |  | 
|  | build_modes: [ | 
|  | { | 
|  | name: dsim_gui | 
|  | is_sim_mode: 1 | 
|  | build_opts: [] | 
|  | run_opts: [] | 
|  | } | 
|  | { | 
|  | name: dsim_waves | 
|  | is_sim_mode: 1 | 
|  | build_opts: ["+acc+b"] | 
|  | run_opts:   ["-waves waves.{waves}", | 
|  | // dsim.probe is currently undefined | 
|  | //"-wave-scope-specs {probe_file}", | 
|  | // Dump unpacked structs and arrays. | 
|  | "-dump-agg"] | 
|  | } | 
|  | { | 
|  | name: dsim_waves_off | 
|  | is_sim_mode: 1 | 
|  | build_opts: [] | 
|  | } | 
|  | // TODO: support coverage mode | 
|  | // Note: no specific build or run options are required for dsim to produce functional | 
|  | // coverage. Code coverage support is evolving. | 
|  | { | 
|  | name: dsim_cov | 
|  | is_sim_mode: 1 | 
|  | build_opts: [// Enable the required cov metrics | 
|  | ] | 
|  | run_opts:   [// Enable the required cov metrics | 
|  | ] | 
|  | } | 
|  | // TODO: support xprop mode | 
|  | { | 
|  | name: dsim_xprop | 
|  | is_sim_mode: 1 | 
|  | } | 
|  | { | 
|  | name: dsim_profile | 
|  | is_sim_mode: 1 | 
|  | run_opts:   ["-profile"] | 
|  | } | 
|  | { | 
|  | // TODO: Add build and run options to enable zero delay loop detection. | 
|  | name: dsim_loopdetect | 
|  | is_sim_mode: 1 | 
|  | build_opts: [] | 
|  | run_opts:   [] | 
|  | } | 
|  | ] | 
|  | } |