Skip to content

Commit

Permalink
Fix for an underflow case where dlen is so small that the underflow_b…
Browse files Browse the repository at this point in the history
…ytes constraint wraps around
  • Loading branch information
calebofearth committed Apr 25, 2024
1 parent 3401875 commit 55e94a2
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ task soc_ifc_env_mbox_dlen_underflow_sequence::mbox_push_datain();
int unsigned underflow_bytes;

// Push less data than dlen requires - randomize how much less
if (!std::randomize(underflow_bytes) with {underflow_bytes <= mbox_op_rand.dlen - 8;})
if (!std::randomize(underflow_bytes) with {!mbox_op_rand.cmd.cmd_s.resp_reqd -> underflow_bytes <= mbox_op_rand.dlen;
mbox_op_rand.cmd.cmd_s.resp_reqd -> underflow_bytes <= mbox_op_rand.dlen - 8;})
`uvm_error("MBOX_UNDERFLOW_SEQ", "Failed to randomize underflow bytes")
else
`uvm_info("MBOX_UNDERFLOW_SEQ", $sformatf("Randomized underflow bytes to %0d", underflow_bytes), UVM_MEDIUM)
Expand Down

0 comments on commit 55e94a2

Please sign in to comment.