Jump to content

How to get the coverage results for Indirect Register Array ?


Recommended Posts

Coverage models are not part of the UVM library. That is a model-generator feature. It is likely a problem that needs to be address by the vendor of the model generator tool.

It would also help if you provided more details. It is hard to figure out what your exact problem is when all we have to go on is "UVM gives an error".

Link to comment
Share on other sites

My question is simply this :

I have an indirectly addressed register array (for example the TABLES array in the "primer" UVM example).

I need to get an address coverage for this register array. In other words, I need to find out what addresses in the register array have been accessed.

Note that this is possible for memory and blocks. But I could not find any example or documentation for indirectly addressed register arrays.

Thanks much for any help or pointers.

Sandeep

Edited by sandeep
Link to comment
Share on other sites

The answer is different whether you are a register model generator or a register model user. Since you are from Agnisys, I'll assume you are the former.

The address of indirect register is only applicable once it is used to actually access the indirect register array, hence implementing the coverage model in the uvm_reg::sample() method of the index register is not the right location. It has to be implemented in the uvm_reg::sample() method of the data access register. The problem is that the argument to that method is the value read or written, not the index in the array. You will need to obtain the index value from the index register before you cample it into the index coverage model.

Assuming you use the uvm_reg_indirect_data class to model the indirect register, you could do something like this (approximate syntax):

class my_table extends uvm_reg_indirect_data;
  ...
  local uvm_reg_data_t idx_to_cover;

  covergroup cvr;
     coverpoint: idx_to_cvr;
  endgroup

  function void sample(uvm_reg_data_t  data, uvm_reg_data_t byte_en,
                       bit  is_read, uvm_reg_map  map);
     idx_to_cover = m_idx.get(); // See note below
     cvr.sample();
  endfunction
endclass

Note: "m_idx" is currently a local variable in the pre-defined indirect register so that won't work. It should be protected. As a work-around, you can have the configure() method in your extended class save a reference to that index register before calling super.configure().

Hope this helps.

P.S> I filed Mantis 3449 on this issue: http://www.eda.org/svdb/view.php?id=3449

Edited by janick
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...