17 / 20 · Concept
Scoreboards and invariants
Check terms, tags, edges and output transfers in addition to the final matrix.
Lessons are free to read. Enroll to save your learning progress.
Separate two references
Use a direct mathematical reference to compute wide sums with independent i/j/k loops. Use a separate timing model to move A right and B down. Copying the RTL's indexing helper into the golden model risks reproducing the same bug. Begin with fixed hand-calculated examples, then expand to reproducible random inputs.
Key the result scoreboard by job and global output coordinates. Compare each received value and mark its key as received. A repeated key is a duplicate, an unexpected key is an address error, and an unreceived expected key is missing. Zero results still require delivery. Padded out-of-range coordinates must never be stored.
Check invariants inside the array
Each PE must consume exactly [0,1,...,K−1]. Matching valid operands need equal job and k tags. Count remains between zero and K. A paused edge holds operands, valid, tags, accumulator and count. Clear leaves count and accumulator zero with no valid tokens. A blocked result holds data and job while valid remains asserted.
| Layer | Failure example | Likely fault |
|---|---|---|
| Arithmetic | 23 instead of 19 | Index, sign or width |
| Terms | [0,1,1] | Duplicate token |
| Timing | Final PE done at E2 | Early completion |
| Pause | Count changes while paused | Partial state hold |
| Output | A key received twice | Handshake control |
For the 2×2 example, the final PE contains eighteen after E2 and fifty after E3. An E2 global-done bug should fail both numerical and timing checks. Conversely, duplicated and omitted equal-valued products can preserve the final sum; term tracking catches that coincidence.
Store random seeds, matrices, dimensions, widths and pause positions. Log the first mismatching PE, term and physical edge. Deliberate tag errors should fail visibly rather than silently disappear.
Observe state after E_t consistently. Node reference execution, RTL compilation, RTL simulation, synthesis, timing closure, DDS project execution and board testing establish different facts. The supplied Node programs validate arithmetic and schedule models. Future RTL tests may reuse fixtures, but must retain their own tool versions, commands and logs.
Try it yourself
Construct inputs where checking only the final sum misses one duplicated and one omitted term.
Read the explanation
A row [1,1] and B column [5,5] correctly sum to ten. Consuming [0,0] also sums to ten but duplicates k0 and omits k1. Requiring both the value and the exact [0,1] term list detects the bug.