Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit test discovery and execution tool #7685

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

fabianschuiki
Copy link
Contributor

Add the circt-test tool. This tool is intended to be a driver for discovering and executing hardware unit tests in an MLIR input file. In this first draft circt-test simply parses an MLIR assembly or bytecode file and prints out a list of verif.formal operations.

This is just a starting point. We'll want this tool to be able to also generate the Verilog code for one or more of the listed unit tests, run the tests through tools and collect results, and much more. From a user perspective, calling something like circt-test design.mlirbc should do a sane default run of all unit tests in the provided input. But the tool should also be useful for build systems to discover tests and run them individually.

Base automatically changed from fschuiki/valid-json-on-failure to main October 9, 2024 05:00
Copy link
Member

@uenoku uenoku left a comment

Choose a reason for hiding this comment

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

This looks like a great starting point!

Copy link
Contributor

@dtzSiFive dtzSiFive left a comment

Choose a reason for hiding this comment

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

Awesome, very exciting!!!

🔥🎉😎

include/circt/Dialect/Verif/VerifOps.td Outdated Show resolved Hide resolved
lib/Support/JSON.cpp Outdated Show resolved Hide resolved
test/circt-test/basic.mlir Show resolved Hide resolved
tools/circt-test/CMakeLists.txt Outdated Show resolved Hide resolved
Copy link
Member

@maerhart maerhart left a comment

Choose a reason for hiding this comment

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

Really cool! 🎉

//===----------------------------------------------------------------------===//

def FormalOp : VerifOp<"formal", [
NoTerminator, RegionKindInterface, HasParent<"mlir::ModuleOp">,
Copy link
Member

Choose a reason for hiding this comment

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

Was HasParent dropped accidentally, or is there a motivation behind it?

Copy link
Contributor Author

@fabianschuiki fabianschuiki Oct 9, 2024

Choose a reason for hiding this comment

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

I saw that we don't really rely on this property anywhere. No passes or similar use this. So I thought drop this until it becomes necessary. Maybe we want to group formal tests? Not sure.

tools/circt-test/CMakeLists.txt Outdated Show resolved Hide resolved
Add the `circt-test` tool. This tool is intended to be a driver for
discovering and executing hardware unit tests in an MLIR input file. In
this first draft circt-test simply parses an MLIR assembly or bytecode
file and prints out a list of `verif.formal` operations.

This is just a starting point. We'll want this tool to be able to also
generate the Verilog code for one or more of the listed unit tests, run
the tests through tools and collect results, and much more. From a user
perspective, calling something like `circt-test design.mlirbc` should
do a sane default run of all unit tests in the provided input. But the
tool should also be useful for build systems to discover tests and run
them individually.
@fabianschuiki fabianschuiki merged commit 6b5b63c into main Oct 9, 2024
4 checks passed
@fabianschuiki fabianschuiki deleted the fschuiki/add-circt-test branch October 9, 2024 17:41
@dobios
Copy link
Member

dobios commented Oct 9, 2024

Ooo exciting ! Looking forward to seeing where this goes!

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.

5 participants