Quantcast
Channel: UVM Forums RSS Feed
Viewing all articles
Browse latest Browse all 756

How to access fields within registers with the same name

$
0
0

The issue I have is the register model has multiple registers of different names but the fields within the registers are named the same.  The register model is generated by a tool so getting changes made will take some time and I need a work around.  I have a lot of registers so this is a big problem.

 

class reg_0 extends uvm_reg;

 

rand uvm_reg_field  x;

rand uvm_reg_field  y;

 

......

endclass

 

class reg_1 extends uvm_reg;

 

rand uvm_reg_field x;

rand uvm_reg_field y;

 

......

endclass

 

I need to be able to access the fields in my scoreboard.  The problem is the field is not associated to the register so I can't simply call peek on x without associating it with the correct register.  Is there a way to associate the register name with the field name and then call peek without hard coding the call to peek? 

 

I am using get_registers() and get_fields() to load my queues.  Is there a way to get the registers and the fields for that register instead of one or the other?  Perhaps I have missed something in the reference manual.

 

reg_fields[i].peek(status,reg_field_data[i]);

 

 

 

 

 

 

 

 

 


Viewing all articles
Browse latest Browse all 756

Trending Articles