2 * Copyright (c) 2004-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.
29 #include "cpu/o3/alpha_dyn_inst.hh"
32 AlphaDynInst<Impl>::AlphaDynInst(MachInst inst, Addr PC, Addr Pred_PC,
33 InstSeqNum seq_num, FullCPU *cpu)
34 : BaseDynInst<Impl>(inst, PC, Pred_PC, seq_num, cpu)
36 // Make sure to have the renamed register entries set to the same
37 // as the normal register entries. It will allow the IQ to work
38 // without any modifications.
39 for (int i = 0; i < this->staticInst->numDestRegs(); i++)
41 _destRegIdx[i] = this->staticInst->destRegIdx(i);
44 for (int i = 0; i < this->staticInst->numSrcRegs(); i++)
46 _srcRegIdx[i] = this->staticInst->srcRegIdx(i);
47 this->_readySrcRegIdx[i] = 0;
53 AlphaDynInst<Impl>::AlphaDynInst(StaticInstPtr &_staticInst)
54 : BaseDynInst<Impl>(_staticInst)
56 // Make sure to have the renamed register entries set to the same
57 // as the normal register entries. It will allow the IQ to work
58 // without any modifications.
59 for (int i = 0; i < _staticInst->numDestRegs(); i++)
61 _destRegIdx[i] = _staticInst->destRegIdx(i);
64 for (int i = 0; i < _staticInst->numSrcRegs(); i++)
66 _srcRegIdx[i] = _staticInst->srcRegIdx(i);
73 AlphaDynInst<Impl>::hwrei()
75 return this->cpu->hwrei();
80 AlphaDynInst<Impl>::readIntrFlag()
82 return this->cpu->readIntrFlag();
87 AlphaDynInst<Impl>::setIntrFlag(int val)
89 this->cpu->setIntrFlag(val);
94 AlphaDynInst<Impl>::inPalMode()
96 return this->cpu->inPalMode();
101 AlphaDynInst<Impl>::trap(Fault fault)
103 this->cpu->trap(fault);
106 template <class Impl>
108 AlphaDynInst<Impl>::simPalCheck(int palFunc)
110 return this->cpu->simPalCheck(palFunc);
113 template <class Impl>
115 AlphaDynInst<Impl>::syscall()
117 this->cpu->syscall(this->threadNumber);