美文网首页
进程同步,通过uvm_event

进程同步,通过uvm_event

作者: Poisson_Lee | 来源:发表于2021-01-12 13:45 被阅读0次

uvm_event axi_busy_flag_ev;

axi_busy_flag_ev = uvm_event_pool:get_global($sformatf("xxxx"));
同步发起地方触发
axi_busy_flag_ev.trigger();

需要同步的地方,可以在seq里同步用来控制仿真结束。而不需要用到 start_phase.raise/drop_objection; 尤其是 uvm_do调用的sequence。

axi_busy_flag_ev.wait_ptrigger();
while(axi_busy_flag_ev.is_on() ) begin
  axi_busy_flag_ev.reset();
  #1ms;
end

这一段可以用来控制仿真结束。(在不同组件之间同步)

对于同一个文件,比如reference model,用run_phase控制结束信号,可以用单bit信号,不需要用 event
bit axi_busy_flag
在采到axi接口transaction时,将 axi_busy_flag = 1;

在run_phase

forever begin
  wait(axi_busy_flag==1);
  phase.raise_objection(this);
  axi_busy_flag = 0;
  #1ms;
  phase.drop_objection(this);
end

相关文章

网友评论

      本文标题:进程同步,通过uvm_event

      本文链接:https://www.haomeiwen.com/subject/nnnsaktx.html