Jump to content

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.

 

Link to comment
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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...