sim: Add a system-global option to bypass caches
Virtualized CPUs and the fastmem mode of the atomic CPU require direct access to physical memory. We currently require caches to be disabled when using them to prevent chaos. This is not ideal when switching between hardware virutalized CPUs and other CPU models as it would require a configuration change on each switch. This changeset introduces a new version of the atomic memory mode, 'atomic_noncaching', where memory accesses are inserted into the memory system as atomic accesses, but bypass caches. To make memory mode tests cleaner, the following methods are added to the System class: * isAtomicMode() -- True if the memory mode is 'atomic' or 'direct'. * isTimingMode() -- True if the memory mode is 'timing'. * bypassCaches() -- True if caches should be bypassed. The old getMemoryMode() and setMemoryMode() methods should never be used from the C++ world anymore.
This commit is contained in:
@@ -232,8 +232,7 @@ DmaPort::sendDma()
|
||||
// switching actually work
|
||||
assert(transmitList.size());
|
||||
|
||||
Enums::MemoryMode state = sys->getMemoryMode();
|
||||
if (state == Enums::timing) {
|
||||
if (sys->isTimingMode()) {
|
||||
// if we are either waiting for a retry or are still waiting
|
||||
// after sending the last packet, then do not proceed
|
||||
if (inRetry || sendEvent.scheduled()) {
|
||||
@@ -242,7 +241,7 @@ DmaPort::sendDma()
|
||||
}
|
||||
|
||||
trySendTimingReq();
|
||||
} else if (state == Enums::atomic) {
|
||||
} else if (sys->isAtomicMode()) {
|
||||
// send everything there is to send in zero time
|
||||
while (!transmitList.empty()) {
|
||||
PacketPtr pkt = transmitList.front();
|
||||
|
||||
@@ -222,8 +222,7 @@ X86ISA::I82094AA::signalInterrupt(int line)
|
||||
apics.push_back(selected);
|
||||
}
|
||||
}
|
||||
intMasterPort.sendMessage(apics, message,
|
||||
sys->getMemoryMode() == Enums::timing);
|
||||
intMasterPort.sendMessage(apics, message, sys->isTimingMode());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user