Hi All,
We access callback function using handle/object, This handle is pushed into queue from top hierarchy.
As shown in below code.
Class Driver;
driver_cbs cbs[$];
task run();
tranaction tr;
foreach(cbs[i]) cbs.post_tx(tr);
endtask
endclass
program test;
initial begin
driver_cbs_p cbs_p = new();
env.drv.cbs.push_back(cbs_p);
end
endprogram
Why do we need a queue. Why do not we do as given below.
class Driver;
driver_cbs cbs; <-----------------
task run();
tranaction tr;
cbs.post_tx(tr);
endtask
endclass
program test;
initial begin
driver_cbs_p cbs_p = new();
env.drv.cbs = cbs_p; <-------------------------------change
end
endprogram
Please reply what is the difference between above two approach.
Thanks,
Rahul Kumar