diff --git a/dv/uvm/icache/dv/ibex_icache_sim.core b/dv/uvm/icache/dv/ibex_icache_sim.core index 1992b80b..22e7c26d 100644 --- a/dv/uvm/icache/dv/ibex_icache_sim.core +++ b/dv/uvm/icache/dv/ibex_icache_sim.core @@ -18,8 +18,17 @@ filesets: targets: sim: + parameters: + - ICacheECC filesets: - files_rtl - files_dv toplevel: tb default_tool: vcs + +parameters: + ICacheECC: + datatype: int + default: 0 + paramtype: vlogparam + description: "Enable ECC protection in instruction cache" diff --git a/dv/uvm/icache/dv/ibex_icache_sim_cfg.hjson b/dv/uvm/icache/dv/ibex_icache_sim_cfg.hjson index 19c59959..5d9edb3c 100644 --- a/dv/uvm/icache/dv/ibex_icache_sim_cfg.hjson +++ b/dv/uvm/icache/dv/ibex_icache_sim_cfg.hjson @@ -20,10 +20,15 @@ // Testplan hjson file. testplan: "{proj_root}/dv/uvm/icache/data/ibex_icache_testplan.hjson" - // Import additional common sim cfg files. - import_cfgs: [// Project wide common sim cfg file - "{proj_root}/dv/uvm/data/common_sim_cfg.hjson"] + import_cfgs: [ + // Project wide common sim cfg file + "{proj_root}/dv/uvm/data/common_sim_cfg.hjson", + + // Configuration options that should apply after the settings in + // common_sim_cfg. + "{proj_root}/dv/uvm/icache/dv/late_cfg.hjson" + ] // Default iterations for all tests - each test entry can override this. reseed: 50 diff --git a/dv/uvm/icache/dv/late_cfg.hjson b/dv/uvm/icache/dv/late_cfg.hjson new file mode 100644 index 00000000..731aa3e6 --- /dev/null +++ b/dv/uvm/icache/dv/late_cfg.hjson @@ -0,0 +1,9 @@ +// Copyright lowRISC contributors. +// Licensed under the Apache License, Version 2.0, see LICENSE for details. +// SPDX-License-Identifier: Apache-2.0 +{ + // Set any fusesoc parameters by appending to sv_flist_gen_opts + // + // We want to enable ICache ECC (needed for the ECC test below) + sv_flist_gen_opts: ["--ICacheECC=1"] +} diff --git a/dv/uvm/icache/dv/tb/tb.sv b/dv/uvm/icache/dv/tb/tb.sv index 60a8d30f..a10cf8a9 100644 --- a/dv/uvm/icache/dv/tb/tb.sv +++ b/dv/uvm/icache/dv/tb/tb.sv @@ -2,7 +2,9 @@ // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 // -module tb; +module tb #( + parameter bit ICacheECC = 1'b0 +); // dep packages import uvm_pkg::*; import dv_utils_pkg::*; @@ -22,7 +24,9 @@ module tb; ibex_icache_mem_if mem_if (.clk(clk), .rst_n(rst_n)); // dut - ibex_icache dut ( + ibex_icache #( + .ICacheECC (ICacheECC) + ) dut ( .clk_i (clk), .rst_ni (rst_n),