bitfields.isa revision 11725:eb58f1bbeac8
1// -*- mode:c++ -*-
2
3// Copyright (c) 2015 RISC-V Foundation
4// Copyright (c) 2016 The University of Virginia
5// All rights reserved.
6//
7// Redistribution and use in source and binary forms, with or without
8// modification, are permitted provided that the following conditions are
9// met: redistributions of source code must retain the above copyright
10// notice, this list of conditions and the following disclaimer;
11// redistributions in binary form must reproduce the above copyright
12// notice, this list of conditions and the following disclaimer in the
13// documentation and/or other materials provided with the distribution;
14// neither the name of the copyright holders nor the names of its
15// contributors may be used to endorse or promote products derived from
16// this software without specific prior written permission.
17//
18// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29//
30// Authors: Maxwell Walter
31//          Alec Roelke
32
33////////////////////////////////////////////////////////////////////
34//
35// Bitfield definitions.
36//
37
38def bitfield OPCODE <6:0>;
39def bitfield NONOPCODE <31:7>;
40
41// R-Type
42def bitfield ALL	<31:0>;
43def bitfield RD     <11:7>;
44def bitfield FUNCT3 <14:12>;
45def bitfield RS1    <19:15>;
46def bitfield RS2    <24:20>;
47def bitfield FUNCT7 <31:25>;
48
49// Bit shifts
50def bitfield SRTYPE <30>;
51def bitfield SHAMT5 <24:20>;
52def bitfield SHAMT6 <25:20>;
53
54// I-Type
55def bitfield IMM12  <31:20>;
56
57// S-Type
58def bitfield IMM5   <11:7>;
59def bitfield IMM7   <31:25>;
60
61// U-Type
62def bitfield IMM20  <31:12>;
63
64// SB-Type
65def bitfield BIMM12BIT11 <7>;
66def bitfield BIMM12BITS4TO1<11:8>;
67def bitfield IMMSIGN <31>;
68def bitfield BIMM12BITS10TO5 <30:25>;
69
70// UJ-Type
71def bitfield UJIMMBITS10TO1 <30:21>;
72def bitfield  UJIMMBIT11 <20>;
73def bitfield UJIMMBITS19TO12 <19:12>;
74
75// System
76def bitfield FUNCT12 <31:20>;
77def bitfield ZIMM <19:15>;
78
79// Floating point
80def bitfield FD <11:7>;
81def bitfield FS1 <19:15>;
82def bitfield FS2 <24:20>;
83def bitfield FS3 <31:27>;
84
85def bitfield ROUND_MODE <14:12>;
86def bitfield CONV_SGN <24:20>;
87def bitfield FUNCT2 <26:25>;
88