diff --git a/dv/uvm/core_ibex/tests/core_ibex_new_seq_lib.sv b/dv/uvm/core_ibex/tests/core_ibex_new_seq_lib.sv index 3b2c4320..baa1603b 100644 --- a/dv/uvm/core_ibex/tests/core_ibex_new_seq_lib.sv +++ b/dv/uvm/core_ibex/tests/core_ibex_new_seq_lib.sv @@ -225,3 +225,38 @@ class memory_error_seq extends core_base_new_seq#(irq_seq_item); endtask endclass: memory_error_seq + +class fetch_enable_seq extends core_base_new_seq#(irq_seq_item); + + `uvm_object_utils(fetch_enable_seq) + `uvm_object_new + + ibex_pkg::fetch_enable_t fetch_enable; + int unsigned on_bias_pc = 50; + int max_delay = 500; + int min_delay = 75; + rand int unsigned off_delay = 0; + + virtual task body(); + dut_vif.dut_cb.fetch_enable <= ibex_pkg::FetchEnableOn; + if(off_delay == 0) begin + `DV_CHECK_MEMBER_RANDOMIZE_WITH_FATAL(off_delay, + off_delay inside {[min_delay : max_delay]};) + end + super.body(); + endtask + + virtual task send_req(); + `uvm_info(get_full_name(), "Sending fetch enable request", UVM_LOW) + `DV_CHECK_MEMBER_RANDOMIZE_WITH_FATAL(fetch_enable, + fetch_enable dist {ibex_pkg::FetchEnableOn :/ on_bias_pc, + [0:15] :/ 100 - on_bias_pc}; + ) + `uvm_info(`gfn, $sformatf("fetch_enable = %d", fetch_enable), UVM_LOW) + dut_vif.dut_cb.fetch_enable <= fetch_enable; + clk_vif.wait_clks(off_delay); + dut_vif.dut_cb.fetch_enable <= ibex_pkg::FetchEnableOn; + + endtask + +endclass diff --git a/dv/uvm/core_ibex/tests/core_ibex_test_lib.sv b/dv/uvm/core_ibex/tests/core_ibex_test_lib.sv index 808d3691..8dde62e6 100644 --- a/dv/uvm/core_ibex/tests/core_ibex_test_lib.sv +++ b/dv/uvm/core_ibex/tests/core_ibex_test_lib.sv @@ -1400,17 +1400,23 @@ class core_ibex_invalid_csr_test extends core_ibex_directed_test; endclass -class core_mem_err_test extends core_ibex_directed_test; - memory_error_seq memory_error_seq_h; +class core_ibex_fetch_en_chk_test extends core_ibex_directed_test; - `uvm_component_utils(core_mem_err_test) + `uvm_component_utils(core_ibex_fetch_en_chk_test) `uvm_component_new virtual task send_stimulus(); - memory_error_seq_h = memory_error_seq::type_id::create("memory_error_seq_h"); - memory_error_seq_h.vseq.cfg = cfg; - memory_error_seq_h.vseq.mem = mem; - memory_error_seq_h.start(env.vseqr); - endtask: send_stimulus + fetch_enable_seq fetch_enable_seq_h; + fetch_enable_seq_h = fetch_enable_seq::type_id::create("fetch_enable_seq_h", this); + `uvm_info(`gfn, "Running core_ibex_fetch_en_chk_test", UVM_LOW) + fork + begin + vseq.start(env.vseqr); + end + begin + fetch_enable_seq_h.start(env.vseqr); + end + join_any + endtask -endclass: core_mem_err_test +endclass