Jump to content

uvm_reg::get()


Recommended Posts

Attempted to use the uvm_reg function get("fieldname") to return the value of specific register field within a register class. Found that get() returns the value of all the fields of the register regardless of the value provided to input argument fname. The feature does not appear to be fully implemented.

// From uvm_reg.svh

function uvm_reg_data_t uvm_reg::get(string fname = "",

int lineno = 0);

// Concatenate the value of the individual fields

// to form the register value

m_fname = fname;

m_lineno = lineno;

get = 0;

foreach (m_fields)

get |= m_fields.get() << m_fields.get_lsb_pos();

endfunction: get

Link to comment
Share on other sites

"fname" means "filename", not fieldname. It's intent is to have any error messages report where the user call was, not where the code is in the UVM library itself:

data = blk.rg.get(`__FILE__, `__LINE__);

Use uvm_reg_field::get() to get the field value.

data = blk.rg.field.get(`__FILE__, `__LINE__);

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.

 Share

×
×
  • Create New...