sim: Mark System::getThreadContext method as const

Change-Id: Ic0ce1b098cfe0ce6ea37986a8a55002a5c18a66c
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21304
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
diff --git a/src/sim/system.hh b/src/sim/system.hh
index d7a3b20..c618e39 100644
--- a/src/sim/system.hh
+++ b/src/sim/system.hh
@@ -200,7 +200,7 @@
     std::vector<ThreadContext *> threadContexts;
     const bool multiThread;
 
-    ThreadContext *getThreadContext(ContextID tid)
+    ThreadContext *getThreadContext(ContextID tid) const
     {
         return threadContexts[tid];
     }