miscregs.hh revision 6329
16329Sgblack@eecs.umich.edu/*
26329Sgblack@eecs.umich.edu * Copyright (c) 2003-2005 The Regents of The University of Michigan
36329Sgblack@eecs.umich.edu * All rights reserved.
46329Sgblack@eecs.umich.edu *
56329Sgblack@eecs.umich.edu * Redistribution and use in source and binary forms, with or without
66329Sgblack@eecs.umich.edu * modification, are permitted provided that the following conditions are
76329Sgblack@eecs.umich.edu * met: redistributions of source code must retain the above copyright
86329Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer;
96329Sgblack@eecs.umich.edu * redistributions in binary form must reproduce the above copyright
106329Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer in the
116329Sgblack@eecs.umich.edu * documentation and/or other materials provided with the distribution;
126329Sgblack@eecs.umich.edu * neither the name of the copyright holders nor the names of its
136329Sgblack@eecs.umich.edu * contributors may be used to endorse or promote products derived from
146329Sgblack@eecs.umich.edu * this software without specific prior written permission.
156329Sgblack@eecs.umich.edu *
166329Sgblack@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
176329Sgblack@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
186329Sgblack@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
196329Sgblack@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
206329Sgblack@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
216329Sgblack@eecs.umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
226329Sgblack@eecs.umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
236329Sgblack@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
246329Sgblack@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
256329Sgblack@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
266329Sgblack@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
276329Sgblack@eecs.umich.edu *
286329Sgblack@eecs.umich.edu * Authors: Gabe Black
296329Sgblack@eecs.umich.edu *          Ali Saidi
306329Sgblack@eecs.umich.edu */
316329Sgblack@eecs.umich.edu
326329Sgblack@eecs.umich.edu#ifndef __ARCH_SPARC_MISCREGS_HH__
336329Sgblack@eecs.umich.edu#define __ARCH_SPARC_MISCREGS_HH__
346329Sgblack@eecs.umich.edu
356329Sgblack@eecs.umich.edu#include "base/types.hh"
366329Sgblack@eecs.umich.edu
376329Sgblack@eecs.umich.edunamespace SparcISA
386329Sgblack@eecs.umich.edu{
396329Sgblack@eecs.umich.edu    enum MiscRegIndex
406329Sgblack@eecs.umich.edu    {
416329Sgblack@eecs.umich.edu        /** Ancillary State Registers */
426329Sgblack@eecs.umich.edu//        MISCREG_Y,
436329Sgblack@eecs.umich.edu//        MISCREG_CCR,
446329Sgblack@eecs.umich.edu        MISCREG_ASI,
456329Sgblack@eecs.umich.edu        MISCREG_TICK,
466329Sgblack@eecs.umich.edu        MISCREG_FPRS,
476329Sgblack@eecs.umich.edu        MISCREG_PCR,
486329Sgblack@eecs.umich.edu        MISCREG_PIC,
496329Sgblack@eecs.umich.edu        MISCREG_GSR,
506329Sgblack@eecs.umich.edu        MISCREG_SOFTINT_SET,
516329Sgblack@eecs.umich.edu        MISCREG_SOFTINT_CLR,
526329Sgblack@eecs.umich.edu        MISCREG_SOFTINT, /* 10 */
536329Sgblack@eecs.umich.edu        MISCREG_TICK_CMPR,
546329Sgblack@eecs.umich.edu        MISCREG_STICK,
556329Sgblack@eecs.umich.edu        MISCREG_STICK_CMPR,
566329Sgblack@eecs.umich.edu
576329Sgblack@eecs.umich.edu        /** Privilged Registers */
586329Sgblack@eecs.umich.edu        MISCREG_TPC,
596329Sgblack@eecs.umich.edu        MISCREG_TNPC,
606329Sgblack@eecs.umich.edu        MISCREG_TSTATE,
616329Sgblack@eecs.umich.edu        MISCREG_TT,
626329Sgblack@eecs.umich.edu        MISCREG_PRIVTICK,
636329Sgblack@eecs.umich.edu        MISCREG_TBA,
646329Sgblack@eecs.umich.edu        MISCREG_PSTATE, /* 20 */
656329Sgblack@eecs.umich.edu        MISCREG_TL,
666329Sgblack@eecs.umich.edu        MISCREG_PIL,
676329Sgblack@eecs.umich.edu        MISCREG_CWP,
686329Sgblack@eecs.umich.edu//        MISCREG_CANSAVE,
696329Sgblack@eecs.umich.edu//        MISCREG_CANRESTORE,
706329Sgblack@eecs.umich.edu//        MISCREG_CLEANWIN,
716329Sgblack@eecs.umich.edu//        MISCREG_OTHERWIN,
726329Sgblack@eecs.umich.edu//        MISCREG_WSTATE,
736329Sgblack@eecs.umich.edu        MISCREG_GL,
746329Sgblack@eecs.umich.edu
756329Sgblack@eecs.umich.edu        /** Hyper privileged registers */
766329Sgblack@eecs.umich.edu        MISCREG_HPSTATE, /* 30 */
776329Sgblack@eecs.umich.edu        MISCREG_HTSTATE,
786329Sgblack@eecs.umich.edu        MISCREG_HINTP,
796329Sgblack@eecs.umich.edu        MISCREG_HTBA,
806329Sgblack@eecs.umich.edu        MISCREG_HVER,
816329Sgblack@eecs.umich.edu        MISCREG_STRAND_STS_REG,
826329Sgblack@eecs.umich.edu        MISCREG_HSTICK_CMPR,
836329Sgblack@eecs.umich.edu
846329Sgblack@eecs.umich.edu        /** Floating Point Status Register */
856329Sgblack@eecs.umich.edu        MISCREG_FSR,
866329Sgblack@eecs.umich.edu
876329Sgblack@eecs.umich.edu        /** MMU Internal Registers */
886329Sgblack@eecs.umich.edu        MISCREG_MMU_P_CONTEXT,
896329Sgblack@eecs.umich.edu        MISCREG_MMU_S_CONTEXT, /* 40 */
906329Sgblack@eecs.umich.edu        MISCREG_MMU_PART_ID,
916329Sgblack@eecs.umich.edu        MISCREG_MMU_LSU_CTRL,
926329Sgblack@eecs.umich.edu
936329Sgblack@eecs.umich.edu        /** Scratchpad regiscers **/
946329Sgblack@eecs.umich.edu        MISCREG_SCRATCHPAD_R0, /* 60 */
956329Sgblack@eecs.umich.edu        MISCREG_SCRATCHPAD_R1,
966329Sgblack@eecs.umich.edu        MISCREG_SCRATCHPAD_R2,
976329Sgblack@eecs.umich.edu        MISCREG_SCRATCHPAD_R3,
986329Sgblack@eecs.umich.edu        MISCREG_SCRATCHPAD_R4,
996329Sgblack@eecs.umich.edu        MISCREG_SCRATCHPAD_R5,
1006329Sgblack@eecs.umich.edu        MISCREG_SCRATCHPAD_R6,
1016329Sgblack@eecs.umich.edu        MISCREG_SCRATCHPAD_R7,
1026329Sgblack@eecs.umich.edu
1036329Sgblack@eecs.umich.edu        /* CPU Queue Registers */
1046329Sgblack@eecs.umich.edu        MISCREG_QUEUE_CPU_MONDO_HEAD,
1056329Sgblack@eecs.umich.edu        MISCREG_QUEUE_CPU_MONDO_TAIL,
1066329Sgblack@eecs.umich.edu        MISCREG_QUEUE_DEV_MONDO_HEAD, /* 70 */
1076329Sgblack@eecs.umich.edu        MISCREG_QUEUE_DEV_MONDO_TAIL,
1086329Sgblack@eecs.umich.edu        MISCREG_QUEUE_RES_ERROR_HEAD,
1096329Sgblack@eecs.umich.edu        MISCREG_QUEUE_RES_ERROR_TAIL,
1106329Sgblack@eecs.umich.edu        MISCREG_QUEUE_NRES_ERROR_HEAD,
1116329Sgblack@eecs.umich.edu        MISCREG_QUEUE_NRES_ERROR_TAIL,
1126329Sgblack@eecs.umich.edu
1136329Sgblack@eecs.umich.edu        /* All the data for the TLB packed up in one register. */
1146329Sgblack@eecs.umich.edu        MISCREG_TLB_DATA,
1156329Sgblack@eecs.umich.edu        MISCREG_NUMMISCREGS
1166329Sgblack@eecs.umich.edu    };
1176329Sgblack@eecs.umich.edu
1186329Sgblack@eecs.umich.edu    struct HPSTATE {
1196329Sgblack@eecs.umich.edu        const static uint64_t id = 0x800;   // this impl. dependent (id) field m
1206329Sgblack@eecs.umich.edu        const static uint64_t ibe = 0x400;
1216329Sgblack@eecs.umich.edu        const static uint64_t red = 0x20;
1226329Sgblack@eecs.umich.edu        const static uint64_t hpriv = 0x4;
1236329Sgblack@eecs.umich.edu        const static uint64_t tlz = 0x1;
1246329Sgblack@eecs.umich.edu    };
1256329Sgblack@eecs.umich.edu
1266329Sgblack@eecs.umich.edu
1276329Sgblack@eecs.umich.edu    struct PSTATE {
1286329Sgblack@eecs.umich.edu        const static int cle = 0x200;
1296329Sgblack@eecs.umich.edu        const static int tle = 0x100;
1306329Sgblack@eecs.umich.edu        const static int mm = 0xC0;
1316329Sgblack@eecs.umich.edu        const static int pef = 0x10;
1326329Sgblack@eecs.umich.edu        const static int am = 0x8;
1336329Sgblack@eecs.umich.edu        const static int priv = 0x4;
1346329Sgblack@eecs.umich.edu        const static int ie = 0x2;
1356329Sgblack@eecs.umich.edu    };
1366329Sgblack@eecs.umich.edu
1376329Sgblack@eecs.umich.edu    struct STS {
1386329Sgblack@eecs.umich.edu        const static int st_idle     = 0x00;
1396329Sgblack@eecs.umich.edu        const static int st_wait     = 0x01;
1406329Sgblack@eecs.umich.edu        const static int st_halt     = 0x02;
1416329Sgblack@eecs.umich.edu        const static int st_run      = 0x05;
1426329Sgblack@eecs.umich.edu        const static int st_spec_run = 0x07;
1436329Sgblack@eecs.umich.edu        const static int st_spec_rdy = 0x13;
1446329Sgblack@eecs.umich.edu        const static int st_ready    = 0x19;
1456329Sgblack@eecs.umich.edu        const static int active      = 0x01;
1466329Sgblack@eecs.umich.edu        const static int speculative = 0x04;
1476329Sgblack@eecs.umich.edu        const static int shft_id     = 8;
1486329Sgblack@eecs.umich.edu        const static int shft_fsm0   = 31;
1496329Sgblack@eecs.umich.edu        const static int shft_fsm1   = 26;
1506329Sgblack@eecs.umich.edu        const static int shft_fsm2   = 21;
1516329Sgblack@eecs.umich.edu        const static int shft_fsm3   = 16;
1526329Sgblack@eecs.umich.edu    };
1536329Sgblack@eecs.umich.edu
1546329Sgblack@eecs.umich.edu
1556329Sgblack@eecs.umich.edu    const int NumMiscArchRegs = MISCREG_NUMMISCREGS;
1566329Sgblack@eecs.umich.edu    const int NumMiscRegs = MISCREG_NUMMISCREGS;
1576329Sgblack@eecs.umich.edu}
1586329Sgblack@eecs.umich.edu
1596329Sgblack@eecs.umich.edu#endif
160