arch-arm: Expose haveGicv3CPUInterface to the ISA interface
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Tue, 19 Feb 2019 09:51:31 +0000 (09:51 +0000)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Thu, 23 May 2019 08:32:25 +0000 (08:32 +0000)
Change-Id: I36232b7618ad875983f34b741c51f12ddb9ae166
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/+/17989
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/arch/arm/isa.cc
src/arch/arm/isa.hh

index 654608a084483f432ea748dd5eb4c25e3ab8fad7..cdc44cdb9d37bdc1e81efdbaf79b0697d702e81f 100644 (file)
@@ -65,7 +65,8 @@ ISA::ISA(Params *p)
       _vecRegRenameMode(Enums::Full),
       pmu(p->pmu),
       haveGICv3CPUInterface(false),
-      impdefAsNop(p->impdef_nop)
+      impdefAsNop(p->impdef_nop),
+      afterStartup(false)
 {
     miscRegs[MISCREG_SCTLR_RST] = 0;
 
@@ -406,6 +407,8 @@ ISA::startup(ThreadContext *tc)
             gicv3CpuInterface->setThreadContext(tc);
         }
     }
+
+    afterStartup = true;
 }
 
 
index 1931306f9fba4c76b482833f6336a97689a1dcf3..b4689d74e9d09a665d007af8c3cc9288e0a27fc3 100644 (file)
@@ -105,6 +105,8 @@ namespace ArmISA
          */
         bool impdefAsNop;
 
+        bool afterStartup;
+
         /** MiscReg metadata **/
         struct MiscRegLUTEntry {
             uint32_t lower;  // Lower half mapped to this register
@@ -706,6 +708,16 @@ namespace ArmISA
 
         Enums::DecoderFlavour decoderFlavour() const { return _decoderFlavour; }
 
+        /** Getter for haveGICv3CPUInterface */
+        bool haveGICv3CpuIfc() const
+        {
+            // haveGICv3CPUInterface is initialized at startup time, hence
+            // trying to read its value before the startup stage will lead
+            // to an error
+            assert(afterStartup);
+            return haveGICv3CPUInterface;
+        }
+
         Enums::VecRegRenameMode
         vecRegRenameMode() const
         {