fastmodel: Plumb the ITB and DTB through the IRIS thread context.
authorGabe Black <gabeblack@google.com>
Wed, 16 Oct 2019 01:19:18 +0000 (18:19 -0700)
committerGabe Black <gabeblack@google.com>
Thu, 7 Nov 2019 01:53:16 +0000 (01:53 +0000)
These might be necessary to, for instance, translate virtual addresses.
A custom TLB which uses the IRIS API will be written which can be
substituted in for the normal ARM TLB.

Change-Id: Ic44822db6692ca3a4ca13875b2260b08547a24da
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22116
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Chun-Chen TK Hsu <chunchenhsu@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>

src/arch/arm/fastmodel/iris/arm/thread_context.cc
src/arch/arm/fastmodel/iris/arm/thread_context.hh
src/arch/arm/fastmodel/iris/cpu.hh
src/arch/arm/fastmodel/iris/thread_context.cc
src/arch/arm/fastmodel/iris/thread_context.hh

index b8e98edcdc193edcb578d24f7e213e092a473476..8933535b9729b86ff4add293227ca2a4e183ae48 100644 (file)
@@ -36,10 +36,10 @@ namespace Iris
 {
 
 ArmThreadContext::ArmThreadContext(
-        ::BaseCPU *cpu, int id, System *system,
+        ::BaseCPU *cpu, int id, System *system, ::BaseTLB *dtb, ::BaseTLB *itb,
         iris::IrisConnectionInterface *iris_if,
         const std::string &iris_path) :
-    ThreadContext(cpu, id, system, iris_if, iris_path),
+    ThreadContext(cpu, id, system, dtb, itb, iris_if, iris_path),
     pcRscId(iris::IRIS_UINT64_MAX)
 {}
 
index f5be14dde188fb1795c43ad059b60e3d3e86a2af..889d27f80a1fd7e7e13e309d2dc01f5524820ec8 100644 (file)
@@ -46,6 +46,7 @@ class ArmThreadContext : public Iris::ThreadContext
 
   public:
     ArmThreadContext(::BaseCPU *cpu, int id, System *system,
+                     ::BaseTLB *dtb, ::BaseTLB *itb,
                      iris::IrisConnectionInterface *iris_if,
                      const std::string &iris_path);
 
index 911743b74d26bf2441510c23ba6eb32a8e2fdbd3..ef839784cc0a524b5371b843a859c9098d2630ec 100644 (file)
@@ -135,7 +135,8 @@ class CPU : public Iris::BaseCPU
         int thread_id = 0;
         for (const std::string &sub_path: params->thread_paths) {
             std::string path = parent_path + "." + sub_path;
-            auto *tc = new TC(this, thread_id++, sys, iris_if, path);
+            auto *tc = new TC(this, thread_id++, sys,
+                    params->dtb, params->itb,iris_if, path);
             threadContexts.push_back(tc);
         }
     }
index 1380cf3bf5daac64f45ae8c97539b370d35aa9b8..bccd7f4c0095fa68742309816dfd12bb62ad9509 100644 (file)
@@ -159,10 +159,10 @@ ThreadContext::simulationTimeEvent(
 }
 
 ThreadContext::ThreadContext(
-        BaseCPU *cpu, int id, System *system,
+        BaseCPU *cpu, int id, System *system, ::BaseTLB *dtb, ::BaseTLB *itb,
         iris::IrisConnectionInterface *iris_if, const std::string &iris_path) :
-    _cpu(cpu), _threadId(id), _system(system), _irisPath(iris_path),
-    _instId(iris::IRIS_UINT64_MAX), _status(Active),
+    _cpu(cpu), _threadId(id), _system(system), _dtb(dtb), _itb(itb),
+    _irisPath(iris_path), _instId(iris::IRIS_UINT64_MAX), _status(Active),
     comInstEventQueue("instruction-based event queue"),
     client(iris_if, "client." + iris_path)
 {
index bdf12ef8be340d3fd63ca9bad0878427b75d51c4..c0f40d76cd6c07c17dd72f7cc43d77ab6cbdbe92 100644 (file)
@@ -55,6 +55,8 @@ class ThreadContext : public ::ThreadContext
     int _threadId;
     ContextID _contextId;
     System *_system;
+    ::BaseTLB *_dtb;
+    ::BaseTLB *_itb;
 
     std::string _irisPath;
     iris::InstanceId _instId;
@@ -101,6 +103,7 @@ class ThreadContext : public ::ThreadContext
 
   public:
     ThreadContext(::BaseCPU *cpu, int id, System *system,
+                  ::BaseTLB *dtb, ::BaseTLB *itb,
                   iris::IrisConnectionInterface *iris_if,
                   const std::string &iris_path);
     virtual ~ThreadContext();
@@ -125,12 +128,12 @@ class ThreadContext : public ::ThreadContext
     BaseTLB *
     getITBPtr() override
     {
-        panic("%s not implemented.", __FUNCTION__);
+        return _itb;
     }
     BaseTLB *
     getDTBPtr() override
     {
-        panic("%s not implemented.", __FUNCTION__);
+        return _dtb;
     }
     CheckerCPU *
     getCheckerCpuPtr() override