I have requirement to do polling i.e, i should do random register read of the interrupt register. How do i randomly do register read in random time. Any pointers do i need to use rand or any suggestions.
PS: I have task READ_REG(INTR) which reads the interrupt register, how do i do this read in random time
In reply to tejasakulu:
Randomize an int variable and Delay that variable. Randomize the reg number.
import uvm_pkg::*; `include "uvm_macros.svh"
module top;
event e; // for debug
function void READ_REG(int q) ;
-> e;
endfunction
initial begin
int v, r;
repeat(200) begin
if (!randomize(v, r) with
{ v < 40 && v > 10;
r < 16 && r >= 0;
}) `uvm_error("MYERR", "This is a randomize error");
#v;
READ_REG(r);
end
$stop;
end
endmodule