mem-cache: Add multiple eviction stats
[gem5.git] / src / arch / arm / system.cc
index 4ea0d1a91253eb7eab1ed9c8f88091decde7754e..5c32059f4636f7994e330913761be4bd61e66b9a 100644 (file)
@@ -48,7 +48,7 @@
 #include "base/loader/object_file.hh"
 #include "base/loader/symtab.hh"
 #include "cpu/thread_context.hh"
-#include "dev/arm/gic_v3.hh"
+#include "dev/arm/gic_v2.hh"
 #include "mem/fs_translating_port_proxy.hh"
 #include "mem/physical.hh"
 #include "sim/full_system.hh"
@@ -75,9 +75,6 @@ ArmSystem::ArmSystem(Params *p)
       _sveVL(p->sve_vl),
       _haveLSE(p->have_lse),
       _havePAN(p->have_pan),
-      _m5opRange(p->m5ops_base ?
-                 RangeSize(p->m5ops_base, 0x10000) :
-                 AddrRange(1, 0)), // Create an empty range if disabled
       semihosting(p->semihosting),
       multiProc(p->multi_proc)
 {
@@ -142,8 +139,9 @@ ArmSystem::initState()
     const Params* p = params();
 
     if (bootldr) {
-        bool isGICv3System = dynamic_cast<Gicv3 *>(getGIC()) != nullptr;
-        bootldr->loadSections(physProxy);
+        bool is_gic_v2 =
+            getGIC()->supportsVersion(BaseGic::GicVersion::GIC_V2);
+        bootldr->buildImage().write(physProxy);
 
         inform("Using bootloader at address %#x\n", bootldr->entryPoint());
 
@@ -153,14 +151,14 @@ ArmSystem::initState()
         if (!p->flags_addr)
            fatal("flags_addr must be set with bootloader\n");
 
-        if (!p->gic_cpu_addr && !isGICv3System)
+        if (!p->gic_cpu_addr && is_gic_v2)
             fatal("gic_cpu_addr must be set with bootloader\n");
 
         for (int i = 0; i < threadContexts.size(); i++) {
             if (!_highestELIs64)
                 threadContexts[i]->setIntReg(3, (kernelEntry & loadAddrMask) +
                         loadAddrOffset);
-            if (!isGICv3System)
+            if (is_gic_v2)
                 threadContexts[i]->setIntReg(4, params()->gic_cpu_addr);
             threadContexts[i]->setIntReg(5, params()->flags_addr);
         }
@@ -174,6 +172,14 @@ ArmSystem::initState()
     }
 }
 
+ArmSystem *
+ArmSystem::getArmSystem(System *sys)
+{
+    ArmSystem *a_sys = dynamic_cast<ArmSystem *>(sys);
+    assert(a_sys);
+    return a_sys;
+}
+
 ArmSystem*
 ArmSystem::getArmSystem(ThreadContext *tc)
 {