Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix, tests, and assertion for stall condition #117

Merged

Conversation

aarongchan
Copy link
Collaborator

Fixing #116

core/Rename.cpp Outdated
@@ -356,4 +359,9 @@ namespace olympia
}
}


void Rename::onStartingTeardown_(){
sparta_assert(current_stall_ == StallReason::NOT_STALLED, "Rename is stalled when entering teardown, possible lockup in Rename?")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@knute-sifive Was thinking either to have an assert like this to ensure that there is no ending stall when teardown begins, or should I do a notification similar to #108

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, you can't have this assertion. It's possible that Rename is stalled waiting for free registers AND the ROB was told to stop simulation on instruction N. This is a valid case and you don't want to assert on that.

In #108 (still under review at this time), having the ROB broadcast "I stopped simulation" and Rename listening for that and determining if it's a cause in this function is appropriate.

Copy link
Collaborator Author

@aarongchan aarongchan Nov 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove the assertion/teardown, and I'll add in the rename debugging with the teardown once #108 is merged.

@ghost ghost assigned aarongchan Nov 8, 2023
@ghost ghost added the bug Something isn't working label Nov 8, 2023
@ghost ghost requested review from klingaard, arupc and kathlenemagnus November 8, 2023 16:00
// decrement reference for store instruction to data register
if(inst_ptr->isStoreInst()) {
// decrement reference to data register
if(inst_ptr->isLoadStoreInst()){
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danbone's fix is a good catch: noticing that the renaming and reclamation are not in sync

But there's something nagging me about all of this -- we're renaming x0. Can you open a new issue that fixes that?

Specifically, in renameInstructions_, when iterating over the sources and destinations, you need to skip renaming x0:

if (num == 0 && rf == core_types::RF_INTEGER) { continue; }

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll approve this for now, but please put in a proper fix for the end-of-simulation assertion (use the ROB notification).

@aarongchan aarongchan marked this pull request as ready for review November 8, 2023 17:49
@aarongchan aarongchan merged commit ae8e1c3 into riscv-software-src:master Nov 8, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant