-
Notifications
You must be signed in to change notification settings - Fork 4
Top-Down Methodology #10
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
base: fdp-develop
Are you sure you want to change the base?
Conversation
…#2346) For a number of common instructions, gem5's built-in ARM disassembler doesn't print the instruction operands. This can be a bit of a headache when you don't want to use libcapstone, and are looking at instruction traces. Reproducer: test.S ``` .text .globl _start _start: ldr x30, [sp] ldr x30, [sp], gem5#16 str x30, [sp] str x30, [sp], gem5#16 ldp x10, x20, [x30] stp x10, x20, [x30] ldp w10, w20, [x30] stp w10, w20, [x30] ldp x10, x20, [x30], #-8 // post-index, negative stp x10, x20, [x30, gem5#16]! // pre-index, write-back ldp w10, w20, [x30, gem5#32] // pre-index, no write-back stp w10, w20, [x30], gem5#128 // post-index, positive dc zva, x17 dc cvac, x17 isb isb #10 dsb nsh dsb sy dsb #8 .long 0xff210110 // m5_op EXIT ``` ``` # Build binary aarch64-linux-gnu-gcc -c test.S -o test.o aarch64-linux-gnu-ld -o test.arm64 test.o -N -Ttext 0x10 -static # objdump disassembly aarch64-linux-gnu-objdump -D test.arm64 # gem5 disassembly ./build/ARM/gem5.opt configs/example/arm/baremetal.py --tarmac-gen --kernel test.arm64 | grep ' IT ' ```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for already cleaning up things.
The main comment I have at the moment is formatting. Mainly indentation.
Check this: https://github.com/gem5/gem5/pull/2313/files
They will soon merge it. But you might be able to copy already the .clang-format
in your gem5 dir and then run git clang-format.
"Backend Bound, fraction of slots lost due to backend resource " | ||
"constraints."), | ||
ADD_STAT( | ||
retiring, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you format it as done above
ADD_STAT(fetchLatency, | ||
statistics::units::Rate<statistics::units::Count, | ||
statistics::units::Count>::get(), | ||
"Fetch Latency Bound, frontend stalls due to instruction cache " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its not only instruction cache but also TLB and BTB
src/cpu/o3/cpu.cc
Outdated
cpu->cpuStats.topDownStats.topDownL1.frontendBound - fetchLatency; | ||
} | ||
|
||
// CPU::CPUStats::TopDownStats::TopDownFrontendBoundL2::TopDownFrontendBoundL2(CPU |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that not ready or why is it commented?
statistics::units::Count>::get(), | ||
"Core Bound, backend stalls due to functional unit constraints") { | ||
// Backend L2 | ||
executionStalls = (cpu->iew.instQueue.getStats().numInstsExec0 - |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not properly indented. Should be consistent. 4 spaces.
Same in the lines below and a lot of other places
src/cpu/o3/cpu.cc
Outdated
statistics::units::Count>::get(), | ||
"Store Bound") { | ||
// Backend Bound / Memory Bound L3 | ||
l1Bound = (cpu->iew.instQueue.getStats().loadStallCycles - |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation
@@ -602,9 +615,11 @@ Decode::decode(bool &status_change, ThreadID tid) | |||
// check if stall conditions have passed | |||
|
|||
if (decodeStatus[tid] == Blocked) { | |||
++stats.blockedCycles; | |||
fetchBubbles -= decodeWidth; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation
@@ -299,6 +299,8 @@ class Decode | |||
*/ | |||
bool squashAfterDelaySlot[MaxThreads]; | |||
|
|||
unsigned fetchBubbles = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO it's redundant. Just use inst_availabe
@@ -180,47 +180,58 @@ InstructionQueue::name() const | |||
InstructionQueue::IQStats::IQStats(CPU *cpu, const unsigned &total_width) | |||
: statistics::Group(cpu), | |||
ADD_STAT(instsAdded, statistics::units::Count::get(), | |||
"Number of instructions added to the IQ (excludes non-spec)"), | |||
"Number of instructions added to the IQ (excludes non-spec)"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you revert that. Its not currently indented and not part of your PR
.flags(statistics::pdf); | ||
idleRate | ||
.prereq(idleRate); | ||
ADD_STAT(predictedBranches, statistics::units::Count::get(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did that change? Most of it is still the same.
ADD_STAT(fetchBubblesMax, statistics::units::Count::get(), | ||
"Stat for Top-Down Methodology, number of cycles in which no " | ||
"instructions are delivered to backend") { | ||
predictedBranches.prereq(predictedBranches); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong indentation
No description provided.