Backdoors

class uvm.reg.uvm_reg_backdoor.UVMRegBackdoor(name='')[source]

Bases: UVMObject

async do_pre_read(rw)[source]

Task: do_pre_read

Execute the pre-read callbacks

This method must be called as the first statement in a user extension of the <read()> method.

Parameters

rw

async do_post_read(rw)[source]

Task: do_post_read

Execute the post-read callbacks

This method must be called as the last statement in a user extension of the <read()> method.

Parameters

rw

async do_pre_write(rw)[source]

Task: do_pre_write

Execute the pre-write callbacks

This method must be called as the first statement in a user extension of the <write()> method.

Parameters

rw

async do_post_write(rw)[source]

Task: do_post_write

Execute the post-write callbacks

This method must be called as the last statement in a user extension of the <write()> method.

Parameters

rw

async write(rw)[source]

Task: write

User-defined backdoor write operation.

Call <do_pre_write()>. Deposit the specified value in the specified register HDL implementation. Call <do_post_write()>. Returns an indication of the success of the operation.

extern def write(self,uvm_reg_item rw)

Parameters

rw

async read(rw)[source]

Task: read

User-defined backdoor read operation.

Overload self method only if the backdoor requires the use of task.

Call <do_pre_read()>. Peek the current value of the specified HDL implementation. Call <do_post_read()>. Returns the current value and an indication of the success of the operation.

By default, calls <read_func()>.

Parameters

rw

read_func(rw)[source]

Function: read_func

User-defined backdoor read operation.

Peek the current value in the HDL implementation. Returns the current value and an indication of the success of the operation.

extern virtual def void read_func(self,uvm_reg_item rw):

Parameters

rw

is_auto_updated(field)[source]

Function: is_auto_updated

Indicates if wait_for_change() method is implemented

Implement to return TRUE if and only if <wait_for_change()> is implemented to watch for changes in the HDL implementation of the specified field

extern virtual def bit is_auto_updated(self,uvm_reg_field field):

Parameters

field

Returns:

async wait_for_change(element)[source]

Task: wait_for_change

Wait for a change in the value of the register or memory element in the DUT.

When self method returns, the mirror value for the register corresponding to self instance of the backdoor class will be updated via a backdoor read operation.

Parameters

element

async pre_read(rw)[source]

Task: pre_read

Called before user-defined backdoor register read.

The registered callback methods are invoked after the invocation of self method.

Parameters

rw

async post_read(rw)[source]

Task: post_read

Called after user-defined backdoor register read.

The registered callback methods are invoked before the invocation of self method.

Parameters

rw

async pre_write(rw)[source]

Task: pre_write

Called before user-defined backdoor register write.

The registered callback methods are invoked after the invocation of self method.

The written value, if modified, modifies the actual value that will be written.

Parameters

rw

async post_write(rw)[source]

Task: post_write

Called after user-defined backdoor register write.

The registered callback methods are invoked before the invocation of self method.

Parameters

rw

create(name='')

Group: Creation

The create method allocates a new object of the same type as this object and returns it via a base uvm_object handle. Every class deriving from uvm_object, directly or indirectly, must implement the create method.

A typical implementation is as follows:

class mytype (UVMObject):
  ...
  def create(self, name=""):
    mytype t = mytype(name)
    return t
Parameters

name (str) – Name of the created object.

Returns

New object.

Return type

obj

get_object_type()

Function: get_object_type

Returns the type-proxy (wrapper) for this object. The uvm_factory’s type-based override and creation methods take arguments of uvm_object_wrapper. This method, if implemented, can be used as convenient means of supplying those arguments. This method is the same as the static get_type method, but uses an already allocated object to determine the type-proxy to access (instead of using the static object).

The default implementation of this method does a factory lookup of the proxy using the return value from get_type_name. If the type returned by get_type_name is not registered with the factory, then a None handle is returned.

For example:

class cmd (UVMObject):
  type_id = UVMObjectRegistry()
  @classmethod
  def type_id get_type(cls):
    return type_id.get()
  def get_object_type(self):
    return cmd.type_id.get()

This function is implemented by the `uvm_*_utils macros, if employed.

Returns:

classmethod get_type()

Returns the type-proxy (wrapper) for this object. The UVMFactory’s type-based override and creation methods take arguments of uvm_object_wrapper. This method, if implemented, can be used as convenient means of supplying those arguments.

The default implementation of this method produces an error and returns None. To enable use of this method, a user’s subtype must implement a version that returns the subtype’s wrapper.

For example:

class cmd(UVMObject):
  type_id = None

  @classmethod
  def get_type(cls):
    return cls.type_id.get()

Then, to use:

factory.set_type_override(cmd.get_type(), subcmd.get_type())

This function is implemented by the uvm_*_utils functions, if employed.

Returns:

get_type_name()

This function returns the type name of the object, which is typically the type identifier enclosed in quotes. It is used for various debugging functions in the library, and it is used by the factory for creating objects.

This function must be defined in every derived class.

A typical implementation is as follows:

class mytype (UVMObject):
  ...
  type_name = "mytype"

  def get_type_name(self):
    return my_type.type_name

We define the type_name static variable to enable access to the type name without need of an object of the class, i.e., to enable access via the scope operator, ~mytype::type_name~.

Returns

Type name of the object.

Return type

str

type_id = <uvm.base.uvm_registry.UVMObjectRegistry object>
type_name = 'UVMRegBackdoor'