对于uvm_sequence_item,get_full_name()与get_name()一样! 因为它是不作为UVM树节点的,所以路径没有别的层次。 这点保留了uvm_object原本的函数性质。 u_tr.get_type_name()会打印出: “jerry_tr”。 实际上,在原始的uvm_object的get_type_name()传出的是,也就是无返回值的。 但是我们为什么看到此处打...
uvm_test_top.env.i_agt.drv create时引号中的名字; 获取的是所在组件的名字; get_name(); drv create时引号中的名字; 获取的是所在组件的名字; get_type_name(); 类型名字:my_driver get_type(); 句柄名字:apb_drv uvm_top中config_db中传递interface的路径用的也是这个路径名字。 uvm_top.print_topolo...
function new(string name = "cfs_dut_reg_config"); //specify the name of the register, its width in bits and if it has coverage super.new(name, 32, 1); endfunction virtual function void build(); reserved = uvm_reg_field::type_id::create("reserved"); //specify parent, width, lsb...
The get() function is a standard OO programming pattern to return an object of a specific type. In UVM, it’s usually used with the uvm_config_db, which is explained the the UVM Cookbook. The get_type_name() method returns a string with the type name of the object on which it is...
从 uvm_object 衍生出来的类必须实 现类似 create()和 get_type_name()这样的纯 虚函数。以下代码演示了一个没有使用 UVM object 类的 AMBA APB 传输的例子 实例4–1: 非 UVM 类定义 1 typedef enum bit { APB _READ, APB_WRITE} apb _direction _enum; 2 class apb_transfer; 3 rand bit [ 31:...
(name,parent);tlm_get=new("tlm_get",this);endfunctiontaskrun_phase(uvm_phasephase);super.run_phase(phase);tlm_get.get(req);`uvm_info(get_type_name(),$sformatf("Received value = %0h",req.value),UVM_NONE);endtaskendclassclassenvextendsuvm_env;producerpro;consumercon;`uvm_component_...
task body(); apb_rw rw_trans; repeat(10) begin rw_trans = apb_rw::type_id::create(.name("rw_trans"),.contxt(get_full_name())); start_item(rw_trans); assert(rw_trans.randomize()); finish_item(rw_trans); end endtask task body(); apb_rw rw_trans; repeat(10) begin rw...
(string name = "ping_pong_reg_block"); super.new(name, UVM_NO_COVERAGE); endfunction function void build(); status_regs = status_reg_block::type_id::create("status_regs"); d_reg_0 = data_reg_0_block::type_id::create("d_reg_0"); d_reg_1 = data_reg_1_block::type_id::...
function new(string name, uvmponent parent); super.new(name, parent); driver = my_driver::type_id::create("driver", this); endfunction endclass class my_driver extends uvm_driver; function run_phase(uvm_phase phase); // 在这里调用get_parent方法获取父级对象 uvm_env env = get_parent(...
class base_test extends uvm_test; `uvm_component_utils(base_test) function new(string name="base_test", uvm_component parent=null); super.new(name, parent); endfunction env e0; bit[`LENGTH-1:0] pattern = 4'b1011; gen_item_seq seq; virtual des_if vif; v...