diff options
author | Marc Orr <morr@cs.wisc.edu> | 2014-11-06 05:42:22 -0600 |
---|---|---|
committer | Marc Orr <morr@cs.wisc.edu> | 2014-11-06 05:42:22 -0600 |
commit | bf80734b2ce080cd75f4b57be47e37465e8901f1 (patch) | |
tree | 0ba9cbba64cd017e95b5a3f637d58435208ebc3c /src/cpu/inorder | |
parent | 3947f88d0fa35d2134fa3e999e05bb184a01e396 (diff) | |
download | gem5-bf80734b2ce080cd75f4b57be47e37465e8901f1.tar.xz |
x86 isa: This patch attempts an implementation at mwait.
Mwait works as follows:
1. A cpu monitors an address of interest (monitor instruction)
2. A cpu calls mwait - this loads the cache line into that cpu's cache.
3. The cpu goes to sleep.
4. When another processor requests write permission for the line, it is
evicted from the sleeping cpu's cache. This eviction is forwarded to the
sleeping cpu, which then wakes up.
Committed by: Nilay Vaish <nilay@cs.wisc.edu>
Diffstat (limited to 'src/cpu/inorder')
-rw-r--r-- | src/cpu/inorder/inorder_dyn_inst.cc | 22 | ||||
-rw-r--r-- | src/cpu/inorder/inorder_dyn_inst.hh | 7 |
2 files changed, 29 insertions, 0 deletions
diff --git a/src/cpu/inorder/inorder_dyn_inst.cc b/src/cpu/inorder/inorder_dyn_inst.cc index 18281e636..c64cf9da4 100644 --- a/src/cpu/inorder/inorder_dyn_inst.cc +++ b/src/cpu/inorder/inorder_dyn_inst.cc @@ -602,3 +602,25 @@ InOrderDynInst::dump(std::string &outstring) outstring = s.str(); } + +void +InOrderDynInst::armMonitor(Addr address) { + cpu->armMonitor(address); +} + +bool +InOrderDynInst::mwait(PacketPtr pkt) { + return cpu->mwait(pkt); +} + +void +InOrderDynInst::mwaitAtomic(ThreadContext *tc) +{ + return cpu->mwaitAtomic(tc, cpu->getDTBPtr()); +} + +AddressMonitor * +InOrderDynInst::getAddrMonitor() +{ + return cpu->getCpuAddrMonitor(); +} diff --git a/src/cpu/inorder/inorder_dyn_inst.hh b/src/cpu/inorder/inorder_dyn_inst.hh index 369ebe2f4..ebb7bf912 100644 --- a/src/cpu/inorder/inorder_dyn_inst.hh +++ b/src/cpu/inorder/inorder_dyn_inst.hh @@ -1077,6 +1077,13 @@ class InOrderDynInst : public ExecContext, public RefCounted void demapPage(Addr vaddr, uint64_t asn) { panic("demapPage unimplemented"); } + + public: + // monitor/mwait funtions + void armMonitor(Addr address); + bool mwait(PacketPtr pkt); + void mwaitAtomic(ThreadContext *tc); + AddressMonitor *getAddrMonitor(); }; |