Skip to content

Commit

Permalink
[dv] Try harder for late randomisation in cip_base_vseq
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
rswarbrick committed Dec 11, 2024
1 parent d74af61 commit ba6c197
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hw/dv/sv/cip_lib/seq_lib/cip_base_vseq.sv
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion hw/dv/sv/cip_lib/seq_lib/cip_base_vseq__tl_errors.svh
Original file line number Diff line number Diff line change
Expand Up @@ -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(); \
Expand Down
3 changes: 2 additions & 1 deletion hw/ip/rv_dm/dv/env/seq_lib/rv_dm_buffered_enable_vseq.sv
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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();

Expand Down

0 comments on commit ba6c197

Please sign in to comment.