如何在复位时初始化时钟块信号

How to initialize clocking block signals at reset

我一直在通读 UVM: illegal combination of driver and procedural assignment warning 和答案中的论文。 (请考虑提到的问题中链接的论文)

然而,驱动程序被实现为在接口信号上而不是在时钟块信号上驱动复位值,时钟不能保证在复位时运行。

那么,如果接口信号被声明为连线,我该如何处理这种情况。

例如 考虑链接问题中的代码。一般情况是

@(vif.cb); 
vif.cb.opcode <= value; 

即使操作码在接口中声明为 net,这也是正确的,因为时钟块将负责正确分配。但是我不能说

@(vif.rst);
vif.cb.opcode <= init_value;

因为我不能保证重置时的时钟。为了适应这一点,我将不得不更改时钟生成策略。

我也说不准

 vif.opcode <= init_value;

导致使用网络类型信号的程序赋值是非法的

另一种方法是将门控信号声明为带有重置的网络,但我认为为此我必须在接口中声明临时信号。任何人都可以详细说明如何在重置时实现驱动网络吗?

虽然从程序代码中分配网络是非法的,但将值强加到它们上是合法的。您可以执行以下操作:

@(negedge vif.rst);
force vif.opcode = 0;

奖金:IMO 你不应该将 opcode 定义为电线。程序性和持续性驾驶员警告的非法组合是错误的。 SV 2012 标准在 14.16.2 驱动时钟输出信号:

中明确说明

It is possible to use a procedural assignment to assign to a signal associated with an output clockvar. When the associated signal is a variable, the procedural assignment assigns a new value to the variable, and the variable shall hold that value until another assignment occurs (either from a drive to a clocking block output or another procedural assignment).