Jump to content

Using uvm callbacks


Recommended Posts

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!

Link to comment
Share on other sites

  • 2 weeks later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...