adhingra Posted August 3, 2012 Report Posted August 3, 2012 I am not sure if I understand the UVM callbacks correctly. What I intend to do is when Golden reference model FSM is finished, generate a callback by calling do_callback. So that my virtual sequencer can decide when to kill the sequences running on individual sequencers. Also if required same callback can be used to inform Scoreboard to do final comparison or generate reports. I am not sure if we can register multiple component with same callback. So far I have created 1. Created model_callback class extending from uvm_callback having pure virtual functions. Something like Class model_callback extends uvm_callback; 2. Register this in reference model and call function uvm_do_callback where necessary. `uvm_register_cb(model,model_callback); Also somewhere in the model I did `uvm_do_callbacks(model,model_callback, function_name()); 3. Then I create a class that extends from model_callback.. class custom_callback extends model_callback 4. Wrote implementation of function call here in this class. Funtion that was defined as pure virtual function in model_callback class. 5. In the TOP I created the instance of custom_callback and did uvm_callback #(model,model_callback)::add(model,custom_callback_inst); Now when I run the simulation; Model initiate the callback and I see the function is executed in custom_callback class, which is intended. How can I use the same callback inside other components like scoreboard or virtual sequencers. Or How can i make my sequencer or scoreboard make use of this callback? Can i register or add my scoreboard function to be called automatically when model initiate the callback. Thanks in advance! Quote
jadec Posted August 16, 2012 Report Posted August 16, 2012 If you are just passing information one-way, from the model to the scoreboard, etc. An analysis port may be the more logical choice. Callbacks are generally more useful if the registered listeners are needed to modify the data. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.