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 "arch/alpha/mt.hh"
40 #include "sim/faults.hh"
44 //XXX These should be implemented by someone who knows the alpha stuff better
54 Addr pc; // program counter
55 Addr npc; // next-cycle program counter
56 Addr nnpc; // next next-cycle program counter
86 return npc + sizeof(MachInst);
94 IntRegFile intRegFile; // (signed) integer register file
95 FloatRegFile floatRegFile; // floating point register file
96 MiscRegFile miscRegFile; // control register file
100 int intrflag; // interrupt flag
105 return miscRegFile.getInstAsid();
111 return miscRegFile.getDataAsid();
113 #endif // FULL_SYSTEM
119 floatRegFile.clear();
124 readMiscRegNoEffect(int miscReg)
126 return miscRegFile.readRegNoEffect(miscReg);
130 readMiscReg(int miscReg, ThreadContext *tc)
132 return miscRegFile.readReg(miscReg, tc);
136 setMiscRegNoEffect(int miscReg, const MiscReg &val)
138 miscRegFile.setRegNoEffect(miscReg, val);
142 setMiscReg(int miscReg, const MiscReg &val, ThreadContext *tc)
144 miscRegFile.setReg(miscReg, val, tc);
148 readFloatReg(int floatReg)
150 return floatRegFile.d[floatReg];
154 readFloatReg(int floatReg, int width)
156 return readFloatReg(floatReg);
160 readFloatRegBits(int floatReg)
162 return floatRegFile.q[floatReg];
166 readFloatRegBits(int floatReg, int width)
168 return readFloatRegBits(floatReg);
172 setFloatReg(int floatReg, const FloatReg &val)
174 floatRegFile.d[floatReg] = val;
178 setFloatReg(int floatReg, const FloatReg &val, int width)
180 setFloatReg(floatReg, val);
184 setFloatRegBits(int floatReg, const FloatRegBits &val)
186 floatRegFile.q[floatReg] = val;
190 setFloatRegBits(int floatReg, const FloatRegBits &val, int width)
192 setFloatRegBits(floatReg, val);
196 readIntReg(int intReg)
198 return intRegFile.readReg(intReg);
202 setIntReg(int intReg, const IntReg &val)
204 intRegFile.setReg(intReg, val);
207 void serialize(EventManager *em, std::ostream &os);
208 void unserialize(EventManager *em, Checkpoint *cp,
209 const std::string §ion);
213 flattenIntIndex(ThreadContext * tc, int reg)
219 flattenFloatIndex(ThreadContext * tc, int reg)
224 void copyRegs(ThreadContext *src, ThreadContext *dest);
226 void copyMiscRegs(ThreadContext *src, ThreadContext *dest);
228 } // namespace AlphaISA
230 #endif // __ARCH_ALPHA_REGFILE_HH__