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.
32 #ifndef __ARCH_SPARC_REGFILE_HH__
33 #define __ARCH_SPARC_REGFILE_HH__
35 #include "arch/sparc/floatregfile.hh"
36 #include "arch/sparc/intregfile.hh"
37 #include "arch/sparc/isa_traits.hh"
38 #include "arch/sparc/miscregfile.hh"
39 #include "arch/sparc/types.hh"
40 #include "sim/host.hh"
51 Addr pc; // Program Counter
52 Addr npc; // Next Program Counter
60 void setNextPC(Addr val);
63 void setNextNPC(Addr val);
66 IntRegFile intRegFile; // integer register file
67 FloatRegFile floatRegFile; // floating point register file
68 MiscRegFile miscRegFile; // control register file
74 int FlattenIntIndex(int reg);
76 MiscReg readMiscRegNoEffect(int miscReg);
78 MiscReg readMiscReg(int miscReg, ThreadContext *tc);
80 void setMiscRegNoEffect(int miscReg, const MiscReg &val);
82 void setMiscReg(int miscReg, const MiscReg &val,
87 return miscRegFile.getInstAsid();
92 return miscRegFile.getDataAsid();
95 FloatReg readFloatReg(int floatReg, int width);
97 FloatReg readFloatReg(int floatReg);
99 FloatRegBits readFloatRegBits(int floatReg, int width);
101 FloatRegBits readFloatRegBits(int floatReg);
103 void setFloatReg(int floatReg, const FloatReg &val, int width);
105 void setFloatReg(int floatReg, const FloatReg &val);
107 void setFloatRegBits(int floatReg, const FloatRegBits &val, int width);
109 void setFloatRegBits(int floatReg, const FloatRegBits &val);
111 IntReg readIntReg(int intReg);
113 void setIntReg(int intReg, const IntReg &val);
115 void serialize(std::ostream &os);
116 void unserialize(Checkpoint *cp, const std::string §ion);
120 void changeContext(RegContextParam param, RegContextVal val);
123 int flattenIntIndex(ThreadContext * tc, int reg);
125 void copyRegs(ThreadContext *src, ThreadContext *dest);
127 void copyMiscRegs(ThreadContext *src, ThreadContext *dest);
129 } // namespace SparcISA