Is it possible to access register model data from within a reference model?

Hi,

I’m a UVM Register model novice and before I attempt to implement I have a query regarding accessing register model mirrored values from elsewhere in the testbench, particularly from with a reference model.

My DUT contains a number of registers containing set-up data. This set-up data is also needed within a reference model of the device function. I think I have a good idea of how I can write the set-up data to the DUT via the RAL and also set the associated mirrored values via a predictor/adapter block.

What I’m not so sure about is if/how I can access the set-up data stored within the register model mirrored values directly from a reference model. Is this possible or does the reference model need to store its own version of the data?

If it is possible, what is the recommended method of accessing the set-up data?

The output of the reference model needs to be stored as a mirrored value in the register model. Am I correct in thinking that I just need to pass the reference model output as a transaction through predictor and adapter blocks in order to update the register model?

Thanks,

Tony.

In reply to Tony_Barnard:

Hello, i believe your reference model already has a reference to the RAL model right? If not then just use the config db to get ome after set.

With regards of the access to the mirrored values of a specific register then you could use the get_mirrored_value() method or you can access the single field by hier like:

Reg_blk.default_map.reg_target.field.value.

Anyways assuming your predictor works you can easily get what you want from the register you are accessing.

Thanks for the response. I think you’ve pointed me in the correct direction. I just need to pass the register model into the config_db in order to be able to access it anywhere. I found another post which seems to describe what I’m after.

https://verificationacademy.com/forums/uvm/accessing-uvm-ral-model-handle-inside-testbench-module