configs: Initialize classic L2 DRRIP slice params#818
Conversation
Change-Id: I4973ed1585461ac134fc26ca254bf08ea636405f
📝 WalkthroughWalkthroughThe L2 cache configuration now conditionally customizes replacement policy parameters when using DRRIPRP instances, setting Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 64ea8a148c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@configs/common/CacheConfig.py`:
- Around line 95-98: DRRIP set geometry currently hardcodes a 64B line size;
update the computation in the DRRIPRP block
(system.l2_caches[i].replacement_policy) so num_sets_per_slice =
system.l2_caches[i].size // (system.cache_line_size * system.l2_caches[i].assoc)
(use system.cache_line_size rather than 64), and defensively fall back to 64 if
system.cache_line_size is missing/None; keep other assignments to num_slices and
num_sets_per_slice unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a35af615-1370-45c4-a3c1-81c96d55e949
📒 Files selected for processing (1)
configs/common/CacheConfig.py
🚀 Coremark Smoke Test Results
✅ Difftest smoke test passed! |
Summary
Initialize DRRIP slice-related parameters for the classic-L2 configuration.
Problem
The default L2 cache uses
DRRIPRP, which inherits fromDuelingRP. In the classic-L2 configuration, the replacement policy did not initializenum_slicesandnum_sets_per_slice.As a result, the simulator could hit
floorLog2(0)during initialization and abort at tick 0 when running with--classic-l2.Fix
When classic L2 is configured, initialize the DRRIP replacement policy with:
num_slices = 1num_sets_per_slice = size / (64 * assoc)This keeps the classic-L2 configuration consistent with the assumptions made by the replacement-policy implementation.
Validation
Validated with SE matrix tests using
--classic-l2:precomp_rand_repro: passesgemm_precomp: all 8 precomputed cases pass