Fix BIST val/dit comparison in gen_tag_macros (axi_llc_tag_store)#29
Open
gm-openchip wants to merge 1 commit into
Open
Fix BIST val/dit comparison in gen_tag_macros (axi_llc_tag_store)#29gm-openchip wants to merge 1 commit into
gm-openchip wants to merge 1 commit into
Conversation
…mparison Root cause: bitwise ~^ between a temporary tag_data_t struct and ram_rdata produces a flattened XNOR result. Re-slicing it back into a packed struct causes single-bit fields (val, dit) to read 0 regardless of actual values in some compilators (VCS + Simon). Fix: drop ram_compared, replace with: - tag: XNOR reduction with explicit Bist/Lookup mux on tag field - val, dit: direct == comparison against bist_pattern Affected signal: bist_res[i], which feeds axi_llc_tag_pattern_gen. Lookup/Flush behavior unchanged (tag_equ unaffected). Verified in simulation: ram_compared.val was 0 with both operands == 1.
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.
The original code performed a bitwise XNOR between a temporary packed struct and ram_rdata, then re-sliced the result back into a tag_data_t struct:
Per IEEE 1800-2017,
~^on packed structs operates on the flattened bit vector. Re-slicing the result into struct fields is valid but error-prone: for single-bit fields(val,dit), I observed that even though the compilation passes, the XNOR result was consistently 0 regardless of the actual values, confirmed in simulation(ram_rdata.val == bist_pattern.val == 1, but ram_compared.val == 0).This was putting the LLC in SPM mode, as BIST was failing.
Replaced with explicit per-field comparisons:
val,dit: == comparison directly on the relevant struct fieldsFunctionally equivalent for Lookup/Flush (
tag_equunchanged), fixes BIST result accumulation inaxi_llc_tag_pattern_gen.