Repository navigation
Use P.INSTR_CLASS_PRED in bpred - #1967
Open
davidharrishmc wants to merge 1 commit into
Open
davidharrishmc wants to merge 1 commit into
davidharrishmc wants to merge 1 commit into
Conversation
bpred hard-coded `define INSTR_CLASS_PRED 1 and never read the config parameter added in 32c102d, so every *_0 branch-predictor derivative built the same as its *_1 twin. With 0, icpred decodes the instruction class from the fetched instruction instead of predicting it in the BTB. Co-Authored-By: Claude Opus 5.5 (1M context) <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.
bpred.svhard-coded`define INSTR_CLASS_PRED 1and never readP.INSTR_CLASS_PRED, which was added tocvw_t, the configs, and 22bpred_*_0_rv32gcderivatives in January 2024 but never wired up. As a result every_0derivative built identically to its_1twin, and BTB/RAS sweeps since May 2023 (the old+define+INSTR_CLASS_PRED=0was also overridden by the in-file `define) measured class prediction on.Default configs set 1, so they are unchanged. With 0,
icpreddecodes call/return/jump/branch from the fetched instruction and the BTB supplies only the target.Lint passes on all derivatives. Verilator ACT rv64gc and rv32gc pass with both settings (the only failures are the Svadu fault tests fixed by #1965), and all 22
bpred_*_0derivatives pass. CoreMark: with 0 the class-wrong count drops to 0; cycles improve 0.3–0.4% for the default configs and 5.1% for the 64-entry-BTB GSHARE config, so published_0vs_1BTB/RAS comparisons should be regenerated.🤖 Generated with Claude Code