isa.hh revision 13395
16313Sgblack@eecs.umich.edu/*
212529Sgiacomo.travaglini@arm.com * Copyright (c) 2010, 2012-2018 ARM Limited
37093Sgblack@eecs.umich.edu * All rights reserved
47093Sgblack@eecs.umich.edu *
57093Sgblack@eecs.umich.edu * The license below extends only to copyright in the software and shall
67093Sgblack@eecs.umich.edu * not be construed as granting a license to any other intellectual
77093Sgblack@eecs.umich.edu * property including but not limited to intellectual property relating
87093Sgblack@eecs.umich.edu * to a hardware implementation of the functionality of the software
97093Sgblack@eecs.umich.edu * licensed hereunder.  You may use the software subject to the license
107093Sgblack@eecs.umich.edu * terms below provided that you ensure that this notice is replicated
117093Sgblack@eecs.umich.edu * unmodified and in its entirety in all distributions of the software,
127093Sgblack@eecs.umich.edu * modified or unmodified, in source code or in binary form.
137093Sgblack@eecs.umich.edu *
146313Sgblack@eecs.umich.edu * Copyright (c) 2009 The Regents of The University of Michigan
156313Sgblack@eecs.umich.edu * All rights reserved.
166313Sgblack@eecs.umich.edu *
176313Sgblack@eecs.umich.edu * Redistribution and use in source and binary forms, with or without
186313Sgblack@eecs.umich.edu * modification, are permitted provided that the following conditions are
196313Sgblack@eecs.umich.edu * met: redistributions of source code must retain the above copyright
206313Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer;
216313Sgblack@eecs.umich.edu * redistributions in binary form must reproduce the above copyright
226313Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer in the
236313Sgblack@eecs.umich.edu * documentation and/or other materials provided with the distribution;
246313Sgblack@eecs.umich.edu * neither the name of the copyright holders nor the names of its
256313Sgblack@eecs.umich.edu * contributors may be used to endorse or promote products derived from
266313Sgblack@eecs.umich.edu * this software without specific prior written permission.
276313Sgblack@eecs.umich.edu *
286313Sgblack@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
296313Sgblack@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
306313Sgblack@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
316313Sgblack@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
326313Sgblack@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
336313Sgblack@eecs.umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
346313Sgblack@eecs.umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
356313Sgblack@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
366313Sgblack@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
376313Sgblack@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
386313Sgblack@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
396313Sgblack@eecs.umich.edu *
406313Sgblack@eecs.umich.edu * Authors: Gabe Black
416313Sgblack@eecs.umich.edu */
426313Sgblack@eecs.umich.edu
436313Sgblack@eecs.umich.edu#ifndef __ARCH_ARM_ISA_HH__
447404SAli.Saidi@ARM.com#define __ARCH_ARM_ISA_HH__
456313Sgblack@eecs.umich.edu
4610461SAndreas.Sandberg@ARM.com#include "arch/arm/isa_device.hh"
4712479SCurtis.Dunham@arm.com#include "arch/arm/miscregs.hh"
486333Sgblack@eecs.umich.edu#include "arch/arm/registers.hh"
4910037SARM gem5 Developers#include "arch/arm/system.hh"
507404SAli.Saidi@ARM.com#include "arch/arm/tlb.hh"
516313Sgblack@eecs.umich.edu#include "arch/arm/types.hh"
5212109SRekai.GonzalezAlberquilla@arm.com#include "arch/generic/traits.hh"
538232Snate@binkert.org#include "debug/Checkpoint.hh"
5412109SRekai.GonzalezAlberquilla@arm.com#include "enums/VecRegRenameMode.hh"
559384SAndreas.Sandberg@arm.com#include "sim/sim_object.hh"
5611165SRekai.GonzalezAlberquilla@arm.com#include "enums/DecoderFlavour.hh"
576313Sgblack@eecs.umich.edu
589384SAndreas.Sandberg@arm.comstruct ArmISAParams;
5910461SAndreas.Sandberg@ARM.comstruct DummyArmISADeviceParams;
606333Sgblack@eecs.umich.educlass ThreadContext;
616313Sgblack@eecs.umich.educlass Checkpoint;
626313Sgblack@eecs.umich.educlass EventManager;
636313Sgblack@eecs.umich.edu
646313Sgblack@eecs.umich.edunamespace ArmISA
656313Sgblack@eecs.umich.edu{
669384SAndreas.Sandberg@arm.com    class ISA : public SimObject
676313Sgblack@eecs.umich.edu    {
686313Sgblack@eecs.umich.edu      protected:
6910037SARM gem5 Developers        // Parent system
7010037SARM gem5 Developers        ArmSystem *system;
7110037SARM gem5 Developers
7211165SRekai.GonzalezAlberquilla@arm.com        // Micro Architecture
7311165SRekai.GonzalezAlberquilla@arm.com        const Enums::DecoderFlavour _decoderFlavour;
7412109SRekai.GonzalezAlberquilla@arm.com        const Enums::VecRegRenameMode _vecRegRenameMode;
7511165SRekai.GonzalezAlberquilla@arm.com
7610461SAndreas.Sandberg@ARM.com        /** Dummy device for to handle non-existing ISA devices */
7710461SAndreas.Sandberg@ARM.com        DummyISADevice dummyDevice;
7810461SAndreas.Sandberg@ARM.com
7910461SAndreas.Sandberg@ARM.com        // PMU belonging to this ISA
8010461SAndreas.Sandberg@ARM.com        BaseISADevice *pmu;
8110461SAndreas.Sandberg@ARM.com
8210844Sandreas.sandberg@arm.com        // Generic timer interface belonging to this ISA
8310844Sandreas.sandberg@arm.com        std::unique_ptr<BaseISADevice> timer;
8410844Sandreas.sandberg@arm.com
8510037SARM gem5 Developers        // Cached copies of system-level properties
8611771SCurtis.Dunham@arm.com        bool highestELIs64;
8710037SARM gem5 Developers        bool haveSecurity;
8810037SARM gem5 Developers        bool haveLPAE;
8910037SARM gem5 Developers        bool haveVirtualization;
9013173Sgiacomo.travaglini@arm.com        bool haveCrypto;
9110037SARM gem5 Developers        bool haveLargeAsid64;
9213114Sgiacomo.travaglini@arm.com        uint8_t physAddrRange;
9310037SARM gem5 Developers
9412714Sgiacomo.travaglini@arm.com        /**
9512714Sgiacomo.travaglini@arm.com         * If true, accesses to IMPLEMENTATION DEFINED registers are treated
9612714Sgiacomo.travaglini@arm.com         * as NOP hence not causing UNDEFINED INSTRUCTION.
9712714Sgiacomo.travaglini@arm.com         */
9812714Sgiacomo.travaglini@arm.com        bool impdefAsNop;
9912714Sgiacomo.travaglini@arm.com
10012478SCurtis.Dunham@arm.com        /** MiscReg metadata **/
10110037SARM gem5 Developers        struct MiscRegLUTEntry {
10212477SCurtis.Dunham@arm.com            uint32_t lower;  // Lower half mapped to this register
10312477SCurtis.Dunham@arm.com            uint32_t upper;  // Upper half mapped to this register
10412478SCurtis.Dunham@arm.com            uint64_t _reset; // value taken on reset (i.e. initialization)
10512478SCurtis.Dunham@arm.com            uint64_t _res0;  // reserved
10612478SCurtis.Dunham@arm.com            uint64_t _res1;  // reserved
10712478SCurtis.Dunham@arm.com            uint64_t _raz;   // read as zero (fixed at 0)
10812478SCurtis.Dunham@arm.com            uint64_t _rao;   // read as one (fixed at 1)
10912478SCurtis.Dunham@arm.com          public:
11012478SCurtis.Dunham@arm.com            MiscRegLUTEntry() :
11112478SCurtis.Dunham@arm.com              lower(0), upper(0),
11212478SCurtis.Dunham@arm.com              _reset(0), _res0(0), _res1(0), _raz(0), _rao(0) {}
11312478SCurtis.Dunham@arm.com            uint64_t reset() const { return _reset; }
11412478SCurtis.Dunham@arm.com            uint64_t res0()  const { return _res0; }
11512478SCurtis.Dunham@arm.com            uint64_t res1()  const { return _res1; }
11612478SCurtis.Dunham@arm.com            uint64_t raz()   const { return _raz; }
11712478SCurtis.Dunham@arm.com            uint64_t rao()   const { return _rao; }
11812478SCurtis.Dunham@arm.com            // raz/rao implies writes ignored
11912478SCurtis.Dunham@arm.com            uint64_t wi()    const { return _raz | _rao; }
12010037SARM gem5 Developers        };
12110037SARM gem5 Developers
12212477SCurtis.Dunham@arm.com        /** Metadata table accessible via the value of the register */
12312479SCurtis.Dunham@arm.com        static std::vector<struct MiscRegLUTEntry> lookUpMiscReg;
12412477SCurtis.Dunham@arm.com
12512477SCurtis.Dunham@arm.com        class MiscRegLUTEntryInitializer {
12612477SCurtis.Dunham@arm.com            struct MiscRegLUTEntry &entry;
12712479SCurtis.Dunham@arm.com            std::bitset<NUM_MISCREG_INFOS> &info;
12812477SCurtis.Dunham@arm.com            typedef const MiscRegLUTEntryInitializer& chain;
12912477SCurtis.Dunham@arm.com          public:
13012477SCurtis.Dunham@arm.com            chain mapsTo(uint32_t l, uint32_t u = 0) const {
13112477SCurtis.Dunham@arm.com                entry.lower = l;
13212477SCurtis.Dunham@arm.com                entry.upper = u;
13312477SCurtis.Dunham@arm.com                return *this;
13412477SCurtis.Dunham@arm.com            }
13512478SCurtis.Dunham@arm.com            chain res0(uint64_t mask) const {
13612478SCurtis.Dunham@arm.com                entry._res0 = mask;
13712478SCurtis.Dunham@arm.com                return *this;
13812478SCurtis.Dunham@arm.com            }
13912478SCurtis.Dunham@arm.com            chain res1(uint64_t mask) const {
14012478SCurtis.Dunham@arm.com                entry._res1 = mask;
14112478SCurtis.Dunham@arm.com                return *this;
14212478SCurtis.Dunham@arm.com            }
14312478SCurtis.Dunham@arm.com            chain raz(uint64_t mask) const {
14412478SCurtis.Dunham@arm.com                entry._raz  = mask;
14512478SCurtis.Dunham@arm.com                return *this;
14612478SCurtis.Dunham@arm.com            }
14712478SCurtis.Dunham@arm.com            chain rao(uint64_t mask) const {
14812478SCurtis.Dunham@arm.com                entry._rao  = mask;
14912478SCurtis.Dunham@arm.com                return *this;
15012478SCurtis.Dunham@arm.com            }
15112479SCurtis.Dunham@arm.com            chain implemented(bool v = true) const {
15212479SCurtis.Dunham@arm.com                info[MISCREG_IMPLEMENTED] = v;
15312479SCurtis.Dunham@arm.com                return *this;
15412479SCurtis.Dunham@arm.com            }
15512479SCurtis.Dunham@arm.com            chain unimplemented() const {
15612479SCurtis.Dunham@arm.com                return implemented(false);
15712479SCurtis.Dunham@arm.com            }
15812479SCurtis.Dunham@arm.com            chain unverifiable(bool v = true) const {
15912479SCurtis.Dunham@arm.com                info[MISCREG_UNVERIFIABLE] = v;
16012479SCurtis.Dunham@arm.com                return *this;
16112479SCurtis.Dunham@arm.com            }
16212479SCurtis.Dunham@arm.com            chain warnNotFail(bool v = true) const {
16312479SCurtis.Dunham@arm.com                info[MISCREG_WARN_NOT_FAIL] = v;
16412479SCurtis.Dunham@arm.com                return *this;
16512479SCurtis.Dunham@arm.com            }
16612479SCurtis.Dunham@arm.com            chain mutex(bool v = true) const {
16712479SCurtis.Dunham@arm.com                info[MISCREG_MUTEX] = v;
16812479SCurtis.Dunham@arm.com                return *this;
16912479SCurtis.Dunham@arm.com            }
17012479SCurtis.Dunham@arm.com            chain banked(bool v = true) const {
17112479SCurtis.Dunham@arm.com                info[MISCREG_BANKED] = v;
17212479SCurtis.Dunham@arm.com                return *this;
17312479SCurtis.Dunham@arm.com            }
17412479SCurtis.Dunham@arm.com            chain bankedChild(bool v = true) const {
17512479SCurtis.Dunham@arm.com                info[MISCREG_BANKED_CHILD] = v;
17612479SCurtis.Dunham@arm.com                return *this;
17712479SCurtis.Dunham@arm.com            }
17812479SCurtis.Dunham@arm.com            chain userNonSecureRead(bool v = true) const {
17912479SCurtis.Dunham@arm.com                info[MISCREG_USR_NS_RD] = v;
18012479SCurtis.Dunham@arm.com                return *this;
18112479SCurtis.Dunham@arm.com            }
18212479SCurtis.Dunham@arm.com            chain userNonSecureWrite(bool v = true) const {
18312479SCurtis.Dunham@arm.com                info[MISCREG_USR_NS_WR] = v;
18412479SCurtis.Dunham@arm.com                return *this;
18512479SCurtis.Dunham@arm.com            }
18612479SCurtis.Dunham@arm.com            chain userSecureRead(bool v = true) const {
18712479SCurtis.Dunham@arm.com                info[MISCREG_USR_S_RD] = v;
18812479SCurtis.Dunham@arm.com                return *this;
18912479SCurtis.Dunham@arm.com            }
19012479SCurtis.Dunham@arm.com            chain userSecureWrite(bool v = true) const {
19112479SCurtis.Dunham@arm.com                info[MISCREG_USR_S_WR] = v;
19212479SCurtis.Dunham@arm.com                return *this;
19312479SCurtis.Dunham@arm.com            }
19412479SCurtis.Dunham@arm.com            chain user(bool v = true) const {
19512479SCurtis.Dunham@arm.com                userNonSecureRead(v);
19612479SCurtis.Dunham@arm.com                userNonSecureWrite(v);
19712479SCurtis.Dunham@arm.com                userSecureRead(v);
19812479SCurtis.Dunham@arm.com                userSecureWrite(v);
19912479SCurtis.Dunham@arm.com                return *this;
20012479SCurtis.Dunham@arm.com            }
20112479SCurtis.Dunham@arm.com            chain privNonSecureRead(bool v = true) const {
20212479SCurtis.Dunham@arm.com                info[MISCREG_PRI_NS_RD] = v;
20312479SCurtis.Dunham@arm.com                return *this;
20412479SCurtis.Dunham@arm.com            }
20512479SCurtis.Dunham@arm.com            chain privNonSecureWrite(bool v = true) const {
20612479SCurtis.Dunham@arm.com                info[MISCREG_PRI_NS_WR] = v;
20712479SCurtis.Dunham@arm.com                return *this;
20812479SCurtis.Dunham@arm.com            }
20912668Sgiacomo.travaglini@arm.com            chain privNonSecure(bool v = true) const {
21012668Sgiacomo.travaglini@arm.com                privNonSecureRead(v);
21112668Sgiacomo.travaglini@arm.com                privNonSecureWrite(v);
21212668Sgiacomo.travaglini@arm.com                return *this;
21312668Sgiacomo.travaglini@arm.com            }
21412479SCurtis.Dunham@arm.com            chain privSecureRead(bool v = true) const {
21512479SCurtis.Dunham@arm.com                info[MISCREG_PRI_S_RD] = v;
21612479SCurtis.Dunham@arm.com                return *this;
21712479SCurtis.Dunham@arm.com            }
21812479SCurtis.Dunham@arm.com            chain privSecureWrite(bool v = true) const {
21912479SCurtis.Dunham@arm.com                info[MISCREG_PRI_S_WR] = v;
22012479SCurtis.Dunham@arm.com                return *this;
22112479SCurtis.Dunham@arm.com            }
22212479SCurtis.Dunham@arm.com            chain privSecure(bool v = true) const {
22312479SCurtis.Dunham@arm.com                privSecureRead(v);
22412479SCurtis.Dunham@arm.com                privSecureWrite(v);
22512479SCurtis.Dunham@arm.com                return *this;
22612479SCurtis.Dunham@arm.com            }
22712668Sgiacomo.travaglini@arm.com            chain priv(bool v = true) const {
22812668Sgiacomo.travaglini@arm.com                privSecure(v);
22912668Sgiacomo.travaglini@arm.com                privNonSecure(v);
23012668Sgiacomo.travaglini@arm.com                return *this;
23112668Sgiacomo.travaglini@arm.com            }
23213395Sgiacomo.travaglini@arm.com            chain privRead(bool v = true) const {
23313395Sgiacomo.travaglini@arm.com                privSecureRead(v);
23413395Sgiacomo.travaglini@arm.com                privNonSecureRead(v);
23513395Sgiacomo.travaglini@arm.com                return *this;
23613395Sgiacomo.travaglini@arm.com            }
23712479SCurtis.Dunham@arm.com            chain hypRead(bool v = true) const {
23812479SCurtis.Dunham@arm.com                info[MISCREG_HYP_RD] = v;
23912479SCurtis.Dunham@arm.com                return *this;
24012479SCurtis.Dunham@arm.com            }
24112479SCurtis.Dunham@arm.com            chain hypWrite(bool v = true) const {
24212479SCurtis.Dunham@arm.com                info[MISCREG_HYP_WR] = v;
24312479SCurtis.Dunham@arm.com                return *this;
24412479SCurtis.Dunham@arm.com            }
24512479SCurtis.Dunham@arm.com            chain hyp(bool v = true) const {
24612479SCurtis.Dunham@arm.com                hypRead(v);
24712479SCurtis.Dunham@arm.com                hypWrite(v);
24812479SCurtis.Dunham@arm.com                return *this;
24912479SCurtis.Dunham@arm.com            }
25012479SCurtis.Dunham@arm.com            chain monSecureRead(bool v = true) const {
25112479SCurtis.Dunham@arm.com                info[MISCREG_MON_NS0_RD] = v;
25212479SCurtis.Dunham@arm.com                return *this;
25312479SCurtis.Dunham@arm.com            }
25412479SCurtis.Dunham@arm.com            chain monSecureWrite(bool v = true) const {
25512479SCurtis.Dunham@arm.com                info[MISCREG_MON_NS0_WR] = v;
25612479SCurtis.Dunham@arm.com                return *this;
25712479SCurtis.Dunham@arm.com            }
25812479SCurtis.Dunham@arm.com            chain monNonSecureRead(bool v = true) const {
25912479SCurtis.Dunham@arm.com                info[MISCREG_MON_NS1_RD] = v;
26012479SCurtis.Dunham@arm.com                return *this;
26112479SCurtis.Dunham@arm.com            }
26212479SCurtis.Dunham@arm.com            chain monNonSecureWrite(bool v = true) const {
26312479SCurtis.Dunham@arm.com                info[MISCREG_MON_NS1_WR] = v;
26412479SCurtis.Dunham@arm.com                return *this;
26512479SCurtis.Dunham@arm.com            }
26612479SCurtis.Dunham@arm.com            chain mon(bool v = true) const {
26712479SCurtis.Dunham@arm.com                monSecureRead(v);
26812479SCurtis.Dunham@arm.com                monSecureWrite(v);
26912479SCurtis.Dunham@arm.com                monNonSecureRead(v);
27012479SCurtis.Dunham@arm.com                monNonSecureWrite(v);
27112479SCurtis.Dunham@arm.com                return *this;
27212479SCurtis.Dunham@arm.com            }
27312479SCurtis.Dunham@arm.com            chain monSecure(bool v = true) const {
27412479SCurtis.Dunham@arm.com                monSecureRead(v);
27512479SCurtis.Dunham@arm.com                monSecureWrite(v);
27612479SCurtis.Dunham@arm.com                return *this;
27712479SCurtis.Dunham@arm.com            }
27812479SCurtis.Dunham@arm.com            chain monNonSecure(bool v = true) const {
27912479SCurtis.Dunham@arm.com                monNonSecureRead(v);
28012479SCurtis.Dunham@arm.com                monNonSecureWrite(v);
28112479SCurtis.Dunham@arm.com                return *this;
28212479SCurtis.Dunham@arm.com            }
28312479SCurtis.Dunham@arm.com            chain allPrivileges(bool v = true) const {
28412479SCurtis.Dunham@arm.com                userNonSecureRead(v);
28512479SCurtis.Dunham@arm.com                userNonSecureWrite(v);
28612479SCurtis.Dunham@arm.com                userSecureRead(v);
28712479SCurtis.Dunham@arm.com                userSecureWrite(v);
28812479SCurtis.Dunham@arm.com                privNonSecureRead(v);
28912479SCurtis.Dunham@arm.com                privNonSecureWrite(v);
29012479SCurtis.Dunham@arm.com                privSecureRead(v);
29112479SCurtis.Dunham@arm.com                privSecureWrite(v);
29212479SCurtis.Dunham@arm.com                hypRead(v);
29312479SCurtis.Dunham@arm.com                hypWrite(v);
29412479SCurtis.Dunham@arm.com                monSecureRead(v);
29512479SCurtis.Dunham@arm.com                monSecureWrite(v);
29612479SCurtis.Dunham@arm.com                monNonSecureRead(v);
29712479SCurtis.Dunham@arm.com                monNonSecureWrite(v);
29812479SCurtis.Dunham@arm.com                return *this;
29912479SCurtis.Dunham@arm.com            }
30012479SCurtis.Dunham@arm.com            chain nonSecure(bool v = true) const {
30112479SCurtis.Dunham@arm.com                userNonSecureRead(v);
30212479SCurtis.Dunham@arm.com                userNonSecureWrite(v);
30312479SCurtis.Dunham@arm.com                privNonSecureRead(v);
30412479SCurtis.Dunham@arm.com                privNonSecureWrite(v);
30512479SCurtis.Dunham@arm.com                hypRead(v);
30612479SCurtis.Dunham@arm.com                hypWrite(v);
30712479SCurtis.Dunham@arm.com                monNonSecureRead(v);
30812479SCurtis.Dunham@arm.com                monNonSecureWrite(v);
30912479SCurtis.Dunham@arm.com                return *this;
31012479SCurtis.Dunham@arm.com            }
31112479SCurtis.Dunham@arm.com            chain secure(bool v = true) const {
31212479SCurtis.Dunham@arm.com                userSecureRead(v);
31312479SCurtis.Dunham@arm.com                userSecureWrite(v);
31412479SCurtis.Dunham@arm.com                privSecureRead(v);
31512479SCurtis.Dunham@arm.com                privSecureWrite(v);
31612479SCurtis.Dunham@arm.com                monSecureRead(v);
31712479SCurtis.Dunham@arm.com                monSecureWrite(v);
31812479SCurtis.Dunham@arm.com                return *this;
31912479SCurtis.Dunham@arm.com            }
32012479SCurtis.Dunham@arm.com            chain reads(bool v) const {
32112479SCurtis.Dunham@arm.com                userNonSecureRead(v);
32212479SCurtis.Dunham@arm.com                userSecureRead(v);
32312479SCurtis.Dunham@arm.com                privNonSecureRead(v);
32412479SCurtis.Dunham@arm.com                privSecureRead(v);
32512479SCurtis.Dunham@arm.com                hypRead(v);
32612479SCurtis.Dunham@arm.com                monSecureRead(v);
32712479SCurtis.Dunham@arm.com                monNonSecureRead(v);
32812479SCurtis.Dunham@arm.com                return *this;
32912479SCurtis.Dunham@arm.com            }
33012479SCurtis.Dunham@arm.com            chain writes(bool v) const {
33112479SCurtis.Dunham@arm.com                userNonSecureWrite(v);
33212479SCurtis.Dunham@arm.com                userSecureWrite(v);
33312479SCurtis.Dunham@arm.com                privNonSecureWrite(v);
33412479SCurtis.Dunham@arm.com                privSecureWrite(v);
33512479SCurtis.Dunham@arm.com                hypWrite(v);
33612479SCurtis.Dunham@arm.com                monSecureWrite(v);
33712479SCurtis.Dunham@arm.com                monNonSecureWrite(v);
33812479SCurtis.Dunham@arm.com                return *this;
33912479SCurtis.Dunham@arm.com            }
34012479SCurtis.Dunham@arm.com            chain exceptUserMode() const {
34112479SCurtis.Dunham@arm.com                user(0);
34212479SCurtis.Dunham@arm.com                return *this;
34312479SCurtis.Dunham@arm.com            }
34412479SCurtis.Dunham@arm.com            MiscRegLUTEntryInitializer(struct MiscRegLUTEntry &e,
34512479SCurtis.Dunham@arm.com                                       std::bitset<NUM_MISCREG_INFOS> &i)
34612479SCurtis.Dunham@arm.com              : entry(e),
34712479SCurtis.Dunham@arm.com                info(i)
34812479SCurtis.Dunham@arm.com            {
34912479SCurtis.Dunham@arm.com                // force unimplemented registers to be thusly declared
35012479SCurtis.Dunham@arm.com                implemented(1);
35112479SCurtis.Dunham@arm.com            }
35210037SARM gem5 Developers        };
35310037SARM gem5 Developers
35412477SCurtis.Dunham@arm.com        const MiscRegLUTEntryInitializer InitReg(uint32_t reg) {
35512479SCurtis.Dunham@arm.com            return MiscRegLUTEntryInitializer(lookUpMiscReg[reg],
35612479SCurtis.Dunham@arm.com                                              miscRegInfo[reg]);
35712477SCurtis.Dunham@arm.com        }
35810037SARM gem5 Developers
35912477SCurtis.Dunham@arm.com        void initializeMiscRegMetadata();
36010037SARM gem5 Developers
3616333Sgblack@eecs.umich.edu        MiscReg miscRegs[NumMiscRegs];
3626718Sgblack@eecs.umich.edu        const IntRegIndex *intRegMap;
3636718Sgblack@eecs.umich.edu
3646718Sgblack@eecs.umich.edu        void
3656718Sgblack@eecs.umich.edu        updateRegMap(CPSR cpsr)
3666718Sgblack@eecs.umich.edu        {
36710037SARM gem5 Developers            if (cpsr.width == 0) {
36810037SARM gem5 Developers                intRegMap = IntReg64Map;
36910037SARM gem5 Developers            } else {
37010037SARM gem5 Developers                switch (cpsr.mode) {
37110037SARM gem5 Developers                  case MODE_USER:
37210037SARM gem5 Developers                  case MODE_SYSTEM:
37310037SARM gem5 Developers                    intRegMap = IntRegUsrMap;
37410037SARM gem5 Developers                    break;
37510037SARM gem5 Developers                  case MODE_FIQ:
37610037SARM gem5 Developers                    intRegMap = IntRegFiqMap;
37710037SARM gem5 Developers                    break;
37810037SARM gem5 Developers                  case MODE_IRQ:
37910037SARM gem5 Developers                    intRegMap = IntRegIrqMap;
38010037SARM gem5 Developers                    break;
38110037SARM gem5 Developers                  case MODE_SVC:
38210037SARM gem5 Developers                    intRegMap = IntRegSvcMap;
38310037SARM gem5 Developers                    break;
38410037SARM gem5 Developers                  case MODE_MON:
38510037SARM gem5 Developers                    intRegMap = IntRegMonMap;
38610037SARM gem5 Developers                    break;
38710037SARM gem5 Developers                  case MODE_ABORT:
38810037SARM gem5 Developers                    intRegMap = IntRegAbtMap;
38910037SARM gem5 Developers                    break;
39010037SARM gem5 Developers                  case MODE_HYP:
39110037SARM gem5 Developers                    intRegMap = IntRegHypMap;
39210037SARM gem5 Developers                    break;
39310037SARM gem5 Developers                  case MODE_UNDEFINED:
39410037SARM gem5 Developers                    intRegMap = IntRegUndMap;
39510037SARM gem5 Developers                    break;
39610037SARM gem5 Developers                  default:
39710037SARM gem5 Developers                    panic("Unrecognized mode setting in CPSR.\n");
39810037SARM gem5 Developers                }
3996718Sgblack@eecs.umich.edu            }
4006718Sgblack@eecs.umich.edu        }
4016313Sgblack@eecs.umich.edu
40210844Sandreas.sandberg@arm.com        BaseISADevice &getGenericTimer(ThreadContext *tc);
40310037SARM gem5 Developers
40410037SARM gem5 Developers
40510037SARM gem5 Developers      private:
40610037SARM gem5 Developers        inline void assert32(ThreadContext *tc) {
40710037SARM gem5 Developers            CPSR cpsr M5_VAR_USED = readMiscReg(MISCREG_CPSR, tc);
40810037SARM gem5 Developers            assert(cpsr.width);
40910037SARM gem5 Developers        }
41010037SARM gem5 Developers
41110037SARM gem5 Developers        inline void assert64(ThreadContext *tc) {
41210037SARM gem5 Developers            CPSR cpsr M5_VAR_USED = readMiscReg(MISCREG_CPSR, tc);
41310037SARM gem5 Developers            assert(!cpsr.width);
41410037SARM gem5 Developers        }
41510037SARM gem5 Developers
4166313Sgblack@eecs.umich.edu      public:
4177427Sgblack@eecs.umich.edu        void clear();
41813114Sgiacomo.travaglini@arm.com
41913114Sgiacomo.travaglini@arm.com      protected:
42013393Sgiacomo.travaglini@arm.com        void clear32(const ArmISAParams *p, const SCTLR &sctlr_rst);
42110037SARM gem5 Developers        void clear64(const ArmISAParams *p);
42213114Sgiacomo.travaglini@arm.com        void initID32(const ArmISAParams *p);
42313114Sgiacomo.travaglini@arm.com        void initID64(const ArmISAParams *p);
4246313Sgblack@eecs.umich.edu
42513114Sgiacomo.travaglini@arm.com      public:
42610035Sandreas.hansson@arm.com        MiscReg readMiscRegNoEffect(int misc_reg) const;
4277405SAli.Saidi@ARM.com        MiscReg readMiscReg(int misc_reg, ThreadContext *tc);
4287405SAli.Saidi@ARM.com        void setMiscRegNoEffect(int misc_reg, const MiscReg &val);
4297405SAli.Saidi@ARM.com        void setMiscReg(int misc_reg, const MiscReg &val, ThreadContext *tc);
4306313Sgblack@eecs.umich.edu
43112106SRekai.GonzalezAlberquilla@arm.com        RegId
43212106SRekai.GonzalezAlberquilla@arm.com        flattenRegId(const RegId& regId) const
43312106SRekai.GonzalezAlberquilla@arm.com        {
43412106SRekai.GonzalezAlberquilla@arm.com            switch (regId.classValue()) {
43512106SRekai.GonzalezAlberquilla@arm.com              case IntRegClass:
43612106SRekai.GonzalezAlberquilla@arm.com                return RegId(IntRegClass, flattenIntIndex(regId.index()));
43712106SRekai.GonzalezAlberquilla@arm.com              case FloatRegClass:
43812106SRekai.GonzalezAlberquilla@arm.com                return RegId(FloatRegClass, flattenFloatIndex(regId.index()));
43912109SRekai.GonzalezAlberquilla@arm.com              case VecRegClass:
44012109SRekai.GonzalezAlberquilla@arm.com                return RegId(VecRegClass, flattenVecIndex(regId.index()));
44112109SRekai.GonzalezAlberquilla@arm.com              case VecElemClass:
44212109SRekai.GonzalezAlberquilla@arm.com                return RegId(VecElemClass, flattenVecElemIndex(regId.index()));
44312106SRekai.GonzalezAlberquilla@arm.com              case CCRegClass:
44412106SRekai.GonzalezAlberquilla@arm.com                return RegId(CCRegClass, flattenCCIndex(regId.index()));
44512106SRekai.GonzalezAlberquilla@arm.com              case MiscRegClass:
44612106SRekai.GonzalezAlberquilla@arm.com                return RegId(MiscRegClass, flattenMiscIndex(regId.index()));
44712106SRekai.GonzalezAlberquilla@arm.com            }
44812106SRekai.GonzalezAlberquilla@arm.com            return RegId();
44912106SRekai.GonzalezAlberquilla@arm.com        }
45012106SRekai.GonzalezAlberquilla@arm.com
4516313Sgblack@eecs.umich.edu        int
45210035Sandreas.hansson@arm.com        flattenIntIndex(int reg) const
4536313Sgblack@eecs.umich.edu        {
4546718Sgblack@eecs.umich.edu            assert(reg >= 0);
4556718Sgblack@eecs.umich.edu            if (reg < NUM_ARCH_INTREGS) {
4566718Sgblack@eecs.umich.edu                return intRegMap[reg];
4576726Sgblack@eecs.umich.edu            } else if (reg < NUM_INTREGS) {
4586726Sgblack@eecs.umich.edu                return reg;
45910037SARM gem5 Developers            } else if (reg == INTREG_SPX) {
46010037SARM gem5 Developers                CPSR cpsr = miscRegs[MISCREG_CPSR];
46110037SARM gem5 Developers                ExceptionLevel el = opModeToEL(
46210037SARM gem5 Developers                    (OperatingMode) (uint8_t) cpsr.mode);
46310037SARM gem5 Developers                if (!cpsr.sp && el != EL0)
46410037SARM gem5 Developers                    return INTREG_SP0;
46510037SARM gem5 Developers                switch (el) {
46610037SARM gem5 Developers                  case EL3:
46710037SARM gem5 Developers                    return INTREG_SP3;
46811574SCurtis.Dunham@arm.com                  case EL2:
46911574SCurtis.Dunham@arm.com                    return INTREG_SP2;
47010037SARM gem5 Developers                  case EL1:
47110037SARM gem5 Developers                    return INTREG_SP1;
47210037SARM gem5 Developers                  case EL0:
47310037SARM gem5 Developers                    return INTREG_SP0;
47410037SARM gem5 Developers                  default:
47510037SARM gem5 Developers                    panic("Invalid exception level");
47613020Sshunhsingou@google.com                    return 0;  // Never happens.
47710037SARM gem5 Developers                }
4786718Sgblack@eecs.umich.edu            } else {
47910037SARM gem5 Developers                return flattenIntRegModeIndex(reg);
4806718Sgblack@eecs.umich.edu            }
4816313Sgblack@eecs.umich.edu        }
4826313Sgblack@eecs.umich.edu
4836313Sgblack@eecs.umich.edu        int
48410035Sandreas.hansson@arm.com        flattenFloatIndex(int reg) const
4856313Sgblack@eecs.umich.edu        {
48610338SCurtis.Dunham@arm.com            assert(reg >= 0);
4876313Sgblack@eecs.umich.edu            return reg;
4886313Sgblack@eecs.umich.edu        }
4896313Sgblack@eecs.umich.edu
4909920Syasuko.eckert@amd.com        int
49112109SRekai.GonzalezAlberquilla@arm.com        flattenVecIndex(int reg) const
49212109SRekai.GonzalezAlberquilla@arm.com        {
49312109SRekai.GonzalezAlberquilla@arm.com            assert(reg >= 0);
49412109SRekai.GonzalezAlberquilla@arm.com            return reg;
49512109SRekai.GonzalezAlberquilla@arm.com        }
49612109SRekai.GonzalezAlberquilla@arm.com
49712109SRekai.GonzalezAlberquilla@arm.com        int
49812109SRekai.GonzalezAlberquilla@arm.com        flattenVecElemIndex(int reg) const
49912109SRekai.GonzalezAlberquilla@arm.com        {
50012109SRekai.GonzalezAlberquilla@arm.com            assert(reg >= 0);
50112109SRekai.GonzalezAlberquilla@arm.com            return reg;
50212109SRekai.GonzalezAlberquilla@arm.com        }
50312109SRekai.GonzalezAlberquilla@arm.com
50412109SRekai.GonzalezAlberquilla@arm.com        int
50510035Sandreas.hansson@arm.com        flattenCCIndex(int reg) const
5069920Syasuko.eckert@amd.com        {
50710338SCurtis.Dunham@arm.com            assert(reg >= 0);
5089920Syasuko.eckert@amd.com            return reg;
5099920Syasuko.eckert@amd.com        }
5109920Syasuko.eckert@amd.com
5117614Sminkyu.jeong@arm.com        int
51210035Sandreas.hansson@arm.com        flattenMiscIndex(int reg) const
5137614Sminkyu.jeong@arm.com        {
51410338SCurtis.Dunham@arm.com            assert(reg >= 0);
51510037SARM gem5 Developers            int flat_idx = reg;
51610037SARM gem5 Developers
5177614Sminkyu.jeong@arm.com            if (reg == MISCREG_SPSR) {
5187614Sminkyu.jeong@arm.com                CPSR cpsr = miscRegs[MISCREG_CPSR];
5197614Sminkyu.jeong@arm.com                switch (cpsr.mode) {
52010037SARM gem5 Developers                  case MODE_EL0T:
52110037SARM gem5 Developers                    warn("User mode does not have SPSR\n");
52210037SARM gem5 Developers                    flat_idx = MISCREG_SPSR;
52310037SARM gem5 Developers                    break;
52410037SARM gem5 Developers                  case MODE_EL1T:
52510037SARM gem5 Developers                  case MODE_EL1H:
52610037SARM gem5 Developers                    flat_idx = MISCREG_SPSR_EL1;
52710037SARM gem5 Developers                    break;
52810037SARM gem5 Developers                  case MODE_EL2T:
52910037SARM gem5 Developers                  case MODE_EL2H:
53010037SARM gem5 Developers                    flat_idx = MISCREG_SPSR_EL2;
53110037SARM gem5 Developers                    break;
53210037SARM gem5 Developers                  case MODE_EL3T:
53310037SARM gem5 Developers                  case MODE_EL3H:
53410037SARM gem5 Developers                    flat_idx = MISCREG_SPSR_EL3;
53510037SARM gem5 Developers                    break;
5367614Sminkyu.jeong@arm.com                  case MODE_USER:
5377614Sminkyu.jeong@arm.com                    warn("User mode does not have SPSR\n");
53810037SARM gem5 Developers                    flat_idx = MISCREG_SPSR;
5397614Sminkyu.jeong@arm.com                    break;
5407614Sminkyu.jeong@arm.com                  case MODE_FIQ:
54110037SARM gem5 Developers                    flat_idx = MISCREG_SPSR_FIQ;
5427614Sminkyu.jeong@arm.com                    break;
5437614Sminkyu.jeong@arm.com                  case MODE_IRQ:
54410037SARM gem5 Developers                    flat_idx = MISCREG_SPSR_IRQ;
5457614Sminkyu.jeong@arm.com                    break;
5467614Sminkyu.jeong@arm.com                  case MODE_SVC:
54710037SARM gem5 Developers                    flat_idx = MISCREG_SPSR_SVC;
5487614Sminkyu.jeong@arm.com                    break;
5497614Sminkyu.jeong@arm.com                  case MODE_MON:
55010037SARM gem5 Developers                    flat_idx = MISCREG_SPSR_MON;
5517614Sminkyu.jeong@arm.com                    break;
5527614Sminkyu.jeong@arm.com                  case MODE_ABORT:
55310037SARM gem5 Developers                    flat_idx = MISCREG_SPSR_ABT;
55410037SARM gem5 Developers                    break;
55510037SARM gem5 Developers                  case MODE_HYP:
55610037SARM gem5 Developers                    flat_idx = MISCREG_SPSR_HYP;
5577614Sminkyu.jeong@arm.com                    break;
5587614Sminkyu.jeong@arm.com                  case MODE_UNDEFINED:
55910037SARM gem5 Developers                    flat_idx = MISCREG_SPSR_UND;
5607614Sminkyu.jeong@arm.com                    break;
5617614Sminkyu.jeong@arm.com                  default:
5627614Sminkyu.jeong@arm.com                    warn("Trying to access SPSR in an invalid mode: %d\n",
5637614Sminkyu.jeong@arm.com                         cpsr.mode);
56410037SARM gem5 Developers                    flat_idx = MISCREG_SPSR;
5657614Sminkyu.jeong@arm.com                    break;
5667614Sminkyu.jeong@arm.com                }
56710037SARM gem5 Developers            } else if (miscRegInfo[reg][MISCREG_MUTEX]) {
56810037SARM gem5 Developers                // Mutually exclusive CP15 register
56910037SARM gem5 Developers                switch (reg) {
57010037SARM gem5 Developers                  case MISCREG_PRRR_MAIR0:
57110037SARM gem5 Developers                  case MISCREG_PRRR_MAIR0_NS:
57210037SARM gem5 Developers                  case MISCREG_PRRR_MAIR0_S:
57310037SARM gem5 Developers                    {
57410037SARM gem5 Developers                        TTBCR ttbcr = readMiscRegNoEffect(MISCREG_TTBCR);
57510037SARM gem5 Developers                        // If the muxed reg has been flattened, work out the
57610037SARM gem5 Developers                        // offset and apply it to the unmuxed reg
57710037SARM gem5 Developers                        int idxOffset = reg - MISCREG_PRRR_MAIR0;
57810037SARM gem5 Developers                        if (ttbcr.eae)
57910037SARM gem5 Developers                            flat_idx = flattenMiscIndex(MISCREG_MAIR0 +
58010037SARM gem5 Developers                                                        idxOffset);
58110037SARM gem5 Developers                        else
58210037SARM gem5 Developers                            flat_idx = flattenMiscIndex(MISCREG_PRRR +
58310037SARM gem5 Developers                                                        idxOffset);
58410037SARM gem5 Developers                    }
58510037SARM gem5 Developers                    break;
58610037SARM gem5 Developers                  case MISCREG_NMRR_MAIR1:
58710037SARM gem5 Developers                  case MISCREG_NMRR_MAIR1_NS:
58810037SARM gem5 Developers                  case MISCREG_NMRR_MAIR1_S:
58910037SARM gem5 Developers                    {
59010037SARM gem5 Developers                        TTBCR ttbcr = readMiscRegNoEffect(MISCREG_TTBCR);
59110037SARM gem5 Developers                        // If the muxed reg has been flattened, work out the
59210037SARM gem5 Developers                        // offset and apply it to the unmuxed reg
59310037SARM gem5 Developers                        int idxOffset = reg - MISCREG_NMRR_MAIR1;
59410037SARM gem5 Developers                        if (ttbcr.eae)
59510037SARM gem5 Developers                            flat_idx = flattenMiscIndex(MISCREG_MAIR1 +
59610037SARM gem5 Developers                                                        idxOffset);
59710037SARM gem5 Developers                        else
59810037SARM gem5 Developers                            flat_idx = flattenMiscIndex(MISCREG_NMRR +
59910037SARM gem5 Developers                                                        idxOffset);
60010037SARM gem5 Developers                    }
60110037SARM gem5 Developers                    break;
60210037SARM gem5 Developers                  case MISCREG_PMXEVTYPER_PMCCFILTR:
60310037SARM gem5 Developers                    {
60410037SARM gem5 Developers                        PMSELR pmselr = miscRegs[MISCREG_PMSELR];
60510037SARM gem5 Developers                        if (pmselr.sel == 31)
60610037SARM gem5 Developers                            flat_idx = flattenMiscIndex(MISCREG_PMCCFILTR);
60710037SARM gem5 Developers                        else
60810037SARM gem5 Developers                            flat_idx = flattenMiscIndex(MISCREG_PMXEVTYPER);
60910037SARM gem5 Developers                    }
61010037SARM gem5 Developers                    break;
61110037SARM gem5 Developers                  default:
61210037SARM gem5 Developers                    panic("Unrecognized misc. register.\n");
61310037SARM gem5 Developers                    break;
61410037SARM gem5 Developers                }
61510037SARM gem5 Developers            } else {
61610037SARM gem5 Developers                if (miscRegInfo[reg][MISCREG_BANKED]) {
61711771SCurtis.Dunham@arm.com                    bool secureReg = haveSecurity && !highestELIs64 &&
61810037SARM gem5 Developers                                     inSecureState(miscRegs[MISCREG_SCR],
61910037SARM gem5 Developers                                                   miscRegs[MISCREG_CPSR]);
62010037SARM gem5 Developers                    flat_idx += secureReg ? 2 : 1;
62110037SARM gem5 Developers                }
6227614Sminkyu.jeong@arm.com            }
62310037SARM gem5 Developers            return flat_idx;
6247614Sminkyu.jeong@arm.com        }
6257614Sminkyu.jeong@arm.com
62611771SCurtis.Dunham@arm.com        std::pair<int,int> getMiscIndices(int misc_reg) const
62711771SCurtis.Dunham@arm.com        {
62811771SCurtis.Dunham@arm.com            // Note: indexes of AArch64 registers are left unchanged
62911771SCurtis.Dunham@arm.com            int flat_idx = flattenMiscIndex(misc_reg);
63011771SCurtis.Dunham@arm.com
63111771SCurtis.Dunham@arm.com            if (lookUpMiscReg[flat_idx].lower == 0) {
63211771SCurtis.Dunham@arm.com                return std::make_pair(flat_idx, 0);
63311771SCurtis.Dunham@arm.com            }
63411771SCurtis.Dunham@arm.com
63511771SCurtis.Dunham@arm.com            // do additional S/NS flattenings if mapped to NS while in S
63611771SCurtis.Dunham@arm.com            bool S = haveSecurity && !highestELIs64 &&
63711771SCurtis.Dunham@arm.com                     inSecureState(miscRegs[MISCREG_SCR],
63811771SCurtis.Dunham@arm.com                                   miscRegs[MISCREG_CPSR]);
63911771SCurtis.Dunham@arm.com            int lower = lookUpMiscReg[flat_idx].lower;
64011771SCurtis.Dunham@arm.com            int upper = lookUpMiscReg[flat_idx].upper;
64111771SCurtis.Dunham@arm.com            // upper == 0, which is CPSR, is not MISCREG_BANKED_CHILD (no-op)
64211771SCurtis.Dunham@arm.com            lower += S && miscRegInfo[lower][MISCREG_BANKED_CHILD];
64311771SCurtis.Dunham@arm.com            upper += S && miscRegInfo[upper][MISCREG_BANKED_CHILD];
64411771SCurtis.Dunham@arm.com            return std::make_pair(lower, upper);
64511771SCurtis.Dunham@arm.com        }
64611771SCurtis.Dunham@arm.com
64710905Sandreas.sandberg@arm.com        void serialize(CheckpointOut &cp) const
6487733SAli.Saidi@ARM.com        {
6497733SAli.Saidi@ARM.com            DPRINTF(Checkpoint, "Serializing Arm Misc Registers\n");
65012529Sgiacomo.travaglini@arm.com            SERIALIZE_ARRAY(miscRegs, NUM_PHYS_MISCREGS);
65110037SARM gem5 Developers
65211771SCurtis.Dunham@arm.com            SERIALIZE_SCALAR(highestELIs64);
65310037SARM gem5 Developers            SERIALIZE_SCALAR(haveSecurity);
65410037SARM gem5 Developers            SERIALIZE_SCALAR(haveLPAE);
65510037SARM gem5 Developers            SERIALIZE_SCALAR(haveVirtualization);
65610037SARM gem5 Developers            SERIALIZE_SCALAR(haveLargeAsid64);
65713114Sgiacomo.travaglini@arm.com            SERIALIZE_SCALAR(physAddrRange);
6587733SAli.Saidi@ARM.com        }
65910905Sandreas.sandberg@arm.com        void unserialize(CheckpointIn &cp)
6607733SAli.Saidi@ARM.com        {
6617733SAli.Saidi@ARM.com            DPRINTF(Checkpoint, "Unserializing Arm Misc Registers\n");
66212529Sgiacomo.travaglini@arm.com            UNSERIALIZE_ARRAY(miscRegs, NUM_PHYS_MISCREGS);
6637733SAli.Saidi@ARM.com            CPSR tmp_cpsr = miscRegs[MISCREG_CPSR];
6647733SAli.Saidi@ARM.com            updateRegMap(tmp_cpsr);
66510037SARM gem5 Developers
66611771SCurtis.Dunham@arm.com            UNSERIALIZE_SCALAR(highestELIs64);
66710037SARM gem5 Developers            UNSERIALIZE_SCALAR(haveSecurity);
66810037SARM gem5 Developers            UNSERIALIZE_SCALAR(haveLPAE);
66910037SARM gem5 Developers            UNSERIALIZE_SCALAR(haveVirtualization);
67010037SARM gem5 Developers            UNSERIALIZE_SCALAR(haveLargeAsid64);
67113114Sgiacomo.travaglini@arm.com            UNSERIALIZE_SCALAR(physAddrRange);
6727733SAli.Saidi@ARM.com        }
6736313Sgblack@eecs.umich.edu
67412972Sandreas.sandberg@arm.com        void startup(ThreadContext *tc);
6759461Snilay@cs.wisc.edu
67611165SRekai.GonzalezAlberquilla@arm.com        Enums::DecoderFlavour decoderFlavour() const { return _decoderFlavour; }
67711165SRekai.GonzalezAlberquilla@arm.com
67812109SRekai.GonzalezAlberquilla@arm.com        Enums::VecRegRenameMode
67912109SRekai.GonzalezAlberquilla@arm.com        vecRegRenameMode() const
68012109SRekai.GonzalezAlberquilla@arm.com        {
68112109SRekai.GonzalezAlberquilla@arm.com            return _vecRegRenameMode;
68212109SRekai.GonzalezAlberquilla@arm.com        }
68312109SRekai.GonzalezAlberquilla@arm.com
6849553Sandreas.hansson@arm.com        /// Explicitly import the otherwise hidden startup
6859553Sandreas.hansson@arm.com        using SimObject::startup;
6869553Sandreas.hansson@arm.com
6879384SAndreas.Sandberg@arm.com        typedef ArmISAParams Params;
6887400SAli.Saidi@ARM.com
6899384SAndreas.Sandberg@arm.com        const Params *params() const;
6909384SAndreas.Sandberg@arm.com
6919384SAndreas.Sandberg@arm.com        ISA(Params *p);
6926313Sgblack@eecs.umich.edu    };
6936313Sgblack@eecs.umich.edu}
6946313Sgblack@eecs.umich.edu
69512109SRekai.GonzalezAlberquilla@arm.comtemplate<>
69612109SRekai.GonzalezAlberquilla@arm.comstruct initRenameMode<ArmISA::ISA>
69712109SRekai.GonzalezAlberquilla@arm.com{
69812109SRekai.GonzalezAlberquilla@arm.com    static Enums::VecRegRenameMode mode(const ArmISA::ISA* isa)
69912109SRekai.GonzalezAlberquilla@arm.com    {
70012109SRekai.GonzalezAlberquilla@arm.com        return isa->vecRegRenameMode();
70112109SRekai.GonzalezAlberquilla@arm.com    }
70212109SRekai.GonzalezAlberquilla@arm.com    static bool equals(const ArmISA::ISA* isa1, const ArmISA::ISA* isa2)
70312109SRekai.GonzalezAlberquilla@arm.com    {
70412109SRekai.GonzalezAlberquilla@arm.com        return mode(isa1) == mode(isa2);
70512109SRekai.GonzalezAlberquilla@arm.com    }
70612109SRekai.GonzalezAlberquilla@arm.com};
70712109SRekai.GonzalezAlberquilla@arm.com
7086313Sgblack@eecs.umich.edu#endif
709