promach
Advanced Member level 4
Could anyone help to explain what the following uvm coding does and how it works ?
Code:
module m;
`include "uvm_macros.svh"
import uvm_pkg::*;
bit clk;
bit[3:0] a=4, b=5, c;
initial forever #10 clk=!clk;
always_comb begin
for (int i=0; i<=3; i++) begin
assert(a[i] > b[i]) else $display("i a[i] b[i]", i, a[i], b[i]); ap_ab: assert property(@ (posedge clk) a[i] |=> b[i]);
end
end
initial begin
repeat(20) begin
@(posedge clk);
if (!randomize(a, b) with
{ a dist {1'b1:=1, 1'b0:=1};
b dist {1'b1:=1, 1'b0:=2};
}) `uvm_error("MYERR", "This is a randomize error");
end
$finish;
end
endmodule