From b904bd5437ead0dfc2c4c0977f3d29d63299c601 Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Fri, 15 Feb 2013 17:40:09 -0500 Subject: 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. --- src/cpu/simple/atomic.cc | 2 +- src/cpu/simple/timing.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/cpu/simple') diff --git a/src/cpu/simple/atomic.cc b/src/cpu/simple/atomic.cc index 7a0778961..d7c4190ee 100644 --- a/src/cpu/simple/atomic.cc +++ b/src/cpu/simple/atomic.cc @@ -212,7 +212,7 @@ AtomicSimpleCPU::takeOverFrom(BaseCPU *oldCPU) void AtomicSimpleCPU::verifyMemoryMode() const { - if (system->getMemoryMode() != Enums::atomic) { + if (!system->isAtomicMode()) { fatal("The atomic CPU requires the memory system to be in " "'atomic' mode.\n"); } diff --git a/src/cpu/simple/timing.cc b/src/cpu/simple/timing.cc index 7423d082c..ab4ea9256 100644 --- a/src/cpu/simple/timing.cc +++ b/src/cpu/simple/timing.cc @@ -191,7 +191,7 @@ TimingSimpleCPU::takeOverFrom(BaseCPU *oldCPU) void TimingSimpleCPU::verifyMemoryMode() const { - if (system->getMemoryMode() != Enums::timing) { + if (!system->isTimingMode()) { fatal("The timing CPU requires the memory system to be in " "'timing' mode.\n"); } -- cgit v1.2.3