UVM树通过uvm_component来实现树形结构。所有的UVM树看的结点都是一个uvm_component。每一个uvm_component都有一个特点:他们在new的时候需要指定一个类型为uvm_component,名字为parent的变量。
uvm_component有phase的概念。
对于每一个uvm_component,它都有一个m_child[]用来保存它的孩子,同理也告诉这些孩子他们的父母是谁。

先来看看uvm_component.svh对应的源码:

- m_parent/m_children[string]/m_children_by_handle[]构建了整个UVM的树形结构。

- line1736-1739,uvm_root的name==top,但是set_name("")所有在get_full_name等函数调用的时候,就不会显示这一级。
- 判断出来是最顶层,直接return,m_parent == null并且m_child[]也不会赋值。

- line1748,相信看过uvm_phase就会知道这个函数。
- line1749,判断uvm_build_phase是不是在common_domain里面。
- line1771,通常在uvm_test_top,case的那一层parent的参数设置为null。



- m_parent
- m_children[]
- m_children_by_handle[]
构建了UVM树形结构

网友评论