Hi,
I’m using set_check_on_read(1) approach to compare the default registers read value, and for registers wr/rd comparison.
But, for few registers, my requirement is as follows:
FIELD1 8 DEF=0x0 RW
FIELD2 7 DEF=0x0 RW
FIELD3 6:5 DEF=0x0 RO NO_CSR_W_TEST
FIELD4 4:3 DEF=0x0 RO NO_CSR_W_TEST
FIELD5 2:1 DEF=0x0 RO NO_CSR_W_TEST
FIELD6 0 DEF=0x0 RW
- As mentioned above, I need to write into RW reg fields only for few registers(but not into RO fields). So, instead of writing into complete register using : reg_model.reg_name.write(status, .value, .parent(this));
, I’m thinking of using the below syntax to write into RW fields only for those registers.
reg_model.Reg_name.field_name.set(value);
reg_model.Reg_name.field_name.update(status);
Is it OKAY? Can anyone please confirm?
Or else if there is any other alternative approach, could you please let me know?
-
I want to skip register comparison for those few RO fields (NO_CSR_W_TEST) for few registers. For that, I’ve tried with the below syntax example:
rg = model.get_reg_by_name("ureg2"); fld = rg.get_field_by_name("f1"); old_check_setting = fld.get_compare(); // Disable checking on that field fld.set_compare(UVM_NO_CHECK);
I’ve tried some examples using that approach. But it didn’t work, but my complete register is getting compared with the desired value (like as-usual) for all registers in my reg model.
I want to skip comparing those few reg fields in a register. Can anyone please guide me in this regard?