Last Updated: December 28, 2013
In the last post, Register Access Methods, we looked at the primary methods of RAL and showed how they worked. This post will further focus on the read()
method and show how the method actually reads and returns the value of a register. In particular, we will explain the steps #1 to #5 of the read()
method we have seen in the last post in more detail.
The following sequence diagram shows the steps involved in the read()
method. We assumed that the user called the method like this:
uvm_status_e status; uvm_reg_data_t value; jb_reg_block.jb_taste_reg.read( status, value ); |
[1]
The user calls theread()
method.[3]
Theread()
method calls theXreadX()
method of theuvm_reg
class. TheXreadX()
method creates auvm_reg_item
object corresponding to the read.[4]
TheXreadX()
method calls thedo_read()
method of theuvm_reg
class.[6]
and[7]
Thedo_read()
method retrieves the “path” and the register map (local_map
) of the register. We assume that we use the FRONTDOOR path.[8]
Thedo_read()
method calls thedo_read()
method of theuvm_reg_map
class, which creates a parent sequence. The parent sequence will be used to start a bus request in the later step.[9]
Thedo_read()
method calls thedo_bus_read()
method of theuvm_reg_map
class. Thedo_bus_read()
method creates auvm_reg_bus_op
that corresponds to the read.[10]
and[11]
Thedo_bus_read()
method calls thereg2bus()
method of theuvm_reg_adapter
class that is associated with the register map to obtain the corresponding bus request.[12]
Thedo_bus_read()
method assigns the sequencer that the bus request will be processed on to the bus request. We assume that the sequencer was associated with the register map.[13]
Thedo_bus_read()
method starts the parent sequence using the above sequencer.[14]
Thedo_bus_read()
method waits for the sequence to finish.[15]
to[18]
If theprovides_responses
property of the register adapter was set to be true, a separate bus response is retrieved by calling theget_base_response()
. The response is converted to auvm_reg_bus_op
(shown asrw_access
).[19]
and[20]
If theprovides_responses
property of the register adapter was set to be false, the bus request, which also contains the bus response, is converted to auvm_reg_bus_op
(shown asrw_access
).[21]
to[24]
Thestatus
and thevalue
of therw_access
is returned to the caller.
I hope this post helped to understand how the read()
method works under the hood.