在UVM中,get_parent是一个非常重要的方法,它用于获取当前对象的父级对象。 get_parent方法的用法如下: 1. 语法 get_parent方法的语法如下所示: uvm_object_base #(T) get_parent() 其中,uvm_object_base是一个UVM中的基类,#(T)表示泛型类型。get_parent方法返回一个uvm_object_base类型的父级对象。 2. ...
1.get_parent: 那m_parent又是什么呢? parent又是什么? 原来就是new的时候,我们传的参!返回的是指针,不是字符串。 2.get_child get_parent()不用传参是因为一个component 只有一个父类。但是一个component 有可能有很多child,所以要指定: 如果有就返回,没有warning。m_children 又是什么? 前两个if不走,...
externvirtualfunctionuvm_componentget_parent(); get_child函数,与get_parent不同的是,get_child需要一个string类型的参数name,表示此child实例在实例化时指定的名字。因为一个component只有一个parent,所以get_parent不需要指定参数;而可能有多个child,所以必须指定name参数。 externfunctionuvm_componentget_child(string...
1functionuvm_reg_block uvm_reg::get_parent();2return get_block();3endfunction45functionuvm_reg_block uvm_reg::get_block();6get_block =m_parent;7endfunction89functionvoid uvm_reg::configure (uvm_reg_block blk_parent,10uvm_reg_file regfile_parent=null,11stringhdl_path ="");12if(blk_...
get_child函数,与get_parent不同的是,get_child需要一个string类型的参数name,表示此child实例在实例化时指定的名字。因为一个component只有一个parent,所以get_parent不需要指定参数;而可能有多个child,所以必须指定name参数。 代码语言:javascript 代码运行次数:0 ...
m_parent=parent;if(size ==0) begin `uvm_error("RegModel", $sformatf("Field \"%s\" cannot have 0 bits", get_full_name())); size=1; end m_size=size; m_volatile=volatile; m_access=access.toupper(); m_lsb=lsb_pos; m_cover_on=UVM_NO_COVERAGE; ...
1、通过在new函数时指定parent参数来形成树形结构。只有uvm_component派生的类,才有节点。 2、phase机制自动执行 build_phase的内容,一般有:利用config_db set/get传递参数;实例化成员变量。 build_phase是一个function,不消耗仿真时间;main_phase是一个task,消耗仿真时间 ...
对于顶层的寄存器模型来说,get_parent()返回的就是null,也就是说寄存器模型中的寄存器会自下而上层层判断有没有自定义的uvm_reg_backdoor句柄,如果都没有,图2中的代码段1执行的get_backdoor()函数最终返回的就是null。于是乎代码段2中执行的就是backdoor_read()任务,而backdoor_read()中又调用了backdoor_rea...
get_parent:用于得到当前实例的parent,一个component只有一个parent,所以get_parent不需要指定参数。 get_child:需要一个string类型的参数name,表示次child实例在实例化时指定的名字。 get_children:得到一个component的所有函数。参数类型为ref uvm_component children[$]。
那么test的parent是谁呢?test的创建并没有采用上述env的创建方式,而是调用了top层的run_test()函数,代码如下图: 位于uvm_globals.svh中的run_test()函数通过uvm_root::get()创建(这里应该是uvm_root::get()第一次被调用,所以说是创建了uvm_root的实列,其他地方调用是reuturn返回的实例,都是在此处创建的)唯...