Jump to content

[UVM REG] Why not add the size in the uvm_reg_bus_op's variables?

Recommended Posts

In some IPs. there are many different width of registers with the same interface.

For example(Read Operation):

byte, word registers inside the IP , using the 32bits interface to access .

4 byte's registers will be packed in one word in the design. It always read the word from DUT.

When we do the byte_en in reg2bus of uvm_reg_adapter, we met one issue.

If the rw.addr[1:0] is 2'h0 , it's difficult to distinguish what's the width of the register which is accessed currently. Byte or Word register ? we could not assign the correct byte_en.

if the register is byte width. we need to enable the Least Significant byte. and then compare the read data with mirrored data in reg model.

So if there is width in uvm_reg_bus_op, it will be easy to handle for byte_en for each register access in reg2bus function.

Link to comment
Share on other sites

Yes, get_n_bytes() method could work for this case.

But there is no 'element' handle in the reg2bus? how to make it happen?

For example

virtual function uvm_sequence_item reg2bus(uvm_reg_bus_op rw);

apb_item apb = apb_item::type_id::create("apb_item");

apb.op = (rw.kind == UVM_READ) ? apb::READ : apb::WRITE;

apb.addr = rw.addr;

apb.data = rw.data;

return apb;


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.

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...