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 post
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 post
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 post
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 post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...