Am getting this Error the below error, as of my knowledge as per this error message am going to access an empty object.
Error-[NOA] Null object access
generator.sv, 23
The object at dereference depth 1 is being used before it was
constructed/allocated.
Please make sure that the object is allocated before using it.
class generator;
transaction trans;
mailbox gen2driv;
// event ended;
function new(mailbox gen2driv);
this.gen2driv = gen2driv;
endfunction
task main();
repeat(4) begin
trans = new();
trans.randomize();
if(!trans.randomize()) $display(“generator ransomize failed”);
trans.display("[generator]");
gen2driv.put(trans);
// -> ended;
end
endtask
endclass
code link
Bhyreshkj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.