[dv, xcelium] Properly pass excl files to IMC To the report and analysis stages, the exclusion files were not being properly passed. This PR fixes that. Now, the generated report and the IMC GUI (analysis) should show the exact same coverage numbers. The following changes are made: - A standardized variable 'xcelium_cov_excl_script' is added to HJSon to add exclusions as TCL scripts. I suggest making this the recommended and the only way of setting exclusions. - This is passed to IMC invocation during both, report and analysis stages. - The AES vRefine file is removed because it is not needed (those exclusions are already captured in the common TCL file). - Some minor fixups. Signed-off-by: Srikrishna Iyer <sriyer@google.com>
diff --git a/hw/dv/tools/dvsim/common_sim_cfg.hjson b/hw/dv/tools/dvsim/common_sim_cfg.hjson index dc995b1..a4345e5 100644 --- a/hw/dv/tools/dvsim/common_sim_cfg.hjson +++ b/hw/dv/tools/dvsim/common_sim_cfg.hjson
@@ -146,7 +146,7 @@ // Project defaults for Xcelium xcelium_cov_cfg_file: "{{build_mode}_xcelium_cov_cfg_file}" xcelium_unr_cfg_file: "{dv_root}/tools/xcelium/unr.cfg" - xcelium_common_excl_file: "{dv_root}/tools/xcelium/exclude.tcl" + xcelium_cov_excl_script: "{dv_root}/tools/xcelium/common_cov_excl.tcl" xcelium_cov_refine_files: [] // Build-specific coverage cfg files for Xcelium.
diff --git a/hw/dv/tools/dvsim/xcelium.hjson b/hw/dv/tools/dvsim/xcelium.hjson index 7db825f..fe20faa 100644 --- a/hw/dv/tools/dvsim/xcelium.hjson +++ b/hw/dv/tools/dvsim/xcelium.hjson
@@ -79,8 +79,10 @@ // Note that this needs to be set as -covfile <file>. xcelium_cov_cfg_file: "" - // Supply the cov refinement files. - // Note that this needs to be set as -load_refinement <file>. + // Supply the cov exclusion tcl script - passed on to IMC using the -init switch. + xcelium_cov_excl_script: "" + + // Supply the cov refinement files - passed on to IMC using the -load_refinement switch. xcelium_cov_refine_files: [] // Set the coverage directories. @@ -106,8 +108,10 @@ cov_report_cmd: "{job_prefix} imc" cov_report_opts: ["-64bit", "-licqueue", - "-exec {dv_root}/tools/xcelium/cov_report.tcl", - "{xcelium_cov_refine_files}"] + "-load {cov_merge_db_dir}", + " {eval_cmd} echo {xcelium_cov_excl_script} | sed -E 's/(\\S+)/-init \\1/g' ", + " {eval_cmd} echo {xcelium_cov_refine_files} | sed -E 's/(\\S+)/-load_refinement \\1/g' ", + "-exec {dv_root}/tools/xcelium/cov_report.tcl"] cov_report_txt: "{cov_report_dir}/cov_report.txt" cov_report_page: "index.html" @@ -115,11 +119,10 @@ // GUI for visual analysis. cov_analyze_dir: "{scratch_path}/cov_analyze" cov_analyze_cmd: "{job_prefix} imc" - cov_analyze_opts: ["-gui", - "-64bit", + cov_analyze_opts: ["-64bit", "-licqueue", "-load {cov_merge_db_dir}", - "-init {xcelium_common_excl_file}", + " {eval_cmd} echo {xcelium_cov_excl_script} | sed -E 's/(\\S+)/-init \\1/g' ", " {eval_cmd} echo {xcelium_cov_refine_files} | sed -E 's/(\\S+)/-load_refinement \\1/g' "] cov_unr_dir: "{scratch_path}/cov_unr"
diff --git a/hw/dv/tools/xcelium/common_cov_excl.tcl b/hw/dv/tools/xcelium/common_cov_excl.tcl new file mode 100644 index 0000000..2fcafd0 --- /dev/null +++ b/hw/dv/tools/xcelium/common_cov_excl.tcl
@@ -0,0 +1,8 @@ +# Copyright lowRISC contributors. +# Licensed under the Apache License, Version 2.0, see LICENSE for details. +# SPDX-License-Identifier: Apache-2.0 + +exclude -inst $::env(DUT_TOP) -toggle '*tl_i.a_user.rsvd' -comment "\[UNSUPPORTED\] Based on our Comportability Spec. Exercising this will result in assertion errors thrown." +exclude -inst $::env(DUT_TOP) -toggle '*tl_i.a_param' -comment "\[UNSUPPORTED\] Based on our Comportability Spec. Exercising this will result in assertion errors thrown." +exclude -inst $::env(DUT_TOP) -toggle '*tl_o.d_param' -comment "\[UNR\] Follows tl_i.a_param which is unsupported." +exclude -inst $::env(DUT_TOP) -toggle '*tl_o.d_sink' -comment "\[UNR\] Based on our Comportability Spec."
diff --git a/hw/dv/tools/xcelium/common_toggle_excl b/hw/dv/tools/xcelium/common_toggle_excl deleted file mode 100644 index 841868f..0000000 --- a/hw/dv/tools/xcelium/common_toggle_excl +++ /dev/null
@@ -1,15 +0,0 @@ -// Copyright lowRISC contributors. -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 - -// Baesd on our Comportable IP spec, these TL pins are reserved / unused. -// -// Add this to the ccf with the following command: -// set_toggle_excludefile ${dv_root}/tools/xcelium/common_toggle_excl -// -// It is not being added right now because it is not working. -// TODO: Work with AE to understand how can this be achieved. --ere module ${DUT_TOP}\.*tl_i\.a_user\.rsvd --ere module ${DUT_TOP}\.*tl_i\.a_param --ere module ${DUT_TOP}\.*tl_o\.d_param --ere module ${DUT_TOP}\.*tl_o\.d_sink
diff --git a/hw/dv/tools/xcelium/cov_report.tcl b/hw/dv/tools/xcelium/cov_report.tcl index d0891c7..975e933 100644 --- a/hw/dv/tools/xcelium/cov_report.tcl +++ b/hw/dv/tools/xcelium/cov_report.tcl
@@ -3,10 +3,10 @@ # SPDX-License-Identifier: Apache-2.0 # Generate reports for the merged coverage in HTML and text format. - -# Set the input merged coverage database directory using the env var 'cov_merge_db_dir'. -# The supplied env var may have quotes or spaces that needs to be trimmed. -set cov_merge_db_dir [string trim $::env(cov_merge_db_dir) " \"'"] +# +# This file is passed to IMC using the -exec switch. Ensure that the merged coverage database, the +# exclusion script and the coverage refinement files are passed to the IMC invocation using the +# -load, -init and -load_refinement switches respectively (whichever ones are applicable). # Set the output directory for the reports database using the env var 'cov_report_dir'. # The supplied env var may have quotes or spaces that needs to be trimmed. @@ -15,10 +15,6 @@ # Set the DUT name. set dut [string trim $::env(DUT_TOP)] set dut_uc [string toupper $dut] -set dut_instance [string trim $::env(dut_instance)] - -# Load the merged coverage database. -load -run $cov_merge_db_dir # Generate the text report (summary is sufficient). report -summary \
diff --git a/hw/dv/tools/xcelium/exclude.tcl b/hw/dv/tools/xcelium/exclude.tcl deleted file mode 100644 index 12ee0d1..0000000 --- a/hw/dv/tools/xcelium/exclude.tcl +++ /dev/null
@@ -1,8 +0,0 @@ -# Copyright lowRISC contributors. -# Licensed under the Apache License, Version 2.0, see LICENSE for details. -# SPDX-License-Identifier: Apache-2.0 - -exclude -inst $::env(DUT_TOP) -toggle 'tl_i.a_user.rsvd' -exclude -inst $::env(DUT_TOP) -toggle 'tl_i.a_param' -exclude -inst $::env(DUT_TOP) -toggle 'tl_o.d_param' -exclude -inst $::env(DUT_TOP) -toggle 'tl_o.d_sink'
diff --git a/hw/ip/aes/dv/aes_sim_cfg.hjson b/hw/ip/aes/dv/aes_sim_cfg.hjson index d11c083..df34cec 100644 --- a/hw/ip/aes/dv/aes_sim_cfg.hjson +++ b/hw/ip/aes/dv/aes_sim_cfg.hjson
@@ -46,9 +46,6 @@ uvm_test: aes_base_test uvm_test_seq: aes_wake_up_vseq - // AES specific exclusions - xcelium_cov_refine_files: ["{proj_root}/hw/ip/aes/dv/cov/aes_cov.vRefine"] - // Update all builds to add options specific to AES C model compilation. en_build_modes: ["{tool}_aes_model_build_opts"] @@ -63,8 +60,7 @@ } ] - -run_opts: ["+uvm_set_verbosity={component_a},{id_a},{verbosity_a},{phase_a}"] + run_opts: ["+uvm_set_verbosity={component_a},{id_a},{verbosity_a},{phase_a}"] // List of test specifications. tests: [ @@ -124,7 +120,8 @@ } { name: stress - tests: ["aes_stress","aes_b2b", "aes_clear", "aes_config_error", "aes_smoke", "aes_alert_reset"] + tests: ["aes_stress","aes_b2b", "aes_clear", "aes_config_error", "aes_smoke", + "aes_alert_reset"] } ] }
diff --git a/hw/ip/aes/dv/cov/aes_cov.vRefine b/hw/ip/aes/dv/cov/aes_cov.vRefine deleted file mode 100644 index 6bf4ae7..0000000 --- a/hw/ip/aes/dv/cov/aes_cov.vRefine +++ /dev/null
@@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?> -<refinement-file-root> - <information comment-version="1" creation-time="Thu 04 Mar 2021 01:47:06 PST" creator="rasmus.madsen" csCheck="false" modified-by="rasmus.madsen" modify-time="Wed 10 Mar 2021 01:54:48 PST" save-ref-method="seq" tool-version="Cadence vManager20.09" rules-signature-c="e2743b896ba5cfea53f1e8edcd36a1"> - <ucm-files> - </ucm-files> - <ccf-files> - </ccf-files> - </information> - <rules> - <rule ccType="inst" comment="0" domain="icc" entityName="aes/"tl_i.a_param"" entityType="toggle" excTime="1615370069" name="exclude" reviewer="rasmus" user="1" vscope="default"></rule> - <rule ccType="inst" domain="icc" entityName="aes/"tl_o.d_param"" entityType="toggle" excTime="1615369582" name="exclude" reviewer="unknown" user="1" vscope="default"></rule> - <rule ccType="inst" domain="icc" entityName="aes/"tl_o.d_sink"" entityType="toggle" excTime="1615369582" name="exclude" reviewer="unknown" user="1" vscope="default"></rule> - </rules> - <cache-map> - <cache-entry key="0" value="[NOT SUPPORTED] This is excluded from the common exclusion file -as the port is not used in the design"></cache-entry> - <cache-entry key="1" value="rasmus.madsen"></cache-entry> - </cache-map> -</refinement-file-root>