Tips and Best Practices
Here are some tips for effectively using the Test Vector feature:
- Use bit width in headers: Specify the bit width of each input/output pin in the header, even if it's 1 bit. This is required for multi-bit values.
- Use underscores for readability: You can use underscores (
_) anywhere in numeric values. Underscores are ignored during parsing. Examples: 0x0000_1111, 0o1234_5670, 1111_0000, 1_234, or -5_000.
- Use spaces between values and headers for alignment: Aligning the starting position of the values and headers improves readability and makes it easier to identify the values and headers. Without doing this it is very easy to mix up which value belongs to which header, thus get really confused when the test fails but the circuit seems to be working correctly.
- Use sequences for stateful circuits: If your circuit has memory (flip-flops, registers, counters), use sequential tests to verify state transitions.
- Use don't care for partial verification: When testing complex circuits, use
<DC> for outputs you're not currently verifying.
- Use floating for tri-state testing: Use
<float> to test circuits with tri-state outputs or high-impedance states.
- Organize with sets: Use the
<set> column to group related tests into sequences. Tests with the same <set> number run together in <seq> order, with circuit state preserved between steps.
- Mix combinational and sequential: You can mix combinational tests (seq=0) with sequential tests in the same file.
Backward Compatibility
All existing test vector files continue to work without modification. The new features are optional:
- If
<set> and <seq> columns are not present, all tests are combinational (default behavior)
- If special values
<DC> and <float> are not used, normal value comparison applies
- The original file format is fully supported
Previous: Command Line Usage | Next: Test Vectors.