diff --git a/dv/uvm/data/common_project_cfg.hjson b/dv/uvm/data/common_project_cfg.hjson index f7160a9b..68f9ea91 100644 --- a/dv/uvm/data/common_project_cfg.hjson +++ b/dv/uvm/data/common_project_cfg.hjson @@ -16,7 +16,6 @@ results_server_prefix: "gs://" results_server_url_prefix: "https://" results_server_cmd: "CLOUDSDK_PYTHON=/usr/bin/python2.7 /usr/bin/gsutil" - results_server_css_path: "{results_server_url_prefix}{results_server}/css/style.css" results_server_path: "{results_server_prefix}{results_server}/{rel_path}" results_server_dir: "{results_server_path}/latest" diff --git a/dv/uvm/data/common_sim_cfg.hjson b/dv/uvm/data/common_sim_cfg.hjson index 610d4637..cd995ff0 100644 --- a/dv/uvm/data/common_sim_cfg.hjson +++ b/dv/uvm/data/common_sim_cfg.hjson @@ -23,10 +23,11 @@ // pass and fail patterns build_pass_patterns: [] - build_fail_patterns: [] + build_fail_patterns: ["^ERROR:.*$"] // fusesoc build error run_pass_patterns: ["^TEST PASSED (UVM_)?CHECKS$"] run_fail_patterns: ["^UVM_ERROR\\s[^:].*$", "^UVM_FATAL\\s[^:].*$", + "^UVM_WARNING\\s[^:].*$", "^Assert failed: ", "^\\s*Offending '.*'", "^TEST FAILED (UVM_)?CHECKS$"] @@ -43,6 +44,11 @@ h: UVM_HIGH d: UVM_DEBUG + // Path to the dut instance (this is used in a couple of places such as coverage cfg + // file, xprop cfg file etc. If this is different for your block, then override it with + // the 'overrides' directive. + dut_instance: "{tb}.dut" + // Default waves dump settings dump_base: waves @@ -69,6 +75,7 @@ WAVES: {waves} DUT_TOP: {dut} TB_TOP: {tb} + dut_instance: {dut_instance} ] // Regressions are tests that can be grouped together and run in one shot diff --git a/dv/uvm/data/fusesoc.hjson b/dv/uvm/data/fusesoc.hjson index d2ca94bf..39c59a08 100644 --- a/dv/uvm/data/fusesoc.hjson +++ b/dv/uvm/data/fusesoc.hjson @@ -5,7 +5,9 @@ sv_flist_gen_cmd: fusesoc fusesoc_core_: "{eval_cmd} echo \"{fusesoc_core}\" | tr ':' '_'" sv_flist_gen_opts: ["--cores-root {proj_root}", - "run --target=sim --build-root={build_dir}", + "run", + "--target=sim", + "--build-root={build_dir}", "--setup {fusesoc_core}"] sv_flist_gen_dir: "{build_dir}/sim-vcs" sv_flist: "{sv_flist_gen_dir}/{fusesoc_core_}.scr" diff --git a/dv/uvm/data/sim.mk b/dv/uvm/data/sim.mk index c471c4af..b4b24c28 100644 --- a/dv/uvm/data/sim.mk +++ b/dv/uvm/data/sim.mk @@ -11,13 +11,16 @@ all: build run ############################### build: compile_result -pre_compile: - @echo "[make]: pre_compile" - mkdir -p ${build_dir} && env | sort > ${build_dir}/env_vars +prep_tool_srcs: + @echo "[make]: prep_tool_srcs" mkdir -p ${tool_srcs_dir} cp -Ru ${tool_srcs} ${tool_srcs_dir}/. -gen_sv_flist: pre_compile +pre_compile: + @echo "[make]: pre_compile" + mkdir -p ${build_dir} + +gen_sv_flist: pre_compile prep_tool_srcs @echo "[make]: gen_sv_flist" cd ${build_dir} && ${sv_flist_gen_cmd} ${sv_flist_gen_opts} @@ -35,7 +38,7 @@ run: run_result pre_run: @echo "[make]: pre_run" - mkdir -p ${run_dir} && env | sort > ${run_dir}/env_vars + mkdir -p ${run_dir} simulate: @echo "[make]: simulate" @@ -58,14 +61,17 @@ debug_waves: ############################ # Merge coverage if there are multiple builds. cov_merge: + @echo "[make]: cov_merge" ${cov_merge_cmd} ${cov_merge_opts} # Open coverage tool to review and create report or exclusion file. -cov_analyze: +cov_analyze: prep_tool_srcs + @echo "[make]: cov_analyze" ${cov_analyze_cmd} ${cov_analyze_opts} # Generate coverage reports. cov_report: + @echo "[make]: cov_report" ${cov_report_cmd} ${cov_report_opts} clean: diff --git a/dv/uvm/data/vcs/vcs.hjson b/dv/uvm/data/vcs/vcs.hjson index 6e48b197..50dce1e4 100644 --- a/dv/uvm/data/vcs/vcs.hjson +++ b/dv/uvm/data/vcs/vcs.hjson @@ -37,7 +37,7 @@ "+UVM_TEST_SEQ={uvm_test_seq}"] // Coverage related. - cov_db_dir: "{build_dir}/cov.vdb" + 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 failiing tests is not included in the final report. @@ -74,8 +74,10 @@ "-group instcov_for_score", "-line nocasedef", "-format both", + "-elfile {vcs_cov_excl_files}", "-report {cov_report_dir}"] - cov_report_dashboard: "{cov_report_dir}/dashboard.txt" + cov_report_txt: "{cov_report_dir}/dashboard.txt" + cov_report_page: "cov_report/dashboard.html" // Analyzing coverage - this is done by invoking --cov-analyze switch. It opens up the // GUI for visual analysis. @@ -133,7 +135,7 @@ run_opts: [// Enable the required cov metrics "-cm {cov_metrics}", // Same directory as build - "-cm_dir {build_dir}/cov.vdb", + "-cm_dir {cov_db_dir}", // Don't output cm.log which can be quite large "-cm_log /dev/null", // Provide a name to the coverage collected for this test diff --git a/dv/uvm/data/xcelium/xcelium.hjson b/dv/uvm/data/xcelium/xcelium.hjson index 7326ad06..551dfb6c 100644 --- a/dv/uvm/data/xcelium/xcelium.hjson +++ b/dv/uvm/data/xcelium/xcelium.hjson @@ -9,7 +9,10 @@ // {tool_srcs_dir} before running the simulation. tool_srcs: ["{proj_root}/dv/uvm/data/xcelium/*"] - build_opts: [" -elaborate -64bit -access +r -sv", + build_opts: ["-elaborate -64bit -access +r -sv", + "-licqueue", + // TODO: duplicate primitives between OT and Ibex #1231 + "-ALLOWREDEFINITION", "-messages -errormax 50", "-timescale 1ns/1ps", "-f {sv_flist}", @@ -17,39 +20,70 @@ "-xmlibdirname {build_dir}/xcelium.d"] run_opts: ["-input {tool_srcs_dir}/xcelium_{dump}.tcl", + "-licqueue", "-64bit -xmlibdirname {build_dir}/xcelium.d -R", "+SVSEED={seed}", "+UVM_TESTNAME={uvm_test}", "+UVM_TEST_SEQ={uvm_test_seq}"] + // Vars that need to exported to the env. + exports: [ + // Poll for an available license in all servers. + CDS_LIC_QUEUE_POLL: 1 + // Poll for an available license every 1 min. + CDS_LIC_QUEUE_POLL_INT: 60 + + // Export the cov_report path so that the tcl file can read these as env vars. + cov_merge_db_dir: "{cov_merge_db_dir}" + cov_report_dir: "{cov_report_dir}" + ] + // Coverage related. - // TODO: These options have to be filled in. - cov_db_dir: "" + // By default, collect all coverage metrics: block:expr:fsm:toggle:functional. + cov_metrics: all + // Supply the cov configuration file. + // Note that this needs to be set as -covfile . + xcelium_cov_cfg_file: "" + // Supply the cov refinement file. + // Note that this needs to be set as -load_refinement . + xcelium_cov_refine_file: "" + + // Set the coverage directories. + cov_work_dir: "{scratch_path}/coverage" + cov_db_dir: "{cov_work_dir}/{build_mode}" // Individual test specific coverage data - this will be deleted if the test fails // so that coverage from failiing tests is not included in the final report. cov_db_test_dir_name: "{run_dir_name}.{seed}" - cov_db_test_dir: "" + cov_db_test_dir: "{cov_db_dir}/{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_base_path}/cov_merge" - cov_merge_db_dir: "" - cov_merge_cmd: "" - cov_merge_opts: [] + cov_merge_db_dir: "{cov_merge_dir}/merged" + cov_merge_cmd: "{job_prefix} imc" + cov_merge_opts: ["-64bit", + "-licqueue", + "-exec {tool_srcs_dir}/cov_merge.tcl"] // Generate covreage reports in text as well as html. - cov_report_dir: "{scratch_base_path}/cov_report" - cov_report_cmd: "" - cov_report_opts: [] - cov_report_dashboard: "" + cov_report_dir: "{scratch_base_path}/cov_report" + cov_report_cmd: "{job_prefix} imc" + cov_report_opts: ["-64bit", + "-licqueue", + "-exec {tool_srcs_dir}/cov_report.tcl"] + cov_report_txt: "{cov_report_dir}/cov_report.txt" + cov_report_page: "cov_report/index.html" // Analyzing coverage - this is done by invoking --cov-analyze switch. It opens up the // GUI for visual analysis. cov_analyze_dir: "{scratch_base_path}/cov_analyze" - cov_analyze_cmd: "" - cov_analyze_opts: [] + cov_analyze_cmd: "{job_prefix} imc" + cov_analyze_opts: ["-gui", + "-64bit", + "-licqueue", + "-load {cov_merge_db_dir}", + "{xcelium_cov_refine_file}"] // pass and fail patterns build_fail_patterns: ["\\*E.*$"] @@ -60,12 +94,23 @@ name: xcelium_waves is_sim_mode: 1 } - // TODO support coverage for xcelium { name: xcelium_cov is_sim_mode: 1 - build_opts: [] - run_opts: [] + build_opts: [// Enable the required cov metrics. + "-coverage {cov_metrics}", + // Limit the scope of coverage collection to the DUT. + "-covdut {dut}", + // Set the coverage configuration file. + "{xcelium_cov_cfg_file}"] + run_opts: [// Coverage database output location. + "-covworkdir {cov_work_dir}", + // Set the scope to the build mode name. + "-covscope {build_mode}", + // Test coverage dir name to create under cov_db_dir. + "-covtest {cov_db_test_dir_name}", + // Overwrite the coverage data of a specific test/seed if it already exists. + "-covoverwrite"] } // TODO support profile for xcelium {