Enum fields in UVM_REG

For some time now, I've been mulling over the problem of storing register field values as enumerations. Enumerations are a very handy tool to improve code readability. Design specifications often make use of them too. If our verification environments could handle enumerated values for register fields we wouldn't have to go back and forth to the specification to decode bits when trying to figure out, for example, how to start the operations that we want or what results we got.


This is a companion discussion topic for the original entry at https://verificationgentleman.netlify.app/2015/05/05/enum-fields-in-uvmreg.html

Hiya,

I’ve been trying to define a uvm_reg_field as ‘enum’.Thought about what you’ve created above- extending the uvm_reg_field to create the new data-type with enum.

Just wondered, through the last 2 years if you’ve come across any additions to the UVM-RAL to create an ‘enum’ uvm_reg_field-type please ?

Ta

The post was mostly an experiment, since I never really used this code on a real project. I don’t know of any other way of implementing enum fields.