16019Shines@cs.fsu.edu// -*- mode:c++ -*-
26019Shines@cs.fsu.edu
312763Sgiacomo.travaglini@arm.com// Copyright (c) 2010, 2011, 2018 ARM Limited
47101Sgblack@eecs.umich.edu// All rights reserved
57101Sgblack@eecs.umich.edu//
67101Sgblack@eecs.umich.edu// The license below extends only to copyright in the software and shall
77101Sgblack@eecs.umich.edu// not be construed as granting a license to any other intellectual
87101Sgblack@eecs.umich.edu// property including but not limited to intellectual property relating
97101Sgblack@eecs.umich.edu// to a hardware implementation of the functionality of the software
107101Sgblack@eecs.umich.edu// licensed hereunder.  You may use the software subject to the license
117101Sgblack@eecs.umich.edu// terms below provided that you ensure that this notice is replicated
127101Sgblack@eecs.umich.edu// unmodified and in its entirety in all distributions of the software,
137101Sgblack@eecs.umich.edu// modified or unmodified, in source code or in binary form.
147101Sgblack@eecs.umich.edu//
156019Shines@cs.fsu.edu// Copyright (c) 2007-2008 The Florida State University
166019Shines@cs.fsu.edu// All rights reserved.
176019Shines@cs.fsu.edu//
186019Shines@cs.fsu.edu// Redistribution and use in source and binary forms, with or without
196019Shines@cs.fsu.edu// modification, are permitted provided that the following conditions are
206019Shines@cs.fsu.edu// met: redistributions of source code must retain the above copyright
216019Shines@cs.fsu.edu// notice, this list of conditions and the following disclaimer;
226019Shines@cs.fsu.edu// redistributions in binary form must reproduce the above copyright
236019Shines@cs.fsu.edu// notice, this list of conditions and the following disclaimer in the
246019Shines@cs.fsu.edu// documentation and/or other materials provided with the distribution;
256019Shines@cs.fsu.edu// neither the name of the copyright holders nor the names of its
266019Shines@cs.fsu.edu// contributors may be used to endorse or promote products derived from
276019Shines@cs.fsu.edu// this software without specific prior written permission.
286019Shines@cs.fsu.edu//
296019Shines@cs.fsu.edu// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
306019Shines@cs.fsu.edu// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
316019Shines@cs.fsu.edu// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
326019Shines@cs.fsu.edu// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
336019Shines@cs.fsu.edu// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
346019Shines@cs.fsu.edu// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
356019Shines@cs.fsu.edu// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
366019Shines@cs.fsu.edu// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
376019Shines@cs.fsu.edu// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
386019Shines@cs.fsu.edu// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
396019Shines@cs.fsu.edu// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
406019Shines@cs.fsu.edu//
416019Shines@cs.fsu.edu// Authors: Stephen Hines
426019Shines@cs.fsu.edu
436019Shines@cs.fsu.edu////////////////////////////////////////////////////////////////////
446019Shines@cs.fsu.edu//
456019Shines@cs.fsu.edu// Bitfield definitions.
466019Shines@cs.fsu.edu//
476019Shines@cs.fsu.edu
486019Shines@cs.fsu.edu// Opcode fields
4910611SAndreas.Sandberg@ARM.comdef bitfield DECODERFAULT  decoderFault;
5012763Sgiacomo.travaglini@arm.comdef bitfield ILLEGALEXEC   illegalExecution;
5110611SAndreas.Sandberg@ARM.com
526268Sgblack@eecs.umich.edudef bitfield ENCODING      encoding;
536251Sgblack@eecs.umich.edudef bitfield OPCODE        opcode;
546269Sgblack@eecs.umich.edudef bitfield MEDIA_OPCODE  mediaOpcode;
556269Sgblack@eecs.umich.edudef bitfield MEDIA_OPCODE2 mediaOpcode2;
566749Sgblack@eecs.umich.edudef bitfield USEIMM        useImm;
577105Sgblack@eecs.umich.edudef bitfield OPCODE_24     opcode24;
587161Sgblack@eecs.umich.edudef bitfield OPCODE_24_23  opcode24_23;
596251Sgblack@eecs.umich.edudef bitfield OPCODE_23_20  opcode23_20;
606251Sgblack@eecs.umich.edudef bitfield OPCODE_23_21  opcode23_21;
616251Sgblack@eecs.umich.edudef bitfield OPCODE_22     opcode22;
627105Sgblack@eecs.umich.edudef bitfield OPCODE_20     opcode20;
637105Sgblack@eecs.umich.edudef bitfield OPCODE_19_16  opcode19_16;
647105Sgblack@eecs.umich.edudef bitfield OPCODE_19     opcode19;
657105Sgblack@eecs.umich.edudef bitfield OPCODE_18     opcode18;
666251Sgblack@eecs.umich.edudef bitfield OPCODE_15_12  opcode15_12;
677105Sgblack@eecs.umich.edudef bitfield OPCODE_15     opcode15;
686268Sgblack@eecs.umich.edudef bitfield MISC_OPCODE   miscOpcode;
6911320Ssteve.reinhardt@amd.comdef bitfield OPC2          opc2;
706251Sgblack@eecs.umich.edudef bitfield OPCODE_7      opcode7;
717105Sgblack@eecs.umich.edudef bitfield OPCODE_6      opcode6;
726251Sgblack@eecs.umich.edudef bitfield OPCODE_4      opcode4;
736019Shines@cs.fsu.edu
746267Sgblack@eecs.umich.edudef bitfield IS_MISC       isMisc;
756267Sgblack@eecs.umich.edudef bitfield SEVEN_AND_FOUR sevenAndFour;
766267Sgblack@eecs.umich.edu
777101Sgblack@eecs.umich.edudef bitfield THUMB         thumb;
787101Sgblack@eecs.umich.edudef bitfield BIGTHUMB      bigThumb;
7910037SARM gem5 Developersdef bitfield AARCH64       aarch64;
807101Sgblack@eecs.umich.edu
816019Shines@cs.fsu.edu// Other
826251Sgblack@eecs.umich.edudef bitfield COND_CODE     condCode;
836251Sgblack@eecs.umich.edudef bitfield S_FIELD       sField;
846251Sgblack@eecs.umich.edudef bitfield RN            rn;
856251Sgblack@eecs.umich.edudef bitfield RD            rd;
867121Sgblack@eecs.umich.edudef bitfield RT            rt;
876251Sgblack@eecs.umich.edudef bitfield SHIFT_SIZE    shiftSize;
886251Sgblack@eecs.umich.edudef bitfield SHIFT         shift;
896251Sgblack@eecs.umich.edudef bitfield RM            rm;
906019Shines@cs.fsu.edu
916251Sgblack@eecs.umich.edudef bitfield RS            rs;
926019Shines@cs.fsu.edu
936275Sgblack@eecs.umich.edudef bitfield PUSWL         puswl;
946275Sgblack@eecs.umich.edudef bitfield PREPOST       puswl.prepost;
956275Sgblack@eecs.umich.edudef bitfield UP               puswl.up;
966275Sgblack@eecs.umich.edudef bitfield PSRUSER       puswl.psruser;
976275Sgblack@eecs.umich.edudef bitfield WRITEBACK     puswl.writeback;
986251Sgblack@eecs.umich.edudef bitfield LOADOP        puswl.loadOp;
996019Shines@cs.fsu.edu
1006275Sgblack@eecs.umich.edudef bitfield PUBWL         pubwl;
1016019Shines@cs.fsu.edu
1026275Sgblack@eecs.umich.edudef bitfield IMM           imm;
1036019Shines@cs.fsu.edu
1046251Sgblack@eecs.umich.edudef bitfield IMMED_11_0    immed11_0;
1057121Sgblack@eecs.umich.edudef bitfield IMMED_7_0     immed7_0;
1066019Shines@cs.fsu.edu
1076251Sgblack@eecs.umich.edudef bitfield IMMED_HI_11_8 immedHi11_8;
1086251Sgblack@eecs.umich.edudef bitfield IMMED_LO_3_0  immedLo3_0;
1096019Shines@cs.fsu.edu
1106251Sgblack@eecs.umich.edudef bitfield IMMED_23_0    immed23_0;
1116019Shines@cs.fsu.edu
1127105Sgblack@eecs.umich.edudef bitfield CPNUM         cpNum;
1136019Shines@cs.fsu.edu// Note that FP Regs are only 3 bits
1147105Sgblack@eecs.umich.edudef bitfield FN            fn;
1157105Sgblack@eecs.umich.edudef bitfield FD            fd;
1167105Sgblack@eecs.umich.edudef bitfield FPREGIMM      fpRegImm;
1176019Shines@cs.fsu.edu// We can just use 3:0 for FM since the hard-wired FP regs are handled in
1186019Shines@cs.fsu.edu// float_regfile.hh
1197105Sgblack@eecs.umich.edudef bitfield FM            fm;
1207105Sgblack@eecs.umich.edudef bitfield FPIMM         fpImm;
1217105Sgblack@eecs.umich.edudef bitfield PUNWL         punwl;
1226019Shines@cs.fsu.edu
1236019Shines@cs.fsu.edu// M5 instructions
1246251Sgblack@eecs.umich.edudef bitfield M5FUNC        m5Func;
1256019Shines@cs.fsu.edu
1267106Sgblack@eecs.umich.edu// 16 bit thumb bitfields
1277103Sgblack@eecs.umich.edudef bitfield TOPCODE_15_13  topcode15_13;
1287103Sgblack@eecs.umich.edudef bitfield TOPCODE_13_11  topcode13_11;
1297103Sgblack@eecs.umich.edudef bitfield TOPCODE_12_11  topcode12_11;
1307103Sgblack@eecs.umich.edudef bitfield TOPCODE_12_10  topcode12_10;
1317103Sgblack@eecs.umich.edudef bitfield TOPCODE_11_9   topcode11_9;
1327103Sgblack@eecs.umich.edudef bitfield TOPCODE_11_8   topcode11_8;
1337103Sgblack@eecs.umich.edudef bitfield TOPCODE_10_9   topcode10_9;
1347103Sgblack@eecs.umich.edudef bitfield TOPCODE_10_8   topcode10_8;
1357103Sgblack@eecs.umich.edudef bitfield TOPCODE_9_6    topcode9_6;
1367103Sgblack@eecs.umich.edudef bitfield TOPCODE_7      topcode7;
1377103Sgblack@eecs.umich.edudef bitfield TOPCODE_7_6    topcode7_6;
1387103Sgblack@eecs.umich.edudef bitfield TOPCODE_7_5    topcode7_5;
1397103Sgblack@eecs.umich.edudef bitfield TOPCODE_7_4    topcode7_4;
1407103Sgblack@eecs.umich.edudef bitfield TOPCODE_3_0    topcode3_0;
1417106Sgblack@eecs.umich.edu
1427106Sgblack@eecs.umich.edu// 32 bit thumb bitfields
1437106Sgblack@eecs.umich.edudef bitfield HTOPCODE_12_11 htopcode12_11;
1447106Sgblack@eecs.umich.edudef bitfield HTOPCODE_10_9  htopcode10_9;
1457106Sgblack@eecs.umich.edudef bitfield HTOPCODE_9     htopcode9;
1467106Sgblack@eecs.umich.edudef bitfield HTOPCODE_9_8   htopcode9_8;
1477106Sgblack@eecs.umich.edudef bitfield HTOPCODE_9_5   htopcode9_5;
1487106Sgblack@eecs.umich.edudef bitfield HTOPCODE_9_4   htopcode9_4;
1497106Sgblack@eecs.umich.edudef bitfield HTOPCODE_8     htopcode8;
1507106Sgblack@eecs.umich.edudef bitfield HTOPCODE_8_7   htopcode8_7;
1517106Sgblack@eecs.umich.edudef bitfield HTOPCODE_8_6   htopcode8_6;
1527106Sgblack@eecs.umich.edudef bitfield HTOPCODE_8_5   htopcode8_5;
1537113Sgblack@eecs.umich.edudef bitfield HTOPCODE_7     htopcode7;
1547116Sgblack@eecs.umich.edudef bitfield HTOPCODE_7_5   htopcode7_5;
1557245Sgblack@eecs.umich.edudef bitfield HTOPCODE_6     htopcode6;
1567106Sgblack@eecs.umich.edudef bitfield HTOPCODE_6_5   htopcode6_5;
1577106Sgblack@eecs.umich.edudef bitfield HTOPCODE_5_4   htopcode5_4;
1587106Sgblack@eecs.umich.edudef bitfield HTOPCODE_4     htopcode4;
1597106Sgblack@eecs.umich.edu
1607106Sgblack@eecs.umich.edudef bitfield HTRN           htrn;
1617106Sgblack@eecs.umich.edudef bitfield HTS            hts;
1627106Sgblack@eecs.umich.edu
1637106Sgblack@eecs.umich.edudef bitfield LTOPCODE_15    ltopcode15;
1647113Sgblack@eecs.umich.edudef bitfield LTOPCODE_11_8  ltopcode11_8;
1657113Sgblack@eecs.umich.edudef bitfield LTOPCODE_7_6   ltopcode7_6;
1667106Sgblack@eecs.umich.edudef bitfield LTOPCODE_7_4   ltopcode7_4;
1677106Sgblack@eecs.umich.edudef bitfield LTOPCODE_4     ltopcode4;
1687106Sgblack@eecs.umich.edu
1697106Sgblack@eecs.umich.edudef bitfield LTRD           ltrd;
1707106Sgblack@eecs.umich.edudef bitfield LTCOPROC       ltcoproc;
171