可以看到存储 child 有两个数组,为以后两种方式得到child 使用。 第一种能够就是我们要找的m_children,用get_name 好像是用字符串当索引。 第二种使用句柄(handle)当索引。(但是句柄如果是内存地址的话,这个值岂不是很大?而且以后还不连续?) 是谁调用了m_add_child呢? 也是在new 里面。 m_parent是什么呢?
在uvm_component类中,存在几个关键参数:m_parent存储当前组件的parent组件,m_children和m_children_by_handle存储当前组件的子组件,是一个联合数组类型。m_add_child函数用于添加子组件,该函数在new函数中被调用。此外,uvm_component内还包含一些查询children的方法,以遍历环境树结构。创建环境组件时,...
在start()函数中,首先调用了函数set_item_context()函数,这个函数位于sequence的父类uvm_sequence_item中,负责给成员变量m_sequencer, m_parent_sequence赋值。 如果没有指定挂载的sequencer,则挂载到parent_sequence的sequencer上。 此处seq0显示传入了需要挂载的p_sqr0,则调用set_sequencer()函数完成挂载,给m_sequenc...
uvm_componentparent);super.new(name,parent);flag_fifo=new();flag=0;endfunctionfunctionvoidbuild_phase(uvm_phasephase);super.build_phase(phase);uvm_config_db#(virtualm_ctrl_if)::get(this,"","m_
UVM的层次化结构设计方法主要体现在以下两个方面:基于uvm_component的层次化结构:树形结构:uvm_component类用于组建验证环境的树形结构,每个组件都有自己的parent和children,形成层次化的结构。关键参数:包括m_parent、m_children和m_children_by_handle。添加子组件:通过m_add_child函数添加子组件,该...
//uvm_port_component #(this_type) m_comp; m_comp = new(name, parent, this);//因此m_comp的父节点也是my_drv 在end_of_elaboration_phase执行时,作为最底层的children,从m_comp的resolve_bindings()开始执行。 virtual function void resolve_bindings(); ...
uvm_port_component继承于uvm_port_component_base, uvm_port_component_base继承于uvm_component。在uvm_port_component_base中,super.new传入的name = "A_ap", parent = A_inst 所以,并不是A_ap这个端口实例被加入到了UVM树形结构,因为A_ap不属于component,无法加入树形结构。只是A_ap的成员变量m_comp加入到...
为了更全面地理解对象的归属关系,uvm_object类还提供了一个名为m_parent_class的成员变量,用于存储对象所属的类名。通过这个机制,系统能够追踪对象的层级关系,理解它们之间的继承结构。然而,uvm_object类是一个抽象基类,意味着它自身不能直接实例化。为了解决这一问题,UVM提供了uvm_object_wrapper类...
从实现中的连接方式来看,port,export只是命令的传递者,imp是命令的执行者,其中实现了具体的function---调用parent相应的function。 所以,port,export可以被定义很多层级,来方便传递,都不影响最终的执行。 代码中表现为,port调用自己provider的put等函数,即export的provider的put等函数,即imp中调用的parent的put函数。
除此之外,m_sequencer可以被用来访问UVM component层次结构中的其他资源或者配置信息等。但有一点需要注意,m_sequencer的类型是uvm_sequencer_base,而我们通常绑定给sequence的sequencer是uvm_sequencer_base的子类,所以,当该句柄引用子类对象时,可引用的资源将受到限制。