Skip to content

sv: assembly misses nonblocking package-variable writes of runtime processes #1969

Open

Description

@tignear

check_package_variable_drivers in celox-frontend-core/src/symbolic/assembly.rs finds the package variables a runtime process writes by scanning its kernel for Store/Commit instructions. A nonblocking assignment in a process does not appear there as a store to the package variable, so assembly does not see it.

In a mixed-language design, where assembly is the only cross-instance check of package-variable drivers, two instances of an SV module whose always_ff runs as a process (for example because it has a host request) and nonblockingly writes one package variable are accepted, although always_ff must be the only writer of its variables (IEEE 1800-2023 9.2.2.4):

package p; logic [7:0] shared; endpackage
module W(input logic clk, input logic [7:0] a);
    always_ff @(posedge clk) begin p::shared <= a; $fwrite(1, "host"); end
endmodule
// a Veryl top instantiating W twice builds without an error

The blocking form (p::shared = a) is rejected since #1872. The same blind spot existed before #1872, which only compared stores.

Expected

Collect the nonblocking writes of process kernels as writes of their targets in the assembly driver check.

Found in a review of #1872.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions