Hi Ron,
Thanks, that’s a great start. I had a quick scan of the code and I’m not sure how many of the possible modes it uses. It seems to have a static test it runs to verify operation, rather than a signal test that could e.g. probe for spurious signals originating in numeric overflows of filters, etc… It would be good to have a driver that says “transmit this, and expect to receive that”, for any pair of Tx/Rx files, and with the hardware previously set into any possible mode.
I had started for example to remove compile warnings about numeric truncation. So if there’s a 12-bit variable in a register somewhere, and the code adds 1 to it, well “1” is a 32-bit literal, so the result is 32 bits, so when you assign it back to the 12-bit register you get a truncation warning. To avoid that, you can use 12’1, a 12-bit literal “1”. But if there is a mistake in expressions like this, they could cause mysterious failures in specific code paths (not this one, which is probably safe). So if I want to be sure that my “warning reduction” change hasn’t broken anything, I need a test that actually exercises that code path.
We don’t have a way to measure the coverage of even the limited tests that we have, let alone determine if a given expression ever gets exercised by some test.
I envisage in the future being able to get (most of) the Hermes gateware running in a Verilator simulation, so you don’t even need hardware to run a regression test (obviously this won’t test the AD9866 or FX2 drivers, but could go close). If we make that possible, we could also get full coverage metrics, and work towards 100% coverage so we can deploy new code with the certainty that (barring device driver bugs) it will work as expected.