google / xls

XLS: Accelerated HW Synthesis
http://google.github.io/xls/
Apache License 2.0
1.2k stars 176 forks source link

[DSLX] Feature: Add `#[test_fail]` and `#[test_proc_fail]` #1071

Open mtdudek opened 1 year ago

mtdudek commented 1 year ago

Right now #[test_proc] and #[test] always has to succeed.

Adding new language testing feature will allow for negative testing. I think it would only require adding #[test_fail] and #[test_proc_fail] to the language parser. Test procs or fn should keep their current type format, and the bulk of the changes would be applied to the DSLX interpreter.

cdleary commented 1 year ago

Related is #481 -- I think a pragma would be non-ideal is we can avoid it vs like, a builtin that traps failure in the bytecode interpreter. Should still be synthesizable in the limit if we think about fail! as a fatal error signal.

cunninghamsandwich commented 5 months ago

Thanks for reporting! As discussed in our April enhancement proposal review meeting: we'll have to think through the syntax we want, so we'll consider this at a lower priority for now.