[dvsim] Fix HJson bugs
- The `exports` key is meant to have a list of key-value pairs (dicts).
Instead, currently they are all parsed as strings instead. This fixes
the exports key and thereby enables the removal of `FlowCfg::process_exports()` subroutine.
- The values in the exports var also contains variable substitutions
(what we are referring to as wildcards) encapsulated in braces without
quotes - this is not allowed in HJson. Values that begin and end in
braces must have quotes, otherwise the braces end up getting treated as
HJson punctuation syntax. It is working currently because it treats the
complete item in a list (separated by comma) as a string.
- As with the first bullet, the `process_exports()` is removed from the
code.
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 32c7ea1..56daa36 100644
--- a/hw/dv/tools/dvsim/common_sim_cfg.hjson
+++ b/hw/dv/tools/dvsim/common_sim_cfg.hjson
@@ -75,12 +75,12 @@
// Default list of things to export to shell
exports: [
- TOOL_SRCS_DIR: {tool_srcs_dir}
- EN_WAVES: {waves}
- DUMP_FMT: {dump_fmt}
- DUT_TOP: {dut}
- TB_TOP: {tb}
- dut_instance: {dut_instance}
+ { TOOL_SRCS_DIR: "{tool_srcs_dir}" },
+ { EN_WAVES: "{waves}" },
+ { DUMP_FMT: "{dump_fmt}" },
+ { DUT_TOP: "{dut}" },
+ { TB_TOP: "{tb}" },
+ { dut_instance: "{dut_instance}" }
]
// Build modes are collection of build_opts and run_opts
diff --git a/hw/dv/tools/dvsim/dsim.hjson b/hw/dv/tools/dvsim/dsim.hjson
index 54fb0a6..33d0784 100644
--- a/hw/dv/tools/dvsim/dsim.hjson
+++ b/hw/dv/tools/dvsim/dsim.hjson
@@ -5,8 +5,7 @@
build_cmd: "{job_prefix} dsim"
run_cmd: "{job_prefix} dsim"
- build_opts: [
- "-work {build_dir}/dsim_out",
+ build_opts: ["-work {build_dir}/dsim_out",
"-genimage image",
"-sv",
// Set parallel compilation jobs limit
@@ -21,16 +20,14 @@
"+incdir+{build_dir}",
// Suppress following DSim errors and warnings:
// EnumMustBePositive - UVM 1.2 violates this
- "-suppress EnumMustBePositive"
- ]
+ "-suppress EnumMustBePositive"]
- run_opts: [
- "-work {build_dir}/dsim_out",
+ 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 std output (lines will be written in proper order)
+ // 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}"]
@@ -38,7 +35,7 @@
// Indicate the tool specific helper sources - these are copied over to the
// {tool_srcs_dir} before running the simulation.
// TODO, there is no dsim tool file, point to vcs for now to avoid error from script
- tool_srcs: ["{dv_root}/tools/vcs/*"]
+ tool_srcs: ["{dv_root}/tools/vcs/*"]
// TODO: refactor coverage configuration for DSim.
@@ -56,13 +53,12 @@
cov_merge_dir: "{scratch_base_path}/cov_merge"
cov_merge_db_dir: "{cov_merge_dir}/merged.vdb"
cov_merge_cmd: "{job_prefix} urg"
- cov_merge_opts: [
- ]
+ cov_merge_opts: []
+
// Generate coverage reports in text as well as html.
cov_report_dir: "{scratch_base_path}/cov_report"
cov_report_cmd: "{job_prefix} urg"
- cov_report_opts: [
- ]
+ cov_report_opts: []
cov_report_txt: "{cov_report_dir}/dashboard.txt"
cov_report_page: "dashboard.html"
@@ -72,40 +68,35 @@
cov_analyze_cmd: "{job_prefix} verdi"
cov_analyze_opts: ["-cov",
"-covdir {cov_merge_db_dir}",
- "-line nocasedef"
+ "-line nocasedef",
"-elfile {vcs_cov_excl_files}"]
// Vars that need to exported to the env.
- exports: [
- ]
+ exports: []
// Defaults for DSim
// TODO: there is currently no equivalent of "all" coverage metrics in DSim
- cov_metrics: ""
+ cov_metrics: ""
// pass and fail patterns
build_fail_patterns: ["^Error-.*$"]
run_fail_patterns: ["^Error-.*$"] // Null pointer error
// waveform
- wave_type: "vcd"
- wave_file: "dsim_wave.{wave_type}"
- probe_file: "dsim.probe"
+ wave_type: "vcd"
+ wave_file: "dsim_wave.{wave_type}"
+ probe_file: "dsim.probe"
build_modes: [
{
name: dsim_waves
is_sim_mode: 1
- build_opts: [
- "+acc+b"
- ]
- run_opts: [
- "-waves {wave_file}",
- // dsim.probe is currently undefined
- //"-wave-scope-specs {probe_file}",
- // Dump unpacked structs and arrays.
- "-dump-agg"
- ]
+ build_opts: ["+acc+b"]
+ run_opts: ["-waves {wave_file}",
+ // dsim.probe is currently undefined
+ //"-wave-scope-specs {probe_file}",
+ // Dump unpacked structs and arrays.
+ "-dump-agg"]
}
// TODO: support coverage mode
// Note: no specific build or run options are required for dsim to produce functional
diff --git a/hw/dv/tools/dvsim/vcs.hjson b/hw/dv/tools/dvsim/vcs.hjson
index ff0ca5f..34bcc8b 100644
--- a/hw/dv/tools/dvsim/vcs.hjson
+++ b/hw/dv/tools/dvsim/vcs.hjson
@@ -149,8 +149,8 @@
// Vars that need to exported to the env.
exports: [
- VCS_ARCH_OVERRIDE: linux
- VCS_LIC_EXPIRE_WARNING: 1
+ { VCS_ARCH_OVERRIDE: "linux" },
+ { VCS_LIC_EXPIRE_WARNING: 1 }
]
// Defaults for VCS
diff --git a/hw/dv/tools/dvsim/xcelium.hjson b/hw/dv/tools/dvsim/xcelium.hjson
index a816192..1a47c88 100644
--- a/hw/dv/tools/dvsim/xcelium.hjson
+++ b/hw/dv/tools/dvsim/xcelium.hjson
@@ -33,18 +33,19 @@
// Vars that need to exported to the env.
exports: [
// Poll for an available license in all servers.
- CDS_LIC_QUEUE_POLL: 1
+ { CDS_LIC_QUEUE_POLL: 1 },
+
// Poll for an available license every 1 min.
- CDS_LIC_QUEUE_POLL_INT: 60
+ { CDS_LIC_QUEUE_POLL_INT: 60 },
// X-prop related: these were suggested by Xcelium as warnings during the build time.
// These enable array corruption when the index is out of range or invalid.
- VL_ENABLE_INVALID_IDX_XPROP: 1
- VL_ENABLE_OUTOFRANGE_IDX_XPROP: 1
+ { VL_ENABLE_INVALID_IDX_XPROP: 1 },
+ { VL_ENABLE_OUTOFRANGE_IDX_XPROP: 1 },
// 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}"
+ { cov_merge_db_dir: "{cov_merge_db_dir}" },
+ { cov_report_dir: "{cov_report_dir}" }
]
// Coverage related.
@@ -57,7 +58,7 @@
// Supply the cov refinement files.
// Note that this needs to be set as -load_refinement <file>.
- xcelium_cov_refine_files: [""]
+ xcelium_cov_refine_files: []
// Set the coverage directories.
cov_work_dir: "{scratch_path}/coverage"
diff --git a/hw/formal/tools/dvsim/common_fpv_cfg.hjson b/hw/formal/tools/dvsim/common_fpv_cfg.hjson
index 7676b89..15b02af 100644
--- a/hw/formal/tools/dvsim/common_fpv_cfg.hjson
+++ b/hw/formal/tools/dvsim/common_fpv_cfg.hjson
@@ -32,9 +32,10 @@
// Vars that need to exported to the env
exports: [
- FPV_TOP: {dut}
- COV: {cov}
+ { FPV_TOP: "{dut}" },
+ { COV: "{cov}" }
]
+
report_cmd: "python3 {proj_root}/hw/formal/tools/{tool}/parse-fpv-report.py"
report_opts: ["--logpath={build_dir}/fpv.log",
"--reppath={build_dir}/results.hjson",
diff --git a/hw/syn/tools/dvsim/dc.hjson b/hw/syn/tools/dvsim/dc.hjson
index 7f242fa..540a8e4 100644
--- a/hw/syn/tools/dvsim/dc.hjson
+++ b/hw/syn/tools/dvsim/dc.hjson
@@ -12,10 +12,12 @@
"{foundry_sdc_path}/{foundry_sdc_file}"]
// Environment variables that are needed in the synthesis script
- exports: [{"DUT" : "{dut}"},
- {"CONSTRAINT": "{sdc_file}"},
- {"BUILD_DIR" : "{build_dir}"},
- {"SV_FLIST" : "{sv_flist}"}]
+ exports: [
+ { DUT: "{dut}" },
+ { CONSTRAINT: "{sdc_file}" },
+ { BUILD_DIR: "{build_dir}" },
+ { SV_FLIST: "{sv_flist}" }
+ ]
// Tool invocation
build_cmd: "{job_prefix} dc_shell-xg-t "
@@ -25,7 +27,7 @@
report_cmd: "{proj_root}/hw/syn/tools/{tool}/parse-syn-report.py --depth {area_depth}"
report_opts: ["--dut {dut}",
"--logpath {build_dir} ",
- "--reppath {build_dir}/REPORTS/ ",
+ "--reppath {build_dir}/REPORTS",
"--outdir {build_dir}"]
// Restrict the maximum message count in each category