Hello Juliette,
let us take an example.
class some_reg extends uvm_reg;
`uvm_object_utils(some_reg)
rand uvm_reg_field flavor;
function new( string name = "some_reg" );
super.new( .name( name ), .n_bits( 1 ), .has_coverage( UVM_NO_COVERAGE ) );
endfunction: new
virtual function void build();
flavor = uvm_reg_field::type_id::create( "flavor" );
flavor.configure( .parent ( this ),
.size ( 3 ),
.lsb_pos ( 0 ),
.access ( "WO" ),
.volatile ( 0 ),
.reset ( 0 ),
.has_reset ( 1 ),
.is_rand ( 1 ),
.individually_accessible( 0 ) );
endfunction: build
endclass: some_reg
In the build function, you can basically configure the register fields, with a default values when reset.
Hope this helps.
Greetings,
Vidya Sagar