From ba6c1971442bc153321ea53569e1ef6deb50812c Mon Sep 17 00:00:00 2001 From: Rupert Swarbrick Date: Wed, 11 Dec 2024 16:09:55 +0000 Subject: [PATCH] [dv] Try harder for late randomisation in cip_base_vseq The increment_outstanding_access() call is now a task that can consume time. Move things so we randomise the sequence that we are going to enqueue just before we enqueue it. Signed-off-by: Rupert Swarbrick --- hw/dv/sv/cip_lib/seq_lib/cip_base_vseq.sv | 2 +- hw/dv/sv/cip_lib/seq_lib/cip_base_vseq__tl_errors.svh | 2 +- hw/ip/rv_dm/dv/env/seq_lib/rv_dm_buffered_enable_vseq.sv | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/dv/sv/cip_lib/seq_lib/cip_base_vseq.sv b/hw/dv/sv/cip_lib/seq_lib/cip_base_vseq.sv index 7b2dc006f1db3..35879c5d41a58 100644 --- a/hw/dv/sv/cip_lib/seq_lib/cip_base_vseq.sv +++ b/hw/dv/sv/cip_lib/seq_lib/cip_base_vseq.sv @@ -251,6 +251,7 @@ class cip_base_vseq #( cip_tl_host_single_seq tl_seq; `uvm_create_on(tl_seq, tl_sequencer_h) + csr_utils_pkg::increment_outstanding_access(); tl_seq.instr_type = instr_type; tl_seq.tl_intg_err_type = tl_intg_err_type; if (cfg.zero_delays) begin @@ -264,7 +265,6 @@ class cip_base_vseq #( mask == local::mask; data == local::data;) - csr_utils_pkg::increment_outstanding_access(); `DV_SPINWAIT(`uvm_send_pri(tl_seq, 100), $sformatf("Timeout waiting tl_access : addr=0x%0h", addr), tl_access_timeout_ns) diff --git a/hw/dv/sv/cip_lib/seq_lib/cip_base_vseq__tl_errors.svh b/hw/dv/sv/cip_lib/seq_lib/cip_base_vseq__tl_errors.svh index a362d8dc48cc7..e8923e00250f1 100644 --- a/hw/dv/sv/cip_lib/seq_lib/cip_base_vseq__tl_errors.svh +++ b/hw/dv/sv/cip_lib/seq_lib/cip_base_vseq__tl_errors.svh @@ -12,13 +12,13 @@ seq_t_ tl_seq; \ `uvm_info(`gfn, {"Running ", `"task_name_`"}, UVM_MEDIUM) \ `uvm_create_on(tl_seq, seqr_t) \ + csr_utils_pkg::increment_outstanding_access(); \ if (cfg.zero_delays) begin \ tl_seq.min_req_delay = 0; \ tl_seq.max_req_delay = 0; \ end \ tl_seq.req_abort_pct = $urandom_range(0, 100); \ `DV_CHECK_RANDOMIZE_WITH_FATAL(tl_seq, with_c_) \ - csr_utils_pkg::increment_outstanding_access(); \ `DV_SPINWAIT(`uvm_send_pri(tl_seq, 1), \ $sformatf("Timeout: %0s with addr %0h", `"task_name_`", tl_seq.addr), 100_000_000) \ csr_utils_pkg::decrement_outstanding_access(); \ diff --git a/hw/ip/rv_dm/dv/env/seq_lib/rv_dm_buffered_enable_vseq.sv b/hw/ip/rv_dm/dv/env/seq_lib/rv_dm_buffered_enable_vseq.sv index 0042a939dbdf8..225285d1b87fa 100644 --- a/hw/ip/rv_dm/dv/env/seq_lib/rv_dm_buffered_enable_vseq.sv +++ b/hw/ip/rv_dm/dv/env/seq_lib/rv_dm_buffered_enable_vseq.sv @@ -85,6 +85,8 @@ class rv_dm_buffered_enable_vseq extends rv_dm_base_vseq; force_enable_at(Rom); end + csr_utils_pkg::increment_outstanding_access(); + // We want to send a TL request to fetch WHERETO. If fetching is enabled, this should respond // with a JAL to some address (tested by rv_dm_halt_resume_whereto_vseq). If not, we have just // forced the TL connection to work so we should manage to perform the TL transaction, but it @@ -99,7 +101,6 @@ class rv_dm_buffered_enable_vseq extends rv_dm_base_vseq; `DV_CHECK_RANDOMIZE_WITH_FATAL(seq, write == 1'b0; addr == 'h300 + mem_base_addr; mask == 4'hf;) - csr_utils_pkg::increment_outstanding_access(); `DV_SPINWAIT(`uvm_send_pri(seq, 100), "Timed out when sending fetch request") csr_utils_pkg::decrement_outstanding_access();