miscregs.hh revision 7286
1955SN/A/* 2955SN/A * Copyright (c) 2010 ARM Limited 31762SN/A * All rights reserved 4955SN/A * 5955SN/A * The license below extends only to copyright in the software and shall 6955SN/A * not be construed as granting a license to any other intellectual 7955SN/A * property including but not limited to intellectual property relating 8955SN/A * to a hardware implementation of the functionality of the software 9955SN/A * licensed hereunder. You may use the software subject to the license 10955SN/A * terms below provided that you ensure that this notice is replicated 11955SN/A * unmodified and in its entirety in all distributions of the software, 12955SN/A * modified or unmodified, in source code or in binary form. 13955SN/A * 14955SN/A * Copyright (c) 2009 The Regents of The University of Michigan 15955SN/A * All rights reserved. 16955SN/A * 17955SN/A * Redistribution and use in source and binary forms, with or without 18955SN/A * modification, are permitted provided that the following conditions are 19955SN/A * met: redistributions of source code must retain the above copyright 20955SN/A * notice, this list of conditions and the following disclaimer; 21955SN/A * redistributions in binary form must reproduce the above copyright 22955SN/A * notice, this list of conditions and the following disclaimer in the 23955SN/A * documentation and/or other materials provided with the distribution; 24955SN/A * neither the name of the copyright holders nor the names of its 25955SN/A * contributors may be used to endorse or promote products derived from 26955SN/A * this software without specific prior written permission. 27955SN/A * 282665Ssaidi@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 292665Ssaidi@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30955SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31955SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32955SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33955SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 34955SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 352632Sstever@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 362632Sstever@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 372632Sstever@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 382632Sstever@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39955SN/A * 402632Sstever@eecs.umich.edu * Authors: Gabe Black 412632Sstever@eecs.umich.edu */ 422761Sstever@eecs.umich.edu#ifndef __ARCH_ARM_MISCREGS_HH__ 432632Sstever@eecs.umich.edu#define __ARCH_ARM_MISCREGS_HH__ 442632Sstever@eecs.umich.edu 452632Sstever@eecs.umich.edu#include "base/bitunion.hh" 462761Sstever@eecs.umich.edu 472761Sstever@eecs.umich.edunamespace ArmISA 482761Sstever@eecs.umich.edu{ 492632Sstever@eecs.umich.edu enum ConditionCode { 502632Sstever@eecs.umich.edu COND_EQ = 0, 512761Sstever@eecs.umich.edu COND_NE, // 1 522761Sstever@eecs.umich.edu COND_CS, // 2 532761Sstever@eecs.umich.edu COND_CC, // 3 542761Sstever@eecs.umich.edu COND_MI, // 4 552761Sstever@eecs.umich.edu COND_PL, // 5 562632Sstever@eecs.umich.edu COND_VS, // 6 572632Sstever@eecs.umich.edu COND_VC, // 7 582632Sstever@eecs.umich.edu COND_HI, // 8 592632Sstever@eecs.umich.edu COND_LS, // 9 602632Sstever@eecs.umich.edu COND_GE, // 10 612632Sstever@eecs.umich.edu COND_LT, // 11 622632Sstever@eecs.umich.edu COND_GT, // 12 63955SN/A COND_LE, // 13 64955SN/A COND_AL, // 14 65955SN/A COND_UC // 15 66955SN/A }; 67955SN/A 685396Ssaidi@eecs.umich.edu enum MiscRegIndex { 694202Sbinkertn@umich.edu MISCREG_CPSR = 0, 705342Sstever@gmail.com MISCREG_SPSR, 71955SN/A MISCREG_SPSR_FIQ, 725273Sstever@gmail.com MISCREG_SPSR_IRQ, 735273Sstever@gmail.com MISCREG_SPSR_SVC, 742656Sstever@eecs.umich.edu MISCREG_SPSR_MON, 752656Sstever@eecs.umich.edu MISCREG_SPSR_UND, 762656Sstever@eecs.umich.edu MISCREG_SPSR_ABT, 772656Sstever@eecs.umich.edu MISCREG_FPSR, 782656Sstever@eecs.umich.edu MISCREG_FPSID, 792656Sstever@eecs.umich.edu MISCREG_FPSCR, 802656Sstever@eecs.umich.edu MISCREG_FPEXC, 812653Sstever@eecs.umich.edu 825227Ssaidi@eecs.umich.edu // CP15 registers 835227Ssaidi@eecs.umich.edu MISCREG_CP15_START, 845227Ssaidi@eecs.umich.edu MISCREG_SCTLR = MISCREG_CP15_START, 855227Ssaidi@eecs.umich.edu MISCREG_DCCISW, 865396Ssaidi@eecs.umich.edu MISCREG_DCCIMVAC, 875396Ssaidi@eecs.umich.edu MISCREG_DCCMVAC, 885396Ssaidi@eecs.umich.edu MISCREG_CONTEXTIDR, 895396Ssaidi@eecs.umich.edu MISCREG_TPIDRURW, 905396Ssaidi@eecs.umich.edu MISCREG_TPIDRURO, 915396Ssaidi@eecs.umich.edu MISCREG_TPIDRPRW, 925396Ssaidi@eecs.umich.edu MISCREG_CP15ISB, 935396Ssaidi@eecs.umich.edu MISCREG_CP15DSB, 945396Ssaidi@eecs.umich.edu MISCREG_CP15DMB, 955396Ssaidi@eecs.umich.edu MISCREG_CPACR, 965396Ssaidi@eecs.umich.edu MISCREG_CLIDR, 975396Ssaidi@eecs.umich.edu MISCREG_ICIALLUIS, 985396Ssaidi@eecs.umich.edu MISCREG_ICIALLU, 995396Ssaidi@eecs.umich.edu MISCREG_ICIMVAU, 1005396Ssaidi@eecs.umich.edu MISCREG_BPIMVA, 1015396Ssaidi@eecs.umich.edu MISCREG_CP15_UNIMP_START, 1025396Ssaidi@eecs.umich.edu MISCREG_CTR = MISCREG_CP15_UNIMP_START, 1035396Ssaidi@eecs.umich.edu MISCREG_TCMTR, 1045396Ssaidi@eecs.umich.edu MISCREG_MPUIR, 1055396Ssaidi@eecs.umich.edu MISCREG_MPIDR, 1065396Ssaidi@eecs.umich.edu MISCREG_MIDR, 1075396Ssaidi@eecs.umich.edu MISCREG_ID_PFR0, 1085396Ssaidi@eecs.umich.edu MISCREG_ID_PFR1, 1095396Ssaidi@eecs.umich.edu MISCREG_ID_DFR0, 1105396Ssaidi@eecs.umich.edu MISCREG_ID_AFR0, 1115396Ssaidi@eecs.umich.edu MISCREG_ID_MMFR0, 1125396Ssaidi@eecs.umich.edu MISCREG_ID_MMFR1, 1135396Ssaidi@eecs.umich.edu MISCREG_ID_MMFR2, 1145396Ssaidi@eecs.umich.edu MISCREG_ID_MMFR3, 1155396Ssaidi@eecs.umich.edu MISCREG_ID_ISAR0, 1165396Ssaidi@eecs.umich.edu MISCREG_ID_ISAR1, 1175396Ssaidi@eecs.umich.edu MISCREG_ID_ISAR2, 1185396Ssaidi@eecs.umich.edu MISCREG_ID_ISAR3, 1195396Ssaidi@eecs.umich.edu MISCREG_ID_ISAR4, 1205396Ssaidi@eecs.umich.edu MISCREG_ID_ISAR5, 1215396Ssaidi@eecs.umich.edu MISCREG_CCSIDR, 1225396Ssaidi@eecs.umich.edu MISCREG_AIDR, 1235396Ssaidi@eecs.umich.edu MISCREG_CSSELR, 1245396Ssaidi@eecs.umich.edu MISCREG_ACTLR, 1255396Ssaidi@eecs.umich.edu MISCREG_DFSR, 1265396Ssaidi@eecs.umich.edu MISCREG_IFSR, 1275396Ssaidi@eecs.umich.edu MISCREG_ADFSR, 1285396Ssaidi@eecs.umich.edu MISCREG_AIFSR, 1295396Ssaidi@eecs.umich.edu MISCREG_DFAR, 1305396Ssaidi@eecs.umich.edu MISCREG_IFAR, 1315396Ssaidi@eecs.umich.edu MISCREG_DRBAR, 1325396Ssaidi@eecs.umich.edu MISCREG_IRBAR, 1335396Ssaidi@eecs.umich.edu MISCREG_DRSR, 1345396Ssaidi@eecs.umich.edu MISCREG_IRSR, 1355396Ssaidi@eecs.umich.edu MISCREG_DRACR, 1365396Ssaidi@eecs.umich.edu MISCREG_IRACR, 1375396Ssaidi@eecs.umich.edu MISCREG_RGNR, 1385396Ssaidi@eecs.umich.edu MISCREG_BPIALLIS, 1395396Ssaidi@eecs.umich.edu MISCREG_BPIALL, 1405396Ssaidi@eecs.umich.edu MISCREG_DCIMVAC, 1415396Ssaidi@eecs.umich.edu MISCREG_DCISW, 1425396Ssaidi@eecs.umich.edu MISCREG_MCCSW, 1435396Ssaidi@eecs.umich.edu MISCREG_DCCMVAU, 1445396Ssaidi@eecs.umich.edu 1455396Ssaidi@eecs.umich.edu MISCREG_CP15_END, 1465396Ssaidi@eecs.umich.edu 1474781Snate@binkert.org // Dummy indices 1481852SN/A MISCREG_NOP = MISCREG_CP15_END, 149955SN/A MISCREG_RAZ, 150955SN/A 151955SN/A NUM_MISCREGS 1523717Sstever@eecs.umich.edu }; 1533716Sstever@eecs.umich.edu 154955SN/A MiscRegIndex decodeCP15Reg(unsigned crn, unsigned opc1, 1551533SN/A unsigned crm, unsigned opc2); 1563716Sstever@eecs.umich.edu 1571533SN/A const char * const miscRegName[NUM_MISCREGS] = { 1584678Snate@binkert.org "cpsr", "spsr", "spsr_fiq", "spsr_irq", "spsr_svc", 1594678Snate@binkert.org "spsr_mon", "spsr_und", "spsr_abt", 1604678Snate@binkert.org "fpsr", "fpsid", "fpscr", "fpexc", 1614678Snate@binkert.org "sctlr", "dccisw", "dccimvac", "dccmvac", 1624678Snate@binkert.org "contextidr", "tpidrurw", "tpidruro", "tpidrprw", 1634678Snate@binkert.org "cp15isb", "cp15dsb", "cp15dmb", "cpacr", "clidr", 1644678Snate@binkert.org "icialluis", "iciallu", "icimvau", "bpimva", 1654678Snate@binkert.org "ctr", "tcmtr", "mpuir", "mpidr", "midr", 1664678Snate@binkert.org "id_pfr0", "id_pfr1", "id_dfr0", "id_afr0", 1674678Snate@binkert.org "id_mmfr0", "id_mmfr1", "id_mmfr2", "id_mmfr3", 1684678Snate@binkert.org "id_isar0", "id_isar1", "id_isar2", "id_isar3", "id_isar4", "id_isar5", 1694678Snate@binkert.org "ccsidr", "aidr", "csselr", "actlr", 1704678Snate@binkert.org "dfsr", "ifsr", "adfsr", "aifsr", "dfar", "ifar", 1714678Snate@binkert.org "drbar", "irbar", "drsr", "irsr", "dracr", "iracr", 1724678Snate@binkert.org "rgnr", "bpiallis", 1734678Snate@binkert.org "bpiall", "dcimvac", "dcisw", "mccsw", 1744678Snate@binkert.org "dccmvau", 1754678Snate@binkert.org "nop", "raz" 1764678Snate@binkert.org }; 1774678Snate@binkert.org 1784678Snate@binkert.org BitUnion32(CPSR) 1794973Ssaidi@eecs.umich.edu Bitfield<31> n; 1804678Snate@binkert.org Bitfield<30> z; 1814678Snate@binkert.org Bitfield<29> c; 1824678Snate@binkert.org Bitfield<28> v; 1834678Snate@binkert.org Bitfield<27> q; 1844678Snate@binkert.org Bitfield<26,25> it1; 1854678Snate@binkert.org Bitfield<24> j; 186955SN/A Bitfield<19, 16> ge; 187955SN/A Bitfield<15,10> it2; 1882632Sstever@eecs.umich.edu Bitfield<9> e; 1892632Sstever@eecs.umich.edu Bitfield<8> a; 190955SN/A Bitfield<7> i; 191955SN/A Bitfield<6> f; 192955SN/A Bitfield<5> t; 193955SN/A Bitfield<4, 0> mode; 1942632Sstever@eecs.umich.edu EndBitUnion(CPSR) 195955SN/A 1962632Sstever@eecs.umich.edu // This mask selects bits of the CPSR that actually go in the CondCodes 1972632Sstever@eecs.umich.edu // integer register to allow renaming. 1982632Sstever@eecs.umich.edu static const uint32_t CondCodesMask = 0xF80F0000; 1992632Sstever@eecs.umich.edu 2002632Sstever@eecs.umich.edu // These otherwise unused bits of the PC are used to select a mode 2012632Sstever@eecs.umich.edu // like the J and T bits of the CPSR. 2022632Sstever@eecs.umich.edu static const Addr PcJBitShift = 33; 2032632Sstever@eecs.umich.edu static const Addr PcTBitShift = 34; 2042632Sstever@eecs.umich.edu static const Addr PcModeMask = (ULL(1) << PcJBitShift) | 2052632Sstever@eecs.umich.edu (ULL(1) << PcTBitShift); 2062632Sstever@eecs.umich.edu 2072632Sstever@eecs.umich.edu BitUnion32(SCTLR) 2082632Sstever@eecs.umich.edu Bitfield<30> te; // Thumb Exception Enable 2093718Sstever@eecs.umich.edu Bitfield<29> afe; // Access flag enable 2103718Sstever@eecs.umich.edu Bitfield<28> tre; // TEX Remap bit 2113718Sstever@eecs.umich.edu Bitfield<27> nmfi;// Non-maskable fast interrupts enable 2123718Sstever@eecs.umich.edu Bitfield<25> ee; // Exception Endianness bit 2133718Sstever@eecs.umich.edu Bitfield<24> ve; // Interrupt vectors enable 2143718Sstever@eecs.umich.edu Bitfield<23> rao1;// Read as one 2153718Sstever@eecs.umich.edu Bitfield<22> u; // Alignment (now unused) 2163718Sstever@eecs.umich.edu Bitfield<21> fi; // Fast interrupts configuration enable 2173718Sstever@eecs.umich.edu Bitfield<18> rao2;// Read as one 2183718Sstever@eecs.umich.edu Bitfield<17> ha; // Hardware access flag enable 2193718Sstever@eecs.umich.edu Bitfield<16> rao3;// Read as one 2203718Sstever@eecs.umich.edu Bitfield<14> rr; // Round robin cache replacement 2213718Sstever@eecs.umich.edu Bitfield<13> v; // Base address for exception vectors 2222634Sstever@eecs.umich.edu Bitfield<12> i; // instruction cache enable 2232634Sstever@eecs.umich.edu Bitfield<11> z; // branch prediction enable bit 2242632Sstever@eecs.umich.edu Bitfield<10> sw; // Enable swp/swpb 2252638Sstever@eecs.umich.edu Bitfield<6,3> rao4;// Read as one 2262632Sstever@eecs.umich.edu Bitfield<7> b; // Endianness support (unused) 2272632Sstever@eecs.umich.edu Bitfield<2> c; // Cache enable bit 2282632Sstever@eecs.umich.edu Bitfield<1> a; // Alignment fault checking 2292632Sstever@eecs.umich.edu Bitfield<0> m; // MMU enable bit 2302632Sstever@eecs.umich.edu EndBitUnion(SCTLR) 2312632Sstever@eecs.umich.edu}; 2321858SN/A 2333716Sstever@eecs.umich.edu#endif // __ARCH_ARM_MISCREGS_HH__ 2342638Sstever@eecs.umich.edu