My issues with uvm_reg's predict method

A couple of weeks ago, I created a status register callback class.
The purpose of it was to create a built-in scoreboard allowing me to predict the value of a status register based on the known status signal's input.
I'll maybe post the code in a sometime in the future.

I've used this code to pass UVM's bit-bash test, as it allows for the prediction of status registers with a "unknown" value.

This week, I tried using this callback class in my home brew sequence. This was the first-time I called uvm_reg's predict method directly from within my sequence.

I discovered during this experiment a bug and a bad API call.
The bug is the fact that by default the field's callback functions won't be called, as when predicting with kind set to UVM_PREDICT_DIRECT, UVM does not call the post_predict callbacks. So be careful to set kind to UVM_PREDICT_READ or UVM_PREDICT_WRITE.

My issue with the API call is the fact that a value must be given. I fail to find the reasoning for this. Why can't value have a the current mirrored value, or 0 for this matter as the default input value? Sometimes the prediction does not need any input from the user and can is solely based on calculated information.

That's it for now.

Tsvi

Comments

Popular posts from this blog

The crooked ways of UVM's register model's coverage methods

uvm_config_db vs uvm_resource_db, where they come from and what are they good for

Don't use null as a sequencer argument to uvm_reg_sequence