cpu: Get rid of the (read|set)RegOtherThread methods.
authorGabe Black <gabeblack@google.com>
Sun, 28 Apr 2019 08:56:22 +0000 (08:56 +0000)
committerGabe Black <gabeblack@google.com>
Mon, 29 Apr 2019 22:57:37 +0000 (22:57 +0000)
These are implemented by MIPS internally now.

Change-Id: If7465e1666e51e1314968efb56a5a814e62ee2d1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18436
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/cpu/checker/cpu.hh
src/cpu/exec_context.hh
src/cpu/minor/exec_context.hh
src/cpu/o3/dyn_inst.hh
src/cpu/simple/exec_context.hh
src/cpu/thread_context.hh

index 5f830d7a9aec8c0906a4204dafbe0dc013d76111..96f6cc7d4c6f2506b6e44108b34915f789604ca1 100644 (file)
@@ -483,21 +483,6 @@ class CheckerCPU : public BaseCPU, public ExecContext
         return this->setMiscReg(reg.index(), val);
     }
 
-#if THE_ISA == MIPS_ISA
-    RegVal
-    readRegOtherThread(const RegId &misc_reg, ThreadID tid) override
-    {
-        panic("MIPS MT not defined for CheckerCPU.\n");
-        return 0;
-    }
-
-    void
-    setRegOtherThread(const RegId& misc_reg, RegVal val, ThreadID tid) override
-    {
-        panic("MIPS MT not defined for CheckerCPU.\n");
-    }
-#endif
-
     /////////////////////////////////////////
 
     void
index d46cc1315f86f07c586503d75bb714f4311a4f0a..58d756c6d5b97c8f22e93828c0d0136b5504e2d2 100644 (file)
@@ -353,20 +353,6 @@ class ExecContext {
     virtual AddressMonitor *getAddrMonitor() = 0;
 
     /** @} */
-
-    /**
-     * @{
-     * @name MIPS-Specific Interfaces
-     */
-
-#if THE_ISA == MIPS_ISA
-    virtual RegVal readRegOtherThread(const RegId &reg,
-                                       ThreadID tid=InvalidThreadID) = 0;
-    virtual void setRegOtherThread(const RegId& reg, RegVal val,
-                                   ThreadID tid=InvalidThreadID) = 0;
-#endif
-
-    /** @} */
 };
 
 #endif // __CPU_EXEC_CONTEXT_HH__
index 02b3dae1c1f0dd99e5ad4db464b420097dfd0c49..4ac621aea17fe711f90b37d3220af32761711f63 100644 (file)
@@ -441,51 +441,6 @@ class ExecContext : public ::ExecContext
 
     BaseCPU *getCpuPtr() { return &cpu; }
 
-    /* MIPS: other thread register reading/writing */
-    RegVal
-    readRegOtherThread(const RegId &reg, ThreadID tid=InvalidThreadID)
-    {
-        SimpleThread *other_thread = (tid == InvalidThreadID
-            ? &thread : cpu.threads[tid]);
-
-        switch (reg.classValue()) {
-            case IntRegClass:
-                return other_thread->readIntReg(reg.index());
-                break;
-            case FloatRegClass:
-                return other_thread->readFloatReg(reg.index());
-                break;
-            case MiscRegClass:
-                return other_thread->readMiscReg(reg.index());
-            default:
-                panic("Unexpected reg class! (%s)",
-                      reg.className());
-                return 0;
-        }
-    }
-
-    void
-    setRegOtherThread(const RegId &reg, RegVal val,
-                      ThreadID tid=InvalidThreadID)
-    {
-        SimpleThread *other_thread = (tid == InvalidThreadID
-            ? &thread : cpu.threads[tid]);
-
-        switch (reg.classValue()) {
-            case IntRegClass:
-                return other_thread->setIntReg(reg.index(), val);
-                break;
-            case FloatRegClass:
-                return other_thread->setFloatReg(reg.index(), val);
-                break;
-            case MiscRegClass:
-                return other_thread->setMiscReg(reg.index(), val);
-            default:
-                panic("Unexpected reg class! (%s)",
-                      reg.className());
-        }
-    }
-
   public:
     // monitor/mwait funtions
     void armMonitor(Addr address) override
index 24c59a25d773ec42d9b59b97dfaaf6c649fd5d3e..01886606eb5f6ec474f1611a9715ca5aba345b88 100644 (file)
@@ -429,21 +429,6 @@ class BaseO3DynInst : public BaseDynInst<Impl>
         this->cpu->setCCReg(this->_destRegIdx[idx], val);
         BaseDynInst<Impl>::setCCRegOperand(si, idx, val);
     }
-
-#if THE_ISA == MIPS_ISA
-    RegVal
-    readRegOtherThread(const RegId& misc_reg, ThreadID tid) override
-    {
-        panic("MIPS MT not defined for O3 CPU.\n");
-        return 0;
-    }
-
-    void
-    setRegOtherThread(const RegId& misc_reg, RegVal val, ThreadID tid) override
-    {
-        panic("MIPS MT not defined for O3 CPU.\n");
-    }
-#endif
 };
 
 #endif // __CPU_O3_ALPHA_DYN_INST_HH__
index de5cc7fd7462eeddcac275a1f1acb8341bc20cfd..b49747dd2462d3807141726ceac63d5b4c91c50f 100644 (file)
@@ -566,25 +566,6 @@ class SimpleExecContext : public ExecContext {
     {
         return cpu->getCpuAddrMonitor(thread->threadId());
     }
-
-#if THE_ISA == MIPS_ISA
-    RegVal
-    readRegOtherThread(const RegId& reg, ThreadID tid=InvalidThreadID)
-        override
-    {
-        panic("Simple CPU models do not support multithreaded "
-              "register access.");
-    }
-
-    void
-    setRegOtherThread(const RegId& reg, RegVal val,
-                      ThreadID tid=InvalidThreadID) override
-    {
-        panic("Simple CPU models do not support multithreaded "
-              "register access.");
-    }
-#endif
-
 };
 
 #endif // __CPU_EXEC_CONTEXT_HH__
index 09f2a1eab4f0c911075e5697b072784df7fadb1f..00e97b23c2280370b5900d19282369dcccf1757a 100644 (file)
@@ -299,17 +299,6 @@ class ThreadContext
 
     virtual RegId flattenRegId(const RegId& regId) const = 0;
 
-    virtual RegVal
-    readRegOtherThread(const RegId& misc_reg, ThreadID tid)
-    {
-        return 0;
-    }
-
-    virtual void
-    setRegOtherThread(const RegId& misc_reg, RegVal val, ThreadID tid)
-    {
-    }
-
     // Also not necessarily the best location for these two.  Hopefully will go
     // away once we decide upon where st cond failures goes.
     virtual unsigned readStCondFailures() const = 0;