pra_constants.hh revision 5222
14661Sksewell@umich.edu/*
25222Sksewell@umich.edu * Copyright (c) 2007 MIPS Technologies, Inc.
34661Sksewell@umich.edu * All rights reserved.
44661Sksewell@umich.edu *
54661Sksewell@umich.edu * Redistribution and use in source and binary forms, with or without
64661Sksewell@umich.edu * modification, are permitted provided that the following conditions are
74661Sksewell@umich.edu * met: redistributions of source code must retain the above copyright
84661Sksewell@umich.edu * notice, this list of conditions and the following disclaimer;
94661Sksewell@umich.edu * redistributions in binary form must reproduce the above copyright
104661Sksewell@umich.edu * notice, this list of conditions and the following disclaimer in the
114661Sksewell@umich.edu * documentation and/or other materials provided with the distribution;
124661Sksewell@umich.edu * neither the name of the copyright holders nor the names of its
134661Sksewell@umich.edu * contributors may be used to endorse or promote products derived from
144661Sksewell@umich.edu * this software without specific prior written permission.
154661Sksewell@umich.edu *
164661Sksewell@umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
174661Sksewell@umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
184661Sksewell@umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
194661Sksewell@umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
204661Sksewell@umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
214661Sksewell@umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
224661Sksewell@umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
234661Sksewell@umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
244661Sksewell@umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
254661Sksewell@umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
264661Sksewell@umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
274661Sksewell@umich.edu *
284661Sksewell@umich.edu * Authors: Jaidev Patwardhan
294661Sksewell@umich.edu */
304661Sksewell@umich.edu
314661Sksewell@umich.edu#ifndef __ARCH_MIPS_PRA_CONSTANTS_HH__
324661Sksewell@umich.edu#define __ARCH_MIPS_PRA_CONSTANTS_HH__
334661Sksewell@umich.edu
344661Sksewell@umich.edu#include "arch/mips/types.hh"
354661Sksewell@umich.edu//#include "config/full_system.hh"
364661Sksewell@umich.edu
374661Sksewell@umich.edunamespace MipsISA
384661Sksewell@umich.edu{
394661Sksewell@umich.edu  // See MIPS32(R) Architecture Reference Manual Volume - III
404661Sksewell@umich.edu  // This header file uses definitions from Revision 2.50
414661Sksewell@umich.edu
424661Sksewell@umich.edu  // Index Status Register - CP0 Reg 0, Sel 0
434661Sksewell@umich.edu
444661Sksewell@umich.edu  const unsigned Index_P_HI = 31;
454661Sksewell@umich.edu  const unsigned Index_P_LO = 31;
464661Sksewell@umich.edu  // Need to figure out how to put in the TLB specific bits here
474661Sksewell@umich.edu  // For now, we assume that the entire length is used by the index field
484661Sksewell@umich.edu  // In reality, Index_HI = N-1, where Ceiling(log2(TLB Entries))=N
494661Sksewell@umich.edu  const unsigned Index_HI = 30;
504661Sksewell@umich.edu  const unsigned Index_LO = 0;
514661Sksewell@umich.edu
524661Sksewell@umich.edu  // CP0 Reg 0, Sel 1-3 are MT registers, see mt_constants.hh
534661Sksewell@umich.edu
544661Sksewell@umich.edu  // Random Register - CP0 Reg 1, Sel 0
554661Sksewell@umich.edu  // This has a problem similar to the Index_HI fields. We'll keep both consistent at 30 for now
564661Sksewell@umich.edu  const unsigned Random_HI = 30;
574661Sksewell@umich.edu  const unsigned Random_LO = 0;
584661Sksewell@umich.edu
594661Sksewell@umich.edu  // EntryLo0 - CP0 Reg2, Sel 0  - Table 8-6, ARM Vol-3
604661Sksewell@umich.edu  const unsigned EntryLo0_Fill_HI = 31; // See Table 8-8, ARM Vol III
614661Sksewell@umich.edu  const unsigned EntryLo0_Fill_LO = 30;
624661Sksewell@umich.edu  const unsigned EntryLo0_PFN_HI  = 29; //PFN defines the Page Frame Number (see Table 8-7, ARM Vol III)
634661Sksewell@umich.edu  const unsigned EntryLo0_PFN_LO  =  6;
644661Sksewell@umich.edu  const unsigned EntryLo0_C_HI    =  5; // Coherency attribute of a Page (see Table 8-8, ARM Vol III)
654661Sksewell@umich.edu  const unsigned EntryLo0_C_LO    =  3;
665222Sksewell@umich.edu  const unsigned EntryLo0_D_HI    =  2; // Dirty Bit, if D=1, page is writable. If D=0, a write causes a TLB Modified Exception
675222Sksewell@umich.edu  const unsigned EntryLo0_D_LO    =  2; // Dirty Bit, if D=1, page is writable. If D=0, a write causes a TLB Modified Exception
685222Sksewell@umich.edu  const unsigned EntryLo0_V_HI    =  1; // Valid Bit
695222Sksewell@umich.edu  const unsigned EntryLo0_V_LO    =  1; // Valid Bit
705222Sksewell@umich.edu  const unsigned EntryLo0_G_HI    =  0; // Global Bit. From the ARM Vol-III, Table 8-5:
715222Sksewell@umich.edu  const unsigned EntryLo0_G_LO    =  0; // Global Bit. From the ARM Vol-III, Table 8-5:
724661Sksewell@umich.edu                                        // On a TLB write, the logical AND of the G bits from EntryLo0 and EntryLo1
734661Sksewell@umich.edu                                        // becomes the G bit in the TLB entry. If the TLB entry G bit is 1, ASID comparisons are
744661Sksewell@umich.edu                                        // ignored during TLB matches. On a read from a TLB entry, the G bits of both Lo0 and Lo1
754661Sksewell@umich.edu                                        // reflect the state of the TLB G bit.
764661Sksewell@umich.edu
774661Sksewell@umich.edu  // EntryLo1 - CP0 Reg3, Sel 0
785222Sksewell@umich.edu  const unsigned EntryLo1_G_HI       =  0;
795222Sksewell@umich.edu  const unsigned EntryLo1_G_LO       =  0;
805222Sksewell@umich.edu  const unsigned EntryLo1_V_HI       =  1; // Valid Bit
815222Sksewell@umich.edu  const unsigned EntryLo1_V_LO       =  1; // Valid Bit
825222Sksewell@umich.edu  const unsigned EntryLo1_D_HI       =  2; // Dirty Bit, if D=1, page is writable. If D=0, a write causes a TLB Modified Exception
835222Sksewell@umich.edu  const unsigned EntryLo1_D_LO       =  2; // Dirty Bit, if D=1, page is writable. If D=0, a write causes a TLB Modified Exception
844661Sksewell@umich.edu  const unsigned EntryLo1_C_HI    =  5; // Coherency attribute of a Page (see Table 8-8, ARM Vol III)
854661Sksewell@umich.edu  const unsigned EntryLo1_C_LO    =  3;
864661Sksewell@umich.edu  const unsigned EntryLo1_PFN_HI  = 29; //PFN defines the Page Frame Number (see Table 8-7, ARM Vol III)
874661Sksewell@umich.edu  const unsigned EntryLo1_PFN_LO  =  6;
884661Sksewell@umich.edu  const unsigned EntryLo1_Fill_LO = 30;
894661Sksewell@umich.edu  const unsigned EntryLo1_Fill_HI = 31; // See Table 8-8, ARM Vol III
904661Sksewell@umich.edu
914661Sksewell@umich.edu
924661Sksewell@umich.edu  // Context Register - CP0 Reg 4, Sel 0
934661Sksewell@umich.edu  const unsigned Context_PTEBase_HI = 31; // Used by the OS to point into current PTE array
944661Sksewell@umich.edu  const unsigned Context_PTEBase_LO = 23;
954661Sksewell@umich.edu  const unsigned Context_BadVPN2_HI = 22; // This is written by hardware on a TLB exception. Contains bits 31-13 of the
964661Sksewell@umich.edu  const unsigned Context_BadVPN2_LO = 4;  // virtual address
974661Sksewell@umich.edu  // Bits 3-0 are zeros
984661Sksewell@umich.edu
994661Sksewell@umich.edu  // PageMask Register - CP0 Reg 5, Sel 0
1004661Sksewell@umich.edu  // Bits 31-29 are 0
1014661Sksewell@umich.edu  const unsigned PageMask_Mask_HI = 28; // (Table 8-10, ARM Vol-III) The Mask field is a bit mask in which a "1" indicates that
1024661Sksewell@umich.edu  const unsigned PageMask_Mask_LO = 13; // the corresponding bit of the virtual address should not participate in the TLB match
1034661Sksewell@umich.edu  const unsigned PageMask_MaskX_HI = 12; // See Table 8-10, ARM Vol-III
1044661Sksewell@umich.edu  const unsigned PageMask_MaskX_LO = 11;
1054661Sksewell@umich.edu  // Bits 10-0 are zero
1064661Sksewell@umich.edu
1074661Sksewell@umich.edu
1084661Sksewell@umich.edu  // PageGrain Register - CP0 Reg 5, Sel 1
1094661Sksewell@umich.edu  const unsigned PageGrain_ASE_UP_HI = 31; // ASE specific bits (SmartMIPS)
1104661Sksewell@umich.edu  const unsigned PageGrain_ASE_UP_LO = 30; //
1114661Sksewell@umich.edu  const unsigned PageGrain_ELPA = 29; // Used to enable support for large physical addresses in MIPS64 processors, unused in MIPS32
1124661Sksewell@umich.edu  const unsigned PageGrain_ESP = 28; // Enables support for 1KB pages (1==enabled,0==disabled), See ARM Vol-III, Table 8-12
1135222Sksewell@umich.edu  const unsigned PageGrain_ESP_HI = 28; // Enables support for 1KB pages (1==enabled,0==disabled), See ARM Vol-III, Table 8-12
1145222Sksewell@umich.edu  const unsigned PageGrain_ESP_LO = 28; // Enables support for 1KB pages (1==enabled,0==disabled), See ARM Vol-III, Table 8-12
1154661Sksewell@umich.edu  const unsigned PageGrain_ASE_DN_HI = 12;
1164661Sksewell@umich.edu  const unsigned PageGrain_ASE_DN_LO = 8;
1174661Sksewell@umich.edu  // Bits 27-13, 7-0 are zeros
1184661Sksewell@umich.edu
1194661Sksewell@umich.edu  // Wired Register - CPO Reg 6, Sel 0
1204661Sksewell@umich.edu  // See note on Index register (CP0, Sel0) above
1214661Sksewell@umich.edu  const unsigned Wired_HI = 30;
1224661Sksewell@umich.edu  const unsigned Wired_LO = 0;
1234661Sksewell@umich.edu
1244661Sksewell@umich.edu
1254661Sksewell@umich.edu  // HWREna Register - CP0 Reg 7, Sel 0
1264661Sksewell@umich.edu  const unsigned HWREna_IMPL_HI = 31; // These bits enable access to implementation dependent hardware registers 31
1274661Sksewell@umich.edu  const unsigned HWREna_IMPL_LO = 30; // and 30
1284661Sksewell@umich.edu  const unsigned HWREna_Mask_HI = 3; // Each bit enables access to a particular hardware register. If bit 'n' is 1, HW Reg n is accessible
1294661Sksewell@umich.edu  const unsigned HWREna_Mask_LO = 0; // See the RDHWR instruction for more details
1304661Sksewell@umich.edu
1314661Sksewell@umich.edu
1324661Sksewell@umich.edu  // BadVAddr Register - CP0 Reg 8, Sel 0
1334661Sksewell@umich.edu  const unsigned BadVAddr_HI = 31;
1344661Sksewell@umich.edu  const unsigned BadVAddr_LO = 0;
1354661Sksewell@umich.edu
1364661Sksewell@umich.edu  // Count Register - CP0 Reg 9, Sel 0
1374661Sksewell@umich.edu  const unsigned Count_HI = 31;
1384661Sksewell@umich.edu  const unsigned Count_LO = 0;
1394661Sksewell@umich.edu
1404661Sksewell@umich.edu  // EntryHI Register - CP0 Reg 10, Sel 0
1415222Sksewell@umich.edu  const unsigned EntryHi_VPN2_HI = 31;  // This field is written by hardware on a TLB exception or on a TLB read
1425222Sksewell@umich.edu  const unsigned EntryHi_VPN2_LO = 13;  // and is written by software before a TLB write
1435222Sksewell@umich.edu  const unsigned EntryHi_VPN2X_HI = 12; // Extension to support 1KB pages
1445222Sksewell@umich.edu  const unsigned EntryHi_VPN2X_LO = 11;
1455222Sksewell@umich.edu  const unsigned EntryHi_ASID_HI = 7; // Address space identifier
1465222Sksewell@umich.edu  const unsigned EntryHi_ASID_LO = 0;
1474661Sksewell@umich.edu
1484661Sksewell@umich.edu  // Compare Register - CP0 Reg 11, Sel 0
1494661Sksewell@umich.edu  const unsigned Compare_HI = 31; // Used in conjunction with Count
1504661Sksewell@umich.edu  const unsigned Compare_LO = 0;
1514661Sksewell@umich.edu
1524661Sksewell@umich.edu  // Status Register - CP Reg 12, Sel 0
1534661Sksewell@umich.edu  const unsigned Status_IE_HI = 0;
1544661Sksewell@umich.edu  const unsigned Status_IE_LO = 0;
1554661Sksewell@umich.edu
1565222Sksewell@umich.edu  const unsigned Status_EXL = 1;
1574661Sksewell@umich.edu  const unsigned Status_EXL_HI = 1;
1584661Sksewell@umich.edu  const unsigned Status_EXL_LO = 1;
1594661Sksewell@umich.edu  const unsigned Status_ERL_HI = 2;
1604661Sksewell@umich.edu  const unsigned Status_ERL_LO = 2;
1614661Sksewell@umich.edu  const unsigned Status_R0 = 3;
1624661Sksewell@umich.edu  const unsigned Status_UM = 4;
1634661Sksewell@umich.edu  const unsigned Status_KSU_HI = 4;  // R0 and UM are also aliased as KSU
1644661Sksewell@umich.edu  const unsigned Status_KSU_LO = 3;
1654661Sksewell@umich.edu  const unsigned Status_UX = 5;
1664661Sksewell@umich.edu  const unsigned Status_SX = 6;
1674661Sksewell@umich.edu  const unsigned Status_KX = 7;
1684661Sksewell@umich.edu  const unsigned Status_IM0 = 8;
1694661Sksewell@umich.edu  const unsigned Status_IM1 = 9;
1704661Sksewell@umich.edu  const unsigned Status_IM2 = 10;
1714661Sksewell@umich.edu  const unsigned Status_IM3 = 11;
1724661Sksewell@umich.edu  const unsigned Status_IM4 = 12;
1734661Sksewell@umich.edu  const unsigned Status_IM5 = 13;
1744661Sksewell@umich.edu  const unsigned Status_IM6 = 14;
1754661Sksewell@umich.edu  const unsigned Status_IM7 = 15;
1764661Sksewell@umich.edu  const unsigned Status_IPL_HI = 15;  // IM7..IM2 are also aliased as IPL
1774661Sksewell@umich.edu  const unsigned Status_IPL_LO = 10;
1784661Sksewell@umich.edu  const unsigned Status_IMPL_HI = 17;
1794661Sksewell@umich.edu  const unsigned Status_IMPL_LO = 16;
1804661Sksewell@umich.edu  const unsigned Status_NMI = 19;
1814661Sksewell@umich.edu  const unsigned Status_SR = 20;
1824661Sksewell@umich.edu  const unsigned Status_TS = 21;
1834661Sksewell@umich.edu  const unsigned Status_BEV = 22;
1845222Sksewell@umich.edu  const unsigned Status_BEV_HI = 22;
1855222Sksewell@umich.edu  const unsigned Status_BEV_LO = 22;
1864661Sksewell@umich.edu  const unsigned Status_PX = 23;
1874661Sksewell@umich.edu  const unsigned Status_MX = 24;
1884661Sksewell@umich.edu  const unsigned Status_RE = 25;
1894661Sksewell@umich.edu  const unsigned Status_FR = 26;
1904661Sksewell@umich.edu  const unsigned Status_RP = 27;
1914661Sksewell@umich.edu  const unsigned Status_CU3_HI = 31;
1924661Sksewell@umich.edu  const unsigned Status_CU3_LO = 31;
1934661Sksewell@umich.edu  const unsigned Status_CU2_HI = 30;
1944661Sksewell@umich.edu  const unsigned Status_CU2_LO = 30;
1954661Sksewell@umich.edu  const unsigned Status_CU1_HI = 29;
1964661Sksewell@umich.edu  const unsigned Status_CU1_LO = 29;
1974661Sksewell@umich.edu  const unsigned Status_CU0_HI = 28;
1984661Sksewell@umich.edu  const unsigned Status_CU0_LO = 28;
1994661Sksewell@umich.edu
2004661Sksewell@umich.edu  // IntCtl Register - CP0 Reg 12, Sel 1
2014661Sksewell@umich.edu  // Interrupt System status and control
2024661Sksewell@umich.edu  const unsigned IntCtl_IPTI_HI = 31;
2034661Sksewell@umich.edu  const unsigned IntCtl_IPTI_LO = 29;
2044661Sksewell@umich.edu  const unsigned IntCtl_IPPCI_HI = 28;
2054661Sksewell@umich.edu  const unsigned IntCtl_IPPCI_LO = 26;
2064661Sksewell@umich.edu  const unsigned IntCtl_VS_HI = 9;
2074661Sksewell@umich.edu  const unsigned IntCtl_VS_LO = 5;
2084661Sksewell@umich.edu  // Bits 26-10, 4-0 are zeros
2094661Sksewell@umich.edu
2104661Sksewell@umich.edu  // SRSCtl Register - CP0 Reg 12, Sel 2
2114661Sksewell@umich.edu  // Shadow Register Set Status and Control
2124661Sksewell@umich.edu  const unsigned SRSCtl_HSS_HI=29; // Highest Shadow Set
2134661Sksewell@umich.edu  const unsigned SRSCtl_HSS_LO=26;
2144661Sksewell@umich.edu  const unsigned SRSCtl_EICSS_HI=21; //EIC interrupt mode shadow set
2154661Sksewell@umich.edu  const unsigned SRSCtl_EICSS_LO=18;
2164661Sksewell@umich.edu  const unsigned SRSCtl_ESS_HI=15; // Exception Shadow Set
2174661Sksewell@umich.edu  const unsigned SRSCtl_ESS_LO=12;
2184661Sksewell@umich.edu  const unsigned SRSCtl_PSS_HI=9; // Previous Shadow Set
2194661Sksewell@umich.edu  const unsigned SRSCtl_PSS_LO=6;
2204661Sksewell@umich.edu  const unsigned SRSCtl_CSS_HI=3; // Current Shadow Set
2214661Sksewell@umich.edu  const unsigned SRSCtl_CSS_LO=0;
2224661Sksewell@umich.edu
2234661Sksewell@umich.edu  // SRSMap Register - CP0 Reg 12, Sel 3
2244661Sksewell@umich.edu  // Shadow Set IPL mapping
2254661Sksewell@umich.edu  const unsigned SRSMap_SSV7_HI = 31; // Shadow sets for particular vector numbers (7..0)
2264661Sksewell@umich.edu  const unsigned SRSMap_SSV7_LO = 28;
2274661Sksewell@umich.edu  const unsigned SRSMap_SSV6_HI = 27;
2284661Sksewell@umich.edu  const unsigned SRSMap_SSV6_LO = 24;
2294661Sksewell@umich.edu  const unsigned SRSMap_SSV5_HI = 23;
2304661Sksewell@umich.edu  const unsigned SRSMap_SSV5_LO = 20;
2314661Sksewell@umich.edu  const unsigned SRSMap_SSV4_HI = 19;
2324661Sksewell@umich.edu  const unsigned SRSMap_SSV4_LO = 16;
2334661Sksewell@umich.edu  const unsigned SRSMap_SSV3_HI = 15;
2344661Sksewell@umich.edu  const unsigned SRSMap_SSV3_LO = 12;
2354661Sksewell@umich.edu  const unsigned SRSMap_SSV2_HI = 11;
2364661Sksewell@umich.edu  const unsigned SRSMap_SSV2_LO = 8;
2374661Sksewell@umich.edu  const unsigned SRSMap_SSV1_HI = 7;
2384661Sksewell@umich.edu  const unsigned SRSMap_SSV1_LO = 4;
2394661Sksewell@umich.edu  const unsigned SRSMap_SSV0_HI = 3;
2404661Sksewell@umich.edu  const unsigned SRSMap_SSV0_LO = 20;
2414661Sksewell@umich.edu
2424661Sksewell@umich.edu  // Cause Register - CP0 Reg 13, Sel 0
2435222Sksewell@umich.edu  const unsigned Cause_BD_HI = 31;
2445222Sksewell@umich.edu  const unsigned Cause_BD_LO = 31;
2455222Sksewell@umich.edu  const unsigned Cause_TI_HI = 30;
2465222Sksewell@umich.edu  const unsigned Cause_TI_LO = 30;
2474661Sksewell@umich.edu  const unsigned Cause_CE_HI = 29;
2484661Sksewell@umich.edu  const unsigned Cause_CE_LO = 28;
2494661Sksewell@umich.edu  const unsigned Cause_DC = 27;
2504661Sksewell@umich.edu  const unsigned Cause_PCI = 26;
2514661Sksewell@umich.edu  const unsigned Cause_IV = 24;
2524661Sksewell@umich.edu  const unsigned Cause_WP = 23;
2534661Sksewell@umich.edu  const unsigned Cause_RIPL_HI = 15; // The individual bits of RIPL are also available as IP7..IP5
2544661Sksewell@umich.edu  const unsigned Cause_RIPL_LO = 10;
2554661Sksewell@umich.edu  const unsigned Cause_IP7 = 15;
2564661Sksewell@umich.edu  const unsigned Cause_IP6 = 14;
2574661Sksewell@umich.edu  const unsigned Cause_IP5 = 13;
2584661Sksewell@umich.edu  const unsigned Cause_IP4 = 12;
2594661Sksewell@umich.edu  const unsigned Cause_IP3 = 11;
2604661Sksewell@umich.edu  const unsigned Cause_IP2 = 10;
2614661Sksewell@umich.edu  const unsigned Cause_IP1 = 9;
2624661Sksewell@umich.edu  const unsigned Cause_IP0 = 8;
2634661Sksewell@umich.edu  const unsigned Cause_EXCCODE_HI = 6;
2644661Sksewell@umich.edu  const unsigned Cause_EXCCODE_LO = 2;
2654661Sksewell@umich.edu  // All intermediate undefined bits must be ZERO
2664661Sksewell@umich.edu
2674661Sksewell@umich.edu
2684661Sksewell@umich.edu  // EPC Register - CP0 Reg 14, Sel 0
2694661Sksewell@umich.edu  // Exception Program Counter
2704661Sksewell@umich.edu  const unsigned EPC_HI = 31;
2714661Sksewell@umich.edu  const unsigned EPC_LO = 0;
2724661Sksewell@umich.edu
2734661Sksewell@umich.edu  // PRId Register - CP0 Reg 15, Sel 0
2744661Sksewell@umich.edu  // Processor Identification register
2754661Sksewell@umich.edu  const unsigned PRIdCoOp_HI = 31;
2764661Sksewell@umich.edu  const unsigned PRIdCoOp_LO = 24;
2774661Sksewell@umich.edu  const unsigned PRIdCoID_HI = 23;
2784661Sksewell@umich.edu  const unsigned PRIdCoID_LO = 16;
2794661Sksewell@umich.edu  const unsigned PRIdProc_ID_HI = 15;
2804661Sksewell@umich.edu  const unsigned PRIdProc_ID_LO = 8;
2814661Sksewell@umich.edu  const unsigned PRIdRev_HI = 7;
2824661Sksewell@umich.edu  const unsigned PRIdRev_LO = 0;
2834661Sksewell@umich.edu
2844661Sksewell@umich.edu
2854661Sksewell@umich.edu  // EBase Register - CP0 Reg 15, Sel 1
2864661Sksewell@umich.edu  // Exception Base Register
2874661Sksewell@umich.edu  const unsigned EBase_MSB = 31; // MUST BE = 1
2884661Sksewell@umich.edu  const unsigned EBase_EXCEPTION_Base_HI = 29;
2894661Sksewell@umich.edu  const unsigned EBase_EXCEPTION_Base_LO = 12;
2904661Sksewell@umich.edu  const unsigned EBase_CPUNum_HI = 9;
2914661Sksewell@umich.edu  const unsigned EBase_CPUNum_LO = 0;
2924661Sksewell@umich.edu  // Undefined bits must be zero
2934661Sksewell@umich.edu
2944661Sksewell@umich.edu  // Config Register - CP0 Reg 16, Sel 0
2954661Sksewell@umich.edu  const unsigned Config_M = 31;
2964661Sksewell@umich.edu  const unsigned Config_K23_HI = 30;
2974661Sksewell@umich.edu  const unsigned Config_K23_LO = 28;
2984661Sksewell@umich.edu  const unsigned Config_KU_HI = 27;
2994661Sksewell@umich.edu  const unsigned Config_KU_LO = 25;
3004661Sksewell@umich.edu  const unsigned Config_IMPL_HI = 24;
3014661Sksewell@umich.edu  const unsigned Config_IMPL_LO = 16;
3025222Sksewell@umich.edu  const unsigned Config_BE_HI = 15;
3035222Sksewell@umich.edu  const unsigned Config_BE_LO = 15;
3044661Sksewell@umich.edu  const unsigned Config_AT_HI = 14;
3054661Sksewell@umich.edu  const unsigned Config_AT_LO = 13;
3064661Sksewell@umich.edu  const unsigned Config_AR_HI = 12;
3074661Sksewell@umich.edu  const unsigned Config_AR_LO = 10;
3084661Sksewell@umich.edu  const unsigned Config_MT_HI = 9;
3094661Sksewell@umich.edu  const unsigned Config_MT_LO = 7;
3105222Sksewell@umich.edu  const unsigned Config_VI_HI = 3;
3115222Sksewell@umich.edu  const unsigned Config_VI_LO = 3;
3124661Sksewell@umich.edu  const unsigned Config_K0_HI = 2;
3134661Sksewell@umich.edu  const unsigned Config_K0_LO = 0;
3144661Sksewell@umich.edu
3154661Sksewell@umich.edu  // Config1 Register - CP0 Reg 16, Sel 1
3164661Sksewell@umich.edu  const unsigned Config1_M = 31;
3174661Sksewell@umich.edu  const unsigned Config1_MMUSize_HI = 30;
3184661Sksewell@umich.edu  const unsigned Config1_MMUSize_LO = 25;
3194661Sksewell@umich.edu  const unsigned Config1_IS_HI = 24;
3204661Sksewell@umich.edu  const unsigned Config1_IS_LO = 22;
3214661Sksewell@umich.edu  const unsigned Config1_IL_HI = 21;
3224661Sksewell@umich.edu  const unsigned Config1_IL_LO = 19;
3234661Sksewell@umich.edu  const unsigned Config1_IA_HI = 18;
3244661Sksewell@umich.edu  const unsigned Config1_IA_LO = 16;
3254661Sksewell@umich.edu  const unsigned Config1_DS_HI = 15;
3264661Sksewell@umich.edu  const unsigned Config1_DS_LO = 13;
3274661Sksewell@umich.edu  const unsigned Config1_DL_HI = 12;
3284661Sksewell@umich.edu  const unsigned Config1_DL_LO = 10;
3294661Sksewell@umich.edu  const unsigned Config1_DA_HI = 9;
3304661Sksewell@umich.edu  const unsigned Config1_DA_LO = 7;
3315222Sksewell@umich.edu  const unsigned Config1_C2_HI = 6;
3325222Sksewell@umich.edu  const unsigned Config1_C2_LO = 6;
3335222Sksewell@umich.edu  const unsigned Config1_MD_HI = 5;
3345222Sksewell@umich.edu  const unsigned Config1_MD_LO = 5;
3355222Sksewell@umich.edu  const unsigned Config1_PC_HI = 4;
3365222Sksewell@umich.edu  const unsigned Config1_PC_LO = 4;
3375222Sksewell@umich.edu  const unsigned Config1_WR_HI = 3;
3385222Sksewell@umich.edu  const unsigned Config1_WR_LO = 3;
3395222Sksewell@umich.edu  const unsigned Config1_CA_HI = 2;
3405222Sksewell@umich.edu  const unsigned Config1_CA_LO = 2;
3415222Sksewell@umich.edu  const unsigned Config1_EP_HI = 1;
3425222Sksewell@umich.edu  const unsigned Config1_EP_LO = 1;
3435222Sksewell@umich.edu  const unsigned Config1_FP_HI = 0;
3445222Sksewell@umich.edu  const unsigned Config1_FP_LO = 0;
3454661Sksewell@umich.edu
3464661Sksewell@umich.edu
3474661Sksewell@umich.edu  // Config2 Register - CP0 Reg 16, Sel 2
3484661Sksewell@umich.edu  const unsigned Config2_M = 31;
3494661Sksewell@umich.edu  const unsigned Config2_TU_HI = 30;
3504661Sksewell@umich.edu  const unsigned Config2_TU_LO = 28;
3514661Sksewell@umich.edu  const unsigned Config2_TS_HI = 27;
3524661Sksewell@umich.edu  const unsigned Config2_TS_LO = 24;
3534661Sksewell@umich.edu  const unsigned Config2_TL_HI = 23;
3544661Sksewell@umich.edu  const unsigned Config2_TL_LO = 20;
3554661Sksewell@umich.edu  const unsigned Config2_TA_HI = 19;
3564661Sksewell@umich.edu  const unsigned Config2_TA_LO = 16;
3574661Sksewell@umich.edu  const unsigned Config2_SU_HI = 15;
3584661Sksewell@umich.edu  const unsigned Config2_SU_LO = 12;
3594661Sksewell@umich.edu  const unsigned Config2_SS_HI = 11;
3604661Sksewell@umich.edu  const unsigned Config2_SS_LO = 8;
3614661Sksewell@umich.edu  const unsigned Config2_SL_HI = 7;
3624661Sksewell@umich.edu  const unsigned Config2_SL_LO = 4;
3634661Sksewell@umich.edu  const unsigned Config2_SA_HI = 3;
3644661Sksewell@umich.edu  const unsigned Config2_SA_LO = 0;
3654661Sksewell@umich.edu
3664661Sksewell@umich.edu  // Config3 Register - CP0 Reg 16, Sel 3
3674661Sksewell@umich.edu  const unsigned Config3_M = 31;
3685222Sksewell@umich.edu  const unsigned Config3_DSPP_HI = 10;
3695222Sksewell@umich.edu  const unsigned Config3_DSPP_LO = 10;
3705222Sksewell@umich.edu  const unsigned Config3_LPA_HI=7;
3715222Sksewell@umich.edu  const unsigned Config3_LPA_LO=7;
3725222Sksewell@umich.edu  const unsigned Config3_VEIC_HI=6;
3735222Sksewell@umich.edu  const unsigned Config3_VEIC_LO=6;
3745222Sksewell@umich.edu  const unsigned Config3_VINT_HI=5;
3755222Sksewell@umich.edu  const unsigned Config3_VINT_LO=5;
3764661Sksewell@umich.edu  const unsigned Config3_SP=4;
3775222Sksewell@umich.edu  const unsigned Config3_SP_HI=4;
3785222Sksewell@umich.edu  const unsigned Config3_SP_LO=4;
3795222Sksewell@umich.edu  const unsigned Config3_MT_HI=2;
3805222Sksewell@umich.edu  const unsigned Config3_MT_LO=2;
3815222Sksewell@umich.edu  const unsigned Config3_SM_HI=1;
3825222Sksewell@umich.edu  const unsigned Config3_SM_LO=1;
3835222Sksewell@umich.edu  const unsigned Config3_TL_HI=0;
3845222Sksewell@umich.edu  const unsigned Config3_TL_LO=0;
3854661Sksewell@umich.edu
3864661Sksewell@umich.edu
3874661Sksewell@umich.edu  // LLAddr Register - CP0 Reg 17, Sel 0
3884661Sksewell@umich.edu  // Load Linked Address (Physical)
3894661Sksewell@umich.edu  const unsigned LLAddr_PAddr_HI = 31;
3904661Sksewell@umich.edu  const unsigned LLAddr_PAddr_LO = 0;
3914661Sksewell@umich.edu
3924661Sksewell@umich.edu
3934661Sksewell@umich.edu
3944661Sksewell@umich.edu  // WatchLo Register - CP0 Reg 18, Sel 0-n
3954661Sksewell@umich.edu  // See WatchHi to determine how many pairs of these registers are available
3964661Sksewell@umich.edu  const unsigned WatchLo_VAddr_HI = 31;
3974661Sksewell@umich.edu  const unsigned WatchLo_VAddr_LO = 3;
3984661Sksewell@umich.edu  const unsigned WatchLo_I = 2;
3994661Sksewell@umich.edu  const unsigned WatchLo_R = 1;
4004661Sksewell@umich.edu  const unsigned WatchLo_W = 0;
4014661Sksewell@umich.edu
4024661Sksewell@umich.edu
4034661Sksewell@umich.edu  // WatchHi Register - CP0 Reg 19, Sel 0-n
4044661Sksewell@umich.edu  const unsigned WatchHi_M = 31; // If M = 1, another pair of WatchHi/Lo registers exist
4054661Sksewell@umich.edu  const unsigned WatchHi_G = 30;
4064661Sksewell@umich.edu  const unsigned WatchHi_ASID_HI = 23;
4074661Sksewell@umich.edu  const unsigned WatchHi_ASID_LO = 16;
4084661Sksewell@umich.edu  const unsigned WatchHi_Mask_HI = 11;
4094661Sksewell@umich.edu  const unsigned WatchHi_Mask_LO = 3;
4104661Sksewell@umich.edu  const unsigned WatchHi_I = 2;
4114661Sksewell@umich.edu  const unsigned WatchHi_R = 1;
4124661Sksewell@umich.edu  const unsigned WatchHi_W = 0;
4134661Sksewell@umich.edu
4144661Sksewell@umich.edu  // Debug Register - CP0 Reg 23, Sel 0
4154661Sksewell@umich.edu
4164661Sksewell@umich.edu  // TraceControl Register - CP0 Reg 23, Sel 1
4174661Sksewell@umich.edu  // TraceControl2 Register - CP0 Reg 23, Sel 2
4184661Sksewell@umich.edu  // UserTraceData Register - CP0 Reg 23, Sel 3
4194661Sksewell@umich.edu  // TraceBPC Register - CP0 Reg 23, Sel 4
4204661Sksewell@umich.edu  // DEPC Register - CP0 Reg 24, Sel 0
4214661Sksewell@umich.edu
4224661Sksewell@umich.edu
4234661Sksewell@umich.edu  // PerfCnt Register - CP0 Reg 25, Sel 0-n
4244661Sksewell@umich.edu  // Each Perf. counter that exists is mapped onto even-odd select pairs of Reg 25
4254661Sksewell@umich.edu  // Even values are control registers, odd values are the actual counter
4264661Sksewell@umich.edu  // The format for the control reg is:
4274661Sksewell@umich.edu  const unsigned PerfCntCtl_M = 31; // Is there another pair of perf counter registers?
4284661Sksewell@umich.edu  const unsigned PerfCntCtl_W = 30;
4294661Sksewell@umich.edu  const unsigned PerfCntCtl_Event_HI = 10;
4304661Sksewell@umich.edu  const unsigned PerfCntCtl_Event_LO = 5;
4314661Sksewell@umich.edu  const unsigned PerfCntCtl_IE = 4;
4324661Sksewell@umich.edu  const unsigned PerfCntCtl_U = 3;
4334661Sksewell@umich.edu  const unsigned PerfCntCtl_S = 2;
4344661Sksewell@umich.edu  const unsigned PerfCntCtl_K = 1;
4354661Sksewell@umich.edu  const unsigned PerfCntCtl_EXL = 0;
4364661Sksewell@umich.edu
4374661Sksewell@umich.edu  // The format for the counter is a 32-bit value (or 64-bit for MIPS64)
4384661Sksewell@umich.edu  const unsigned PerfCnt_Count_HI = 31;
4394661Sksewell@umich.edu  const unsigned PerfCnt_Count_LO = 0;
4404661Sksewell@umich.edu
4414661Sksewell@umich.edu  // ErrCtl Register - CP0 Reg 26, Sel 0
4424661Sksewell@umich.edu  // This is implementation dependent, not defined by the ISA
4434661Sksewell@umich.edu
4444661Sksewell@umich.edu  // CacheErr Register - CP0 Reg 27, Sel 0
4454661Sksewell@umich.edu  // NOTE: Page 65 of the ARM, Volume-III indicates that there are four sel. values (0-3)
4464661Sksewell@umich.edu  // used by the CacheErr registers. However, on page 134, only one sel value is shown
4474661Sksewell@umich.edu  const unsigned Cache_Err_ER = 31;
4484661Sksewell@umich.edu  const unsigned Cache_Err_EC = 30;
4494661Sksewell@umich.edu  const unsigned Cache_Err_ED = 29;
4504661Sksewell@umich.edu  const unsigned Cache_Err_ET = 28;
4514661Sksewell@umich.edu  const unsigned Cache_Err_ES = 27;
4524661Sksewell@umich.edu  const unsigned Cache_Err_EE = 26;
4534661Sksewell@umich.edu  const unsigned Cache_Err_EB = 25;
4544661Sksewell@umich.edu  const unsigned Cache_Err_IMPL_HI = 24;
4554661Sksewell@umich.edu  const unsigned Cache_Err_IMPL_LO = 22;
4564661Sksewell@umich.edu  const unsigned Cache_Err_Index_HI = 21;
4574661Sksewell@umich.edu  const unsigned Cache_Err_Index_LO = 0;
4584661Sksewell@umich.edu
4594661Sksewell@umich.edu  // TagLo Register - CP0 Reg 28 - Even Selects (0,2)
4604661Sksewell@umich.edu  const unsigned TagLo_PTagLo_HI = 31;
4614661Sksewell@umich.edu  const unsigned TagLo_PTagLo_LO = 8;
4624661Sksewell@umich.edu  const unsigned TagLo_PState_HI = 7;
4634661Sksewell@umich.edu  const unsigned TagLo_PState_LO = 6;
4644661Sksewell@umich.edu  const unsigned TagLo_L = 5;
4654661Sksewell@umich.edu  const unsigned TagLo_IMPL_HI = 4;
4664661Sksewell@umich.edu  const unsigned TagLo_IMPL_LO = 3;
4674661Sksewell@umich.edu  const unsigned TagLo_P = 0;
4684661Sksewell@umich.edu  // undefined bits must be written 0
4694661Sksewell@umich.edu
4704661Sksewell@umich.edu
4714661Sksewell@umich.edu  // DataLo Register - CP0 Reg 28 - Odd Selects (1,3)
4724661Sksewell@umich.edu  const unsigned DataLo_HI = 31;
4734661Sksewell@umich.edu  const unsigned DataLo_LO = 0;
4744661Sksewell@umich.edu
4754661Sksewell@umich.edu  // TagHi Register - CP0 Reg 29 - Even Selects (0,2)
4764661Sksewell@umich.edu  // Not defined by the architecture
4774661Sksewell@umich.edu
4784661Sksewell@umich.edu  // DataHi Register - CP0 Reg 29 - Odd Selects (1,3)
4794661Sksewell@umich.edu  const unsigned DataHi_HI = 31;
4804661Sksewell@umich.edu  const unsigned DataHi_LO = 0;
4814661Sksewell@umich.edu
4824661Sksewell@umich.edu
4834661Sksewell@umich.edu  // ErrorEPC - CP0 Reg 30, Sel 0
4844661Sksewell@umich.edu  const unsigned ErrorPC_HI = 31;
4854661Sksewell@umich.edu  const unsigned ErrorPC_LO = 0;
4864661Sksewell@umich.edu
4874661Sksewell@umich.edu  // DESAVE - CP0 Reg 31, Sel 0
4884661Sksewell@umich.edu
4894661Sksewell@umich.edu
4904661Sksewell@umich.edu
4914661Sksewell@umich.edu
4924661Sksewell@umich.edu
4934661Sksewell@umich.edu} // namespace MipsISA
4944661Sksewell@umich.edu
4954661Sksewell@umich.edu#endif
496