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

cpu-minor: Integrate Minor's executeStats with int/fp/vec ALU Accesses #1108

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

poal023
Copy link

@poal023 poal023 commented May 6, 2024

Amending my previous iteration of the commit #1107, to add ALU access stats under Minor's execute stats so users can check ALU ops per thread.

Change-Id: Ic1d7757750ad4c9253c11dc965f732b447c1a8e7
@mattsinc mattsinc added the stats The gem5 statistics code and related infrastructure label May 6, 2024
Copy link
Contributor

@mattsinc mattsinc left a comment

Choose a reason for hiding this comment

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

This seems reasonable to me, but we should wait for @powerjg or someone from Davis to chime in before we merge.

@hnpl
Copy link
Contributor

hnpl commented May 7, 2024

I don't know if those stats count accesses from speculative instructions. If that's the case then we should move this to the execute stage. If not, this change looks good to me!

If we count all Functional Unit accesses, the issue logic inside the execute stage seems to be the best place for updating the stats,

DPRINTF(MinorExecute, "Trying to issue inst: %s to FU: %d\n",

Copy link
Contributor

@powerjg powerjg left a comment

Choose a reason for hiding this comment

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

I agree with Hoa about speculative instructions and putting the execute stats in the execute stage instead of the commit stage.

Furthermore, there are many other CPU stats that are missing from the minor CPU. Maybe we could add them all at once?

@@ -876,6 +876,15 @@ Execute::doInstCommitAccounting(MinorDynInstPtr inst)
cpu.commitStats[inst->id.threadId]->numOps++;
cpu.commitStats[inst->id.threadId]
->committedInstType[inst->staticInst->opClass()]++;
if (inst->isInst()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you need to check isInst()? How could that be false?

Copy link
Author

@poal023 poal023 May 14, 2024

Choose a reason for hiding this comment

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

I initially put that in the issue logic (in the issue function), since doing inst->staticInst->isInteger() would segfault without it. Otherwise, I'll take it out.

Only question I have about adding additional stats from base.cc of the base CPU is, does Minor have an equivalent execcontext? I noticed that within BaseExecContext, there are specific stats that are updated (such as numCallsReturns, which I assume I'd have to do something similar and create an exec context to access the thread's info, although there could be a better approach?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stats The gem5 statistics code and related infrastructure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants