miscregs.hh revision 8829
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
358829Sgblack@eecs.umich.edu#include "base/bitunion.hh"
366329Sgblack@eecs.umich.edu#include "base/types.hh"
376329Sgblack@eecs.umich.edu
386329Sgblack@eecs.umich.edunamespace SparcISA
396329Sgblack@eecs.umich.edu{
407741Sgblack@eecs.umich.eduenum MiscRegIndex
417741Sgblack@eecs.umich.edu{
427741Sgblack@eecs.umich.edu    /** Ancillary State Registers */
437741Sgblack@eecs.umich.edu//    MISCREG_Y,
447741Sgblack@eecs.umich.edu//    MISCREG_CCR,
457741Sgblack@eecs.umich.edu    MISCREG_ASI,
467741Sgblack@eecs.umich.edu    MISCREG_TICK,
477741Sgblack@eecs.umich.edu    MISCREG_FPRS,
487741Sgblack@eecs.umich.edu    MISCREG_PCR,
497741Sgblack@eecs.umich.edu    MISCREG_PIC,
507741Sgblack@eecs.umich.edu    MISCREG_GSR,
517741Sgblack@eecs.umich.edu    MISCREG_SOFTINT_SET,
527741Sgblack@eecs.umich.edu    MISCREG_SOFTINT_CLR,
537741Sgblack@eecs.umich.edu    MISCREG_SOFTINT, /* 10 */
547741Sgblack@eecs.umich.edu    MISCREG_TICK_CMPR,
557741Sgblack@eecs.umich.edu    MISCREG_STICK,
567741Sgblack@eecs.umich.edu    MISCREG_STICK_CMPR,
576329Sgblack@eecs.umich.edu
587741Sgblack@eecs.umich.edu    /** Privilged Registers */
597741Sgblack@eecs.umich.edu    MISCREG_TPC,
607741Sgblack@eecs.umich.edu    MISCREG_TNPC,
617741Sgblack@eecs.umich.edu    MISCREG_TSTATE,
627741Sgblack@eecs.umich.edu    MISCREG_TT,
637741Sgblack@eecs.umich.edu    MISCREG_PRIVTICK,
647741Sgblack@eecs.umich.edu    MISCREG_TBA,
657741Sgblack@eecs.umich.edu    MISCREG_PSTATE, /* 20 */
667741Sgblack@eecs.umich.edu    MISCREG_TL,
677741Sgblack@eecs.umich.edu    MISCREG_PIL,
687741Sgblack@eecs.umich.edu    MISCREG_CWP,
697741Sgblack@eecs.umich.edu//    MISCREG_CANSAVE,
707741Sgblack@eecs.umich.edu//    MISCREG_CANRESTORE,
717741Sgblack@eecs.umich.edu//    MISCREG_CLEANWIN,
727741Sgblack@eecs.umich.edu//    MISCREG_OTHERWIN,
737741Sgblack@eecs.umich.edu//    MISCREG_WSTATE,
747741Sgblack@eecs.umich.edu    MISCREG_GL,
756329Sgblack@eecs.umich.edu
767741Sgblack@eecs.umich.edu    /** Hyper privileged registers */
777741Sgblack@eecs.umich.edu    MISCREG_HPSTATE, /* 30 */
787741Sgblack@eecs.umich.edu    MISCREG_HTSTATE,
797741Sgblack@eecs.umich.edu    MISCREG_HINTP,
807741Sgblack@eecs.umich.edu    MISCREG_HTBA,
817741Sgblack@eecs.umich.edu    MISCREG_HVER,
827741Sgblack@eecs.umich.edu    MISCREG_STRAND_STS_REG,
837741Sgblack@eecs.umich.edu    MISCREG_HSTICK_CMPR,
846329Sgblack@eecs.umich.edu
857741Sgblack@eecs.umich.edu    /** Floating Point Status Register */
867741Sgblack@eecs.umich.edu    MISCREG_FSR,
876329Sgblack@eecs.umich.edu
887741Sgblack@eecs.umich.edu    /** MMU Internal Registers */
897741Sgblack@eecs.umich.edu    MISCREG_MMU_P_CONTEXT,
907741Sgblack@eecs.umich.edu    MISCREG_MMU_S_CONTEXT, /* 40 */
917741Sgblack@eecs.umich.edu    MISCREG_MMU_PART_ID,
927741Sgblack@eecs.umich.edu    MISCREG_MMU_LSU_CTRL,
936329Sgblack@eecs.umich.edu
947741Sgblack@eecs.umich.edu    /** Scratchpad regiscers **/
957741Sgblack@eecs.umich.edu    MISCREG_SCRATCHPAD_R0, /* 60 */
967741Sgblack@eecs.umich.edu    MISCREG_SCRATCHPAD_R1,
977741Sgblack@eecs.umich.edu    MISCREG_SCRATCHPAD_R2,
987741Sgblack@eecs.umich.edu    MISCREG_SCRATCHPAD_R3,
997741Sgblack@eecs.umich.edu    MISCREG_SCRATCHPAD_R4,
1007741Sgblack@eecs.umich.edu    MISCREG_SCRATCHPAD_R5,
1017741Sgblack@eecs.umich.edu    MISCREG_SCRATCHPAD_R6,
1027741Sgblack@eecs.umich.edu    MISCREG_SCRATCHPAD_R7,
1036329Sgblack@eecs.umich.edu
1047741Sgblack@eecs.umich.edu    /* CPU Queue Registers */
1057741Sgblack@eecs.umich.edu    MISCREG_QUEUE_CPU_MONDO_HEAD,
1067741Sgblack@eecs.umich.edu    MISCREG_QUEUE_CPU_MONDO_TAIL,
1077741Sgblack@eecs.umich.edu    MISCREG_QUEUE_DEV_MONDO_HEAD, /* 70 */
1087741Sgblack@eecs.umich.edu    MISCREG_QUEUE_DEV_MONDO_TAIL,
1097741Sgblack@eecs.umich.edu    MISCREG_QUEUE_RES_ERROR_HEAD,
1107741Sgblack@eecs.umich.edu    MISCREG_QUEUE_RES_ERROR_TAIL,
1117741Sgblack@eecs.umich.edu    MISCREG_QUEUE_NRES_ERROR_HEAD,
1127741Sgblack@eecs.umich.edu    MISCREG_QUEUE_NRES_ERROR_TAIL,
1136329Sgblack@eecs.umich.edu
1147741Sgblack@eecs.umich.edu    /* All the data for the TLB packed up in one register. */
1157741Sgblack@eecs.umich.edu    MISCREG_TLB_DATA,
1167741Sgblack@eecs.umich.edu    MISCREG_NUMMISCREGS
1177741Sgblack@eecs.umich.edu};
1186329Sgblack@eecs.umich.edu
1198829Sgblack@eecs.umich.eduBitUnion64(HPSTATE)
1208829Sgblack@eecs.umich.edu    Bitfield<0> tlz;
1218829Sgblack@eecs.umich.edu    Bitfield<2> hpriv;
1228829Sgblack@eecs.umich.edu    Bitfield<5> red;
1238829Sgblack@eecs.umich.edu    Bitfield<10> ibe;
1248829Sgblack@eecs.umich.edu    Bitfield<11> id;  // this impl. dependent (id) field m
1258829Sgblack@eecs.umich.eduEndBitUnion(HPSTATE)
1266329Sgblack@eecs.umich.edu
1278829Sgblack@eecs.umich.eduBitUnion16(PSTATE)
1288829Sgblack@eecs.umich.edu    Bitfield<1> ie;
1298829Sgblack@eecs.umich.edu    Bitfield<2> priv;
1308829Sgblack@eecs.umich.edu    Bitfield<3> am;
1318829Sgblack@eecs.umich.edu    Bitfield<4> pef;
1328829Sgblack@eecs.umich.edu    Bitfield<6, 7> mm;
1338829Sgblack@eecs.umich.edu    Bitfield<8> tle;
1348829Sgblack@eecs.umich.edu    Bitfield<9> cle;
1358829Sgblack@eecs.umich.edu    Bitfield<10> pid0;
1368829Sgblack@eecs.umich.edu    Bitfield<11> pid1;
1378829Sgblack@eecs.umich.eduEndBitUnion(PSTATE)
1386329Sgblack@eecs.umich.edu
1397741Sgblack@eecs.umich.edustruct STS
1407741Sgblack@eecs.umich.edu{
1417741Sgblack@eecs.umich.edu    const static int st_idle     = 0x00;
1427741Sgblack@eecs.umich.edu    const static int st_wait     = 0x01;
1437741Sgblack@eecs.umich.edu    const static int st_halt     = 0x02;
1447741Sgblack@eecs.umich.edu    const static int st_run      = 0x05;
1457741Sgblack@eecs.umich.edu    const static int st_spec_run = 0x07;
1467741Sgblack@eecs.umich.edu    const static int st_spec_rdy = 0x13;
1477741Sgblack@eecs.umich.edu    const static int st_ready    = 0x19;
1487741Sgblack@eecs.umich.edu    const static int active      = 0x01;
1497741Sgblack@eecs.umich.edu    const static int speculative = 0x04;
1507741Sgblack@eecs.umich.edu    const static int shft_id     = 8;
1517741Sgblack@eecs.umich.edu    const static int shft_fsm0   = 31;
1527741Sgblack@eecs.umich.edu    const static int shft_fsm1   = 26;
1537741Sgblack@eecs.umich.edu    const static int shft_fsm2   = 21;
1547741Sgblack@eecs.umich.edu    const static int shft_fsm3   = 16;
1557741Sgblack@eecs.umich.edu};
1566329Sgblack@eecs.umich.edu
1576329Sgblack@eecs.umich.edu
1587741Sgblack@eecs.umich.educonst int NumMiscArchRegs = MISCREG_NUMMISCREGS;
1597741Sgblack@eecs.umich.educonst int NumMiscRegs = MISCREG_NUMMISCREGS;
1607741Sgblack@eecs.umich.edu
1616329Sgblack@eecs.umich.edu}
1626329Sgblack@eecs.umich.edu
1636329Sgblack@eecs.umich.edu#endif
164