美文网首页
creat a uvm_sched---自定义domain的ru

creat a uvm_sched---自定义domain的ru

作者: li_li_li_1202 | 来源:发表于2022-02-10 09:16 被阅读0次

前面讲了用户自定义uvm_phase:https://www.jianshu.com/p/90161143bb62
以及多个domain的同步和设置:https://www.jianshu.com/p/0435c400a7c8

那么我现在有这样一个需求:如何实现domain的12个run-time_phase自定义?

如果只是例化一个new_domain并且set_domain(new_domain)的话,只是添加了12个run-time_phase.这个是怎么实现的呢?这就不得不涉及到源码的set_domain的实现。

伪代码

如果在设置uvm_domain的时候并没有实例化name="uvm_sched"的uvm_phase的话,这里就会调用uvm_domain::add_uvm_phase(),也就是标椎的12个run-time_phase。并且会将common_domain的run_phase与12个run-time_phase并行起来。

由此联想到,如果我们将new_domain里面定义一个uvm_sched的uvm_phase(自己定义,而不是12-run_time_phase),那么就走不到if(schedule == null)的分支里面了。

  • C放在了common_domain里面,在pre_reset_phase和reset_phase中间插入了training_phase。
  • A是new_domain,并且手动添加了12-run_time_phase
    • 第一步:例化new_domain和uvm_sched
    • 第二步:add phase并将它add到new_domain上
    • 第三步:将new_domain的sched与common_domain的run_phase并行起来
    • 第四步:set_domain(new_domian)

自定义uvm_sched的run-time_phase

接上一个例子,修改A.sv的代码.

  • 在上述的第三步可以修改成你想要的顺序,当然你也可以用add的.with_phase/.before_phase/.after_phase来指定相对的顺序,可以参考https://www.jianshu.com/p/90161143bb62

另外一种思路:直接将define_domain进行重写。其实也就是将上面的1/2/3步骤挪到define_domain里面。

相关文章

网友评论

      本文标题:creat a uvm_sched---自定义domain的ru

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