diff options
author | Andreas Sandberg <Andreas.Sandberg@ARM.com> | 2013-02-15 17:40:08 -0500 |
---|---|---|
committer | Andreas Sandberg <Andreas.Sandberg@ARM.com> | 2013-02-15 17:40:08 -0500 |
commit | 1eec115c31395e2819c073a1859d75eb5933dac2 (patch) | |
tree | 503552557b8a5504bbb9aa9a3515b0bb398a97fc /src/cpu/base.hh | |
parent | 1c7aa665bfc678c33cc05829acc52aebb1d2612c (diff) | |
download | gem5-1eec115c31395e2819c073a1859d75eb5933dac2.tar.xz |
cpu: Refactor memory system checks
CPUs need to test that the memory system is in the right mode in two
places, when the CPU is initialized (unless it's switched out) and on
a drainResume(). This led to some code duplication in the CPU
models. This changeset introduces the verifyMemoryMode() method which
is called by BaseCPU::init() if the CPU isn't switched out. The
individual CPU models are responsible for calling this method when
resuming from a drain as this code is CPU model specific.
Diffstat (limited to 'src/cpu/base.hh')
-rw-r--r-- | src/cpu/base.hh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/cpu/base.hh b/src/cpu/base.hh index 34b23cea0..073050816 100644 --- a/src/cpu/base.hh +++ b/src/cpu/base.hh @@ -342,6 +342,17 @@ class BaseCPU : public MemObject bool switchedOut() const { return _switchedOut; } /** + * Verify that the system is in a memory mode supported by the + * CPU. + * + * Implementations are expected to query the system for the + * current memory mode and ensure that it is what the CPU model + * expects. If the check fails, the implementation should + * terminate the simulation using fatal(). + */ + virtual void verifyMemoryMode() const { }; + + /** * Number of threads we're actually simulating (<= SMT_MAX_THREADS). * This is a constant for the duration of the simulation. */ |