circt icon indicating copy to clipboard operation
circt copied to clipboard

integration_test: Add FIRRTL ref/public/agg ABI test.

Open dtzSiFive opened this issue 1 year ago • 2 comments

Build two FIRRTL files, check the resulting Verilog is somewhat sane (uses verilator --lint-only).

Check with aggregates preserved as well.

Draft to invite some discussion and leave room for doing this sort of testing a different way. WDYT?

dtzSiFive avatar Feb 09 '24 20:02 dtzSiFive

I know this will lead to duplication, but it would be nice to have some check lines to get a sense of what the test is verifying by looking at it.

nandor avatar Feb 12 '24 17:02 nandor

Generally, having end-to-end integration tests that are checking the legality of the emitted Verilog are great. This was a huge missing testing mode that would have helped early on when getting CIRCT online. (See discussion here and conclusion that this style of testing should be in an integration test: https://github.com/llvm/circt/issues/1587#issuecomment-899922260) What is great about this is that it acts as a backstop for patches which create illegal Verilog for certain options unknowingly.

@nandor wrote:

I know this will lead to duplication, but it would be nice to have some check lines to get a sense of what the test is verifying by looking at it.

This is hard to do as there isn't really anything being tested other than the exit code of verilator --lint-only. Do you think some comments in the test would be sufficient to communicate intent? WDYT?

seldridge avatar Feb 12 '24 19:02 seldridge