-
Notifications
You must be signed in to change notification settings - Fork 304
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
[circt-test] Add simple SymbiYosys test runner #7756
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is pretty neat!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
@@ -0,0 +1,113 @@ | |||
// RUN: circt-test %s -r circt-test-runner-sby.py | |||
// REQUIRES: sby |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also run Filecheck to confirm all <num> tests passed
is actually printed? (If it's tricky due to color I think it's ok not to add the check though).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah cool idea, definitely!
pm.addNestedPass<hw::HWModuleOp>(createLowerVerifToSVPass()); | ||
pm.addNestedPass<hw::HWModuleOp>(sv::createHWLegalizeModulesPass()); | ||
pm.addNestedPass<hw::HWModuleOp>(sv::createPrettifyVerilogPass()); | ||
pm.addPass(createExportVerilogPass(verilogFile->os())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great use of ExportVerilog!
tools/circt-test/circt-test.cpp
Outdated
if (auto result = llvm::sys::findProgramByName(runner)) | ||
runner = result.get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Return failure otherwise?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, thanks!
Extend circt-test to export the input MLIR file as Verilog and then run all discovered tests through a simple SymbiYosys runner script. This is currently very rigid: all tests are always run, and they all run through the exact same runner script. In the future, we'll want to add filtering mechanisms to include and exclude tests, and pick among multiple runner scripts for each test. Also add a basic integration test that builds an adder from discrete logic gates and then verifies it through multiple `verif.formal` ops. To run this you need to have SymbiYosys installed. In the future we'll want to have `circt-bmc` and other CIRCT-based verification tools available as runners as well.
cfdef71
to
a1b66fb
Compare
Landing this since the only failure is related to #7093. |
Extend circt-test to export the input MLIR file as Verilog and then run all discovered tests through a simple SymbiYosys runner script. This is currently very rigid: all tests are always run, and they all run through the exact same runner script. In the future, we'll want to add filtering mechanisms to include and exclude tests, and pick among multiple runner scripts for each test.
Also add a basic integration test that builds an adder from discrete logic gates and then verifies it through multiple
verif.formal
ops.To run this you need to have SymbiYosys installed. In the future we'll want to have
circt-bmc
and other CIRCT-based verification tools available as runners as well.