System Verilog 片断

 

Q:如何制作multi-bit variable 的 toggle coverage group?

A:Systemverilog for Verification P394. 利用 option.per_instance = 1;设置covergroup.

 

//in covergroup declaration
covergroup group_name with function sample(bit sample_bit)
   coverpoint_name: coverpoint sample_bit;
   option.per_instance = 1;
endgroup

Q:forever begin块中的 return and continue会有效果吗?

A:

Q:disable fork 的作用域

A:Kill calling thread's all fork and descendents in fork. Calling thread is the one where "disable fork" exsists.

杀死所有在calling thread中已经被创建的thread。

fork
  thread 1;
  thread 2;
  disable fork;
  // calling thread is this line itself, so disable fork will kill it own rather then thread1 and thread2.
join_none

Q:disable label的作用域

A:他的作用有点“stastic”的感觉,will kill all process named with the corresponding lable. 所以慎用!更推荐使用diable fork. 这里的label带有hierarchy的概念,实际上disable的是带有类似*.test.generator.label的thread,不同路径下面的同样的label并不会被disable。

Q:SV 中数据的强制类型转换的方法?

A:type_name'(X);

P: The type of object generated by new(), is decided by type of handle before new().

P: 特别注意符号位的扩展问题.

Q: disable fork和disable label的区别?

A: disable fork会终结掉calling thread(调用的disable fork的begin_end)中已经被创建的thread。disable label会终结掉同一label(包含了hierarchy信息,即为xxx.driver.task1.label)下的thread。

P: use wildcard。 *:anything ; ?:one character

posted on 2015-07-27 13:35  Module_Sun  阅读(814)  评论(0编辑  收藏  举报

导航