ARM/Alpha/Cpu: Change prefetchs to be more like normal loads.
Review Request #256 - Created Oct. 2, 2010 and submitted
| Information | |
|---|---|
| Ali Saidi | |
| gem5 | |
| Reviewers | |
| Default | |
ARM/Alpha/Cpu: Change prefetchs to be more like normal loads. This change modifies the way prefetches work. They are now like normal loads that don't writeback a register. Previously prefetches were supposed to call prefetch() on the exection context, so they executed with execute() methods instead of initiateAcc() completeAcc(). The prefetch() methods for all the CPUs are blank, meaning that they get executed, but don't actually do anything. On Alpha dead cache copy code was removed and prefetches are now normal ops. They count as executed operations, but still don't do anything and IsMemRef is not longer set on them. On ARM IsDataPrefetch or IsInstructionPreftech is now set on all prefetch instructions. The timing simple CPU doesn't try to do anything special for prefetches now and they execute with the normal memory code path.
Posted (Oct. 2, 2010, 12:19 p.m.)
-
src/cpu/simple/timing.cc (Diff revision 1) -
This change marks prefetches as regular load ops so they can actually execute. Alpha prefetches don't do anything at the moment and don't have an initiateAcc() method, so there needs to be a change to the ISA description for them.
Posted (Oct. 9, 2010, 6:38 a.m.)
-
src/cpu/simple/timing.cc (Diff revision 1) -
I don't think this is right. This will likely break X86_FS where curMacroStaticInst will almost always be set. If you're having trouble with this in ARM, a possible culprit is that you're not setting isDelayedCommit on microops that aren't at the end of a macroop.
-
src/cpu/simple/timing.cc (Diff revision 1) -
Prefetch faults should ideally be surpressed at their source, not here. At the source we already implicitly know the instruction shouldn't fault. Here, we have to rediscover that all the time.
-
src/cpu/simple/timing.cc (Diff revision 1) -
I'm not sure this is necessary. If the CPU isn't running, that's because it's waiting for something. If it's waiting for something, then it's doing a memory access, and there won't be a fault. The original assert should be right.
Posted (Oct. 10, 2010, 1:42 p.m.)
-
src/cpu/simple/timing.cc (Diff revision 1) -
I'll check it out.
Posted (Oct. 15, 2010, 10:41 a.m.)
-
src/arch/arm/faults.cc (Diff revision 1) -
This looks a bug fix that's unrelated to prefetching and should go in a separate patch.
-
src/cpu/simple/timing.cc (Diff revision 1) -
yea, I don't get this either
-
src/cpu/simple/timing.cc (Diff revision 1) -
I agree, prefetches should just never set fault to anything other than NoFault.
-
src/cpu/simple/timing.cc (Diff revision 1) -
So what happens with Alpha now? Does this cause an error? I think we discussed this but I forgot the upshot. Seems like the Alpha prefetches should at least get a warn_once() or something.
-
src/cpu/simple/timing.cc (Diff revision 1) -
yea, again, if prefetches never set fault then this would not be necessary
Review request changed
Updated (Nov. 3, 2010, 9:13 a.m.)
Summary: |
|
||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: |
|
||||||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 2 (+3838 -5588) |
Posted (Nov. 3, 2010, 1:08 p.m.)
Please split out the code changes and the stats changes into separate changesets (as is our habit, if not yet our official policy)... the stats changes are just too unwieldy and make it awkward to browse the code changes. Thanks!
-
src/arch/alpha/isa/decoder.isa (Diff revision 2) -
Is there still a writeHint() method out there that just doesn't ever get called now? Seems like if we're going to change the API to get rid of writeHint() and prefetch() (which seems reasonable to me) we should make sure we eliminate them thoroughly.
-
src/cpu/simple/timing.cc (Diff revision 2) -
Does swapping the order of this OR really matter?
Posted (Nov. 5, 2010, 10:27 a.m.)
-
src/cpu/simple/timing.cc (Diff revision 3) -
I still didn't fix this change, but it is fixed in my local patch
Posted (Nov. 6, 2010, 6:44 p.m.)
Most of these comments are pretty minor, but I think my comment for timing.cc is fairly important. It's not life or death, but there's some low hanging performance there.
-
src/arch/alpha/isa/mem.isa (Diff revision 3) -
You might want to leave out this new blank line.
-
src/arch/alpha/isa/mem.isa (Diff revision 3) -
And getting rid of this blank line.
-
src/arch/alpha/isa/mem.isa (Diff revision 3) -
This doesn't need to be on its own line.
-
src/cpu/simple/timing.cc (Diff revision 3) -
Could this be supressed in initiateAcc itself? That won't work in other models where the fault doesn't go through initiateAcc on its way back to the CPU, but it would make this check unnecessary.
-
src/cpu/static_inst.hh (Diff revision 3) -
You could use isInstPrefetch and isDataPrefetch internally here. It's not likely to ever make a difference, but if those other functions ever get more complicated isPrefetch would pick it up automatically. It's fine if you don't, but I thought I'd suggest it.
