Repository navigation
Why? through memories: follow a value read from a memory - #24
Merged
Merged
Conversation
…and its writer
"Why is it this value?" used to stop at a memory read with "mem = ?". The
simulator now records each memory word's changes like a signal's
(SimResult::words, named like tb.dut.mem[2]) and, each time an assignment
that reads memory words runs, which words it read (SimResult::word_reads,
Origin::words). The web app shows the word read ("It used mem[0] = 17,
rptr = 0") and follows it back to the line that stored it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
In Why is it this value?, a value read from a memory (
assign dout = mem[rptr]) used to end the chain withmem = ?. Now it names the word that was read and lets you follow it back:"Why wasn't it N?" lists the words read in the same way.
How
wafer-sim):SimResult::words, namedtb.dut.mem[2], with what wrote each value).SimResult::word_reads, inOrigin::wordsorder). That log is capped atMAX_WORD_READS.wordNames,wordWidths,wordTimes,wordValues,wordBy,wordReadTimes,wordReadOriginsandwordReadWords;wordsis added to the origins JSON.why.tslooks words up like signals and expands a memory read into the words read by the run that made the value.Checks
memory_words_are_recorded_like_signals: a memory with a non-zero base index, an index expression, two word reads in one assignment, and a bit-select of a word.dout→mem[0]→mem[wptr] <= din→din, as shown above.🤖 Generated with Claude Code