[dv:entropy_src] Added vif/knob/signal for efuse_es_sw_reg_en
Signed-off-by: Steve Nelson <steve.nelson@wdc.com>
diff --git a/hw/ip/entropy_src/data/entropy_src_testplan.hjson b/hw/ip/entropy_src/data/entropy_src_testplan.hjson
index 2125ce4..c20d497 100644
--- a/hw/ip/entropy_src/data/entropy_src_testplan.hjson
+++ b/hw/ip/entropy_src/data/entropy_src_testplan.hjson
@@ -83,14 +83,16 @@
{
name: stress_all
desc: '''
- This will combine the other individual testpoints while injecting TL errors and running CSR tests in parallel.'''
+ This will combine the other individual testpoints while injecting TL errors and
+ running CSR tests in parallel.'''
milestone: V2
tests: []
}
{
name: stress_all_with_random_reset
desc: '''
- This will combine the other individual testpoints while injecting TL errors and running CSR tests in parallel and asserting reset in the middle of test.'''
+ This will combine the other individual testpoints while injecting TL errors and
+ running CSR tests in parallel and asserting reset in the middle of test.'''
milestone: V2
tests: []
}
diff --git a/hw/ip/entropy_src/dv/env/entropy_src_env.sv b/hw/ip/entropy_src/dv/env/entropy_src_env.sv
index 9b69914..692c6fe 100644
--- a/hw/ip/entropy_src/dv/env/entropy_src_env.sv
+++ b/hw/ip/entropy_src/dv/env/entropy_src_env.sv
@@ -14,6 +14,10 @@
function void build_phase(uvm_phase phase);
super.build_phase(phase);
+
+ if (!uvm_config_db#(virtual pins_if)::get(this, "", "efuse_es_sw_reg_en_vif", cfg.efuse_es_sw_reg_en_vif)) begin
+ `uvm_fatal(get_full_name(), "failed to get efuse_es_sw_reg_en_vif from uvm_config_db")
+ end
endfunction
function void connect_phase(uvm_phase phase);
diff --git a/hw/ip/entropy_src/dv/env/entropy_src_env_cfg.sv b/hw/ip/entropy_src/dv/env/entropy_src_env_cfg.sv
index f3441da..ff24083 100644
--- a/hw/ip/entropy_src/dv/env/entropy_src_env_cfg.sv
+++ b/hw/ip/entropy_src/dv/env/entropy_src_env_cfg.sv
@@ -11,6 +11,8 @@
`uvm_object_new
+ virtual pins_if efuse_es_sw_reg_en_vif;
+
virtual function void initialize_csr_addr_map_size();
this.csr_addr_map_size = ENTROPY_SRC_ADDR_MAP_SIZE;
endfunction : initialize_csr_addr_map_size
diff --git a/hw/ip/entropy_src/dv/env/seq_lib/entropy_src_base_vseq.sv b/hw/ip/entropy_src/dv/env/seq_lib/entropy_src_base_vseq.sv
index af890fd..a7d90b5 100644
--- a/hw/ip/entropy_src/dv/env/seq_lib/entropy_src_base_vseq.sv
+++ b/hw/ip/entropy_src/dv/env/seq_lib/entropy_src_base_vseq.sv
@@ -10,8 +10,10 @@
);
`uvm_object_utils(entropy_src_base_vseq)
+ bit efuse_es_sw_reg_en = 1'b1;
+
// various knobs to enable certain routines
- bit do_entropy_src_init = 1'b1;
+ bit do_entropy_src_init = 1'b1;
`uvm_object_new
@@ -27,6 +29,7 @@
// setup basic entropy_src features
virtual task entropy_src_init();
+ cfg.efuse_es_sw_reg_en_vif.drive_pin(.idx(0), .val(efuse_es_sw_reg_en));
endtask
endclass : entropy_src_base_vseq
diff --git a/hw/ip/entropy_src/dv/tb/tb.sv b/hw/ip/entropy_src/dv/tb/tb.sv
index 232fb3e..d338368 100644
--- a/hw/ip/entropy_src/dv/tb/tb.sv
+++ b/hw/ip/entropy_src/dv/tb/tb.sv
@@ -15,6 +15,7 @@
wire clk, rst_n;
wire devmode;
+ wire efuse_es_sw_reg_en;
wire [NUM_MAX_INTERRUPTS-1:0] interrupts;
wire intr_entropy_valid;
wire intr_rct_failed;
@@ -25,6 +26,7 @@
clk_rst_if clk_rst_if(.clk(clk), .rst_n(rst_n));
pins_if #(NUM_MAX_INTERRUPTS) intr_if(interrupts);
pins_if #(1) devmode_if(devmode);
+ pins_if #(1) efuse_es_sw_reg_en_if(efuse_es_sw_reg_en);
tl_if tl_if(.clk(clk), .rst_n(rst_n));
// dut
@@ -35,7 +37,7 @@
.tl_i (tl_if.h2d ),
.tl_o (tl_if.d2h ),
- .efuse_es_sw_reg_en_i (1'b1),
+ .efuse_es_sw_reg_en_i (efuse_es_sw_reg_en),
.entropy_src_hw_if_o (),
.entropy_src_hw_if_i (),
@@ -49,6 +51,7 @@
.es_fifo_err_o (intr_fifo_err)
);
+
assign interrupts[EntropyValid] = intr_entropy_valid;
assign interrupts[RctFailed] = intr_rct_failed;
assign interrupts[AptFailed] = intr_apt_failed;
@@ -60,6 +63,7 @@
uvm_config_db#(virtual clk_rst_if)::set(null, "*.env", "clk_rst_vif", clk_rst_if);
uvm_config_db#(intr_vif)::set(null, "*.env", "intr_vif", intr_if);
uvm_config_db#(devmode_vif)::set(null, "*.env", "devmode_vif", devmode_if);
+ uvm_config_db#(virtual pins_if)::set(null, "*.env", "efuse_es_sw_reg_en_vif", efuse_es_sw_reg_en_if);
uvm_config_db#(virtual tl_if)::set(null, "*.env.m_tl_agent*", "vif", tl_if);
$timeformat(-12, 0, " ps", 12);
run_test();
diff --git a/hw/ip/entropy_src/dv/tests/entropy_src_base_test.sv b/hw/ip/entropy_src/dv/tests/entropy_src_base_test.sv
index 005bc52..9c8acd4 100644
--- a/hw/ip/entropy_src/dv/tests/entropy_src_base_test.sv
+++ b/hw/ip/entropy_src/dv/tests/entropy_src_base_test.sv
@@ -10,6 +10,10 @@
`uvm_component_utils(entropy_src_base_test)
`uvm_component_new
+ virtual function void build_phase(uvm_phase phase);
+ super.build_phase(phase);
+ endfunction // build_phase
+
// the base class dv_base_test creates the following instances:
// entropy_src_env_cfg: cfg
// entropy_src_env: env