UVM User-defined Back-door Access

User-defined Back-door Access

If DPI-based back-door access doesn’t meet your needs, you can create a custom back-door access method. This lets you use any SystemVerilog constructs or tool-specific utilities to access registers and memories.

For example, if a memory or register is inside an encrypted model, a custom back-door method can use an appropriate API to directly peek or poke values into the encrypted model.

A user-defined back-door for registers is created by extending the uvm_reg_backdoor class.

  • The back-door write operation is implemented in the uvm_reg_backdoor::write() method.
  • The back-door read operation is implemented in the uvm_reg_backdoor::read() method.

This custom back-door is linked to:

  • A specific register using the uvm_reg::set_backdoor() method.
  • All registers in a block using the uvm_reg_block::set_backdoor() method.

Similarly, a user-defined back-door for memories is created by extending the uvm_mem_backdoor class.

  • The write operation is implemented in the uvm_mem_backdoor::write() method.
  • The read operation is implemented in the uvm_mem_backdoor::read() method.

This custom back-door is linked to a specific memory using the uvm_mem::set_backdoor() method.

How It Works:

  • Automatic Association:
    Register model generators can define these back-doors. During the build() method of the register model, they are automatically associated with the corresponding blocks, registers, or memories.
  • Manual Association:
    You can also associate a user-defined back-door later, during the environment’s build() method. This will override any default back-door mechanisms that were previously defined.

 

// This function is intended to be overridden by derived classes
virtual function void build();
  super.build();
  // Create an instance of a custom class for register backdoor functionality
  my_custom_reg_backdoor reg_bkdr = new();
  // Create an instance of a custom class for memory backdoor functionality
  my_custom_mem_backdoor mem_bkdr = new();

  // Assuming 'some_register' is a reference to a register in the environment
  // Associate the register with the custom register backdoor object
  some_register.set_backdoor(reg_bkdr);

  // Assuming 'some_memory' is a reference to a memory in the environment
  // Associate the memory with the custom memory backdoor object
  some_memory.set_backdoor(mem_bkdr);
endfunction