1. 功能
uvm_config_db#(T)
是一个类,用于配置uvm_component实例的资源;uvm_config_db主要是提供了一种资源配置的简化方法。
2. 命令解析
class hierarchy
uvm_config_db#(T)
或者
uvm_config_db
T 就是待配置选项的type类型。
3. class定义
class uvm_config_db#(
type T = int
) extends uvm_resource_db#(T)
methods
- get: 判断
inst_name
的field_name
,是否等于指定的value。 - set: 设置
inst_name
的field_name
。 - exists: 检查
inst_name
的field_name
设置值,是否有效。 wait_modified:
等待inst_name
的field_name
开始配置;否则后续命令不继续往下执行。
get
static function bit get(
uvm_component cntxt,
string inst_name,
string field_name,
inout T value
)
uvm_component cntxt
是UVM树形结构的起始点。可以认为是string inst_name
的相对层次路径。uvm_component cntxt
与string inst_name
,配合得到UVM树形结构的具体层次。string field_name
是指定层次下的field字段名称。inout T value
是field字段的type类型。- get的返回值是function bit类型(不要看成简单的bit类型),即0或者1。1代表指定层次的
inst_name
,其对应field_name
的value值,并做好了get functio