rr - DilipKrishnappa/UVM GitHub Wiki
HDL access routines
UVM provides the backdoor access sub-routines for force/release or read/deposit some vale on any hierarchical path provided in the argument. These functions acts as an interface between SystemVerilog and C code to perform various operations. These functions can not only be used for backdoor accesses, but also for forcing some value in any RTL modules.
Following is a list of API’s(Application programming interface) that are provided by UVM to perform various things. We can directly call these functions from the testbench and provide proper string based path as an input argument. This will automatically invoke the DPI-C(Direct programming interface) code in UVM BCL(Base class library). They are seven HDL access routine function which are,
- uvm_hdl_check_path
Checks that the given HDL path exists are not.
import "DPI-C" function int uvm_hdl_check(string path);
In the Example.1 shown below, the uvm_hdl_check_path function will check the given path exist are not in below code the path top.Ripple.A is exist, so it return the uvm_info as path exit, otherwise it will return the else condition.
if(uvm_hdl_check_path("top.Ripple.A")) begin
uvm_info("checking",$sformatf(" 1.check the path exist top.Ripple.A = %0d",top.Ripple.A),UVM_LOW) end else begin
uvm_info("checking",$sformatf(" 1.The path does not exist top.Ripple.A = %0d",top.Ripple.A),UVM_LOW)
end
2. uvm_hdl_deposit
Sets the given HDL path to the specified value.
import "DPI-C" function int uvm_hdl_deposit(string path, uvm_hdl_data_t value);
if(uvm_hdl_deposit("top.Ripple.B",2)) begin
uvm_info("checking",$sformatf(" After Deposit of specified value top.Ripple.B = %0d",top.Ripple.B),UVM_LOW) end else begin
uvm_info("checking",$sformatf(" Value is not Deposited to the Specified path top.Ripple.B = %0d",top.Ripple.B),UVM_LOW)
end