I have a sequence which fetches an object from the config db at the start of its body. It uses get_full_name() to get the ‘sequencer path’.
However I now have a case where the thing that creates the sequence (let’s say the test) should alter something in that config object, prior to starting the sequence.
My initial try was to move the config db access from body() to new():
class myseq extends uvm_sequence #(...);
some_object my_obj; // this one is in the config db
function new(..);
if(scope_name=="")
scope_name = get_full_name();
uvm_config_db #(some_obj)::get(null, scope_name, "my_obj",my_obj)
endfunction
endclass
This would allow the test to create the sequence, and then do for example
seq.my_obj.something = ...
The issue is that new does not know about the sequencer path yet, so the above code will not let the object be retrieved from the config db.
what would be a good workaround for this?
Some possibilities:
- get the object from the config db in the test, but this means I have to put the visibility of that object higher than I actually would want to.
- put a callback or so in the beginning of the body
…