12597SN/A/*
25251Sksewell@umich.edu * Copyright (c) 2007 MIPS Technologies, Inc.
35251Sksewell@umich.edu * All rights reserved.
42597SN/A *
55251Sksewell@umich.edu * Redistribution and use in source and binary forms, with or without
65251Sksewell@umich.edu * modification, are permitted provided that the following conditions are
75251Sksewell@umich.edu * met: redistributions of source code must retain the above copyright
85251Sksewell@umich.edu * notice, this list of conditions and the following disclaimer;
95251Sksewell@umich.edu * redistributions in binary form must reproduce the above copyright
105251Sksewell@umich.edu * notice, this list of conditions and the following disclaimer in the
115251Sksewell@umich.edu * documentation and/or other materials provided with the distribution;
125251Sksewell@umich.edu * neither the name of the copyright holders nor the names of its
135251Sksewell@umich.edu * contributors may be used to endorse or promote products derived from
145251Sksewell@umich.edu * this software without specific prior written permission.
152597SN/A *
165251Sksewell@umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
175251Sksewell@umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
185251Sksewell@umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
195251Sksewell@umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
205251Sksewell@umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
215251Sksewell@umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
225251Sksewell@umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
235251Sksewell@umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
245251Sksewell@umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
255251Sksewell@umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
265251Sksewell@umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
272665Ssaidi@eecs.umich.edu *
285251Sksewell@umich.edu * Authors: Korey Sewell
292597SN/A */
302597SN/A
312597SN/A#ifndef __ARCH_MIPS_TYPES_HH__
322597SN/A#define __ARCH_MIPS_TYPES_HH__
332597SN/A
347720Sgblack@eecs.umich.edu#include "arch/generic/types.hh"
356214Snate@binkert.org#include "base/types.hh"
362597SN/A
372597SN/Anamespace MipsISA
382597SN/A{
392597SN/A
406378Sgblack@eecs.umich.edutypedef uint32_t MachInst;
416378Sgblack@eecs.umich.edutypedef uint64_t ExtMachInst;
424040Ssaidi@eecs.umich.edu
437720Sgblack@eecs.umich.edutypedef GenericISA::DelaySlotPCState<MachInst> PCState;
447720Sgblack@eecs.umich.edu
456378Sgblack@eecs.umich.edu//used in FP convert & round function
466378Sgblack@eecs.umich.eduenum ConvertType{
476378Sgblack@eecs.umich.edu    SINGLE_TO_DOUBLE,
486378Sgblack@eecs.umich.edu    SINGLE_TO_WORD,
496378Sgblack@eecs.umich.edu    SINGLE_TO_LONG,
502597SN/A
516378Sgblack@eecs.umich.edu    DOUBLE_TO_SINGLE,
526378Sgblack@eecs.umich.edu    DOUBLE_TO_WORD,
536378Sgblack@eecs.umich.edu    DOUBLE_TO_LONG,
542597SN/A
556378Sgblack@eecs.umich.edu    LONG_TO_SINGLE,
566378Sgblack@eecs.umich.edu    LONG_TO_DOUBLE,
576378Sgblack@eecs.umich.edu    LONG_TO_WORD,
586378Sgblack@eecs.umich.edu    LONG_TO_PS,
592597SN/A
606378Sgblack@eecs.umich.edu    WORD_TO_SINGLE,
616378Sgblack@eecs.umich.edu    WORD_TO_DOUBLE,
626378Sgblack@eecs.umich.edu    WORD_TO_LONG,
636378Sgblack@eecs.umich.edu    WORD_TO_PS,
642597SN/A
656378Sgblack@eecs.umich.edu    PL_TO_SINGLE,
666378Sgblack@eecs.umich.edu    PU_TO_SINGLE
676378Sgblack@eecs.umich.edu};
686378Sgblack@eecs.umich.edu
696378Sgblack@eecs.umich.edu//used in FP convert & round function
706378Sgblack@eecs.umich.eduenum RoundMode{
716378Sgblack@eecs.umich.edu    RND_ZERO,
726378Sgblack@eecs.umich.edu    RND_DOWN,
736378Sgblack@eecs.umich.edu    RND_UP,
746378Sgblack@eecs.umich.edu    RND_NEAREST
756378Sgblack@eecs.umich.edu};
765004Sgblack@eecs.umich.edu
775251Sksewell@umich.edustruct CoreSpecific {
788181Sksewell@umich.edu    CoreSpecific()
798181Sksewell@umich.edu        : CP0_IntCtl_IPTI(0), CP0_IntCtl_IPPCI(0), CP0_SrsCtl_HSS(0),
808181Sksewell@umich.edu          CP0_PRId_CompanyOptions(0), CP0_PRId_CompanyID(0),
818181Sksewell@umich.edu          CP0_PRId_ProcessorID(0), CP0_PRId_Revision(0),
828181Sksewell@umich.edu          CP0_EBase_CPUNum(0), CP0_Config_BE(0), CP0_Config_AT(0),
838181Sksewell@umich.edu          CP0_Config_AR(0), CP0_Config_MT(0), CP0_Config_VI(0),
848181Sksewell@umich.edu          CP0_Config1_M(0), CP0_Config1_MMU(0), CP0_Config1_IS(0),
858181Sksewell@umich.edu          CP0_Config1_IL(0), CP0_Config1_IA(0), CP0_Config1_DS(0),
868181Sksewell@umich.edu          CP0_Config1_DL(0), CP0_Config1_DA(0), CP0_Config1_C2(false),
878181Sksewell@umich.edu          CP0_Config1_MD(false), CP0_Config1_PC(false), CP0_Config1_WR(false),
888181Sksewell@umich.edu          CP0_Config1_CA(false), CP0_Config1_EP(false), CP0_Config1_FP(false),
898181Sksewell@umich.edu          CP0_Config2_M(false), CP0_Config2_TU(0), CP0_Config2_TS(0),
908181Sksewell@umich.edu          CP0_Config2_TL(0), CP0_Config2_TA(0), CP0_Config2_SU(0),
918181Sksewell@umich.edu          CP0_Config2_SS(0), CP0_Config2_SL(0), CP0_Config2_SA(0),
928181Sksewell@umich.edu          CP0_Config3_M(false), CP0_Config3_DSPP(false), CP0_Config3_LPA(false),
938181Sksewell@umich.edu          CP0_Config3_VEIC(false), CP0_Config3_VInt(false),
948181Sksewell@umich.edu          CP0_Config3_SP(false), CP0_Config3_MT(false), CP0_Config3_SM(false),
958181Sksewell@umich.edu          CP0_Config3_TL(false), CP0_WatchHi_M(false), CP0_PerfCtr_M(false),
968181Sksewell@umich.edu          CP0_PerfCtr_W(false), CP0_PRId(0), CP0_Config(0), CP0_Config1(0),
978181Sksewell@umich.edu          CP0_Config2(0), CP0_Config3(0)
988181Sksewell@umich.edu    { }
998181Sksewell@umich.edu
1005251Sksewell@umich.edu      // MIPS CP0 State - First individual variables
1016378Sgblack@eecs.umich.edu      // Page numbers refer to revision 2.50 (July 2005) of the MIPS32 ARM,
1026378Sgblack@eecs.umich.edu      // Volume III (PRA)
1035251Sksewell@umich.edu      unsigned CP0_IntCtl_IPTI; // Page 93, IP Timer Interrupt
1045251Sksewell@umich.edu      unsigned CP0_IntCtl_IPPCI; // Page 94, IP Performance Counter Interrupt
1055251Sksewell@umich.edu      unsigned CP0_SrsCtl_HSS; // Page 95, Highest Implemented Shadow Set
1065251Sksewell@umich.edu      unsigned CP0_PRId_CompanyOptions; // Page 105, Manufacture options
1075251Sksewell@umich.edu      unsigned CP0_PRId_CompanyID; // Page 105, Company ID - (0-255, 1=>MIPS)
1085251Sksewell@umich.edu      unsigned CP0_PRId_ProcessorID; // Page 105
1095251Sksewell@umich.edu      unsigned CP0_PRId_Revision; // Page 105
1106378Sgblack@eecs.umich.edu      unsigned CP0_EBase_CPUNum; // Page 106, CPU Number in a multiprocessor
1116378Sgblack@eecs.umich.edu                                 //system
1125251Sksewell@umich.edu      unsigned CP0_Config_BE; // Page 108, Big/Little Endian mode
1135251Sksewell@umich.edu      unsigned CP0_Config_AT; //Page 109
1145251Sksewell@umich.edu      unsigned CP0_Config_AR; //Page 109
1155251Sksewell@umich.edu      unsigned CP0_Config_MT; //Page 109
1165251Sksewell@umich.edu      unsigned CP0_Config_VI; //Page 109
1175251Sksewell@umich.edu      unsigned CP0_Config1_M; // Page 110
1185251Sksewell@umich.edu      unsigned CP0_Config1_MMU; // Page 110
1195251Sksewell@umich.edu      unsigned CP0_Config1_IS; // Page 110
1205251Sksewell@umich.edu      unsigned CP0_Config1_IL; // Page 111
1215251Sksewell@umich.edu      unsigned CP0_Config1_IA; // Page 111
1225251Sksewell@umich.edu      unsigned CP0_Config1_DS; // Page 111
1235251Sksewell@umich.edu      unsigned CP0_Config1_DL; // Page 112
1245251Sksewell@umich.edu      unsigned CP0_Config1_DA; // Page 112
1255251Sksewell@umich.edu      bool CP0_Config1_C2; // Page 112
1265251Sksewell@umich.edu      bool CP0_Config1_MD;// Page 112 - Technically not used in MIPS32
1275251Sksewell@umich.edu      bool CP0_Config1_PC;// Page 112
1285251Sksewell@umich.edu      bool CP0_Config1_WR;// Page 113
1295251Sksewell@umich.edu      bool CP0_Config1_CA;// Page 113
1305251Sksewell@umich.edu      bool CP0_Config1_EP;// Page 113
1315251Sksewell@umich.edu      bool CP0_Config1_FP;// Page 113
1325251Sksewell@umich.edu      bool CP0_Config2_M; // Page 114
1335251Sksewell@umich.edu      unsigned CP0_Config2_TU;// Page 114
1345251Sksewell@umich.edu      unsigned CP0_Config2_TS;// Page 114
1355251Sksewell@umich.edu      unsigned CP0_Config2_TL;// Page 115
1365251Sksewell@umich.edu      unsigned CP0_Config2_TA;// Page 115
1375251Sksewell@umich.edu      unsigned CP0_Config2_SU;// Page 115
1385251Sksewell@umich.edu      unsigned CP0_Config2_SS;// Page 115
1395251Sksewell@umich.edu      unsigned CP0_Config2_SL;// Page 116
1405251Sksewell@umich.edu      unsigned CP0_Config2_SA;// Page 116
1415251Sksewell@umich.edu      bool CP0_Config3_M; //// Page 117
1425251Sksewell@umich.edu      bool CP0_Config3_DSPP;// Page 117
1435251Sksewell@umich.edu      bool CP0_Config3_LPA;// Page 117
1445251Sksewell@umich.edu      bool CP0_Config3_VEIC;// Page 118
1455251Sksewell@umich.edu      bool CP0_Config3_VInt; // Page 118
1465251Sksewell@umich.edu      bool CP0_Config3_SP;// Page 118
1475251Sksewell@umich.edu      bool CP0_Config3_MT;// Page 119
1485251Sksewell@umich.edu      bool CP0_Config3_SM;// Page 119
1495251Sksewell@umich.edu      bool CP0_Config3_TL;// Page 119
1505251Sksewell@umich.edu
1515251Sksewell@umich.edu      bool CP0_WatchHi_M; // Page 124
1525251Sksewell@umich.edu      bool CP0_PerfCtr_M; // Page 130
1535251Sksewell@umich.edu      bool CP0_PerfCtr_W; // Page 130
1545251Sksewell@umich.edu
1555251Sksewell@umich.edu
1565251Sksewell@umich.edu      // Then, whole registers
1575251Sksewell@umich.edu      unsigned CP0_PRId;
1585251Sksewell@umich.edu      unsigned CP0_Config;
1595251Sksewell@umich.edu      unsigned CP0_Config1;
1605251Sksewell@umich.edu      unsigned CP0_Config2;
1615251Sksewell@umich.edu      unsigned CP0_Config3;
1625251Sksewell@umich.edu};
1635251Sksewell@umich.edu
1642597SN/A} // namespace MipsISA
1652597SN/A#endif
166