Skip to content

Conversation

@sequencer
Copy link
Owner

@sequencer sequencer commented Jul 6, 2025

Core Problem:

The fundamental issue with standard SVA is that all sequence and property constructs carry implicit clocking semantics. This creates ambiguity, particularly for immediate assertions which, despite being combinational, are formally verified using a conceptual, tool-provided clock.

Proposed Design Philosophy:

To create a clearer and more explicit system, this design moves away from SVA's implicit clocking. The core principle is to make all clocking relationships explicit within the API, thereby improving type and semantic clarity:

  1. Explicit Separation of Sequence and Property: Unlike SystemVerilog, this design introduces two distinct API kinds to represent the different concepts:
  • ref_to_bool.S: Represents a Sequence. It is a temporal construct that is always explicitly bound to a clock.
  • sequence.P: Represents a Property without any clock semantic.
  1. Explicitly Clocked Sequences: Under this model, there are no "un-clocked" or implicitly clocked sequences. Every sequence (ref_to_bool.S) must be associated with an explicit clock, eliminating ambiguity.

  2. Handling Immediate Assertions: The main challenge in an explicitly clocked system is how to handle immediate SVA assertions, such as those used for verifying combinational logic (always_comb). These assertions rely on a "virtual" clock provided by formal verification tools for their decision points.
    To solve this, a new, dedicated API is introduced:

  • ref_to_bool.I: Represents a non-temporal, Immediate boolean expression derived from LTL. This construct is used only for clock-less, immediate assertions.

The capabilities of ref_to_bool.I are intentionally restricted to maintain semantic integrity:

  • It can imply another I expression or be converted directly into a Property.
  • It cannot be temporally concatenated with sequences (e.g., using ##), as it exists outside the clocked temporal domain.

@sequencer sequencer mentioned this pull request Jul 6, 2025
Comment on lines 48 to 54
// macro bug:
// [285] [info] compiling 1 Scala source to ./out/zaozi/tests/compile.dest/classes ...
// [285] [error] -- Error: ./zaozi/tests/src/SVASpec.scala:48:12 ---
// [285] [error] 48 | a.S
// [285] [error] | ^^^
// [285] [error] |Type parameter T must be a subtype of DynamicSubfield, but got me.jiuyang.zaozi.valuetpe.Bool.
// [285] [error] one error found
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import zaozi.given

@Clo91eaf
Copy link
Collaborator

Clo91eaf commented Aug 6, 2025

I will take this PR. This PR is related to llvm/circt#8673, but they are independent implecation of each other. After I finish the work for issue 8673, I will open a new PR to introduce and integrate the new explicit clocking design.

@Clo91eaf Clo91eaf force-pushed the sva branch 8 times, most recently from f7c28c3 to 08a8a05 Compare September 23, 2025 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants