VERILOG2100: A static variable’s initializer should not depend on another variable that does not have a defined order of initialization relative to the first

Summary

Count: 1

ReliabilitySecurityMaintainabilityCode attributeEffort to fixTags
HIGH--Intentionality | Logical10minsynthesis, vscode, linter, simulation

Description

Noncompliant code example

package p;
  int i = 1;
endpackage

module fly;
  import p::i;
  int j = i; // Noncompliant: Initializer for static variable 'j' refers to another static variable 'i' which will be initialized in an indeterminate order
endmodule

A static variable's initializer refers to another variable that does not have a defined order of initialization relative to the first. This means that the initialization may or may not work as expected depending on how the tool chooses to schedule the initializers.

Parameters

No parameters.