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赋值;

Logo

Agent 垂直技术社区,欢迎活跃、内容共建。

更多推荐