I’m trying to implement a reserved field in a RAL model.
This is my register .
class ID_t extends uvm_reg;
rand uvm_reg_field field2;
rand uvm_reg_field rsvd;
rand uvm_reg_field field1;
virtual function void build();
field2 = uvm_reg_field::type_id::create("field2");
field2.configure(this, 16, 0, "RW", 0, 0, 1, 1, 1);
rsvd = uvm_reg_field::type_id::create("rsvd");
rsvd.configure(this, 8, 16, "RW", 0, 0, 0, 1, 1);
field1 = uvm_reg_field::type_id::create("field1");
field1.configure(this, 8, 24, "RW", 0, 0, 0, 1, 1);
endfunction
There is a register(ID) which consists of 3 individual field(field1, rsvd, field2).
Firstly, I write the whole register with 32’h12345678, and overwrite it with individual field access as the below,
mmap0.rfile0.ID.write(status, 32'h12345678);
mmap0.rfile0.ID.field1.write(status, 14'hab);
mmap0.rfile0.ID.read(status, rdata);
`uvm_info(get_type_name(), $sformatf("Read data :%h",rdata), UVM_LOW)
when I executed the RAL model, I get the mirror value mismatched error message as the below,
Register "ID" value read from DUT (0x0000000012bb5678) does not match mirrored value (0x0000000012345678)
How do I correctly set the reserved field in register model?