cpu: added assertions to ensure the correct proxies are used
authorBrad Beckmann <Brad.Beckmann@amd.com>
Wed, 11 Jul 2012 05:51:53 +0000 (22:51 -0700)
committerBrad Beckmann <Brad.Beckmann@amd.com>
Wed, 11 Jul 2012 05:51:53 +0000 (22:51 -0700)
src/cpu/thread_state.cc
src/cpu/thread_state.hh

index eda62dad17ed14cc3715e1d89acdd164b638c962..d0f946989d04eb84583a7436c5a351c8b988b664 100644 (file)
@@ -122,6 +122,30 @@ ThreadState::initMemProxies(ThreadContext *tc)
     }
 }
 
+PortProxy &
+ThreadState::getPhysProxy()
+{
+    assert(FullSystem);
+    assert(physProxy != NULL);
+    return *physProxy;
+}
+
+FSTranslatingPortProxy &
+ThreadState::getVirtProxy()
+{
+    assert(FullSystem);
+    assert(virtProxy != NULL);
+    return *virtProxy;
+}
+
+SETranslatingPortProxy &
+ThreadState::getMemProxy()
+{
+    assert(!FullSystem);
+    assert(proxy != NULL);
+    return *proxy;
+}
+
 void
 ThreadState::profileClear()
 {
index 995a870f59fbf56c1af3ebea1758a1eb98fee869..d8dccc4aee9f3b2eb734be3cecd149cb9ab5da8c 100644 (file)
@@ -99,13 +99,13 @@ struct ThreadState {
 
     TheISA::Kernel::Statistics *getKernelStats() { return kernelStats; }
 
-    PortProxy &getPhysProxy() { return *physProxy; }
+    PortProxy &getPhysProxy();
 
-    FSTranslatingPortProxy &getVirtProxy() { return *virtProxy; }
+    FSTranslatingPortProxy &getVirtProxy();
 
     Process *getProcessPtr() { return process; }
 
-    SETranslatingPortProxy &getMemProxy() { return *proxy; }
+    SETranslatingPortProxy &getMemProxy();
 
     /** Reads the number of instructions functionally executed and
      * committed.