Skip to content

[test] Add tests of domain crossings w/ assertions#5280

Open
seldridge wants to merge 1 commit intomainfrom
dev/seldridge/clockdomain-assertion-tests
Open

[test] Add tests of domain crossings w/ assertions#5280
seldridge wants to merge 1 commit intomainfrom
dev/seldridge/clockdomain-assertion-tests

Conversation

@seldridge
Copy link
Copy Markdown
Member

@seldridge seldridge commented Apr 23, 2026

Add semi-comprehensive tests of different dummy clock crossings: (1)
synchronous, (2) rational, and (3) asynchronous. Use property assertions
to show how these crossings can be written to disallow crossings which are
supposed to not be allowed. E.g., this shows that a synchronous crossing
cannot be used to cross between rationally related domains or to do fully
asynchronous crossings.

While not shown (for brevity) these are intended to be added to strengthen
the otherwise entirely unsafe domain.unsafeCast API.

Note: this test will build these, but doesn't do anything as domaintool is not available. This passes locally for me. However, once we have a firtool-resolver that includes this, or separate publishing of domaintool, then this can be used for checking correctness of domain crossings.

I can't currently express everything I want with checking rational crossings and am in the process of adding boolean operations to the FIRRTL and OM dialects. Granted, this is just a test, so it's kind of fine if these are "weird" crossings that don't work as they entirely should.

@seldridge seldridge added DO NOT MERGE No Release Notes Exclude from release notes, consider using Internal instead labels Apr 23, 2026
@seldridge seldridge changed the base branch from ci/ci-circt-nightly to main April 24, 2026 22:43
Add semi-comprehensive tests of different dummy clock crossings: (1)
synchronous, (2) rational, and (3) asynchronous.  Use property assertions
to show how these crossings can be written to disallow crossings which are
supposed to not be allowed.  E.g., this shows that a synchronous crossing
cannot be used to cross between rationally related domains or to do fully
asynchronous crossings.

While not shown (for brevity) these are intended to be added to strengthen
the otherwise entirely unsafe `domain.unsafeCast` API.

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
@seldridge seldridge force-pushed the dev/seldridge/clockdomain-assertion-tests branch from dc32ddd to 0e5a64c Compare April 24, 2026 22:45
@seldridge seldridge requested a review from jackkoenig April 24, 2026 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

No Release Notes Exclude from release notes, consider using Internal instead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant