Related system verilog Constraint random verificatio

In reply to Naven8:

You should note that randomize() is a function call with a return code that tells you if it is successful or not.

Your code should look something like:


if (!pkt1_inst.randomize()) $display("Randomize error!");
else $display("Hello: pkt_type_0 = %d ,trans_type_0 = %d pkt_type = %s ,trans_type = %s addr=%d",pkt1_inst.pkt_type,pkt1_inst.trans_type,pkt1_inst.pkt_type,pkt1_inst.trans_type,pkt1_inst.addr);