Update reg2bus

Hi ,
Is it possible to extend properties of reg2bus task in uvm_reg_adapter.
If possible, Example please.
Or else,
I have couple of fields, which is not listed in uvm_reg_bus_op struct (Kind,addr,…).
How to add those two fields in uvm_reg_bus_op.
Please help.

Thanks,
Raja.A

In reply to arasupotri.natarajan90:

Hi ,
Is it possible to extend properties of reg2bus task in uvm_reg_adapter.
If possible, Example please.
Or else,
I have couple of fields, which is not listed in uvm_reg_bus_op struct (Kind,addr,…).
How to add those two fields in uvm_reg_bus_op.
Please help.
Thanks,
Raja.A

You can override all the function given in uvm_reg_adapter.svh and then use in your own example.

class reg2apb_adapter extends uvm_reg_adapter;
`uvm_object_utils(reg2apb_adapter)

function new(string name=“reg2apb_adapter”);
super.new(name);

endfunction

virtual function uvm_sequence_item reg2bus(uvm_reg_bus_op rw);
apb_item apb = apb_item::type_id::create(“apb_item”);
apb.op = (rw.kind == UVM_READ) ? apb::READ : apb::WRITE;
apb.addr = rw.addr;
apb.data = rw.data;
return apb;
endfunction

You can add your fields in this fucntion .Also ,you need to change uvm_reg_tlm_adapter class to make it more generic.

In reply to sa5691:

Hi,
You can add your fields in this fucntion .Also ,you need to change uvm_reg_tlm_adapter class to make it more generic.

I have tried but can’t. Can you please give example to implement.

Thanks,
Raja.A

In reply to arasupotri.natarajan90:

In reply to sa5691:
Hi,
You can add your fields in this fucntion .Also ,you need to change uvm_reg_tlm_adapter class to make it more generic.
I have tried but can’t. Can you please give example to implement.
Thanks,
Raja.A

Hi ,
Now I can able read register which i have done write previously.
But i can not able not read Read only register.
example : reg offset is 0x05 reset value is 0x70
read value is 0x00(in predictor i getting correct value) only but i can see correct value in waveform.
Please help on this issue.
Note : Enabled provides_response bit in adapter ,
BUS : I2C , Facing issue At repeated start read (WR followed RD combined format)

Thanks,
Raja.A*

In reply to arasupotri.natarajan90:

Try checking the mirror value of the register.
You can use syntax like this reg_h.mirror