gem5 v24.0.0.0
Loading...
Searching...
No Matches
types.hh
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 The University of Edinburgh
3 * Copyright (c) 2021 IBM Corporation
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer;
10 * redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution;
13 * neither the name of the copyright holders nor the names of its
14 * contributors may be used to endorse or promote products derived from
15 * this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30#ifndef __ARCH_POWER_TYPES_HH__
31#define __ARCH_POWER_TYPES_HH__
32
33#include <cstdint>
34
35#include "arch/power/pcstate.hh"
36#include "base/bitunion.hh"
37
38namespace gem5
39{
40
41namespace PowerISA
42{
43
44typedef uint32_t MachInst;
45
47
48 // Registers
49 Bitfield<25, 21> rs;
50 Bitfield<20, 16> ra;
51
52 // Shifts and masks
53 Bitfield<15, 11> sh;
54 Bitfield<1> shn;
55 Bitfield<10, 6> mb;
56 Bitfield<5> mbn;
57 Bitfield< 5, 1> me;
58 Bitfield<5> men;
59
60 // Immediate fields
61 Bitfield<15, 0> si;
62 Bitfield<15, 0> ui;
63 Bitfield<15, 0> d;
64 Bitfield<15, 2> ds;
65 Bitfield<15, 6> d0;
66 Bitfield<20, 16> d1;
67 Bitfield< 1, 0> d2;
68
69 // Compare fields
70 Bitfield<21> l;
71
72 // Special purpose register identifier
73 Bitfield<20, 11> spr;
74 Bitfield<25, 23> bf;
75 Bitfield<20, 18> bfa;
76
77 // Branch instruction fields
78 Bitfield<1> aa;
79 Bitfield<15, 2> bd;
80 Bitfield<20, 16> bi;
81 Bitfield<12, 11> bh;
82 Bitfield<25, 21> bo;
83 Bitfield<25, 2> li;
84 Bitfield<0> lk;
85
86 // Record bits
87 Bitfield<0> rc;
88 Bitfield<10> oe;
89
90 // Condition register fields
91 Bitfield<25, 21> bt;
92 Bitfield<20, 16> ba;
93 Bitfield<15, 11> bb;
94
95 // Trap instruction fields
96 Bitfield<25, 21> to;
97
98 // FXM field for mtcrf instruction
99 Bitfield<19, 12> fxm;
101
102// typedef uint64_t LargestRead;
103// // Need to use 64 bits to make sure that read requests get handled properly
104
105// typedef int RegContextParam;
106// typedef int RegContextVal;
107
108} // namespace PowerISA
109} // namespace gem5
110
111namespace std {
112
113template<>
114struct hash<gem5::PowerISA::ExtMachInst> : public hash<uint32_t>
115{
116 size_t operator()(const gem5::PowerISA::ExtMachInst &emi) const {
117 return hash<uint32_t>::operator()((uint32_t)emi);
118 };
119};
120
121} // namespace std
122
123#endif // __ARCH_POWER_TYPES_HH__
#define BitUnion32(name)
Definition bitunion.hh:495
#define EndBitUnion(name)
This closes off the class and union started by the above macro.
Definition bitunion.hh:428
Bitfield< 25, 21 > to
Definition types.hh:96
Bitfield< 10, 6 > mb
Definition types.hh:55
Bitfield< 0 > lk
Definition types.hh:84
Bitfield< 12, 11 > bh
Definition types.hh:81
Bitfield< 20, 16 > ba
Definition types.hh:92
Bitfield< 15, 2 > bd
Definition types.hh:79
Bitfield< 1 > aa
Definition types.hh:78
Bitfield< 25, 23 > bf
Definition types.hh:74
Bitfield< 19, 12 > fxm
Definition types.hh:99
Bitfield< 5 > men
Definition types.hh:58
Bitfield< 15, 0 > d
Definition types.hh:63
Bitfield< 15, 0 > ui
Definition types.hh:62
Bitfield< 7 > oe
Definition misc.hh:100
Bitfield< 20, 16 > d1
Definition types.hh:66
Bitfield< 15, 0 > si
Definition types.hh:61
Bitfield< 0 > rc
Definition types.hh:87
Bitfield< 20, 11 > spr
Definition types.hh:73
Bitfield< 15, 11 > sh
Definition types.hh:53
uint32_t MachInst
Definition types.hh:44
Bitfield< 20, 18 > bfa
Definition types.hh:75
Bitfield< 20, 16 > ra
Definition types.hh:50
Bitfield< 25, 21 > bt
Definition types.hh:91
Bitfield< 1 > shn
Definition types.hh:54
Bitfield< 15, 11 > bb
Definition types.hh:93
Bitfield< 15, 6 > d0
Definition types.hh:65
Bitfield< 25, 2 > li
Definition types.hh:83
Bitfield< 20, 16 > bi
Definition types.hh:80
Bitfield< 5 > mbn
Definition types.hh:56
Bitfield< 12 > me
Definition misc.hh:118
Bitfield< 25, 21 > bo
Definition types.hh:82
Bitfield< 15, 2 > ds
Definition types.hh:64
Bitfield< 1, 0 > d2
Definition types.hh:67
Bitfield< 21 > l
Definition types.hh:70
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
Overload hash function for BasicBlockRange type.
Definition binary32.hh:81
size_t operator()(const gem5::PowerISA::ExtMachInst &emi) const
Definition types.hh:116

Generated on Tue Jun 18 2024 16:24:00 for gem5 by doxygen 1.11.0