externvirtualfunctionuvm_componentget_parent(); get_child函数,与get_parent不同的是,get_child需要一个string类型的参数name,表示此child实例在实例化时指定的名字。因为一个component只有一个parent,所以get_parent不需要指定参数;而可能有多个child,所以必须指定name参数。 externfunctionuvm_componentget_child(string...
在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. ...
4.还可以使用get_first_child 和 get_next_child 一次得到所有的child:(这两个返回的是string) name 是作为ref 类型传递的。 5.get_num_children:返回当前component 所拥有的child 数量: 6.还有has_child, do_flush 等函数。
对于顶层的寄存器模型来说,get_parent()返回的就是null,也就是说寄存器模型中的寄存器会自下而上层层判断有没有自定义的uvm_reg_backdoor句柄,如果都没有,图2中的代码段1执行的get_backdoor()函数最终返回的就是null。于是乎代码段2中执行的就是backdoor_read()任务,而backdoor_read()中又调用了backdoor_rea...
(2) 注:下文的源代码比较旧,新版中exp=get_mirrored_value,而不是exp=get(); 1taskuvm_reg::mirror(outputuvm_status_e status,2inputuvm_check_e check =UVM_NO_CHECK,3inputuvm_path_e path =UVM_DEFAULT_PATH,4inputuvm_reg_map map =null,5inputuvm_sequence_base parent =null,6inputintprior =...
UVM提供了一系列的接口函数用于访问UVM树中的结点。这其中最主要的是以下几个: get_parent 用于得到当前实例的parent,其函数原型为: 代码语言:javascript 代码运行次数:0 运行 AI代码解释 extern virtualfunctionuvm_componentget_parent(); get_child函数,与get_parent不同的是,get_child需要一个string类型的参数name...
get_parent:用于得到当前实例的parent,一个component只有一个parent,所以get_parent不需要指定参数。 get_child:需要一个string类型的参数name,表示次child实例在实例化时指定的名字。 get_children:得到一个component的所有函数。参数类型为ref uvm_component children[$]。
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,消耗仿真时间 ...
在start()函数中,首先调用了函数set_item_context()函数,这个函数位于sequence的父类uvm_sequence_item中,负责给成员变量m_sequencer, m_parent_sequence赋值。 如果没有指定挂载的sequencer,则挂载到parent_sequence的sequencer上。 此处seq0显示传入了需要挂载的p_sqr0,则调用set_sequencer()函数完成挂载,给m_sequenc...