强制结构成员

Forcing a member of a struct

我试图在我的设计中强制使用一些内部节点。我试图强迫的一件事是 struct.

的成员

当我尝试这样做时:

module struct_force;

   struct {
      logic a;
      logic b;
      logic c;} d;

   initial begin
      force d.a  = 1;
      $display(d);
   end
endmodule

Incisive 给我一个错误:

Illegal use of a bit-select, part-select, member-select or mda element [9.3.1(IEEE)]

但 VCS 似乎对此很满意:See EDA playground example

来自 IEEE-1800,我看到这与 force 有关:

The left-hand side of the assignment can be a reference to a singular variable, a net, a constant bit-select of a vector net, a constant part-select of a vector net, or a concatenation of these.

我在解析这句话时遇到了问题,无法找出谁错了:是 Incisive 阻止了我做我应该做的事情,还是 VCS 与规范一起玩得过火了?

如果这实际上是非法的,那么强制执行结构的一部分的变通方法是什么?

上面句子中的关键词是单数变量。您尝试 force 的变量是一个解压缩的结构,它不是一个单一的变量;它是一个聚合变量。

如果你把它变成一个压缩结构,你 运行 变成你引用的句子后面的句子:"It shall not be a bit-select or a part-select of a variable..."

网络被有效地分解成单独的标量位,其值是该网络驱动程序的分辨率函数。 force 成为该网络的另一个驱动程序。

将其添加为 LRM 的增强功能并非不可能,但工具必须将变量分解为单独的位 - 对该变量的每个常规赋值都必须逐位完成以检查是否其中一位处于强制状态。