Jump to content

uvm_reg::read() and write() documentation


Recommended Posts

Hi,

I am looking for documentation and examples on uvm_reg::read() and write().

I am implementing an onchip token-ring type bus, and so need to include source/dest and other information to be passed from the uvm_reg::read()/write() to the adapter, so that the ring-bus will have all appropriate fields.

My suspicion is that the uvm_reg::read()/write() 'extension' argument is indended for such use, but I haven't spotted anything showing how to use it.

Link to comment
Share on other sites

You can do a get_item() in the adapter to get bus-independent read/write information (uvm_reg_item) that corresponds to the generic bus transaction currently translated to a bus-specific transaction..

The 'extension' will be available via that reference and then you can use that information to be used appropriately in the adapter

Link to comment
Share on other sites

You can do a get_item() in the adapter to get bus-independent read/write information (uvm_reg_item) that corresponds to the generic bus transaction currently translated to a bus-specific transaction..

The 'extension' will be available via that reference and then you can use that information to be used appropriately in the adapter

Thanks! Is there any documentation on the other arguments to read()/write(), and how to use them?

Link to comment
Share on other sites

  • 3 weeks later...

This is how you can code this:

pseudo code:

class token-ring_info extends uvm_object;

rand bit [31:0] source;

rand bit [31:0] dest;

..

`uvm_object_utils()

..

function new(...);

super.new();

endfunction

endclass

Then in your TB code,

token-ring_info obj;

obj = new("ext");

..

// Populate the 'obj' instance

obj.dest = ..;

/* pass the extension argument */

model.TABLES.read(status, data,,,,,obj);

In the Adapter

virtual function uvm_sequence_item reg2bus(const ref uvm_reg_bus_op rw);

uvm_reg_item item; //declare a handle of uvm_reg_tem

...

item = this.get_item();

if(item.extension != null)

<do_something>

else

<do_something else>

endfunction

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