Skip to content

Commit

Permalink
[otbn,dv] Wait long enough for RF read in otbn_rf_base_intg_err_vseq
Browse files Browse the repository at this point in the history
This vseq wants to start an OTBN run and then, at some time after the
run has started, corrupt the next read of the base register file. Of
course, this needs a bit of a wait: we need to wait until the base
register file is being read. This wait is usually very short (we read
from the RF with most instructions) but is rather longer if we happen
to be stalled reading from RND!

The stall for a RND read is longer when CDC is enabled, and pushed us
over the 2000 cycle max wait. Increasing by another multiple of 10
seems to fix things.

Signed-off-by: Rupert Swarbrick <[email protected]>
  • Loading branch information
rswarbrick authored and sameo committed May 7, 2024
1 parent 1d85079 commit 954fbad
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion hw/ip/otbn/dv/uvm/env/seq_lib/otbn_rf_base_intg_err_vseq.sv
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ class otbn_rf_base_intg_err_vseq extends otbn_base_vseq;
`uvm_object_new
rand bit insert_intg_err_to_a;

// Wait until the selected register file is being used
//
// This will normally just be a couple of cycles (because most instructions read from the register
// file), but it might be a bit longer if we happen to be stalled waiting for the EDN, which
// happens on a RND read.
task await_use();
logic rd_en;
`uvm_info(`gfn, "Waiting for selected RF to be used", UVM_LOW)
Expand All @@ -20,7 +25,8 @@ class otbn_rf_base_intg_err_vseq extends otbn_base_vseq;
rd_en = insert_intg_err_to_a ? cfg.trace_vif.rf_base_rd_en_a :
cfg.trace_vif.rf_base_rd_en_b;
end while(!rd_en);,
cfg.clk_rst_vif.wait_clks(20000);)
cfg.clk_rst_vif.wait_clks(20000);
)
if (!rd_en) begin
`uvm_fatal(`gfn,
$sformatf("Timeout while waiting for register file %s to be used",
Expand Down

0 comments on commit 954fbad

Please sign in to comment.