How to get the RAL model handle in Scoreboard

Hi,

In my testbench, I have a monitor which sends packets to scoreboard through analysis port.
Based on the packet content, I need to go and check if certain status is updated or not in the intended status register.

For example

  1. Scoreboard:
    if (pkt.addr == 'hAA) begin
    if (pkt.data == 'h01) begin
    reg_status = 1;
    end
    end

If reg_status = 1, then I need to read the DUT STATUS_REG to see if it has set the reg_status (field in the register) to 1 or not.

So when my scoreboard checker has evaluated based on the pkt addr and data that the status needs to be updated,
Can I do RAL_MODEL.reg.read from the scoreboard?

If yes, then how do I get the register model handle in the scoreboard?

Please note that all the settings are done in the env class for required for usual RAL model setup.

=====================================================================================================

Env class:

dma_op_clock ral;
reg_top_block ral_model;

all steps related to ral model setting are done on “ral” handle.
“ral_model” is subclass of ral under which all registers are defined.

In connect_phase…

uvm_config_db#(reg_top_block)::set(null,“*”,“reg_top_block”,ral.ral_model);

end of connect_phase

In scoreboard, in start_of_simulation_phase, I have below get method

if( !uvm_config_db#(reg_top_block)::get(this,“*”, “reg_top_block”, reg_block)) //get method to access the registers using RAL
`uvm_fatal(get_full_name(),{“RAL model register block not found”} );


In one of the task in scoreboard I perform below read.

reg_block.STATUS_REG.read(status, reg_value, UVM_FRONTDOOR);

========================================================================

It gives me below run time error

Error-[NOA] Null object access
The object at dereference depth 2 is being used before it was
constructed/allocated.
Please make sure that the object is allocated before using it.

Can anyone help me to resolve this issue?

In reply to kanojedipali07:

The UVM register model is not a uvm_component. It is a uvm_object.
In your env you are passing the register model to the config_db. From there you can retrieve it in any other place like a scoreboard.
What to do:
(1) declare the register model in your scoreboard:

reg_top_block ral_model;

(2) retrieve the ral model from the config_db like this:

  uvm_config_db#(reg_top_block)::get(this,"","reg_top_block",ral_model);

Thanks chr_sue for the response.

I will correct the hierarchy instance to which I am getting it in scoreboard.