Jump to content
Sign in to follow this  
allancarter

null pointer access in uvm_reg::Xcheck_accessX line 2624

Recommended Posts

I added a new register to a register block, but didn't add it to the map. When I try to read it in my test I get a null pointer access in:

 

uvm-1.2c/src/reg/uvm_reg.svh, line 2624

 

The bug is that get_local_map returns a null pointer and rw.map is null because it wasn't specified in the read method. But the uvm_error macro references rw.map.get_full_name() when rw.map is null.

 

Share this post


Link to post
Share on other sites

I guess related to this is that the following warning is output before this. Seems like it should be an error:

UVM_WARNING /path/tools/uvm/uvm-1.1d/src/reg/uvm_reg.svh(1646) @ 0: reporter [RegModel] Register 'm_mem_block.regfile.regc' is not registered with any map

Share this post


Link to post
Share on other sites

The following fix gets rid of the null poiter reference:

 

     if (rw.local_map == null) begin
       if (rw.map == null) begin
         `uvm_error("RegModel", {"Register '", get_full_name(), "' is not registered with any map."})
         rw.status = UVM_NOT_OK;
         return 0;
       end else begin
         `uvm_error(get_type_name(),
           {"No transactor available to physically access register on map '",
            rw.map.get_full_name(),"'"})
         rw.status = UVM_NOT_OK;
         return 0;
       end
     end

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×