From 7eb0fb8b6ebffcb39b61964d4c7387455c262aae Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Mon, 7 Jan 2013 13:05:41 -0500 Subject: cpu: Check that the memory system is in the correct mode This patch adds checks to all CPU models to make sure that the memory system is in the correct mode at startup and when resuming after a drain. Previously, we only checked that the memory system was in the right mode when resuming. This is inadequate since this is a configuration error that should be detected at startup as well as when resuming. Additionally, since the check was done using an assert, it wasn't performed when NDEBUG was set (e.g., the fast target). --- src/cpu/inorder/cpu.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/cpu/inorder') diff --git a/src/cpu/inorder/cpu.cc b/src/cpu/inorder/cpu.cc index 1ca0657ad..3582e55ca 100644 --- a/src/cpu/inorder/cpu.cc +++ b/src/cpu/inorder/cpu.cc @@ -787,6 +787,12 @@ InOrderCPU::init() { BaseCPU::init(); + if (!params()->defer_registration && + system->getMemoryMode() != Enums::timing) { + fatal("The in-order CPU requires the memory system to be in " + "'timing' mode.\n"); + } + for (ThreadID tid = 0; tid < numThreads; ++tid) { // Set noSquashFromTC so that the CPU doesn't squash when initially // setting up registers. -- cgit v1.2.3