2004-08-20 20:54:07 +02:00
|
|
|
/*
|
2006-06-13 01:04:42 +02:00
|
|
|
* Copyright (c) 2004-2006 The Regents of The University of Michigan
|
2004-08-20 20:54:07 +02:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions are
|
|
|
|
* met: redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer;
|
|
|
|
* redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution;
|
|
|
|
* neither the name of the copyright holders nor the names of its
|
|
|
|
* contributors may be used to endorse or promote products derived from
|
|
|
|
* this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
2006-06-01 01:26:56 +02:00
|
|
|
*
|
|
|
|
* Authors: Kevin Lim
|
2004-08-20 20:54:07 +02:00
|
|
|
*/
|
|
|
|
|
2005-02-26 00:00:49 +01:00
|
|
|
#ifndef __CPU_BASE_DYN_INST_HH__
|
|
|
|
#define __CPU_BASE_DYN_INST_HH__
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-06-14 19:12:41 +02:00
|
|
|
#include <bitset>
|
2006-04-23 00:26:48 +02:00
|
|
|
#include <list>
|
2004-08-20 20:54:07 +02:00
|
|
|
#include <string>
|
|
|
|
|
2006-06-03 00:15:20 +02:00
|
|
|
#include "arch/faults.hh"
|
2004-08-20 20:54:07 +02:00
|
|
|
#include "base/fast_alloc.hh"
|
|
|
|
#include "base/trace.hh"
|
2005-08-30 19:18:54 +02:00
|
|
|
#include "config/full_system.hh"
|
2005-02-26 00:00:49 +01:00
|
|
|
#include "cpu/exetrace.hh"
|
|
|
|
#include "cpu/inst_seq.hh"
|
2006-06-03 00:15:20 +02:00
|
|
|
#include "cpu/op_class.hh"
|
2005-02-26 00:00:49 +01:00
|
|
|
#include "cpu/static_inst.hh"
|
2006-06-03 00:15:20 +02:00
|
|
|
#include "mem/packet.hh"
|
2006-04-23 00:26:48 +02:00
|
|
|
#include "sim/system.hh"
|
2004-08-20 20:54:07 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* Defines a dynamic instruction context.
|
|
|
|
*/
|
|
|
|
|
Update to make multiple instruction issue and different latencies work.
Also change to ref counted DynInst.
SConscript:
Add branch predictor, BTB, load store queue, and storesets.
arch/isa_parser.py:
Specify the template parameter for AlphaDynInst
base/traceflags.py:
Add load store queue, store set, and mem dependence unit to the
list of trace flags.
cpu/base_dyn_inst.cc:
Change formating, add in debug statement.
cpu/base_dyn_inst.hh:
Change DynInst to be RefCounted, add flag to clear whether or not this
instruction can commit. This is likely to be removed in the future.
cpu/beta_cpu/alpha_dyn_inst.cc:
AlphaDynInst has been changed to be templated, so now this CC file
is just used to force instantiations of AlphaDynInst.
cpu/beta_cpu/alpha_dyn_inst.hh:
Changed AlphaDynInst to be templated on Impl. Removed some unnecessary
functions.
cpu/beta_cpu/alpha_full_cpu.cc:
AlphaFullCPU has been changed to be templated, so this CC file is now
just used to force instantation of AlphaFullCPU.
cpu/beta_cpu/alpha_full_cpu.hh:
Change AlphaFullCPU to be templated on Impl.
cpu/beta_cpu/alpha_impl.hh:
Update it to reflect AlphaDynInst and AlphaFullCPU being templated
on Impl. Also removed time buffers from here, as they are really
a part of the CPU and are thus in the CPU policy now.
cpu/beta_cpu/alpha_params.hh:
Make AlphaSimpleParams inherit from the BaseFullCPU so that it doesn't
need to specifically declare any parameters that are already in the
BaseFullCPU.
cpu/beta_cpu/comm.hh:
Changed the structure of the time buffer communication structs. Now
they include the size of the packet of instructions it is sending.
Added some parameters to the backwards communication struct, mainly
for squashing.
cpu/beta_cpu/commit.hh:
Update typenames to reflect change in location of time buffer structs.
Update DynInst to DynInstPtr (it is refcounted now).
cpu/beta_cpu/commit_impl.hh:
Formatting changes mainly. Also sends back proper information
on branch mispredicts so that the bpred unit can update itself.
Updated behavior for non-speculative instructions (stores, any
other non-spec instructions): once they reach the head of the ROB,
the ROB signals back to the IQ that it can go ahead and issue the
non-speculative instruction. The instruction itself is updated so that
commit won't try to commit it again until it is done executing.
cpu/beta_cpu/cpu_policy.hh:
Added branch prediction unit, mem dependence prediction unit, load
store queue. Moved time buffer structs from AlphaSimpleImpl to here.
cpu/beta_cpu/decode.hh:
Changed typedefs to reflect change in location of time buffer structs
and also the change from DynInst to ref counted DynInstPtr.
cpu/beta_cpu/decode_impl.hh:
Continues to buffer instructions even while unblocking now. Changed
how it loops through groups of instructions so it can properly block
during the middle of a group of instructions.
cpu/beta_cpu/fetch.hh:
Changed typedefs to reflect change in location of time buffer structs
and the change to ref counted DynInsts. Also added in branch
brediction unit.
cpu/beta_cpu/fetch_impl.hh:
Add in branch prediction. Changed how fetch checks inputs and its
current state to make for easier logic.
cpu/beta_cpu/free_list.cc:
Changed int regs and float regs to logically use one flat namespace.
Future change will be moving them to a single scoreboard to conserve
space.
cpu/beta_cpu/free_list.hh:
Mostly debugging statements. Might be removed for performance in future.
cpu/beta_cpu/full_cpu.cc:
Added in some debugging statements. Updated BaseFullCPU to take
a params object.
cpu/beta_cpu/full_cpu.hh:
Added params class within BaseCPU that other param classes will be
able to inherit from. Updated typedefs to reflect change in location
of time buffer structs and ref counted DynInst.
cpu/beta_cpu/iew.hh:
Updated typedefs to reflect change in location of time buffer structs
and use of ref counted DynInsts.
cpu/beta_cpu/iew_impl.hh:
Added in load store queue, updated iew to be able to execute non-
speculative instructions, instead of having them execute in commit.
cpu/beta_cpu/inst_queue.hh:
Updated change to ref counted DynInsts. Changed inst queue to hold
non-speculative instructions as well, which are issued only when
commit signals backwards that a nonspeculative instruction is at
the head of the ROB.
cpu/beta_cpu/inst_queue_impl.hh:
Updated to allow for non-speculative instructions to be in the inst
queue. Also added some debug functions.
cpu/beta_cpu/regfile.hh:
Added debugging statements, changed formatting.
cpu/beta_cpu/rename.hh:
Updated typedefs, added some functions to clean up code.
cpu/beta_cpu/rename_impl.hh:
Moved some code into functions to make it easier to read.
cpu/beta_cpu/rename_map.cc:
Changed int and float reg behavior to use a single flat namespace. In
the future, the rename maps can be combined to a single rename map to
save space.
cpu/beta_cpu/rename_map.hh:
Added destructor.
cpu/beta_cpu/rob.hh:
Updated it with change from DynInst to ref counted DynInst.
cpu/beta_cpu/rob_impl.hh:
Formatting, updated to use ref counted DynInst.
cpu/static_inst.hh:
Updated forward declaration for AlphaDynInst now that it is templated.
--HG--
extra : convert_revision : 1045f240ee9b6a4bd368e1806aca029ebbdc6dd3
2004-09-23 20:06:03 +02:00
|
|
|
// Forward declaration.
|
|
|
|
class StaticInstPtr;
|
2004-08-20 20:54:07 +02:00
|
|
|
|
|
|
|
template <class Impl>
|
Update to make multiple instruction issue and different latencies work.
Also change to ref counted DynInst.
SConscript:
Add branch predictor, BTB, load store queue, and storesets.
arch/isa_parser.py:
Specify the template parameter for AlphaDynInst
base/traceflags.py:
Add load store queue, store set, and mem dependence unit to the
list of trace flags.
cpu/base_dyn_inst.cc:
Change formating, add in debug statement.
cpu/base_dyn_inst.hh:
Change DynInst to be RefCounted, add flag to clear whether or not this
instruction can commit. This is likely to be removed in the future.
cpu/beta_cpu/alpha_dyn_inst.cc:
AlphaDynInst has been changed to be templated, so now this CC file
is just used to force instantiations of AlphaDynInst.
cpu/beta_cpu/alpha_dyn_inst.hh:
Changed AlphaDynInst to be templated on Impl. Removed some unnecessary
functions.
cpu/beta_cpu/alpha_full_cpu.cc:
AlphaFullCPU has been changed to be templated, so this CC file is now
just used to force instantation of AlphaFullCPU.
cpu/beta_cpu/alpha_full_cpu.hh:
Change AlphaFullCPU to be templated on Impl.
cpu/beta_cpu/alpha_impl.hh:
Update it to reflect AlphaDynInst and AlphaFullCPU being templated
on Impl. Also removed time buffers from here, as they are really
a part of the CPU and are thus in the CPU policy now.
cpu/beta_cpu/alpha_params.hh:
Make AlphaSimpleParams inherit from the BaseFullCPU so that it doesn't
need to specifically declare any parameters that are already in the
BaseFullCPU.
cpu/beta_cpu/comm.hh:
Changed the structure of the time buffer communication structs. Now
they include the size of the packet of instructions it is sending.
Added some parameters to the backwards communication struct, mainly
for squashing.
cpu/beta_cpu/commit.hh:
Update typenames to reflect change in location of time buffer structs.
Update DynInst to DynInstPtr (it is refcounted now).
cpu/beta_cpu/commit_impl.hh:
Formatting changes mainly. Also sends back proper information
on branch mispredicts so that the bpred unit can update itself.
Updated behavior for non-speculative instructions (stores, any
other non-spec instructions): once they reach the head of the ROB,
the ROB signals back to the IQ that it can go ahead and issue the
non-speculative instruction. The instruction itself is updated so that
commit won't try to commit it again until it is done executing.
cpu/beta_cpu/cpu_policy.hh:
Added branch prediction unit, mem dependence prediction unit, load
store queue. Moved time buffer structs from AlphaSimpleImpl to here.
cpu/beta_cpu/decode.hh:
Changed typedefs to reflect change in location of time buffer structs
and also the change from DynInst to ref counted DynInstPtr.
cpu/beta_cpu/decode_impl.hh:
Continues to buffer instructions even while unblocking now. Changed
how it loops through groups of instructions so it can properly block
during the middle of a group of instructions.
cpu/beta_cpu/fetch.hh:
Changed typedefs to reflect change in location of time buffer structs
and the change to ref counted DynInsts. Also added in branch
brediction unit.
cpu/beta_cpu/fetch_impl.hh:
Add in branch prediction. Changed how fetch checks inputs and its
current state to make for easier logic.
cpu/beta_cpu/free_list.cc:
Changed int regs and float regs to logically use one flat namespace.
Future change will be moving them to a single scoreboard to conserve
space.
cpu/beta_cpu/free_list.hh:
Mostly debugging statements. Might be removed for performance in future.
cpu/beta_cpu/full_cpu.cc:
Added in some debugging statements. Updated BaseFullCPU to take
a params object.
cpu/beta_cpu/full_cpu.hh:
Added params class within BaseCPU that other param classes will be
able to inherit from. Updated typedefs to reflect change in location
of time buffer structs and ref counted DynInst.
cpu/beta_cpu/iew.hh:
Updated typedefs to reflect change in location of time buffer structs
and use of ref counted DynInsts.
cpu/beta_cpu/iew_impl.hh:
Added in load store queue, updated iew to be able to execute non-
speculative instructions, instead of having them execute in commit.
cpu/beta_cpu/inst_queue.hh:
Updated change to ref counted DynInsts. Changed inst queue to hold
non-speculative instructions as well, which are issued only when
commit signals backwards that a nonspeculative instruction is at
the head of the ROB.
cpu/beta_cpu/inst_queue_impl.hh:
Updated to allow for non-speculative instructions to be in the inst
queue. Also added some debug functions.
cpu/beta_cpu/regfile.hh:
Added debugging statements, changed formatting.
cpu/beta_cpu/rename.hh:
Updated typedefs, added some functions to clean up code.
cpu/beta_cpu/rename_impl.hh:
Moved some code into functions to make it easier to read.
cpu/beta_cpu/rename_map.cc:
Changed int and float reg behavior to use a single flat namespace. In
the future, the rename maps can be combined to a single rename map to
save space.
cpu/beta_cpu/rename_map.hh:
Added destructor.
cpu/beta_cpu/rob.hh:
Updated it with change from DynInst to ref counted DynInst.
cpu/beta_cpu/rob_impl.hh:
Formatting, updated to use ref counted DynInst.
cpu/static_inst.hh:
Updated forward declaration for AlphaDynInst now that it is templated.
--HG--
extra : convert_revision : 1045f240ee9b6a4bd368e1806aca029ebbdc6dd3
2004-09-23 20:06:03 +02:00
|
|
|
class BaseDynInst : public FastAlloc, public RefCounted
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// Typedef for the CPU.
|
2006-06-16 23:08:47 +02:00
|
|
|
typedef typename Impl::CPUType ImplCPU;
|
|
|
|
typedef typename ImplCPU::ImplState ImplState;
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
// Binary machine instruction type.
|
Changes to untemplate StaticInst and StaticInstPtr, change the isa to a namespace instead of a class, an improvement to the architecture specific header file selection system, and fixed up a few include paths.
arch/alpha/alpha_linux_process.cc:
Added using directive for AlphaISA namespace
arch/alpha/alpha_memory.hh:
arch/alpha/isa/branch.isa:
cpu/pc_event.hh:
Added typedefs for Addr
arch/alpha/alpha_tru64_process.cc:
arch/alpha/arguments.cc:
Added using directive for AlphaISA
arch/alpha/ev5.hh:
Added an include of arch/alpha/isa_traits.hh, and a using directive for the AlphaISA namespace.
arch/alpha/faults.hh:
Added a typedef for the Addr type, and changed the formatting of the faults slightly.
arch/alpha/isa/main.isa:
Untemplatized StaticInst, added a using for namespace AlphaISA to show up in decoder.cc and the exec.ccs, relocated makeNop to decoder.hh
arch/alpha/isa/mem.isa:
Untemplatized StaticInst and StaticInstPtr
arch/alpha/isa/pal.isa:
cpu/base_dyn_inst.cc:
Untemplatized StaticInstPtr
arch/alpha/isa_traits.hh:
Changed variables to be externs instead of static since they are part of a namespace and not a class.
arch/alpha/stacktrace.cc:
Untemplatized StaticInstPtr, and added a using directive for AlphaISA.
arch/alpha/stacktrace.hh:
Added some typedefs for Addr and MachInst, and untemplatized StaticInstPtr
arch/alpha/vtophys.cc:
Added a using directive for AlphaISA
arch/alpha/vtophys.hh:
Added the AlphaISA namespace specifier where needed
arch/isa_parser.py:
Changed the placement of the definition of the decodeInst function to be outside the namespaceInst namespace.
base/loader/object_file.hh:
cpu/o3/bpred_unit.hh:
Added a typedef for Addr
base/loader/symtab.hh:
Added a typedef for Addr, and added a TheISA to Addr in another typedef
base/remote_gdb.cc:
Added a using namespace TheISA, and untemplatized StaticInstPtr
base/remote_gdb.hh:
Added typedefs for Addr and MachInst
cpu/base.cc:
Added TheISA specifier to some variables exported from the isa.
cpu/base.hh:
Added a typedef for Addr, and TheISA to some variables from the ISA
cpu/base_dyn_inst.hh:
Untemplatized StaticInstPtr, and added TheISA specifier to some variables from the ISA.
cpu/exec_context.hh:
Added some typedefs for types from the isa, and added TheISA specifier to some variables from the isa
cpu/exetrace.hh:
Added typedefs for some types from the ISA, and untemplatized StaticInstPtr
cpu/memtest/memtest.cc:
cpu/o3/btb.cc:
dev/baddev.cc:
dev/ide_ctrl.cc:
dev/ide_disk.cc:
dev/isa_fake.cc:
dev/ns_gige.cc:
dev/pciconfigall.cc:
dev/platform.cc:
dev/sinic.cc:
dev/uart8250.cc:
kern/freebsd/freebsd_system.cc:
kern/linux/linux_system.cc:
kern/system_events.cc:
kern/tru64/dump_mbuf.cc:
kern/tru64/tru64_events.cc:
sim/process.cc:
sim/pseudo_inst.cc:
sim/system.cc:
Added using namespace TheISA
cpu/memtest/memtest.hh:
cpu/trace/opt_cpu.hh:
cpu/trace/reader/itx_reader.hh:
dev/ide_disk.hh:
dev/pcidev.hh:
dev/platform.hh:
dev/tsunami.hh:
sim/system.hh:
sim/vptr.hh:
Added typedef for Addr
cpu/o3/2bit_local_pred.hh:
Changed the include to use arch/isa_traits.hh instead of arch/alpha/isa_traits.hh. Added typedef for Addr
cpu/o3/alpha_cpu.hh:
Added typedefs for Addr and IntReg
cpu/o3/alpha_cpu_impl.hh:
Added this-> to setNextPC to fix a problem since it didn't depend on template parameters any more. Removed "typename" where it was no longer needed.
cpu/o3/alpha_dyn_inst.hh:
Cleaned up some typedefs, and untemplatized StaticInst
cpu/o3/alpha_dyn_inst_impl.hh:
untemplatized StaticInstPtr
cpu/o3/alpha_impl.hh:
Fixed up a typedef of MachInst
cpu/o3/bpred_unit_impl.hh:
Added a using TheISA::MachInst to a function
cpu/o3/btb.hh:
Changed an include from arch/alpha/isa_traits.hh to arch/isa_traits.hh, and added a typedef for Addr
cpu/o3/commit.hh:
Removed a typedef of Impl::ISA as ISA, since TheISA takes care of this now.
cpu/o3/cpu.cc:
Cleaned up namespace issues
cpu/o3/cpu.hh:
Cleaned up namespace usage
cpu/o3/decode.hh:
Removed typedef of ISA, and changed it to TheISA
cpu/o3/fetch.hh:
Fized up typedefs, and changed ISA to TheISA
cpu/o3/free_list.hh:
Changed include of arch/alpha/isa_traits.hh to arch/isa_traits.hh
cpu/o3/iew.hh:
Removed typedef of ISA
cpu/o3/iew_impl.hh:
Added TheISA namespace specifier to MachInst
cpu/o3/ras.hh:
Changed include from arch/alpha/isa_traits.hh to arch/isa_traits.hh, and added a typedef for Addr.
cpu/o3/regfile.hh:
Changed ISA to TheISA, and added some typedefs for Addr, IntReg, FloatReg, and MiscRegFile
cpu/o3/rename.hh:
Changed ISA to TheISA, and added a typedef for RegIndex
cpu/o3/rename_map.hh:
Added an include for arch/isa_traits.hh, and a typedef for RegIndex
cpu/o3/rob.hh:
Added a typedef for RegIndex
cpu/o3/store_set.hh:
cpu/o3/tournament_pred.hh:
Changed an include of arch/alpha/isa_traits.hh to arch/isa_traits.hh, and added a typedef of Addr
cpu/ozone/cpu.hh:
Changed ISA into TheISA, and untemplatized StaticInst
cpu/pc_event.cc:
Added namespace specifier TheISA to Addr types
cpu/profile.hh:
kern/kernel_stats.hh:
Added typedef for Addr, and untemplatized StaticInstPtr
cpu/simple/cpu.cc:
Changed using directive from LittleEndianGuest to AlphaISA, which will contain both namespaces. Added TheISA where needed, and untemplatized StaticInst
cpu/simple/cpu.hh:
Added a typedef for MachInst, and untemplatized StaticInst
cpu/static_inst.cc:
Untemplatized StaticInst
cpu/static_inst.hh:
Untemplatized StaticInst by using the TheISA namespace
dev/alpha_console.cc:
Added using namespace AlphaISA
dev/simple_disk.hh:
Added typedef for Addr and fixed up some formatting
dev/sinicreg.hh:
Added TheISA namespace specifier where needed
dev/tsunami.cc:
dev/tsunami_io.cc:
dev/tsunami_pchip.cc:
Added using namespace TheISA. It might be better for it to be AlphaISA
dev/tsunami_cchip.cc:
Added typedef for TheISA. It might be better for it to be AlphaISA
kern/linux/aligned.hh:
sim/pseudo_inst.hh:
Added TheISA namespace specifier to Addr
kern/linux/linux_threadinfo.hh:
Added typedef for Addr, and TheISA namespace specifier to StackPointerReg
kern/tru64/mbuf.hh:
Added TheISA to Addr type in structs
sim/process.hh:
Added typedefs of Addr, RegFile, and MachInst
sim/syscall_emul.cc:
Added using namespace TheISA, and a cast of VMPageSize to the int type
sim/syscall_emul.hh:
Added typecast for Addr, and TheISA namespace specifier for where needed
--HG--
extra : convert_revision : 91d4f6ca33a73b21c1f1771d74bfdea3b80eff45
2006-02-19 08:34:37 +01:00
|
|
|
typedef TheISA::MachInst MachInst;
|
2006-04-23 00:26:48 +02:00
|
|
|
// Extended machine instruction type
|
|
|
|
typedef TheISA::ExtMachInst ExtMachInst;
|
|
|
|
// Logical register index type.
|
Changes to untemplate StaticInst and StaticInstPtr, change the isa to a namespace instead of a class, an improvement to the architecture specific header file selection system, and fixed up a few include paths.
arch/alpha/alpha_linux_process.cc:
Added using directive for AlphaISA namespace
arch/alpha/alpha_memory.hh:
arch/alpha/isa/branch.isa:
cpu/pc_event.hh:
Added typedefs for Addr
arch/alpha/alpha_tru64_process.cc:
arch/alpha/arguments.cc:
Added using directive for AlphaISA
arch/alpha/ev5.hh:
Added an include of arch/alpha/isa_traits.hh, and a using directive for the AlphaISA namespace.
arch/alpha/faults.hh:
Added a typedef for the Addr type, and changed the formatting of the faults slightly.
arch/alpha/isa/main.isa:
Untemplatized StaticInst, added a using for namespace AlphaISA to show up in decoder.cc and the exec.ccs, relocated makeNop to decoder.hh
arch/alpha/isa/mem.isa:
Untemplatized StaticInst and StaticInstPtr
arch/alpha/isa/pal.isa:
cpu/base_dyn_inst.cc:
Untemplatized StaticInstPtr
arch/alpha/isa_traits.hh:
Changed variables to be externs instead of static since they are part of a namespace and not a class.
arch/alpha/stacktrace.cc:
Untemplatized StaticInstPtr, and added a using directive for AlphaISA.
arch/alpha/stacktrace.hh:
Added some typedefs for Addr and MachInst, and untemplatized StaticInstPtr
arch/alpha/vtophys.cc:
Added a using directive for AlphaISA
arch/alpha/vtophys.hh:
Added the AlphaISA namespace specifier where needed
arch/isa_parser.py:
Changed the placement of the definition of the decodeInst function to be outside the namespaceInst namespace.
base/loader/object_file.hh:
cpu/o3/bpred_unit.hh:
Added a typedef for Addr
base/loader/symtab.hh:
Added a typedef for Addr, and added a TheISA to Addr in another typedef
base/remote_gdb.cc:
Added a using namespace TheISA, and untemplatized StaticInstPtr
base/remote_gdb.hh:
Added typedefs for Addr and MachInst
cpu/base.cc:
Added TheISA specifier to some variables exported from the isa.
cpu/base.hh:
Added a typedef for Addr, and TheISA to some variables from the ISA
cpu/base_dyn_inst.hh:
Untemplatized StaticInstPtr, and added TheISA specifier to some variables from the ISA.
cpu/exec_context.hh:
Added some typedefs for types from the isa, and added TheISA specifier to some variables from the isa
cpu/exetrace.hh:
Added typedefs for some types from the ISA, and untemplatized StaticInstPtr
cpu/memtest/memtest.cc:
cpu/o3/btb.cc:
dev/baddev.cc:
dev/ide_ctrl.cc:
dev/ide_disk.cc:
dev/isa_fake.cc:
dev/ns_gige.cc:
dev/pciconfigall.cc:
dev/platform.cc:
dev/sinic.cc:
dev/uart8250.cc:
kern/freebsd/freebsd_system.cc:
kern/linux/linux_system.cc:
kern/system_events.cc:
kern/tru64/dump_mbuf.cc:
kern/tru64/tru64_events.cc:
sim/process.cc:
sim/pseudo_inst.cc:
sim/system.cc:
Added using namespace TheISA
cpu/memtest/memtest.hh:
cpu/trace/opt_cpu.hh:
cpu/trace/reader/itx_reader.hh:
dev/ide_disk.hh:
dev/pcidev.hh:
dev/platform.hh:
dev/tsunami.hh:
sim/system.hh:
sim/vptr.hh:
Added typedef for Addr
cpu/o3/2bit_local_pred.hh:
Changed the include to use arch/isa_traits.hh instead of arch/alpha/isa_traits.hh. Added typedef for Addr
cpu/o3/alpha_cpu.hh:
Added typedefs for Addr and IntReg
cpu/o3/alpha_cpu_impl.hh:
Added this-> to setNextPC to fix a problem since it didn't depend on template parameters any more. Removed "typename" where it was no longer needed.
cpu/o3/alpha_dyn_inst.hh:
Cleaned up some typedefs, and untemplatized StaticInst
cpu/o3/alpha_dyn_inst_impl.hh:
untemplatized StaticInstPtr
cpu/o3/alpha_impl.hh:
Fixed up a typedef of MachInst
cpu/o3/bpred_unit_impl.hh:
Added a using TheISA::MachInst to a function
cpu/o3/btb.hh:
Changed an include from arch/alpha/isa_traits.hh to arch/isa_traits.hh, and added a typedef for Addr
cpu/o3/commit.hh:
Removed a typedef of Impl::ISA as ISA, since TheISA takes care of this now.
cpu/o3/cpu.cc:
Cleaned up namespace issues
cpu/o3/cpu.hh:
Cleaned up namespace usage
cpu/o3/decode.hh:
Removed typedef of ISA, and changed it to TheISA
cpu/o3/fetch.hh:
Fized up typedefs, and changed ISA to TheISA
cpu/o3/free_list.hh:
Changed include of arch/alpha/isa_traits.hh to arch/isa_traits.hh
cpu/o3/iew.hh:
Removed typedef of ISA
cpu/o3/iew_impl.hh:
Added TheISA namespace specifier to MachInst
cpu/o3/ras.hh:
Changed include from arch/alpha/isa_traits.hh to arch/isa_traits.hh, and added a typedef for Addr.
cpu/o3/regfile.hh:
Changed ISA to TheISA, and added some typedefs for Addr, IntReg, FloatReg, and MiscRegFile
cpu/o3/rename.hh:
Changed ISA to TheISA, and added a typedef for RegIndex
cpu/o3/rename_map.hh:
Added an include for arch/isa_traits.hh, and a typedef for RegIndex
cpu/o3/rob.hh:
Added a typedef for RegIndex
cpu/o3/store_set.hh:
cpu/o3/tournament_pred.hh:
Changed an include of arch/alpha/isa_traits.hh to arch/isa_traits.hh, and added a typedef of Addr
cpu/ozone/cpu.hh:
Changed ISA into TheISA, and untemplatized StaticInst
cpu/pc_event.cc:
Added namespace specifier TheISA to Addr types
cpu/profile.hh:
kern/kernel_stats.hh:
Added typedef for Addr, and untemplatized StaticInstPtr
cpu/simple/cpu.cc:
Changed using directive from LittleEndianGuest to AlphaISA, which will contain both namespaces. Added TheISA where needed, and untemplatized StaticInst
cpu/simple/cpu.hh:
Added a typedef for MachInst, and untemplatized StaticInst
cpu/static_inst.cc:
Untemplatized StaticInst
cpu/static_inst.hh:
Untemplatized StaticInst by using the TheISA namespace
dev/alpha_console.cc:
Added using namespace AlphaISA
dev/simple_disk.hh:
Added typedef for Addr and fixed up some formatting
dev/sinicreg.hh:
Added TheISA namespace specifier where needed
dev/tsunami.cc:
dev/tsunami_io.cc:
dev/tsunami_pchip.cc:
Added using namespace TheISA. It might be better for it to be AlphaISA
dev/tsunami_cchip.cc:
Added typedef for TheISA. It might be better for it to be AlphaISA
kern/linux/aligned.hh:
sim/pseudo_inst.hh:
Added TheISA namespace specifier to Addr
kern/linux/linux_threadinfo.hh:
Added typedef for Addr, and TheISA namespace specifier to StackPointerReg
kern/tru64/mbuf.hh:
Added TheISA to Addr type in structs
sim/process.hh:
Added typedefs of Addr, RegFile, and MachInst
sim/syscall_emul.cc:
Added using namespace TheISA, and a cast of VMPageSize to the int type
sim/syscall_emul.hh:
Added typecast for Addr, and TheISA namespace specifier for where needed
--HG--
extra : convert_revision : 91d4f6ca33a73b21c1f1771d74bfdea3b80eff45
2006-02-19 08:34:37 +01:00
|
|
|
typedef TheISA::RegIndex RegIndex;
|
2006-06-08 22:58:50 +02:00
|
|
|
// Integer register type.
|
Changes to untemplate StaticInst and StaticInstPtr, change the isa to a namespace instead of a class, an improvement to the architecture specific header file selection system, and fixed up a few include paths.
arch/alpha/alpha_linux_process.cc:
Added using directive for AlphaISA namespace
arch/alpha/alpha_memory.hh:
arch/alpha/isa/branch.isa:
cpu/pc_event.hh:
Added typedefs for Addr
arch/alpha/alpha_tru64_process.cc:
arch/alpha/arguments.cc:
Added using directive for AlphaISA
arch/alpha/ev5.hh:
Added an include of arch/alpha/isa_traits.hh, and a using directive for the AlphaISA namespace.
arch/alpha/faults.hh:
Added a typedef for the Addr type, and changed the formatting of the faults slightly.
arch/alpha/isa/main.isa:
Untemplatized StaticInst, added a using for namespace AlphaISA to show up in decoder.cc and the exec.ccs, relocated makeNop to decoder.hh
arch/alpha/isa/mem.isa:
Untemplatized StaticInst and StaticInstPtr
arch/alpha/isa/pal.isa:
cpu/base_dyn_inst.cc:
Untemplatized StaticInstPtr
arch/alpha/isa_traits.hh:
Changed variables to be externs instead of static since they are part of a namespace and not a class.
arch/alpha/stacktrace.cc:
Untemplatized StaticInstPtr, and added a using directive for AlphaISA.
arch/alpha/stacktrace.hh:
Added some typedefs for Addr and MachInst, and untemplatized StaticInstPtr
arch/alpha/vtophys.cc:
Added a using directive for AlphaISA
arch/alpha/vtophys.hh:
Added the AlphaISA namespace specifier where needed
arch/isa_parser.py:
Changed the placement of the definition of the decodeInst function to be outside the namespaceInst namespace.
base/loader/object_file.hh:
cpu/o3/bpred_unit.hh:
Added a typedef for Addr
base/loader/symtab.hh:
Added a typedef for Addr, and added a TheISA to Addr in another typedef
base/remote_gdb.cc:
Added a using namespace TheISA, and untemplatized StaticInstPtr
base/remote_gdb.hh:
Added typedefs for Addr and MachInst
cpu/base.cc:
Added TheISA specifier to some variables exported from the isa.
cpu/base.hh:
Added a typedef for Addr, and TheISA to some variables from the ISA
cpu/base_dyn_inst.hh:
Untemplatized StaticInstPtr, and added TheISA specifier to some variables from the ISA.
cpu/exec_context.hh:
Added some typedefs for types from the isa, and added TheISA specifier to some variables from the isa
cpu/exetrace.hh:
Added typedefs for some types from the ISA, and untemplatized StaticInstPtr
cpu/memtest/memtest.cc:
cpu/o3/btb.cc:
dev/baddev.cc:
dev/ide_ctrl.cc:
dev/ide_disk.cc:
dev/isa_fake.cc:
dev/ns_gige.cc:
dev/pciconfigall.cc:
dev/platform.cc:
dev/sinic.cc:
dev/uart8250.cc:
kern/freebsd/freebsd_system.cc:
kern/linux/linux_system.cc:
kern/system_events.cc:
kern/tru64/dump_mbuf.cc:
kern/tru64/tru64_events.cc:
sim/process.cc:
sim/pseudo_inst.cc:
sim/system.cc:
Added using namespace TheISA
cpu/memtest/memtest.hh:
cpu/trace/opt_cpu.hh:
cpu/trace/reader/itx_reader.hh:
dev/ide_disk.hh:
dev/pcidev.hh:
dev/platform.hh:
dev/tsunami.hh:
sim/system.hh:
sim/vptr.hh:
Added typedef for Addr
cpu/o3/2bit_local_pred.hh:
Changed the include to use arch/isa_traits.hh instead of arch/alpha/isa_traits.hh. Added typedef for Addr
cpu/o3/alpha_cpu.hh:
Added typedefs for Addr and IntReg
cpu/o3/alpha_cpu_impl.hh:
Added this-> to setNextPC to fix a problem since it didn't depend on template parameters any more. Removed "typename" where it was no longer needed.
cpu/o3/alpha_dyn_inst.hh:
Cleaned up some typedefs, and untemplatized StaticInst
cpu/o3/alpha_dyn_inst_impl.hh:
untemplatized StaticInstPtr
cpu/o3/alpha_impl.hh:
Fixed up a typedef of MachInst
cpu/o3/bpred_unit_impl.hh:
Added a using TheISA::MachInst to a function
cpu/o3/btb.hh:
Changed an include from arch/alpha/isa_traits.hh to arch/isa_traits.hh, and added a typedef for Addr
cpu/o3/commit.hh:
Removed a typedef of Impl::ISA as ISA, since TheISA takes care of this now.
cpu/o3/cpu.cc:
Cleaned up namespace issues
cpu/o3/cpu.hh:
Cleaned up namespace usage
cpu/o3/decode.hh:
Removed typedef of ISA, and changed it to TheISA
cpu/o3/fetch.hh:
Fized up typedefs, and changed ISA to TheISA
cpu/o3/free_list.hh:
Changed include of arch/alpha/isa_traits.hh to arch/isa_traits.hh
cpu/o3/iew.hh:
Removed typedef of ISA
cpu/o3/iew_impl.hh:
Added TheISA namespace specifier to MachInst
cpu/o3/ras.hh:
Changed include from arch/alpha/isa_traits.hh to arch/isa_traits.hh, and added a typedef for Addr.
cpu/o3/regfile.hh:
Changed ISA to TheISA, and added some typedefs for Addr, IntReg, FloatReg, and MiscRegFile
cpu/o3/rename.hh:
Changed ISA to TheISA, and added a typedef for RegIndex
cpu/o3/rename_map.hh:
Added an include for arch/isa_traits.hh, and a typedef for RegIndex
cpu/o3/rob.hh:
Added a typedef for RegIndex
cpu/o3/store_set.hh:
cpu/o3/tournament_pred.hh:
Changed an include of arch/alpha/isa_traits.hh to arch/isa_traits.hh, and added a typedef of Addr
cpu/ozone/cpu.hh:
Changed ISA into TheISA, and untemplatized StaticInst
cpu/pc_event.cc:
Added namespace specifier TheISA to Addr types
cpu/profile.hh:
kern/kernel_stats.hh:
Added typedef for Addr, and untemplatized StaticInstPtr
cpu/simple/cpu.cc:
Changed using directive from LittleEndianGuest to AlphaISA, which will contain both namespaces. Added TheISA where needed, and untemplatized StaticInst
cpu/simple/cpu.hh:
Added a typedef for MachInst, and untemplatized StaticInst
cpu/static_inst.cc:
Untemplatized StaticInst
cpu/static_inst.hh:
Untemplatized StaticInst by using the TheISA namespace
dev/alpha_console.cc:
Added using namespace AlphaISA
dev/simple_disk.hh:
Added typedef for Addr and fixed up some formatting
dev/sinicreg.hh:
Added TheISA namespace specifier where needed
dev/tsunami.cc:
dev/tsunami_io.cc:
dev/tsunami_pchip.cc:
Added using namespace TheISA. It might be better for it to be AlphaISA
dev/tsunami_cchip.cc:
Added typedef for TheISA. It might be better for it to be AlphaISA
kern/linux/aligned.hh:
sim/pseudo_inst.hh:
Added TheISA namespace specifier to Addr
kern/linux/linux_threadinfo.hh:
Added typedef for Addr, and TheISA namespace specifier to StackPointerReg
kern/tru64/mbuf.hh:
Added TheISA to Addr type in structs
sim/process.hh:
Added typedefs of Addr, RegFile, and MachInst
sim/syscall_emul.cc:
Added using namespace TheISA, and a cast of VMPageSize to the int type
sim/syscall_emul.hh:
Added typecast for Addr, and TheISA namespace specifier for where needed
--HG--
extra : convert_revision : 91d4f6ca33a73b21c1f1771d74bfdea3b80eff45
2006-02-19 08:34:37 +01:00
|
|
|
typedef TheISA::IntReg IntReg;
|
2006-06-08 22:58:50 +02:00
|
|
|
// Floating point register type.
|
|
|
|
typedef TheISA::FloatReg FloatReg;
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
// The DynInstPtr type.
|
|
|
|
typedef typename Impl::DynInstPtr DynInstPtr;
|
|
|
|
|
|
|
|
// The list of instructions iterator type.
|
|
|
|
typedef typename std::list<DynInstPtr>::iterator ListIt;
|
|
|
|
|
2004-08-20 20:54:07 +02:00
|
|
|
enum {
|
2006-04-23 00:26:48 +02:00
|
|
|
MaxInstSrcRegs = TheISA::MaxInstSrcRegs, /// Max source regs
|
|
|
|
MaxInstDestRegs = TheISA::MaxInstDestRegs, /// Max dest regs
|
2004-08-20 20:54:07 +02:00
|
|
|
};
|
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
/** The StaticInst used by this BaseDynInst. */
|
Changes to untemplate StaticInst and StaticInstPtr, change the isa to a namespace instead of a class, an improvement to the architecture specific header file selection system, and fixed up a few include paths.
arch/alpha/alpha_linux_process.cc:
Added using directive for AlphaISA namespace
arch/alpha/alpha_memory.hh:
arch/alpha/isa/branch.isa:
cpu/pc_event.hh:
Added typedefs for Addr
arch/alpha/alpha_tru64_process.cc:
arch/alpha/arguments.cc:
Added using directive for AlphaISA
arch/alpha/ev5.hh:
Added an include of arch/alpha/isa_traits.hh, and a using directive for the AlphaISA namespace.
arch/alpha/faults.hh:
Added a typedef for the Addr type, and changed the formatting of the faults slightly.
arch/alpha/isa/main.isa:
Untemplatized StaticInst, added a using for namespace AlphaISA to show up in decoder.cc and the exec.ccs, relocated makeNop to decoder.hh
arch/alpha/isa/mem.isa:
Untemplatized StaticInst and StaticInstPtr
arch/alpha/isa/pal.isa:
cpu/base_dyn_inst.cc:
Untemplatized StaticInstPtr
arch/alpha/isa_traits.hh:
Changed variables to be externs instead of static since they are part of a namespace and not a class.
arch/alpha/stacktrace.cc:
Untemplatized StaticInstPtr, and added a using directive for AlphaISA.
arch/alpha/stacktrace.hh:
Added some typedefs for Addr and MachInst, and untemplatized StaticInstPtr
arch/alpha/vtophys.cc:
Added a using directive for AlphaISA
arch/alpha/vtophys.hh:
Added the AlphaISA namespace specifier where needed
arch/isa_parser.py:
Changed the placement of the definition of the decodeInst function to be outside the namespaceInst namespace.
base/loader/object_file.hh:
cpu/o3/bpred_unit.hh:
Added a typedef for Addr
base/loader/symtab.hh:
Added a typedef for Addr, and added a TheISA to Addr in another typedef
base/remote_gdb.cc:
Added a using namespace TheISA, and untemplatized StaticInstPtr
base/remote_gdb.hh:
Added typedefs for Addr and MachInst
cpu/base.cc:
Added TheISA specifier to some variables exported from the isa.
cpu/base.hh:
Added a typedef for Addr, and TheISA to some variables from the ISA
cpu/base_dyn_inst.hh:
Untemplatized StaticInstPtr, and added TheISA specifier to some variables from the ISA.
cpu/exec_context.hh:
Added some typedefs for types from the isa, and added TheISA specifier to some variables from the isa
cpu/exetrace.hh:
Added typedefs for some types from the ISA, and untemplatized StaticInstPtr
cpu/memtest/memtest.cc:
cpu/o3/btb.cc:
dev/baddev.cc:
dev/ide_ctrl.cc:
dev/ide_disk.cc:
dev/isa_fake.cc:
dev/ns_gige.cc:
dev/pciconfigall.cc:
dev/platform.cc:
dev/sinic.cc:
dev/uart8250.cc:
kern/freebsd/freebsd_system.cc:
kern/linux/linux_system.cc:
kern/system_events.cc:
kern/tru64/dump_mbuf.cc:
kern/tru64/tru64_events.cc:
sim/process.cc:
sim/pseudo_inst.cc:
sim/system.cc:
Added using namespace TheISA
cpu/memtest/memtest.hh:
cpu/trace/opt_cpu.hh:
cpu/trace/reader/itx_reader.hh:
dev/ide_disk.hh:
dev/pcidev.hh:
dev/platform.hh:
dev/tsunami.hh:
sim/system.hh:
sim/vptr.hh:
Added typedef for Addr
cpu/o3/2bit_local_pred.hh:
Changed the include to use arch/isa_traits.hh instead of arch/alpha/isa_traits.hh. Added typedef for Addr
cpu/o3/alpha_cpu.hh:
Added typedefs for Addr and IntReg
cpu/o3/alpha_cpu_impl.hh:
Added this-> to setNextPC to fix a problem since it didn't depend on template parameters any more. Removed "typename" where it was no longer needed.
cpu/o3/alpha_dyn_inst.hh:
Cleaned up some typedefs, and untemplatized StaticInst
cpu/o3/alpha_dyn_inst_impl.hh:
untemplatized StaticInstPtr
cpu/o3/alpha_impl.hh:
Fixed up a typedef of MachInst
cpu/o3/bpred_unit_impl.hh:
Added a using TheISA::MachInst to a function
cpu/o3/btb.hh:
Changed an include from arch/alpha/isa_traits.hh to arch/isa_traits.hh, and added a typedef for Addr
cpu/o3/commit.hh:
Removed a typedef of Impl::ISA as ISA, since TheISA takes care of this now.
cpu/o3/cpu.cc:
Cleaned up namespace issues
cpu/o3/cpu.hh:
Cleaned up namespace usage
cpu/o3/decode.hh:
Removed typedef of ISA, and changed it to TheISA
cpu/o3/fetch.hh:
Fized up typedefs, and changed ISA to TheISA
cpu/o3/free_list.hh:
Changed include of arch/alpha/isa_traits.hh to arch/isa_traits.hh
cpu/o3/iew.hh:
Removed typedef of ISA
cpu/o3/iew_impl.hh:
Added TheISA namespace specifier to MachInst
cpu/o3/ras.hh:
Changed include from arch/alpha/isa_traits.hh to arch/isa_traits.hh, and added a typedef for Addr.
cpu/o3/regfile.hh:
Changed ISA to TheISA, and added some typedefs for Addr, IntReg, FloatReg, and MiscRegFile
cpu/o3/rename.hh:
Changed ISA to TheISA, and added a typedef for RegIndex
cpu/o3/rename_map.hh:
Added an include for arch/isa_traits.hh, and a typedef for RegIndex
cpu/o3/rob.hh:
Added a typedef for RegIndex
cpu/o3/store_set.hh:
cpu/o3/tournament_pred.hh:
Changed an include of arch/alpha/isa_traits.hh to arch/isa_traits.hh, and added a typedef of Addr
cpu/ozone/cpu.hh:
Changed ISA into TheISA, and untemplatized StaticInst
cpu/pc_event.cc:
Added namespace specifier TheISA to Addr types
cpu/profile.hh:
kern/kernel_stats.hh:
Added typedef for Addr, and untemplatized StaticInstPtr
cpu/simple/cpu.cc:
Changed using directive from LittleEndianGuest to AlphaISA, which will contain both namespaces. Added TheISA where needed, and untemplatized StaticInst
cpu/simple/cpu.hh:
Added a typedef for MachInst, and untemplatized StaticInst
cpu/static_inst.cc:
Untemplatized StaticInst
cpu/static_inst.hh:
Untemplatized StaticInst by using the TheISA namespace
dev/alpha_console.cc:
Added using namespace AlphaISA
dev/simple_disk.hh:
Added typedef for Addr and fixed up some formatting
dev/sinicreg.hh:
Added TheISA namespace specifier where needed
dev/tsunami.cc:
dev/tsunami_io.cc:
dev/tsunami_pchip.cc:
Added using namespace TheISA. It might be better for it to be AlphaISA
dev/tsunami_cchip.cc:
Added typedef for TheISA. It might be better for it to be AlphaISA
kern/linux/aligned.hh:
sim/pseudo_inst.hh:
Added TheISA namespace specifier to Addr
kern/linux/linux_threadinfo.hh:
Added typedef for Addr, and TheISA namespace specifier to StackPointerReg
kern/tru64/mbuf.hh:
Added TheISA to Addr type in structs
sim/process.hh:
Added typedefs of Addr, RegFile, and MachInst
sim/syscall_emul.cc:
Added using namespace TheISA, and a cast of VMPageSize to the int type
sim/syscall_emul.hh:
Added typecast for Addr, and TheISA namespace specifier for where needed
--HG--
extra : convert_revision : 91d4f6ca33a73b21c1f1771d74bfdea3b80eff45
2006-02-19 08:34:37 +01:00
|
|
|
StaticInstPtr staticInst;
|
2004-08-20 20:54:07 +02:00
|
|
|
|
|
|
|
////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// INSTRUCTION EXECUTION
|
|
|
|
//
|
|
|
|
////////////////////////////////////////////
|
2006-04-23 00:26:48 +02:00
|
|
|
/** InstRecord that tracks this instructions. */
|
2004-08-20 20:54:07 +02:00
|
|
|
Trace::InstRecord *traceData;
|
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
/**
|
|
|
|
* Does a read to a given address.
|
|
|
|
* @param addr The address to read.
|
|
|
|
* @param data The read's data is written into this parameter.
|
|
|
|
* @param flags The request's flags.
|
|
|
|
* @return Returns any fault due to the read.
|
|
|
|
*/
|
2004-08-20 20:54:07 +02:00
|
|
|
template <class T>
|
2006-02-22 02:10:40 +01:00
|
|
|
Fault read(Addr addr, T &data, unsigned flags);
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
/**
|
|
|
|
* Does a write to a given address.
|
|
|
|
* @param data The data to be written.
|
|
|
|
* @param addr The address to write to.
|
|
|
|
* @param flags The request's flags.
|
|
|
|
* @param res The result of the write (for load locked/store conditionals).
|
|
|
|
* @return Returns any fault due to the write.
|
|
|
|
*/
|
2004-08-20 20:54:07 +02:00
|
|
|
template <class T>
|
2006-02-22 02:10:40 +01:00
|
|
|
Fault write(T data, Addr addr, unsigned flags,
|
2004-08-20 20:54:07 +02:00
|
|
|
uint64_t *res);
|
|
|
|
|
|
|
|
void prefetch(Addr addr, unsigned flags);
|
|
|
|
void writeHint(Addr addr, int size, unsigned flags);
|
2006-02-22 02:10:40 +01:00
|
|
|
Fault copySrcTranslate(Addr src);
|
|
|
|
Fault copy(Addr dest);
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2005-05-19 07:28:25 +02:00
|
|
|
/** @todo: Consider making this private. */
|
2004-08-20 20:54:07 +02:00
|
|
|
public:
|
|
|
|
/** The sequence number of the instruction. */
|
|
|
|
InstSeqNum seqNum;
|
|
|
|
|
2006-06-14 19:12:41 +02:00
|
|
|
enum Status {
|
|
|
|
IqEntry, /// Instruction is in the IQ
|
|
|
|
RobEntry, /// Instruction is in the ROB
|
|
|
|
LsqEntry, /// Instruction is in the LSQ
|
|
|
|
Completed, /// Instruction has completed
|
|
|
|
ResultReady, /// Instruction has its result
|
|
|
|
CanIssue, /// Instruction can issue and execute
|
|
|
|
Issued, /// Instruction has issued
|
|
|
|
Executed, /// Instruction has executed
|
|
|
|
CanCommit, /// Instruction can commit
|
|
|
|
AtCommit, /// Instruction has reached commit
|
|
|
|
Committed, /// Instruction has committed
|
|
|
|
Squashed, /// Instruction is squashed
|
|
|
|
SquashedInIQ, /// Instruction is squashed in the IQ
|
|
|
|
SquashedInLSQ, /// Instruction is squashed in the LSQ
|
|
|
|
SquashedInROB, /// Instruction is squashed in the ROB
|
|
|
|
RecoverInst, /// Is a recover instruction
|
|
|
|
BlockingInst, /// Is a blocking instruction
|
|
|
|
ThreadsyncWait, /// Is a thread synchronization instruction
|
|
|
|
SerializeBefore, /// Needs to serialize on
|
|
|
|
/// instructions ahead of it
|
|
|
|
SerializeAfter, /// Needs to serialize instructions behind it
|
|
|
|
SerializeHandled, /// Serialization has been handled
|
|
|
|
NumStatus
|
|
|
|
};
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-06-14 19:12:41 +02:00
|
|
|
/** The status of this BaseDynInst. Several bits can be set. */
|
|
|
|
std::bitset<NumStatus> status;
|
2004-08-20 20:54:07 +02:00
|
|
|
|
|
|
|
/** The thread this instruction is from. */
|
|
|
|
short threadNumber;
|
|
|
|
|
|
|
|
/** data address space ID, for loads & stores. */
|
|
|
|
short asid;
|
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
/** How many source registers are ready. */
|
|
|
|
unsigned readyRegs;
|
|
|
|
|
2006-06-16 23:08:47 +02:00
|
|
|
/** Pointer to the Impl's CPU object. */
|
|
|
|
ImplCPU *cpu;
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-06-06 23:32:21 +02:00
|
|
|
/** Pointer to the thread state. */
|
2006-04-23 00:26:48 +02:00
|
|
|
ImplState *thread;
|
2004-08-20 20:54:07 +02:00
|
|
|
|
|
|
|
/** The kind of fault this instruction has generated. */
|
2006-02-22 02:10:40 +01:00
|
|
|
Fault fault;
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
/** The memory request. */
|
2006-06-03 00:15:20 +02:00
|
|
|
Request *req;
|
|
|
|
|
2006-06-13 01:04:42 +02:00
|
|
|
/** Pointer to the data for the memory access. */
|
2006-06-03 00:15:20 +02:00
|
|
|
uint8_t *memData;
|
2006-04-23 00:26:48 +02:00
|
|
|
|
2004-08-20 20:54:07 +02:00
|
|
|
/** The effective virtual address (lds & stores only). */
|
|
|
|
Addr effAddr;
|
|
|
|
|
|
|
|
/** The effective physical address. */
|
|
|
|
Addr physEffAddr;
|
|
|
|
|
|
|
|
/** Effective virtual address for a copy source. */
|
|
|
|
Addr copySrcEffAddr;
|
|
|
|
|
|
|
|
/** Effective physical address for a copy source. */
|
|
|
|
Addr copySrcPhysEffAddr;
|
|
|
|
|
|
|
|
/** The memory request flags (from translation). */
|
|
|
|
unsigned memReqFlags;
|
|
|
|
|
2005-02-26 00:00:49 +01:00
|
|
|
union Result {
|
|
|
|
uint64_t integer;
|
|
|
|
float fp;
|
|
|
|
double dbl;
|
|
|
|
};
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2005-02-26 00:00:49 +01:00
|
|
|
/** The result of the instruction; assumes for now that there's only one
|
|
|
|
* destination register.
|
|
|
|
*/
|
|
|
|
Result instResult;
|
2004-08-20 20:54:07 +02:00
|
|
|
|
|
|
|
/** PC of this instruction. */
|
|
|
|
Addr PC;
|
|
|
|
|
|
|
|
/** Next non-speculative PC. It is not filled in at fetch, but rather
|
|
|
|
* once the target of the branch is truly known (either decode or
|
|
|
|
* execute).
|
|
|
|
*/
|
|
|
|
Addr nextPC;
|
|
|
|
|
2006-07-23 19:39:42 +02:00
|
|
|
/** Next non-speculative NPC. Target PC for Mips or Sparc. */
|
|
|
|
Addr nextNPC;
|
|
|
|
|
2004-08-20 20:54:07 +02:00
|
|
|
/** Predicted next PC. */
|
|
|
|
Addr predPC;
|
|
|
|
|
|
|
|
/** Count of total number of dynamic instructions. */
|
|
|
|
static int instcount;
|
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
#ifdef DEBUG
|
|
|
|
void dumpSNList();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/** Whether or not the source register is ready.
|
|
|
|
* @todo: Not sure this should be here vs the derived class.
|
2004-08-20 20:54:07 +02:00
|
|
|
*/
|
|
|
|
bool _readySrcRegIdx[MaxInstSrcRegs];
|
|
|
|
|
|
|
|
public:
|
2006-04-23 00:26:48 +02:00
|
|
|
/** BaseDynInst constructor given a binary instruction.
|
|
|
|
* @param inst The binary instruction.
|
|
|
|
* @param PC The PC of the instruction.
|
|
|
|
* @param pred_PC The predicted next PC.
|
|
|
|
* @param seq_num The sequence number of the instruction.
|
|
|
|
* @param cpu Pointer to the instruction's CPU.
|
|
|
|
*/
|
|
|
|
BaseDynInst(ExtMachInst inst, Addr PC, Addr pred_PC, InstSeqNum seq_num,
|
2006-06-16 23:08:47 +02:00
|
|
|
ImplCPU *cpu);
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
/** BaseDynInst constructor given a StaticInst pointer.
|
|
|
|
* @param _staticInst The StaticInst for this BaseDynInst.
|
|
|
|
*/
|
Changes to untemplate StaticInst and StaticInstPtr, change the isa to a namespace instead of a class, an improvement to the architecture specific header file selection system, and fixed up a few include paths.
arch/alpha/alpha_linux_process.cc:
Added using directive for AlphaISA namespace
arch/alpha/alpha_memory.hh:
arch/alpha/isa/branch.isa:
cpu/pc_event.hh:
Added typedefs for Addr
arch/alpha/alpha_tru64_process.cc:
arch/alpha/arguments.cc:
Added using directive for AlphaISA
arch/alpha/ev5.hh:
Added an include of arch/alpha/isa_traits.hh, and a using directive for the AlphaISA namespace.
arch/alpha/faults.hh:
Added a typedef for the Addr type, and changed the formatting of the faults slightly.
arch/alpha/isa/main.isa:
Untemplatized StaticInst, added a using for namespace AlphaISA to show up in decoder.cc and the exec.ccs, relocated makeNop to decoder.hh
arch/alpha/isa/mem.isa:
Untemplatized StaticInst and StaticInstPtr
arch/alpha/isa/pal.isa:
cpu/base_dyn_inst.cc:
Untemplatized StaticInstPtr
arch/alpha/isa_traits.hh:
Changed variables to be externs instead of static since they are part of a namespace and not a class.
arch/alpha/stacktrace.cc:
Untemplatized StaticInstPtr, and added a using directive for AlphaISA.
arch/alpha/stacktrace.hh:
Added some typedefs for Addr and MachInst, and untemplatized StaticInstPtr
arch/alpha/vtophys.cc:
Added a using directive for AlphaISA
arch/alpha/vtophys.hh:
Added the AlphaISA namespace specifier where needed
arch/isa_parser.py:
Changed the placement of the definition of the decodeInst function to be outside the namespaceInst namespace.
base/loader/object_file.hh:
cpu/o3/bpred_unit.hh:
Added a typedef for Addr
base/loader/symtab.hh:
Added a typedef for Addr, and added a TheISA to Addr in another typedef
base/remote_gdb.cc:
Added a using namespace TheISA, and untemplatized StaticInstPtr
base/remote_gdb.hh:
Added typedefs for Addr and MachInst
cpu/base.cc:
Added TheISA specifier to some variables exported from the isa.
cpu/base.hh:
Added a typedef for Addr, and TheISA to some variables from the ISA
cpu/base_dyn_inst.hh:
Untemplatized StaticInstPtr, and added TheISA specifier to some variables from the ISA.
cpu/exec_context.hh:
Added some typedefs for types from the isa, and added TheISA specifier to some variables from the isa
cpu/exetrace.hh:
Added typedefs for some types from the ISA, and untemplatized StaticInstPtr
cpu/memtest/memtest.cc:
cpu/o3/btb.cc:
dev/baddev.cc:
dev/ide_ctrl.cc:
dev/ide_disk.cc:
dev/isa_fake.cc:
dev/ns_gige.cc:
dev/pciconfigall.cc:
dev/platform.cc:
dev/sinic.cc:
dev/uart8250.cc:
kern/freebsd/freebsd_system.cc:
kern/linux/linux_system.cc:
kern/system_events.cc:
kern/tru64/dump_mbuf.cc:
kern/tru64/tru64_events.cc:
sim/process.cc:
sim/pseudo_inst.cc:
sim/system.cc:
Added using namespace TheISA
cpu/memtest/memtest.hh:
cpu/trace/opt_cpu.hh:
cpu/trace/reader/itx_reader.hh:
dev/ide_disk.hh:
dev/pcidev.hh:
dev/platform.hh:
dev/tsunami.hh:
sim/system.hh:
sim/vptr.hh:
Added typedef for Addr
cpu/o3/2bit_local_pred.hh:
Changed the include to use arch/isa_traits.hh instead of arch/alpha/isa_traits.hh. Added typedef for Addr
cpu/o3/alpha_cpu.hh:
Added typedefs for Addr and IntReg
cpu/o3/alpha_cpu_impl.hh:
Added this-> to setNextPC to fix a problem since it didn't depend on template parameters any more. Removed "typename" where it was no longer needed.
cpu/o3/alpha_dyn_inst.hh:
Cleaned up some typedefs, and untemplatized StaticInst
cpu/o3/alpha_dyn_inst_impl.hh:
untemplatized StaticInstPtr
cpu/o3/alpha_impl.hh:
Fixed up a typedef of MachInst
cpu/o3/bpred_unit_impl.hh:
Added a using TheISA::MachInst to a function
cpu/o3/btb.hh:
Changed an include from arch/alpha/isa_traits.hh to arch/isa_traits.hh, and added a typedef for Addr
cpu/o3/commit.hh:
Removed a typedef of Impl::ISA as ISA, since TheISA takes care of this now.
cpu/o3/cpu.cc:
Cleaned up namespace issues
cpu/o3/cpu.hh:
Cleaned up namespace usage
cpu/o3/decode.hh:
Removed typedef of ISA, and changed it to TheISA
cpu/o3/fetch.hh:
Fized up typedefs, and changed ISA to TheISA
cpu/o3/free_list.hh:
Changed include of arch/alpha/isa_traits.hh to arch/isa_traits.hh
cpu/o3/iew.hh:
Removed typedef of ISA
cpu/o3/iew_impl.hh:
Added TheISA namespace specifier to MachInst
cpu/o3/ras.hh:
Changed include from arch/alpha/isa_traits.hh to arch/isa_traits.hh, and added a typedef for Addr.
cpu/o3/regfile.hh:
Changed ISA to TheISA, and added some typedefs for Addr, IntReg, FloatReg, and MiscRegFile
cpu/o3/rename.hh:
Changed ISA to TheISA, and added a typedef for RegIndex
cpu/o3/rename_map.hh:
Added an include for arch/isa_traits.hh, and a typedef for RegIndex
cpu/o3/rob.hh:
Added a typedef for RegIndex
cpu/o3/store_set.hh:
cpu/o3/tournament_pred.hh:
Changed an include of arch/alpha/isa_traits.hh to arch/isa_traits.hh, and added a typedef of Addr
cpu/ozone/cpu.hh:
Changed ISA into TheISA, and untemplatized StaticInst
cpu/pc_event.cc:
Added namespace specifier TheISA to Addr types
cpu/profile.hh:
kern/kernel_stats.hh:
Added typedef for Addr, and untemplatized StaticInstPtr
cpu/simple/cpu.cc:
Changed using directive from LittleEndianGuest to AlphaISA, which will contain both namespaces. Added TheISA where needed, and untemplatized StaticInst
cpu/simple/cpu.hh:
Added a typedef for MachInst, and untemplatized StaticInst
cpu/static_inst.cc:
Untemplatized StaticInst
cpu/static_inst.hh:
Untemplatized StaticInst by using the TheISA namespace
dev/alpha_console.cc:
Added using namespace AlphaISA
dev/simple_disk.hh:
Added typedef for Addr and fixed up some formatting
dev/sinicreg.hh:
Added TheISA namespace specifier where needed
dev/tsunami.cc:
dev/tsunami_io.cc:
dev/tsunami_pchip.cc:
Added using namespace TheISA. It might be better for it to be AlphaISA
dev/tsunami_cchip.cc:
Added typedef for TheISA. It might be better for it to be AlphaISA
kern/linux/aligned.hh:
sim/pseudo_inst.hh:
Added TheISA namespace specifier to Addr
kern/linux/linux_threadinfo.hh:
Added typedef for Addr, and TheISA namespace specifier to StackPointerReg
kern/tru64/mbuf.hh:
Added TheISA to Addr type in structs
sim/process.hh:
Added typedefs of Addr, RegFile, and MachInst
sim/syscall_emul.cc:
Added using namespace TheISA, and a cast of VMPageSize to the int type
sim/syscall_emul.hh:
Added typecast for Addr, and TheISA namespace specifier for where needed
--HG--
extra : convert_revision : 91d4f6ca33a73b21c1f1771d74bfdea3b80eff45
2006-02-19 08:34:37 +01:00
|
|
|
BaseDynInst(StaticInstPtr &_staticInst);
|
2004-08-20 20:54:07 +02:00
|
|
|
|
|
|
|
/** BaseDynInst destructor. */
|
|
|
|
~BaseDynInst();
|
|
|
|
|
2005-02-26 00:00:49 +01:00
|
|
|
private:
|
2005-05-19 07:28:25 +02:00
|
|
|
/** Function to initialize variables in the constructors. */
|
2005-02-26 00:00:49 +01:00
|
|
|
void initVars();
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2005-02-26 00:00:49 +01:00
|
|
|
public:
|
2004-08-20 20:54:07 +02:00
|
|
|
/** Dumps out contents of this BaseDynInst. */
|
|
|
|
void dump();
|
|
|
|
|
|
|
|
/** Dumps out contents of this BaseDynInst into given string. */
|
|
|
|
void dump(std::string &outstring);
|
|
|
|
|
|
|
|
/** Returns the fault type. */
|
2006-02-22 02:10:40 +01:00
|
|
|
Fault getFault() { return fault; }
|
2004-08-20 20:54:07 +02:00
|
|
|
|
|
|
|
/** Checks whether or not this instruction has had its branch target
|
|
|
|
* calculated yet. For now it is not utilized and is hacked to be
|
|
|
|
* always false.
|
2006-04-23 00:26:48 +02:00
|
|
|
* @todo: Actually use this instruction.
|
2004-08-20 20:54:07 +02:00
|
|
|
*/
|
|
|
|
bool doneTargCalc() { return false; }
|
|
|
|
|
2005-05-19 07:28:25 +02:00
|
|
|
/** Returns the next PC. This could be the speculative next PC if it is
|
|
|
|
* called prior to the actual branch target being calculated.
|
|
|
|
*/
|
2004-08-20 20:54:07 +02:00
|
|
|
Addr readNextPC() { return nextPC; }
|
|
|
|
|
2006-07-23 19:39:42 +02:00
|
|
|
/** Returns the next NPC. This could be the speculative next NPC if it is
|
|
|
|
* called prior to the actual branch target being calculated.
|
|
|
|
*/
|
|
|
|
Addr readNextNPC() { return nextNPC; }
|
|
|
|
|
2004-08-20 20:54:07 +02:00
|
|
|
/** Set the predicted target of this current instruction. */
|
|
|
|
void setPredTarg(Addr predicted_PC) { predPC = predicted_PC; }
|
|
|
|
|
|
|
|
/** Returns the predicted target of the branch. */
|
|
|
|
Addr readPredTarg() { return predPC; }
|
|
|
|
|
|
|
|
/** Returns whether the instruction was predicted taken or not. */
|
2006-07-23 19:39:42 +02:00
|
|
|
bool predTaken()
|
|
|
|
#if THE_ISA == ALPHA_ISA
|
|
|
|
{ return predPC != (PC + sizeof(MachInst)); }
|
|
|
|
#else
|
|
|
|
{ return predPC != (nextPC + sizeof(MachInst)); }
|
|
|
|
#endif
|
2004-08-20 20:54:07 +02:00
|
|
|
|
|
|
|
/** Returns whether the instruction mispredicted. */
|
2006-07-23 19:39:42 +02:00
|
|
|
bool mispredicted()
|
|
|
|
#if THE_ISA == ALPHA_ISA
|
|
|
|
{ return predPC != nextPC; }
|
|
|
|
#else
|
|
|
|
{ return predPC != nextNPC; }
|
|
|
|
#endif
|
2004-08-20 20:54:07 +02:00
|
|
|
//
|
|
|
|
// Instruction types. Forward checks to StaticInst object.
|
|
|
|
//
|
|
|
|
bool isNop() const { return staticInst->isNop(); }
|
|
|
|
bool isMemRef() const { return staticInst->isMemRef(); }
|
|
|
|
bool isLoad() const { return staticInst->isLoad(); }
|
|
|
|
bool isStore() const { return staticInst->isStore(); }
|
2006-05-23 20:38:16 +02:00
|
|
|
bool isStoreConditional() const
|
|
|
|
{ return staticInst->isStoreConditional(); }
|
2004-08-20 20:54:07 +02:00
|
|
|
bool isInstPrefetch() const { return staticInst->isInstPrefetch(); }
|
|
|
|
bool isDataPrefetch() const { return staticInst->isDataPrefetch(); }
|
|
|
|
bool isCopy() const { return staticInst->isCopy(); }
|
|
|
|
bool isInteger() const { return staticInst->isInteger(); }
|
|
|
|
bool isFloating() const { return staticInst->isFloating(); }
|
|
|
|
bool isControl() const { return staticInst->isControl(); }
|
|
|
|
bool isCall() const { return staticInst->isCall(); }
|
|
|
|
bool isReturn() const { return staticInst->isReturn(); }
|
|
|
|
bool isDirectCtrl() const { return staticInst->isDirectCtrl(); }
|
|
|
|
bool isIndirectCtrl() const { return staticInst->isIndirectCtrl(); }
|
|
|
|
bool isCondCtrl() const { return staticInst->isCondCtrl(); }
|
|
|
|
bool isUncondCtrl() const { return staticInst->isUncondCtrl(); }
|
2006-07-23 19:39:42 +02:00
|
|
|
bool isCondDelaySlot() const { return staticInst->isCondDelaySlot(); }
|
2004-08-20 20:54:07 +02:00
|
|
|
bool isThreadSync() const { return staticInst->isThreadSync(); }
|
|
|
|
bool isSerializing() const { return staticInst->isSerializing(); }
|
2006-04-23 00:26:48 +02:00
|
|
|
bool isSerializeBefore() const
|
2006-06-14 19:12:41 +02:00
|
|
|
{ return staticInst->isSerializeBefore() || status[SerializeBefore]; }
|
2006-04-23 00:26:48 +02:00
|
|
|
bool isSerializeAfter() const
|
2006-06-14 19:12:41 +02:00
|
|
|
{ return staticInst->isSerializeAfter() || status[SerializeAfter]; }
|
2004-08-20 20:54:07 +02:00
|
|
|
bool isMemBarrier() const { return staticInst->isMemBarrier(); }
|
|
|
|
bool isWriteBarrier() const { return staticInst->isWriteBarrier(); }
|
|
|
|
bool isNonSpeculative() const { return staticInst->isNonSpeculative(); }
|
2006-04-23 00:26:48 +02:00
|
|
|
bool isQuiesce() const { return staticInst->isQuiesce(); }
|
2006-05-23 20:38:16 +02:00
|
|
|
bool isIprAccess() const { return staticInst->isIprAccess(); }
|
2006-05-11 20:12:34 +02:00
|
|
|
bool isUnverifiable() const { return staticInst->isUnverifiable(); }
|
2006-04-23 00:26:48 +02:00
|
|
|
|
|
|
|
/** Temporarily sets this instruction as a serialize before instruction. */
|
2006-06-14 19:12:41 +02:00
|
|
|
void setSerializeBefore() { status.set(SerializeBefore); }
|
2006-04-23 00:26:48 +02:00
|
|
|
|
|
|
|
/** Clears the serializeBefore part of this instruction. */
|
2006-06-14 19:12:41 +02:00
|
|
|
void clearSerializeBefore() { status.reset(SerializeBefore); }
|
2006-04-23 00:26:48 +02:00
|
|
|
|
|
|
|
/** Checks if this serializeBefore is only temporarily set. */
|
2006-06-14 19:12:41 +02:00
|
|
|
bool isTempSerializeBefore() { return status[SerializeBefore]; }
|
2006-04-23 00:26:48 +02:00
|
|
|
|
|
|
|
/** Temporarily sets this instruction as a serialize after instruction. */
|
2006-06-14 19:12:41 +02:00
|
|
|
void setSerializeAfter() { status.set(SerializeAfter); }
|
2006-04-23 00:26:48 +02:00
|
|
|
|
|
|
|
/** Clears the serializeAfter part of this instruction.*/
|
2006-06-14 19:12:41 +02:00
|
|
|
void clearSerializeAfter() { status.reset(SerializeAfter); }
|
2006-04-23 00:26:48 +02:00
|
|
|
|
|
|
|
/** Checks if this serializeAfter is only temporarily set. */
|
2006-06-14 19:12:41 +02:00
|
|
|
bool isTempSerializeAfter() { return status[SerializeAfter]; }
|
2006-04-23 00:26:48 +02:00
|
|
|
|
2006-06-14 19:12:41 +02:00
|
|
|
/** Sets the serialization part of this instruction as handled. */
|
|
|
|
void setSerializeHandled() { status.set(SerializeHandled); }
|
2006-04-23 00:26:48 +02:00
|
|
|
|
|
|
|
/** Checks if the serialization part of this instruction has been
|
|
|
|
* handled. This does not apply to the temporary serializing
|
|
|
|
* state; it only applies to this instruction's own permanent
|
|
|
|
* serializing state.
|
|
|
|
*/
|
2006-06-14 19:12:41 +02:00
|
|
|
bool isSerializeHandled() { return status[SerializeHandled]; }
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2005-02-26 00:00:49 +01:00
|
|
|
/** Returns the opclass of this instruction. */
|
|
|
|
OpClass opClass() const { return staticInst->opClass(); }
|
|
|
|
|
|
|
|
/** Returns the branch target address. */
|
|
|
|
Addr branchTarget() const { return staticInst->branchTarget(PC); }
|
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
/** Returns the number of source registers. */
|
|
|
|
int8_t numSrcRegs() const { return staticInst->numSrcRegs(); }
|
2005-05-19 07:28:25 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
/** Returns the number of destination registers. */
|
2004-08-20 20:54:07 +02:00
|
|
|
int8_t numDestRegs() const { return staticInst->numDestRegs(); }
|
|
|
|
|
|
|
|
// the following are used to track physical register usage
|
|
|
|
// for machines with separate int & FP reg files
|
|
|
|
int8_t numFPDestRegs() const { return staticInst->numFPDestRegs(); }
|
|
|
|
int8_t numIntDestRegs() const { return staticInst->numIntDestRegs(); }
|
|
|
|
|
|
|
|
/** Returns the logical register index of the i'th destination register. */
|
2006-04-23 00:26:48 +02:00
|
|
|
RegIndex destRegIdx(int i) const { return staticInst->destRegIdx(i); }
|
2004-08-20 20:54:07 +02:00
|
|
|
|
|
|
|
/** Returns the logical register index of the i'th source register. */
|
2006-04-23 00:26:48 +02:00
|
|
|
RegIndex srcRegIdx(int i) const { return staticInst->srcRegIdx(i); }
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2005-05-19 07:28:25 +02:00
|
|
|
/** Returns the result of an integer instruction. */
|
2005-02-26 00:00:49 +01:00
|
|
|
uint64_t readIntResult() { return instResult.integer; }
|
2005-05-19 07:28:25 +02:00
|
|
|
|
|
|
|
/** Returns the result of a floating point instruction. */
|
2005-02-26 00:00:49 +01:00
|
|
|
float readFloatResult() { return instResult.fp; }
|
2005-05-19 07:28:25 +02:00
|
|
|
|
|
|
|
/** Returns the result of a floating point (double) instruction. */
|
2005-02-26 00:00:49 +01:00
|
|
|
double readDoubleResult() { return instResult.dbl; }
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-06-13 01:04:42 +02:00
|
|
|
/** Records an integer register being set to a value. */
|
2006-05-11 20:12:34 +02:00
|
|
|
void setIntReg(const StaticInst *si, int idx, uint64_t val)
|
|
|
|
{
|
|
|
|
instResult.integer = val;
|
|
|
|
}
|
|
|
|
|
2006-06-13 01:04:42 +02:00
|
|
|
/** Records an fp register being set to a value. */
|
2006-06-08 22:58:50 +02:00
|
|
|
void setFloatReg(const StaticInst *si, int idx, FloatReg val, int width)
|
|
|
|
{
|
|
|
|
if (width == 32)
|
|
|
|
instResult.fp = val;
|
|
|
|
else if (width == 64)
|
|
|
|
instResult.dbl = val;
|
|
|
|
else
|
|
|
|
panic("Unsupported width!");
|
|
|
|
}
|
|
|
|
|
2006-06-13 01:04:42 +02:00
|
|
|
/** Records an fp register being set to a value. */
|
2006-06-08 22:58:50 +02:00
|
|
|
void setFloatReg(const StaticInst *si, int idx, FloatReg val)
|
2006-05-11 20:12:34 +02:00
|
|
|
{
|
|
|
|
instResult.fp = val;
|
|
|
|
}
|
|
|
|
|
2006-06-13 01:04:42 +02:00
|
|
|
/** Records an fp register being set to an integer value. */
|
2006-06-08 22:58:50 +02:00
|
|
|
void setFloatRegBits(const StaticInst *si, int idx, uint64_t val, int width)
|
2006-05-11 20:12:34 +02:00
|
|
|
{
|
2006-06-08 22:58:50 +02:00
|
|
|
instResult.integer = val;
|
2006-05-11 20:12:34 +02:00
|
|
|
}
|
|
|
|
|
2006-06-13 01:04:42 +02:00
|
|
|
/** Records an fp register being set to an integer value. */
|
2006-06-08 22:58:50 +02:00
|
|
|
void setFloatRegBits(const StaticInst *si, int idx, uint64_t val)
|
2006-05-11 20:12:34 +02:00
|
|
|
{
|
|
|
|
instResult.integer = val;
|
|
|
|
}
|
|
|
|
|
2004-08-20 20:54:07 +02:00
|
|
|
/** Records that one of the source registers is ready. */
|
2006-04-23 00:26:48 +02:00
|
|
|
void markSrcRegReady();
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-05-23 22:57:14 +02:00
|
|
|
/** Marks a specific register as ready. */
|
2006-04-23 00:26:48 +02:00
|
|
|
void markSrcRegReady(RegIndex src_idx);
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2005-05-19 07:28:25 +02:00
|
|
|
/** Returns if a source register is ready. */
|
2005-02-26 00:00:49 +01:00
|
|
|
bool isReadySrcRegIdx(int idx) const
|
|
|
|
{
|
|
|
|
return this->_readySrcRegIdx[idx];
|
|
|
|
}
|
|
|
|
|
2005-05-19 07:28:25 +02:00
|
|
|
/** Sets this instruction as completed. */
|
2006-06-14 19:12:41 +02:00
|
|
|
void setCompleted() { status.set(Completed); }
|
2005-02-26 00:00:49 +01:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
/** Returns whether or not this instruction is completed. */
|
2006-06-14 19:12:41 +02:00
|
|
|
bool isCompleted() const { return status[Completed]; }
|
2005-02-26 00:00:49 +01:00
|
|
|
|
2006-06-14 19:12:41 +02:00
|
|
|
/** Marks the result as ready. */
|
|
|
|
void setResultReady() { status.set(ResultReady); }
|
2006-05-11 20:12:34 +02:00
|
|
|
|
2006-06-14 19:12:41 +02:00
|
|
|
/** Returns whether or not the result is ready. */
|
|
|
|
bool isResultReady() const { return status[ResultReady]; }
|
2006-05-11 20:12:34 +02:00
|
|
|
|
2004-08-20 20:54:07 +02:00
|
|
|
/** Sets this instruction as ready to issue. */
|
2006-06-14 19:12:41 +02:00
|
|
|
void setCanIssue() { status.set(CanIssue); }
|
2004-08-20 20:54:07 +02:00
|
|
|
|
|
|
|
/** Returns whether or not this instruction is ready to issue. */
|
2006-06-14 19:12:41 +02:00
|
|
|
bool readyToIssue() const { return status[CanIssue]; }
|
2004-08-20 20:54:07 +02:00
|
|
|
|
|
|
|
/** Sets this instruction as issued from the IQ. */
|
2006-06-14 19:12:41 +02:00
|
|
|
void setIssued() { status.set(Issued); }
|
2004-08-20 20:54:07 +02:00
|
|
|
|
|
|
|
/** Returns whether or not this instruction has issued. */
|
2006-06-14 19:12:41 +02:00
|
|
|
bool isIssued() const { return status[Issued]; }
|
2004-08-20 20:54:07 +02:00
|
|
|
|
|
|
|
/** Sets this instruction as executed. */
|
2006-06-14 19:12:41 +02:00
|
|
|
void setExecuted() { status.set(Executed); }
|
2004-08-20 20:54:07 +02:00
|
|
|
|
|
|
|
/** Returns whether or not this instruction has executed. */
|
2006-06-14 19:12:41 +02:00
|
|
|
bool isExecuted() const { return status[Executed]; }
|
2004-08-20 20:54:07 +02:00
|
|
|
|
|
|
|
/** Sets this instruction as ready to commit. */
|
2006-06-14 19:12:41 +02:00
|
|
|
void setCanCommit() { status.set(CanCommit); }
|
2004-08-20 20:54:07 +02:00
|
|
|
|
Update to make multiple instruction issue and different latencies work.
Also change to ref counted DynInst.
SConscript:
Add branch predictor, BTB, load store queue, and storesets.
arch/isa_parser.py:
Specify the template parameter for AlphaDynInst
base/traceflags.py:
Add load store queue, store set, and mem dependence unit to the
list of trace flags.
cpu/base_dyn_inst.cc:
Change formating, add in debug statement.
cpu/base_dyn_inst.hh:
Change DynInst to be RefCounted, add flag to clear whether or not this
instruction can commit. This is likely to be removed in the future.
cpu/beta_cpu/alpha_dyn_inst.cc:
AlphaDynInst has been changed to be templated, so now this CC file
is just used to force instantiations of AlphaDynInst.
cpu/beta_cpu/alpha_dyn_inst.hh:
Changed AlphaDynInst to be templated on Impl. Removed some unnecessary
functions.
cpu/beta_cpu/alpha_full_cpu.cc:
AlphaFullCPU has been changed to be templated, so this CC file is now
just used to force instantation of AlphaFullCPU.
cpu/beta_cpu/alpha_full_cpu.hh:
Change AlphaFullCPU to be templated on Impl.
cpu/beta_cpu/alpha_impl.hh:
Update it to reflect AlphaDynInst and AlphaFullCPU being templated
on Impl. Also removed time buffers from here, as they are really
a part of the CPU and are thus in the CPU policy now.
cpu/beta_cpu/alpha_params.hh:
Make AlphaSimpleParams inherit from the BaseFullCPU so that it doesn't
need to specifically declare any parameters that are already in the
BaseFullCPU.
cpu/beta_cpu/comm.hh:
Changed the structure of the time buffer communication structs. Now
they include the size of the packet of instructions it is sending.
Added some parameters to the backwards communication struct, mainly
for squashing.
cpu/beta_cpu/commit.hh:
Update typenames to reflect change in location of time buffer structs.
Update DynInst to DynInstPtr (it is refcounted now).
cpu/beta_cpu/commit_impl.hh:
Formatting changes mainly. Also sends back proper information
on branch mispredicts so that the bpred unit can update itself.
Updated behavior for non-speculative instructions (stores, any
other non-spec instructions): once they reach the head of the ROB,
the ROB signals back to the IQ that it can go ahead and issue the
non-speculative instruction. The instruction itself is updated so that
commit won't try to commit it again until it is done executing.
cpu/beta_cpu/cpu_policy.hh:
Added branch prediction unit, mem dependence prediction unit, load
store queue. Moved time buffer structs from AlphaSimpleImpl to here.
cpu/beta_cpu/decode.hh:
Changed typedefs to reflect change in location of time buffer structs
and also the change from DynInst to ref counted DynInstPtr.
cpu/beta_cpu/decode_impl.hh:
Continues to buffer instructions even while unblocking now. Changed
how it loops through groups of instructions so it can properly block
during the middle of a group of instructions.
cpu/beta_cpu/fetch.hh:
Changed typedefs to reflect change in location of time buffer structs
and the change to ref counted DynInsts. Also added in branch
brediction unit.
cpu/beta_cpu/fetch_impl.hh:
Add in branch prediction. Changed how fetch checks inputs and its
current state to make for easier logic.
cpu/beta_cpu/free_list.cc:
Changed int regs and float regs to logically use one flat namespace.
Future change will be moving them to a single scoreboard to conserve
space.
cpu/beta_cpu/free_list.hh:
Mostly debugging statements. Might be removed for performance in future.
cpu/beta_cpu/full_cpu.cc:
Added in some debugging statements. Updated BaseFullCPU to take
a params object.
cpu/beta_cpu/full_cpu.hh:
Added params class within BaseCPU that other param classes will be
able to inherit from. Updated typedefs to reflect change in location
of time buffer structs and ref counted DynInst.
cpu/beta_cpu/iew.hh:
Updated typedefs to reflect change in location of time buffer structs
and use of ref counted DynInsts.
cpu/beta_cpu/iew_impl.hh:
Added in load store queue, updated iew to be able to execute non-
speculative instructions, instead of having them execute in commit.
cpu/beta_cpu/inst_queue.hh:
Updated change to ref counted DynInsts. Changed inst queue to hold
non-speculative instructions as well, which are issued only when
commit signals backwards that a nonspeculative instruction is at
the head of the ROB.
cpu/beta_cpu/inst_queue_impl.hh:
Updated to allow for non-speculative instructions to be in the inst
queue. Also added some debug functions.
cpu/beta_cpu/regfile.hh:
Added debugging statements, changed formatting.
cpu/beta_cpu/rename.hh:
Updated typedefs, added some functions to clean up code.
cpu/beta_cpu/rename_impl.hh:
Moved some code into functions to make it easier to read.
cpu/beta_cpu/rename_map.cc:
Changed int and float reg behavior to use a single flat namespace. In
the future, the rename maps can be combined to a single rename map to
save space.
cpu/beta_cpu/rename_map.hh:
Added destructor.
cpu/beta_cpu/rob.hh:
Updated it with change from DynInst to ref counted DynInst.
cpu/beta_cpu/rob_impl.hh:
Formatting, updated to use ref counted DynInst.
cpu/static_inst.hh:
Updated forward declaration for AlphaDynInst now that it is templated.
--HG--
extra : convert_revision : 1045f240ee9b6a4bd368e1806aca029ebbdc6dd3
2004-09-23 20:06:03 +02:00
|
|
|
/** Clears this instruction as being ready to commit. */
|
2006-06-14 19:12:41 +02:00
|
|
|
void clearCanCommit() { status.reset(CanCommit); }
|
Update to make multiple instruction issue and different latencies work.
Also change to ref counted DynInst.
SConscript:
Add branch predictor, BTB, load store queue, and storesets.
arch/isa_parser.py:
Specify the template parameter for AlphaDynInst
base/traceflags.py:
Add load store queue, store set, and mem dependence unit to the
list of trace flags.
cpu/base_dyn_inst.cc:
Change formating, add in debug statement.
cpu/base_dyn_inst.hh:
Change DynInst to be RefCounted, add flag to clear whether or not this
instruction can commit. This is likely to be removed in the future.
cpu/beta_cpu/alpha_dyn_inst.cc:
AlphaDynInst has been changed to be templated, so now this CC file
is just used to force instantiations of AlphaDynInst.
cpu/beta_cpu/alpha_dyn_inst.hh:
Changed AlphaDynInst to be templated on Impl. Removed some unnecessary
functions.
cpu/beta_cpu/alpha_full_cpu.cc:
AlphaFullCPU has been changed to be templated, so this CC file is now
just used to force instantation of AlphaFullCPU.
cpu/beta_cpu/alpha_full_cpu.hh:
Change AlphaFullCPU to be templated on Impl.
cpu/beta_cpu/alpha_impl.hh:
Update it to reflect AlphaDynInst and AlphaFullCPU being templated
on Impl. Also removed time buffers from here, as they are really
a part of the CPU and are thus in the CPU policy now.
cpu/beta_cpu/alpha_params.hh:
Make AlphaSimpleParams inherit from the BaseFullCPU so that it doesn't
need to specifically declare any parameters that are already in the
BaseFullCPU.
cpu/beta_cpu/comm.hh:
Changed the structure of the time buffer communication structs. Now
they include the size of the packet of instructions it is sending.
Added some parameters to the backwards communication struct, mainly
for squashing.
cpu/beta_cpu/commit.hh:
Update typenames to reflect change in location of time buffer structs.
Update DynInst to DynInstPtr (it is refcounted now).
cpu/beta_cpu/commit_impl.hh:
Formatting changes mainly. Also sends back proper information
on branch mispredicts so that the bpred unit can update itself.
Updated behavior for non-speculative instructions (stores, any
other non-spec instructions): once they reach the head of the ROB,
the ROB signals back to the IQ that it can go ahead and issue the
non-speculative instruction. The instruction itself is updated so that
commit won't try to commit it again until it is done executing.
cpu/beta_cpu/cpu_policy.hh:
Added branch prediction unit, mem dependence prediction unit, load
store queue. Moved time buffer structs from AlphaSimpleImpl to here.
cpu/beta_cpu/decode.hh:
Changed typedefs to reflect change in location of time buffer structs
and also the change from DynInst to ref counted DynInstPtr.
cpu/beta_cpu/decode_impl.hh:
Continues to buffer instructions even while unblocking now. Changed
how it loops through groups of instructions so it can properly block
during the middle of a group of instructions.
cpu/beta_cpu/fetch.hh:
Changed typedefs to reflect change in location of time buffer structs
and the change to ref counted DynInsts. Also added in branch
brediction unit.
cpu/beta_cpu/fetch_impl.hh:
Add in branch prediction. Changed how fetch checks inputs and its
current state to make for easier logic.
cpu/beta_cpu/free_list.cc:
Changed int regs and float regs to logically use one flat namespace.
Future change will be moving them to a single scoreboard to conserve
space.
cpu/beta_cpu/free_list.hh:
Mostly debugging statements. Might be removed for performance in future.
cpu/beta_cpu/full_cpu.cc:
Added in some debugging statements. Updated BaseFullCPU to take
a params object.
cpu/beta_cpu/full_cpu.hh:
Added params class within BaseCPU that other param classes will be
able to inherit from. Updated typedefs to reflect change in location
of time buffer structs and ref counted DynInst.
cpu/beta_cpu/iew.hh:
Updated typedefs to reflect change in location of time buffer structs
and use of ref counted DynInsts.
cpu/beta_cpu/iew_impl.hh:
Added in load store queue, updated iew to be able to execute non-
speculative instructions, instead of having them execute in commit.
cpu/beta_cpu/inst_queue.hh:
Updated change to ref counted DynInsts. Changed inst queue to hold
non-speculative instructions as well, which are issued only when
commit signals backwards that a nonspeculative instruction is at
the head of the ROB.
cpu/beta_cpu/inst_queue_impl.hh:
Updated to allow for non-speculative instructions to be in the inst
queue. Also added some debug functions.
cpu/beta_cpu/regfile.hh:
Added debugging statements, changed formatting.
cpu/beta_cpu/rename.hh:
Updated typedefs, added some functions to clean up code.
cpu/beta_cpu/rename_impl.hh:
Moved some code into functions to make it easier to read.
cpu/beta_cpu/rename_map.cc:
Changed int and float reg behavior to use a single flat namespace. In
the future, the rename maps can be combined to a single rename map to
save space.
cpu/beta_cpu/rename_map.hh:
Added destructor.
cpu/beta_cpu/rob.hh:
Updated it with change from DynInst to ref counted DynInst.
cpu/beta_cpu/rob_impl.hh:
Formatting, updated to use ref counted DynInst.
cpu/static_inst.hh:
Updated forward declaration for AlphaDynInst now that it is templated.
--HG--
extra : convert_revision : 1045f240ee9b6a4bd368e1806aca029ebbdc6dd3
2004-09-23 20:06:03 +02:00
|
|
|
|
2004-08-20 20:54:07 +02:00
|
|
|
/** Returns whether or not this instruction is ready to commit. */
|
2006-06-14 19:12:41 +02:00
|
|
|
bool readyToCommit() const { return status[CanCommit]; }
|
|
|
|
|
|
|
|
void setAtCommit() { status.set(AtCommit); }
|
|
|
|
|
|
|
|
bool isAtCommit() { return status[AtCommit]; }
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
/** Sets this instruction as committed. */
|
2006-06-14 19:12:41 +02:00
|
|
|
void setCommitted() { status.set(Committed); }
|
2006-04-23 00:26:48 +02:00
|
|
|
|
|
|
|
/** Returns whether or not this instruction is committed. */
|
2006-06-14 19:12:41 +02:00
|
|
|
bool isCommitted() const { return status[Committed]; }
|
2006-04-23 00:26:48 +02:00
|
|
|
|
2004-08-20 20:54:07 +02:00
|
|
|
/** Sets this instruction as squashed. */
|
2006-06-14 19:12:41 +02:00
|
|
|
void setSquashed() { status.set(Squashed); }
|
2004-08-20 20:54:07 +02:00
|
|
|
|
|
|
|
/** Returns whether or not this instruction is squashed. */
|
2006-06-14 19:12:41 +02:00
|
|
|
bool isSquashed() const { return status[Squashed]; }
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
//Instruction Queue Entry
|
|
|
|
//-----------------------
|
|
|
|
/** Sets this instruction as a entry the IQ. */
|
2006-06-14 19:12:41 +02:00
|
|
|
void setInIQ() { status.set(IqEntry); }
|
2006-04-23 00:26:48 +02:00
|
|
|
|
|
|
|
/** Sets this instruction as a entry the IQ. */
|
2006-06-14 19:12:41 +02:00
|
|
|
void clearInIQ() { status.reset(IqEntry); }
|
|
|
|
|
|
|
|
/** Returns whether or not this instruction has issued. */
|
|
|
|
bool isInIQ() const { return status[IqEntry]; }
|
2006-04-23 00:26:48 +02:00
|
|
|
|
2004-08-20 20:54:07 +02:00
|
|
|
/** Sets this instruction as squashed in the IQ. */
|
2006-06-14 19:12:41 +02:00
|
|
|
void setSquashedInIQ() { status.set(SquashedInIQ); status.set(Squashed);}
|
2004-08-20 20:54:07 +02:00
|
|
|
|
|
|
|
/** Returns whether or not this instruction is squashed in the IQ. */
|
2006-06-14 19:12:41 +02:00
|
|
|
bool isSquashedInIQ() const { return status[SquashedInIQ]; }
|
2006-04-23 00:26:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
//Load / Store Queue Functions
|
|
|
|
//-----------------------
|
|
|
|
/** Sets this instruction as a entry the LSQ. */
|
2006-06-14 19:12:41 +02:00
|
|
|
void setInLSQ() { status.set(LsqEntry); }
|
2006-04-23 00:26:48 +02:00
|
|
|
|
|
|
|
/** Sets this instruction as a entry the LSQ. */
|
2006-06-14 19:12:41 +02:00
|
|
|
void removeInLSQ() { status.reset(LsqEntry); }
|
|
|
|
|
|
|
|
/** Returns whether or not this instruction is in the LSQ. */
|
|
|
|
bool isInLSQ() const { return status[LsqEntry]; }
|
2006-04-23 00:26:48 +02:00
|
|
|
|
|
|
|
/** Sets this instruction as squashed in the LSQ. */
|
2006-06-14 19:12:41 +02:00
|
|
|
void setSquashedInLSQ() { status.set(SquashedInLSQ);}
|
2006-04-23 00:26:48 +02:00
|
|
|
|
|
|
|
/** Returns whether or not this instruction is squashed in the LSQ. */
|
2006-06-14 19:12:41 +02:00
|
|
|
bool isSquashedInLSQ() const { return status[SquashedInLSQ]; }
|
2006-04-23 00:26:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
//Reorder Buffer Functions
|
|
|
|
//-----------------------
|
|
|
|
/** Sets this instruction as a entry the ROB. */
|
2006-06-14 19:12:41 +02:00
|
|
|
void setInROB() { status.set(RobEntry); }
|
2006-04-23 00:26:48 +02:00
|
|
|
|
|
|
|
/** Sets this instruction as a entry the ROB. */
|
2006-06-14 19:12:41 +02:00
|
|
|
void clearInROB() { status.reset(RobEntry); }
|
|
|
|
|
|
|
|
/** Returns whether or not this instruction is in the ROB. */
|
|
|
|
bool isInROB() const { return status[RobEntry]; }
|
2006-04-23 00:26:48 +02:00
|
|
|
|
|
|
|
/** Sets this instruction as squashed in the ROB. */
|
2006-06-14 19:12:41 +02:00
|
|
|
void setSquashedInROB() { status.set(SquashedInROB); }
|
2006-04-23 00:26:48 +02:00
|
|
|
|
|
|
|
/** Returns whether or not this instruction is squashed in the ROB. */
|
2006-06-14 19:12:41 +02:00
|
|
|
bool isSquashedInROB() const { return status[SquashedInROB]; }
|
2006-04-23 00:26:48 +02:00
|
|
|
|
2004-08-20 20:54:07 +02:00
|
|
|
/** Read the PC of this instruction. */
|
2005-02-26 00:00:49 +01:00
|
|
|
const Addr readPC() const { return PC; }
|
2004-08-20 20:54:07 +02:00
|
|
|
|
|
|
|
/** Set the next PC of this instruction (its actual target). */
|
2006-05-11 20:12:34 +02:00
|
|
|
void setNextPC(uint64_t val)
|
|
|
|
{
|
|
|
|
nextPC = val;
|
|
|
|
}
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-07-23 19:39:42 +02:00
|
|
|
/** Set the next NPC of this instruction (the target in Mips or Sparc).*/
|
|
|
|
void setNextNPC(uint64_t val)
|
|
|
|
{
|
|
|
|
nextNPC = val;
|
|
|
|
}
|
|
|
|
|
2006-06-13 01:04:42 +02:00
|
|
|
/** Sets the ASID. */
|
2006-04-23 00:26:48 +02:00
|
|
|
void setASID(short addr_space_id) { asid = addr_space_id; }
|
|
|
|
|
2006-06-13 01:04:42 +02:00
|
|
|
/** Sets the thread id. */
|
|
|
|
void setTid(unsigned tid) { threadNumber = tid; }
|
2006-04-23 00:26:48 +02:00
|
|
|
|
2006-06-14 19:12:41 +02:00
|
|
|
/** Sets the pointer to the thread state. */
|
2006-06-13 01:04:42 +02:00
|
|
|
void setThreadState(ImplState *state) { thread = state; }
|
2006-04-23 00:26:48 +02:00
|
|
|
|
2006-06-14 19:12:41 +02:00
|
|
|
/** Returns the thread context. */
|
2006-06-06 23:32:21 +02:00
|
|
|
ThreadContext *tcBase() { return thread->getTC(); }
|
2005-02-26 00:00:49 +01:00
|
|
|
|
|
|
|
private:
|
2005-05-19 07:28:25 +02:00
|
|
|
/** Instruction effective address.
|
|
|
|
* @todo: Consider if this is necessary or not.
|
|
|
|
*/
|
2005-02-26 00:00:49 +01:00
|
|
|
Addr instEffAddr;
|
2006-04-23 00:26:48 +02:00
|
|
|
|
2005-05-19 07:28:25 +02:00
|
|
|
/** Whether or not the effective address calculation is completed.
|
|
|
|
* @todo: Consider if this is necessary or not.
|
|
|
|
*/
|
2005-02-26 00:00:49 +01:00
|
|
|
bool eaCalcDone;
|
|
|
|
|
|
|
|
public:
|
2005-05-19 07:28:25 +02:00
|
|
|
/** Sets the effective address. */
|
2005-02-26 00:00:49 +01:00
|
|
|
void setEA(Addr &ea) { instEffAddr = ea; eaCalcDone = true; }
|
2005-05-19 07:28:25 +02:00
|
|
|
|
|
|
|
/** Returns the effective address. */
|
2006-06-03 00:15:20 +02:00
|
|
|
const Addr &getEA() const { return instEffAddr; }
|
2005-05-19 07:28:25 +02:00
|
|
|
|
|
|
|
/** Returns whether or not the eff. addr. calculation has been completed. */
|
2005-02-26 00:00:49 +01:00
|
|
|
bool doneEACalc() { return eaCalcDone; }
|
2005-05-19 07:28:25 +02:00
|
|
|
|
|
|
|
/** Returns whether or not the eff. addr. source registers are ready. */
|
2005-02-26 00:00:49 +01:00
|
|
|
bool eaSrcsReady();
|
2005-05-03 16:56:47 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
/** Whether or not the memory operation is done. */
|
|
|
|
bool memOpDone;
|
|
|
|
|
2005-05-03 16:56:47 +02:00
|
|
|
public:
|
2005-05-19 07:28:25 +02:00
|
|
|
/** Load queue index. */
|
2005-05-03 16:56:47 +02:00
|
|
|
int16_t lqIdx;
|
2005-05-19 07:28:25 +02:00
|
|
|
|
|
|
|
/** Store queue index. */
|
2005-05-03 16:56:47 +02:00
|
|
|
int16_t sqIdx;
|
2006-04-23 00:26:48 +02:00
|
|
|
|
|
|
|
/** Iterator pointing to this BaseDynInst in the list of all insts. */
|
|
|
|
ListIt instListIt;
|
|
|
|
|
|
|
|
/** Returns iterator to this instruction in the list of all insts. */
|
|
|
|
ListIt &getInstListIt() { return instListIt; }
|
|
|
|
|
|
|
|
/** Sets iterator for this instruction in the list of all insts. */
|
|
|
|
void setInstListIt(ListIt _instListIt) { instListIt = _instListIt; }
|
2004-08-20 20:54:07 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
template<class Impl>
|
|
|
|
template<class T>
|
2006-02-22 02:10:40 +01:00
|
|
|
inline Fault
|
2004-08-20 20:54:07 +02:00
|
|
|
BaseDynInst<Impl>::read(Addr addr, T &data, unsigned flags)
|
|
|
|
{
|
2006-06-09 18:28:11 +02:00
|
|
|
// Sometimes reads will get retried, so they may come through here
|
|
|
|
// twice.
|
|
|
|
if (!req) {
|
|
|
|
req = new Request();
|
|
|
|
req->setVirt(asid, addr, sizeof(T), flags, this->PC);
|
|
|
|
req->setThreadContext(thread->readCpuId(), threadNumber);
|
|
|
|
} else {
|
|
|
|
assert(addr == req->getVaddr());
|
2006-04-23 00:26:48 +02:00
|
|
|
}
|
|
|
|
|
2006-06-03 00:15:20 +02:00
|
|
|
if ((req->getVaddr() & (TheISA::VMPageSize - 1)) + req->getSize() >
|
2006-04-23 00:26:48 +02:00
|
|
|
TheISA::VMPageSize) {
|
|
|
|
return TheISA::genAlignmentFault();
|
|
|
|
}
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-06-08 22:58:50 +02:00
|
|
|
fault = cpu->translateDataReadReq(req, thread);
|
2004-08-20 20:54:07 +02:00
|
|
|
|
Changed the fault enum into a class, and fixed everything up to work with it. Next, the faults need to be pulled out of all the other code so that they are only used to communicate between the CPU and the ISA.
SConscript:
The new faults.cc file in sim allocates the system wide faults. When these faults are generated through a function interface in the ISA, this file may go away.
arch/alpha/alpha_memory.cc:
Changed Fault to Fault * and took the underscores out of fault names.
arch/alpha/alpha_memory.hh:
Changed Fault to Fault *. Also, added an include for the alpha faults.
arch/alpha/ev5.cc:
Changed the fault_addr array into a fault_addr function. Once all of the faults can be expected to have the same type, fault_addr can go away completely and the info it provided will come from the fault itself. Also, Fault was changed to Fault *, and underscores were taken out of fault names.
arch/alpha/isa/decoder.isa:
Changed Fault to Fault * and took the underscores out fault names.
arch/alpha/isa/fp.isa:
Changed Fault to Fault *, and took the underscores out of fault names.
arch/alpha/isa/main.isa:
Changed Fault to Fault *, removed underscores from fault names, and made an include of the alpha faults show up in all the generated files.
arch/alpha/isa/mem.isa:
Changed Fault to Fault * and removed underscores from fault names.
arch/alpha/isa/unimp.isa:
arch/alpha/isa/unknown.isa:
cpu/exec_context.hh:
cpu/ozone/cpu.hh:
cpu/simple/cpu.cc:
dev/alpha_console.cc:
dev/ide_ctrl.cc:
dev/isa_fake.cc:
dev/pciconfigall.cc:
dev/pcidev.cc:
dev/pcidev.hh:
dev/tsunami_cchip.cc:
dev/tsunami_io.cc:
dev/tsunami_pchip.cc:
Changed Fault to Fault *, and removed underscores from fault names.
arch/alpha/isa_traits.hh:
Changed the include of arch/alpha/faults.hh to sim/faults.hh, since the alpha faults weren't needed.
cpu/base_dyn_inst.cc:
Changed Fault to Fault *, and removed underscores from fault names. This file probably shouldn't use the Unimplemented Opcode fault.
cpu/base_dyn_inst.hh:
Changed Fault to Fault * and took the underscores out of the fault names.
cpu/exec_context.cc:
cpu/o3/alpha_dyn_inst.hh:
cpu/o3/alpha_dyn_inst_impl.hh:
cpu/o3/fetch.hh:
dev/alpha_console.hh:
dev/baddev.hh:
dev/ide_ctrl.hh:
dev/isa_fake.hh:
dev/ns_gige.hh:
dev/pciconfigall.hh:
dev/sinic.hh:
dev/tsunami_cchip.hh:
dev/tsunami_io.hh:
dev/tsunami_pchip.hh:
dev/uart.hh:
dev/uart8250.hh:
Changed Fault to Fault *.
cpu/o3/alpha_cpu.hh:
Changed Fault to Fault *, removed underscores from fault names.
cpu/o3/alpha_cpu_impl.hh:
Changed Fault to Fault *, removed underscores from fault names, and changed the fault_addr array to the fault_addr function. Once all faults are from the ISA, this function will probably go away.
cpu/o3/commit_impl.hh:
cpu/o3/fetch_impl.hh:
dev/baddev.cc:
Changed Fault to Fault *, and removed underscores from the fault names.
cpu/o3/regfile.hh:
Added an include for the alpha specific faults which will hopefully go away once the ipr stuff is moved, changed Fault to Fault *, and removed the underscores from fault names.
cpu/simple/cpu.hh:
Changed Fault to Fault *
dev/ns_gige.cc:
Changed Fault to Fault *, and removdd underscores from fault names.
dev/sinic.cc:
Changed Fault to Fault *, and removed the underscores from fault names.
dev/uart8250.cc:
Chanted Fault to Fault *, and removed underscores from fault names.
kern/kernel_stats.cc:
Removed underscores from fault names, and from NumFaults.
kern/kernel_stats.hh:
Changed the predeclaration of Fault from an enum to a class, and changd the "fault" function to work with the classes instead of the enum. Once there are no system wide faults anymore, this code will simplify back to something like it was originally.
sim/faults.cc:
This allocates the system wide faults.
sim/faults.hh:
This declares the system wide faults.
sim/syscall_emul.cc:
sim/syscall_emul.hh:
Removed the underscores from fault names.
--HG--
rename : arch/alpha/faults.cc => sim/faults.cc
rename : arch/alpha/faults.hh => sim/faults.hh
extra : convert_revision : 253d39258237333ae8ec4d8047367cb3ea68569d
2006-02-16 07:22:51 +01:00
|
|
|
if (fault == NoFault) {
|
2006-06-06 00:14:39 +02:00
|
|
|
effAddr = req->getVaddr();
|
|
|
|
physEffAddr = req->getPaddr();
|
|
|
|
memReqFlags = req->getFlags();
|
|
|
|
|
2006-06-08 22:58:50 +02:00
|
|
|
#if 0
|
2006-04-23 00:26:48 +02:00
|
|
|
if (cpu->system->memctrl->badaddr(physEffAddr)) {
|
|
|
|
fault = TheISA::genMachineCheckFault();
|
|
|
|
data = (T)-1;
|
|
|
|
this->setExecuted();
|
|
|
|
} else {
|
|
|
|
fault = cpu->read(req, data, lqIdx);
|
|
|
|
}
|
|
|
|
#else
|
2005-05-03 16:56:47 +02:00
|
|
|
fault = cpu->read(req, data, lqIdx);
|
2006-04-23 00:26:48 +02:00
|
|
|
#endif
|
2005-05-19 07:28:25 +02:00
|
|
|
} else {
|
2004-08-20 20:54:07 +02:00
|
|
|
// Return a fixed value to keep simulation deterministic even
|
|
|
|
// along misspeculated paths.
|
|
|
|
data = (T)-1;
|
2006-04-23 00:26:48 +02:00
|
|
|
|
|
|
|
// Commit will have to clean up whatever happened. Set this
|
|
|
|
// instruction as executed.
|
|
|
|
this->setExecuted();
|
2004-08-20 20:54:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (traceData) {
|
|
|
|
traceData->setAddr(addr);
|
|
|
|
traceData->setData(data);
|
|
|
|
}
|
|
|
|
|
|
|
|
return fault;
|
|
|
|
}
|
|
|
|
|
|
|
|
template<class Impl>
|
|
|
|
template<class T>
|
2006-02-22 02:10:40 +01:00
|
|
|
inline Fault
|
2004-08-20 20:54:07 +02:00
|
|
|
BaseDynInst<Impl>::write(T data, Addr addr, unsigned flags, uint64_t *res)
|
|
|
|
{
|
|
|
|
if (traceData) {
|
|
|
|
traceData->setAddr(addr);
|
|
|
|
traceData->setData(data);
|
|
|
|
}
|
|
|
|
|
2006-06-09 18:28:11 +02:00
|
|
|
assert(req == NULL);
|
|
|
|
|
2006-06-03 00:15:20 +02:00
|
|
|
req = new Request();
|
|
|
|
req->setVirt(asid, addr, sizeof(T), flags, this->PC);
|
2006-06-07 21:29:53 +02:00
|
|
|
req->setThreadContext(thread->readCpuId(), threadNumber);
|
2006-04-23 00:26:48 +02:00
|
|
|
|
2006-06-03 00:15:20 +02:00
|
|
|
if ((req->getVaddr() & (TheISA::VMPageSize - 1)) + req->getSize() >
|
2006-04-23 00:26:48 +02:00
|
|
|
TheISA::VMPageSize) {
|
|
|
|
return TheISA::genAlignmentFault();
|
|
|
|
}
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-06-08 22:58:50 +02:00
|
|
|
fault = cpu->translateDataWriteReq(req, thread);
|
2004-08-20 20:54:07 +02:00
|
|
|
|
Changed the fault enum into a class, and fixed everything up to work with it. Next, the faults need to be pulled out of all the other code so that they are only used to communicate between the CPU and the ISA.
SConscript:
The new faults.cc file in sim allocates the system wide faults. When these faults are generated through a function interface in the ISA, this file may go away.
arch/alpha/alpha_memory.cc:
Changed Fault to Fault * and took the underscores out of fault names.
arch/alpha/alpha_memory.hh:
Changed Fault to Fault *. Also, added an include for the alpha faults.
arch/alpha/ev5.cc:
Changed the fault_addr array into a fault_addr function. Once all of the faults can be expected to have the same type, fault_addr can go away completely and the info it provided will come from the fault itself. Also, Fault was changed to Fault *, and underscores were taken out of fault names.
arch/alpha/isa/decoder.isa:
Changed Fault to Fault * and took the underscores out fault names.
arch/alpha/isa/fp.isa:
Changed Fault to Fault *, and took the underscores out of fault names.
arch/alpha/isa/main.isa:
Changed Fault to Fault *, removed underscores from fault names, and made an include of the alpha faults show up in all the generated files.
arch/alpha/isa/mem.isa:
Changed Fault to Fault * and removed underscores from fault names.
arch/alpha/isa/unimp.isa:
arch/alpha/isa/unknown.isa:
cpu/exec_context.hh:
cpu/ozone/cpu.hh:
cpu/simple/cpu.cc:
dev/alpha_console.cc:
dev/ide_ctrl.cc:
dev/isa_fake.cc:
dev/pciconfigall.cc:
dev/pcidev.cc:
dev/pcidev.hh:
dev/tsunami_cchip.cc:
dev/tsunami_io.cc:
dev/tsunami_pchip.cc:
Changed Fault to Fault *, and removed underscores from fault names.
arch/alpha/isa_traits.hh:
Changed the include of arch/alpha/faults.hh to sim/faults.hh, since the alpha faults weren't needed.
cpu/base_dyn_inst.cc:
Changed Fault to Fault *, and removed underscores from fault names. This file probably shouldn't use the Unimplemented Opcode fault.
cpu/base_dyn_inst.hh:
Changed Fault to Fault * and took the underscores out of the fault names.
cpu/exec_context.cc:
cpu/o3/alpha_dyn_inst.hh:
cpu/o3/alpha_dyn_inst_impl.hh:
cpu/o3/fetch.hh:
dev/alpha_console.hh:
dev/baddev.hh:
dev/ide_ctrl.hh:
dev/isa_fake.hh:
dev/ns_gige.hh:
dev/pciconfigall.hh:
dev/sinic.hh:
dev/tsunami_cchip.hh:
dev/tsunami_io.hh:
dev/tsunami_pchip.hh:
dev/uart.hh:
dev/uart8250.hh:
Changed Fault to Fault *.
cpu/o3/alpha_cpu.hh:
Changed Fault to Fault *, removed underscores from fault names.
cpu/o3/alpha_cpu_impl.hh:
Changed Fault to Fault *, removed underscores from fault names, and changed the fault_addr array to the fault_addr function. Once all faults are from the ISA, this function will probably go away.
cpu/o3/commit_impl.hh:
cpu/o3/fetch_impl.hh:
dev/baddev.cc:
Changed Fault to Fault *, and removed underscores from the fault names.
cpu/o3/regfile.hh:
Added an include for the alpha specific faults which will hopefully go away once the ipr stuff is moved, changed Fault to Fault *, and removed the underscores from fault names.
cpu/simple/cpu.hh:
Changed Fault to Fault *
dev/ns_gige.cc:
Changed Fault to Fault *, and removdd underscores from fault names.
dev/sinic.cc:
Changed Fault to Fault *, and removed the underscores from fault names.
dev/uart8250.cc:
Chanted Fault to Fault *, and removed underscores from fault names.
kern/kernel_stats.cc:
Removed underscores from fault names, and from NumFaults.
kern/kernel_stats.hh:
Changed the predeclaration of Fault from an enum to a class, and changd the "fault" function to work with the classes instead of the enum. Once there are no system wide faults anymore, this code will simplify back to something like it was originally.
sim/faults.cc:
This allocates the system wide faults.
sim/faults.hh:
This declares the system wide faults.
sim/syscall_emul.cc:
sim/syscall_emul.hh:
Removed the underscores from fault names.
--HG--
rename : arch/alpha/faults.cc => sim/faults.cc
rename : arch/alpha/faults.hh => sim/faults.hh
extra : convert_revision : 253d39258237333ae8ec4d8047367cb3ea68569d
2006-02-16 07:22:51 +01:00
|
|
|
if (fault == NoFault) {
|
2006-06-06 00:14:39 +02:00
|
|
|
effAddr = req->getVaddr();
|
|
|
|
physEffAddr = req->getPaddr();
|
|
|
|
memReqFlags = req->getFlags();
|
2006-06-08 22:58:50 +02:00
|
|
|
#if 0
|
2006-04-23 00:26:48 +02:00
|
|
|
if (cpu->system->memctrl->badaddr(physEffAddr)) {
|
|
|
|
fault = TheISA::genMachineCheckFault();
|
|
|
|
} else {
|
|
|
|
fault = cpu->write(req, data, sqIdx);
|
|
|
|
}
|
|
|
|
#else
|
2005-05-03 16:56:47 +02:00
|
|
|
fault = cpu->write(req, data, sqIdx);
|
2006-04-23 00:26:48 +02:00
|
|
|
#endif
|
2004-08-20 20:54:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (res) {
|
|
|
|
// always return some result to keep misspeculated paths
|
|
|
|
// (which will ignore faults) deterministic
|
2006-06-03 00:15:20 +02:00
|
|
|
*res = (fault == NoFault) ? req->getScResult() : 0;
|
2004-08-20 20:54:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return fault;
|
|
|
|
}
|
|
|
|
|
2005-02-26 00:00:49 +01:00
|
|
|
#endif // __CPU_BASE_DYN_INST_HH__
|