Conversation
The current load/storeCompletedIdx ignores certain situations, which may cause some instructions before Idx to not have been committed. Change-Id: I7f79ad2ea0bc305f9d389e4372b45a453bf59278
📝 WalkthroughWalkthroughThe LSQ unit's completion index tracking mechanism was refactored to use a sentinel convention (head()-1) for initialized indices, enforce strict boundary constraints, replace per-iteration progression with guarded advancement loops, and introduce a unified rewindCompletedIdx mechanism to handle squash operations consistently. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Suggested reviewers
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
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.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@src/cpu/o3/lsq_unit.cc`:
- Around line 2904-2917: The loop that advances loadCompletedIdx can call
loadQueue.getIterator(loadCompletedIdx + 1) when loadCompletedIdx equals the
queue tail, producing an invalid iterator; before calling getIterator(check),
add a bounds check using loadQueue.tail() or loadQueue.size() to ensure
loadCompletedIdx + 1 is within the queue range (e.g., if (loadCompletedIdx + 1
<= loadQueue.tail()) ) and only then obtain loadIt and inspect
loadIt->valid()/instruction()/isExecuted(); keep the rest of the logic
(loadCompletionWidth, DPRINTF, incrementing loadCompletedIdx) unchanged.
- Around line 2920-2932: The loop advances storeCompletedIdx by calling
storeQueue.getIterator(storeCompletedIdx + 1) without checking bounds; when
storeCompletedIdx == storeQueue.tail() that +1 access is out of range. Fix by
adding a bounds check before calling getIterator (or change the loop condition)
so you only attempt getIterator(storeCompletedIdx + 1) when storeCompletedIdx !=
storeQueue.tail(); i.e., ensure the loop over storeCompletionWidth also verifies
storeCompletedIdx != storeQueue.tail() and break if it is, before using
storeQueue.getIterator, keeping use of storeQueue, storeCompletedIdx,
storeCompletionWidth, storeQueue.getIterator, addrReady(), and canWB() intact.
🚀 Coremark Smoke Test Results
✅ Difftest smoke test passed! |
The current load/storeCompletedIdx ignores certain situations, which may cause some instructions before Idx to not have been committed. Change-Id: I7f79ad2ea0bc305f9d389e4372b45a453bf59278
The current load/storeCompletedIdx ignores certain situations, which may cause some instructions before Idx to not have been committed.
Change-Id: I7f79ad2ea0bc305f9d389e4372b45a453bf59278
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.