如何控制agent的开关

在UVM_agent中,默认is_active等于UVM_ACTIVE,这会根据其值决定是否实例化drv和mon。在build_phase函数里,如果is_active仍为UVM_ACTIVE,则创建sequencer和driver。若要关闭实例化,可以通过设置配置或直接改变每个agent的is_active值。
摘要由CSDN通过智能技术生成

uvm_agent中有一个变量:

        uvm_active_passive_enum is_active = UVM_ACTIVE;

默认情况下都是开启的;

在extends出来的自己的agent中,根据is_active的值,确定要不要实例化drv/mon; 

function void my_agent::build_phase(uvm_phase phase); 

         super.build_phase(phase);

         if (is_active == UVM_ACTIVE) begin

                 sqr = my_sequencer::type_id::create("sqr", this);

                 drv = new_driver::type_id::create("drv", this);

         end

         mon = my_monitor::type_id::create("mon", this);

endfunction

想要关闭的话,通过如下方式关闭掉:

        uvm_config_int::set(this,"<relative_path_to_agent>","is_active",UVM_ACTIVE);

也可以直接用层次化的方式,直接给每个agent的is_active赋值;

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值