leonardt / fault

A Python package for testing hardware (part of the magma ecosystem)
BSD 3-Clause "New" or "Revised" License
41 stars 13 forks source link

Add ReadyValidTester for I/O sequences #314

Closed leonardt closed 3 years ago

leonardt commented 3 years ago

For an initial implementation we can actually create a synthesizable test bench to feed input sequences and check output sequences. This is likely to become an issue when scaling to large sequences (since we have to generate each sequence element as a constant fed into a mux). To handle this, I think we can change the sequence mux to read data from a file (or a memory that has its contents loaded from a file).

leonardt commented 3 years ago

Depends on https://github.com/phanrahan/magma/pull/992

leonardt commented 3 years ago

I think we may be able to us the while loop tester to implement a non-synthesizable version since we need to wait until ready/valid handshakes, we could also use a for loop with a while loop inside to stall iterations, but we need some strategy for serializing the input/output sequences, we could try just having them as literals in the generated code, but using files might be a better longterm strategy (assuming we can compress things better into a binary representation for file IO)

leonardt commented 3 years ago

Thought: how can we allow the user to debug issues with these tests? E.g. we can add a debug flag that prints out the sequences/handshakes (so perhaps we can find the one that it stalls on), is there someway we can inject user defined instrumentation code that might be useful? We can also just wait for user feedback to determine useful debugging features.