Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help with UVM coding

Status
Not open for further replies.

promach

Advanced Member level 4
Joined
Feb 22, 2016
Messages
1,199
Helped
2
Reputation
4
Reaction score
5
Trophy points
1,318
Activity points
11,636
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
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top