2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;
9 * redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution;
12 * neither the name of the copyright holders nor the names of its
13 * contributors may be used to endorse or promote products derived from
14 * this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 #ifndef __ARCH_ALPHA_REGFILE_HH__
32 #define __ARCH_ALPHA_REGFILE_HH__
34 #include "arch/alpha/isa_traits.hh"
35 #include "arch/alpha/floatregfile.hh"
36 #include "arch/alpha/intregfile.hh"
37 #include "arch/alpha/miscregfile.hh"
38 #include "arch/alpha/types.hh"
39 #include "sim/faults.hh"
43 //XXX These should be implemented by someone who knows the alpha stuff better
53 Addr pc; // program counter
54 Addr npc; // next-cycle program counter
55 Addr nnpc; // next next-cycle program counter
85 return npc + sizeof(MachInst);
93 IntRegFile intRegFile; // (signed) integer register file
94 FloatRegFile floatRegFile; // floating point register file
95 MiscRegFile miscRegFile; // control register file
99 int intrflag; // interrupt flag
104 return miscRegFile.getInstAsid();
110 return miscRegFile.getDataAsid();
112 #endif // FULL_SYSTEM
118 floatRegFile.clear();
123 readMiscRegNoEffect(int miscReg)
125 return miscRegFile.readRegNoEffect(miscReg);
129 readMiscReg(int miscReg, ThreadContext *tc)
131 return miscRegFile.readReg(miscReg, tc);
135 setMiscRegNoEffect(int miscReg, const MiscReg &val)
137 miscRegFile.setRegNoEffect(miscReg, val);
141 setMiscReg(int miscReg, const MiscReg &val, ThreadContext *tc)
143 miscRegFile.setReg(miscReg, val, tc);
147 readFloatReg(int floatReg)
149 return floatRegFile.d[floatReg];
153 readFloatReg(int floatReg, int width)
155 return readFloatReg(floatReg);
159 readFloatRegBits(int floatReg)
161 return floatRegFile.q[floatReg];
165 readFloatRegBits(int floatReg, int width)
167 return readFloatRegBits(floatReg);
171 setFloatReg(int floatReg, const FloatReg &val)
173 floatRegFile.d[floatReg] = val;
177 setFloatReg(int floatReg, const FloatReg &val, int width)
179 setFloatReg(floatReg, val);
183 setFloatRegBits(int floatReg, const FloatRegBits &val)
185 floatRegFile.q[floatReg] = val;
189 setFloatRegBits(int floatReg, const FloatRegBits &val, int width)
191 setFloatRegBits(floatReg, val);
195 readIntReg(int intReg)
197 return intRegFile.readReg(intReg);
201 setIntReg(int intReg, const IntReg &val)
203 intRegFile.setReg(intReg, val);
206 void serialize(EventManager *em, std::ostream &os);
207 void unserialize(EventManager *em, Checkpoint *cp,
208 const std::string §ion);
211 changeContext(RegContextParam param, RegContextVal val)
213 //This would be an alternative place to call/implement
214 //the swapPALShadow function
219 flattenIntIndex(ThreadContext * tc, int reg)
225 flattenFloatIndex(ThreadContext * tc, int reg)
230 void copyRegs(ThreadContext *src, ThreadContext *dest);
232 void copyMiscRegs(ThreadContext *src, ThreadContext *dest);
234 } // namespace AlphaISA
236 #endif // __ARCH_ALPHA_REGFILE_HH__