circt
circt copied to clipboard
[reduce] Add default error tester to circt-reduce
As discussed in #1591, it would make sense to have circt-reduce provide a few default testers that cover the main things people want to check for in tool output: specific error messages or tool crashes. Something like:
--run-script foo.sh--reduce-error "error: sink ..."--reduce-crash
Ideally the --reduce-error case would take a regex argument, and multiple --reduce-error would imply that all of them must be present in the output. Also, regarding tool options, it would be great to have the tester/tool and its arguments be a positional argument to circt-reduce, such that we can do things like:
circt-reduce foo.mlir -- firtool --verilog --lower-to-hw --some-magic-flag
Possibly even providing a placeholder in the command, like firtool {} --verilog --lower-to-hw --some-magic-flag where {} would be replaced with the output to be tested.