ejessen Posted December 15, 2011 Report Posted December 15, 2011 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. Quote
amitshere Posted December 19, 2011 Report Posted December 19, 2011 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 Quote
ejessen Posted December 19, 2011 Author Report Posted December 19, 2011 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? Quote
ejessen Posted January 6, 2012 Author Report Posted January 6, 2012 Also - any examples or test-cases using the extension? Quote
amitshere Posted January 9, 2012 Report Posted January 9, 2012 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 Quote
Recommended Posts
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.