Deleted Added
sdiff udiff text old ( 12106:7784fac1b159 ) new ( 12107:998b4c54ee51 )
full compact
1/*
2 * Copyright (c) 2011,2013 ARM Limited
3 * Copyright (c) 2013 Advanced Micro Devices, Inc.
4 * All rights reserved.
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating
9 * to a hardware implementation of the functionality of the software
10 * licensed hereunder. You may use the software subject to the license

--- 33 unchanged lines hidden (view full) ---

44 */
45
46#ifndef __CPU_BASE_DYN_INST_HH__
47#define __CPU_BASE_DYN_INST_HH__
48
49#include <array>
50#include <bitset>
51#include <list>
52#include <string>
53#include <queue>
54
55#include "arch/generic/tlb.hh"
56#include "arch/utility.hh"
57#include "base/trace.hh"
58#include "config/the_isa.hh"
59#include "cpu/checker/cpu.hh"
60#include "cpu/o3/comm.hh"
61#include "cpu/exec_context.hh"
62#include "cpu/exetrace.hh"
63#include "cpu/inst_seq.hh"
64#include "cpu/op_class.hh"
65#include "cpu/static_inst.hh"
66#include "cpu/translation.hh"
67#include "mem/packet.hh"
68#include "mem/request.hh"
69#include "sim/byteswap.hh"
70#include "sim/system.hh"
71

--- 17 unchanged lines hidden (view full) ---

89 // The list of instructions iterator type.
90 typedef typename std::list<DynInstPtr>::iterator ListIt;
91
92 enum {
93 MaxInstSrcRegs = TheISA::MaxInstSrcRegs, /// Max source regs
94 MaxInstDestRegs = TheISA::MaxInstDestRegs /// Max dest regs
95 };
96
97 union Result {
98 uint64_t integer;
99 double dbl;
100 void set(uint64_t i) { integer = i; }
101 void set(double d) { dbl = d; }
102 void get(uint64_t& i) { i = integer; }
103 void get(double& d) { d = dbl; }
104 };
105
106 protected:
107 enum Status {
108 IqEntry, /// Instruction is in the IQ
109 RobEntry, /// Instruction is in the ROB
110 LsqEntry, /// Instruction is in the LSQ
111 Completed, /// Instruction has completed
112 ResultReady, /// Instruction has its result
113 CanIssue, /// Instruction can issue and execute

--- 55 unchanged lines hidden (view full) ---

169
170 /** InstRecord that tracks this instructions. */
171 Trace::InstRecord *traceData;
172
173 protected:
174 /** The result of the instruction; assumes an instruction can have many
175 * destination registers.
176 */
177 std::queue instResult;
178
179 /** PC state for this instruction. */
180 TheISA::PCState pc;
181
182 /* An amalgamation of a lot of boolean values into one */
183 std::bitset<MaxFlags> instFlags;
184
185 /** The status of this BaseDynInst. Several bits can be set. */

--- 415 unchanged lines hidden (view full) ---

601 int8_t numCCDestRegs() const { return staticInst->numCCDestRegs(); }
602
603 /** Returns the logical register index of the i'th destination register. */
604 const RegId& destRegIdx(int i) const { return staticInst->destRegIdx(i); }
605
606 /** Returns the logical register index of the i'th source register. */
607 const RegId& srcRegIdx(int i) const { return staticInst->srcRegIdx(i); }
608
609 /** Pops a result off the instResult queue */
610 template <class T>
611 void popResult(T& t)
612 {
613 if (!instResult.empty()) {
614 instResult.front().get(t);
615 instResult.pop();
616 }
617 }
618
619 /** Read the most recent result stored by this instruction */
620 template <class T>
621 void readResult(T& t)
622 {
623 instResult.back().get(t);
624 }
625
626 /** Pushes a result onto the instResult queue */
627 template <class T>
628 void setResult(T t)
629 {
630 if (instFlags[RecordResult]) {
631 Result instRes;
632 instRes.set(t);
633 instResult.push(instRes);
634 }
635 }
636
637 /** Records an integer register being set to a value. */
638 void setIntRegOperand(const StaticInst *si, int idx, IntReg val)
639 {
640 setResult<uint64_t>(val);
641 }
642
643 /** Records a CC register being set to a value. */
644 void setCCRegOperand(const StaticInst *si, int idx, CCReg val)
645 {
646 setResult<uint64_t>(val);
647 }
648
649 /** Records an fp register being set to a value. */
650 void setFloatRegOperand(const StaticInst *si, int idx, FloatReg val)
651 {
652 setResult<double>(val);
653 }
654
655 /** Records an fp register being set to an integer value. */
656 void setFloatRegOperandBits(const StaticInst *si, int idx, FloatRegBits val)
657 {
658 setResult<uint64_t>(val);
659 }
660
661 /** Records that one of the source registers is ready. */
662 void markSrcRegReady();
663
664 /** Marks a specific register as ready. */
665 void markSrcRegReady(RegIndex src_idx);
666

--- 414 unchanged lines hidden ---