2004-08-20 20:54:07 +02:00
|
|
|
/*
|
2005-06-05 11:16:00 +02:00
|
|
|
* Copyright (c) 2004-2005 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.
|
|
|
|
*/
|
|
|
|
|
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-04-23 00:26:48 +02:00
|
|
|
#include <list>
|
2004-08-20 20:54:07 +02:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#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"
|
|
|
|
#include "cpu/static_inst.hh"
|
2005-06-05 02:50:10 +02:00
|
|
|
#include "encumbered/cpu/full/op_class.hh"
|
2006-04-23 00:26:48 +02:00
|
|
|
#include "mem/functional/memory_control.hh"
|
|
|
|
#include "sim/system.hh"
|
|
|
|
/*
|
|
|
|
#include "encumbered/cpu/full/bpred_update.hh"
|
2005-06-05 02:50:10 +02:00
|
|
|
#include "encumbered/cpu/full/spec_memory.hh"
|
|
|
|
#include "encumbered/cpu/full/spec_state.hh"
|
|
|
|
#include "encumbered/mem/functional/main.hh"
|
2006-04-23 00:26:48 +02:00
|
|
|
*/
|
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.
|
|
|
|
typedef typename Impl::FullCPU FullCPU;
|
2006-04-23 00:26:48 +02:00
|
|
|
typedef typename FullCPU::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-04-23 00:26:48 +02:00
|
|
|
// Integer 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::IntReg IntReg;
|
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-04-23 00:26:48 +02:00
|
|
|
/** Is the instruction in the IQ */
|
|
|
|
bool iqEntry;
|
|
|
|
|
|
|
|
/** Is the instruction in the ROB */
|
|
|
|
bool robEntry;
|
|
|
|
|
|
|
|
/** Is the instruction in the LSQ */
|
|
|
|
bool lsqEntry;
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2005-02-26 00:00:49 +01:00
|
|
|
/** Is the instruction completed. */
|
|
|
|
bool completed;
|
|
|
|
|
2006-05-11 20:12:34 +02:00
|
|
|
/** Is the instruction's result ready. */
|
|
|
|
bool resultReady;
|
|
|
|
|
2004-08-20 20:54:07 +02:00
|
|
|
/** Can this instruction issue. */
|
|
|
|
bool canIssue;
|
|
|
|
|
|
|
|
/** Has this instruction issued. */
|
|
|
|
bool issued;
|
|
|
|
|
|
|
|
/** Has this instruction executed (or made it through execute) yet. */
|
|
|
|
bool executed;
|
|
|
|
|
|
|
|
/** Can this instruction commit. */
|
|
|
|
bool canCommit;
|
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
/** Is this instruction committed. */
|
|
|
|
bool committed;
|
|
|
|
|
2004-08-20 20:54:07 +02:00
|
|
|
/** Is this instruction squashed. */
|
|
|
|
bool squashed;
|
|
|
|
|
|
|
|
/** Is this instruction squashed in the instruction queue. */
|
|
|
|
bool squashedInIQ;
|
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
/** Is this instruction squashed in the instruction queue. */
|
|
|
|
bool squashedInLSQ;
|
|
|
|
|
|
|
|
/** Is this instruction squashed in the instruction queue. */
|
|
|
|
bool squashedInROB;
|
|
|
|
|
2004-08-20 20:54:07 +02:00
|
|
|
/** Is this a recover instruction. */
|
|
|
|
bool recoverInst;
|
|
|
|
|
|
|
|
/** Is this a thread blocking instruction. */
|
|
|
|
bool blockingInst; /* this inst has called thread_block() */
|
|
|
|
|
|
|
|
/** Is this a thread syncrhonization instruction. */
|
|
|
|
bool threadsyncWait;
|
|
|
|
|
|
|
|
/** 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;
|
|
|
|
|
2004-08-20 20:54:07 +02:00
|
|
|
/** Pointer to the FullCPU object. */
|
|
|
|
FullCPU *cpu;
|
|
|
|
|
2006-05-11 20:12:34 +02:00
|
|
|
/** Pointer to the exec context. */
|
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. */
|
|
|
|
MemReqPtr req;
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
/** The size of the data to be stored. */
|
|
|
|
int storeSize;
|
|
|
|
|
|
|
|
/** The data to be stored. */
|
|
|
|
IntReg storeData;
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
/** 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,
|
2004-08-20 20:54:07 +02:00
|
|
|
FullCPU *cpu);
|
|
|
|
|
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:
|
2006-04-23 00:26:48 +02:00
|
|
|
/**
|
|
|
|
* @todo: Make this function work; currently it is a dummy function.
|
|
|
|
* @param fault Last fault.
|
|
|
|
* @param cmd Last command.
|
|
|
|
* @param addr Virtual address of access.
|
|
|
|
* @param p Memory accessed.
|
|
|
|
* @param nbytes Access size.
|
|
|
|
*/
|
2004-08-20 20:54:07 +02:00
|
|
|
void
|
2006-04-23 00:26:48 +02:00
|
|
|
trace_mem(Fault fault,
|
|
|
|
MemCmd cmd,
|
|
|
|
Addr addr,
|
|
|
|
void *p,
|
|
|
|
int nbytes);
|
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; }
|
|
|
|
|
|
|
|
/** 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-04-23 00:26:48 +02:00
|
|
|
bool predTaken() { return predPC != (PC + sizeof(MachInst)); }
|
2004-08-20 20:54:07 +02:00
|
|
|
|
|
|
|
/** Returns whether the instruction mispredicted. */
|
2006-04-23 00:26:48 +02:00
|
|
|
bool mispredicted() { return predPC != nextPC; }
|
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(); }
|
|
|
|
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(); }
|
|
|
|
bool isThreadSync() const { return staticInst->isThreadSync(); }
|
|
|
|
bool isSerializing() const { return staticInst->isSerializing(); }
|
2006-04-23 00:26:48 +02:00
|
|
|
bool isSerializeBefore() const
|
|
|
|
{ return staticInst->isSerializeBefore() || serializeBefore; }
|
|
|
|
bool isSerializeAfter() const
|
|
|
|
{ return staticInst->isSerializeAfter() || 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-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. */
|
|
|
|
void setSerializeBefore() { serializeBefore = true; }
|
|
|
|
|
|
|
|
/** Clears the serializeBefore part of this instruction. */
|
|
|
|
void clearSerializeBefore() { serializeBefore = false; }
|
|
|
|
|
|
|
|
/** Checks if this serializeBefore is only temporarily set. */
|
|
|
|
bool isTempSerializeBefore() { return serializeBefore; }
|
|
|
|
|
|
|
|
/** Tracks if instruction has been externally set as serializeBefore. */
|
|
|
|
bool serializeBefore;
|
|
|
|
|
|
|
|
/** Temporarily sets this instruction as a serialize after instruction. */
|
|
|
|
void setSerializeAfter() { serializeAfter = true; }
|
|
|
|
|
|
|
|
/** Clears the serializeAfter part of this instruction.*/
|
|
|
|
void clearSerializeAfter() { serializeAfter = false; }
|
|
|
|
|
|
|
|
/** Checks if this serializeAfter is only temporarily set. */
|
|
|
|
bool isTempSerializeAfter() { return serializeAfter; }
|
|
|
|
|
|
|
|
/** Tracks if instruction has been externally set as serializeAfter. */
|
|
|
|
bool serializeAfter;
|
|
|
|
|
|
|
|
/** 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.
|
|
|
|
*/
|
|
|
|
bool isSerializeHandled() { return serializeHandled; }
|
|
|
|
|
|
|
|
/** Sets the serialization part of this instruction as handled. */
|
|
|
|
void setSerializeHandled() { serializeHandled = true; }
|
|
|
|
|
|
|
|
/** Whether or not the serialization of this instruction has been handled. */
|
|
|
|
bool 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-05-11 20:12:34 +02:00
|
|
|
void setIntReg(const StaticInst *si, int idx, uint64_t val)
|
|
|
|
{
|
|
|
|
instResult.integer = val;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setFloatRegSingle(const StaticInst *si, int idx, float val)
|
|
|
|
{
|
|
|
|
instResult.fp = val;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setFloatRegDouble(const StaticInst *si, int idx, double val)
|
|
|
|
{
|
|
|
|
instResult.dbl = val;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setFloatRegInt(const StaticInst *si, int idx, uint64_t val)
|
|
|
|
{
|
|
|
|
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. */
|
2005-02-26 00:00:49 +01:00
|
|
|
void setCompleted() { completed = true; }
|
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
/** Returns whether or not this instruction is completed. */
|
2005-02-26 00:00:49 +01:00
|
|
|
bool isCompleted() const { return completed; }
|
|
|
|
|
2006-05-11 20:12:34 +02:00
|
|
|
void setResultReady() { resultReady = true; }
|
|
|
|
|
|
|
|
bool isResultReady() const { return resultReady; }
|
|
|
|
|
2004-08-20 20:54:07 +02:00
|
|
|
/** Sets this instruction as ready to issue. */
|
|
|
|
void setCanIssue() { canIssue = true; }
|
|
|
|
|
|
|
|
/** Returns whether or not this instruction is ready to issue. */
|
|
|
|
bool readyToIssue() const { return canIssue; }
|
|
|
|
|
|
|
|
/** Sets this instruction as issued from the IQ. */
|
|
|
|
void setIssued() { issued = true; }
|
|
|
|
|
|
|
|
/** Returns whether or not this instruction has issued. */
|
2005-02-26 00:00:49 +01:00
|
|
|
bool isIssued() const { return issued; }
|
2004-08-20 20:54:07 +02:00
|
|
|
|
|
|
|
/** Sets this instruction as executed. */
|
|
|
|
void setExecuted() { executed = true; }
|
|
|
|
|
|
|
|
/** Returns whether or not this instruction has executed. */
|
2005-02-26 00:00:49 +01:00
|
|
|
bool isExecuted() const { return executed; }
|
2004-08-20 20:54:07 +02:00
|
|
|
|
|
|
|
/** Sets this instruction as ready to commit. */
|
|
|
|
void setCanCommit() { canCommit = true; }
|
|
|
|
|
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. */
|
|
|
|
void clearCanCommit() { canCommit = false; }
|
|
|
|
|
2004-08-20 20:54:07 +02:00
|
|
|
/** Returns whether or not this instruction is ready to commit. */
|
|
|
|
bool readyToCommit() const { return canCommit; }
|
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
/** Sets this instruction as committed. */
|
|
|
|
void setCommitted() { committed = true; }
|
|
|
|
|
|
|
|
/** Returns whether or not this instruction is committed. */
|
|
|
|
bool isCommitted() const { return committed; }
|
|
|
|
|
2004-08-20 20:54:07 +02:00
|
|
|
/** Sets this instruction as squashed. */
|
|
|
|
void setSquashed() { squashed = true; }
|
|
|
|
|
|
|
|
/** Returns whether or not this instruction is squashed. */
|
|
|
|
bool isSquashed() const { return squashed; }
|
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
//Instruction Queue Entry
|
|
|
|
//-----------------------
|
|
|
|
/** Sets this instruction as a entry the IQ. */
|
|
|
|
void setInIQ() { iqEntry = true; }
|
|
|
|
|
|
|
|
/** Sets this instruction as a entry the IQ. */
|
|
|
|
void removeInIQ() { iqEntry = false; }
|
|
|
|
|
2004-08-20 20:54:07 +02:00
|
|
|
/** Sets this instruction as squashed in the IQ. */
|
2006-04-23 00:26:48 +02:00
|
|
|
void setSquashedInIQ() { squashedInIQ = true; squashed = true;}
|
2004-08-20 20:54:07 +02:00
|
|
|
|
|
|
|
/** Returns whether or not this instruction is squashed in the IQ. */
|
2005-02-26 00:00:49 +01:00
|
|
|
bool isSquashedInIQ() const { return squashedInIQ; }
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
/** Returns whether or not this instruction has issued. */
|
|
|
|
bool isInIQ() const { return iqEntry; }
|
|
|
|
|
|
|
|
|
|
|
|
//Load / Store Queue Functions
|
|
|
|
//-----------------------
|
|
|
|
/** Sets this instruction as a entry the LSQ. */
|
|
|
|
void setInLSQ() { lsqEntry = true; }
|
|
|
|
|
|
|
|
/** Sets this instruction as a entry the LSQ. */
|
|
|
|
void removeInLSQ() { lsqEntry = false; }
|
|
|
|
|
|
|
|
/** Sets this instruction as squashed in the LSQ. */
|
|
|
|
void setSquashedInLSQ() { squashedInLSQ = true;}
|
|
|
|
|
|
|
|
/** Returns whether or not this instruction is squashed in the LSQ. */
|
|
|
|
bool isSquashedInLSQ() const { return squashedInLSQ; }
|
|
|
|
|
|
|
|
/** Returns whether or not this instruction is in the LSQ. */
|
|
|
|
bool isInLSQ() const { return lsqEntry; }
|
|
|
|
|
|
|
|
|
|
|
|
//Reorder Buffer Functions
|
|
|
|
//-----------------------
|
|
|
|
/** Sets this instruction as a entry the ROB. */
|
|
|
|
void setInROB() { robEntry = true; }
|
|
|
|
|
|
|
|
/** Sets this instruction as a entry the ROB. */
|
|
|
|
void removeInROB() { robEntry = false; }
|
|
|
|
|
|
|
|
/** Sets this instruction as squashed in the ROB. */
|
|
|
|
void setSquashedInROB() { squashedInROB = true; }
|
|
|
|
|
|
|
|
/** Returns whether or not this instruction is squashed in the ROB. */
|
|
|
|
bool isSquashedInROB() const { return squashedInROB; }
|
|
|
|
|
|
|
|
/** Returns whether or not this instruction is in the ROB. */
|
|
|
|
bool isInROB() const { return robEntry; }
|
|
|
|
|
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;
|
|
|
|
// instResult.integer = val;
|
|
|
|
}
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
void setASID(short addr_space_id) { asid = addr_space_id; }
|
|
|
|
|
|
|
|
void setThread(unsigned tid) { threadNumber = tid; }
|
|
|
|
|
|
|
|
void setState(ImplState *state) { thread = state; }
|
|
|
|
|
2005-05-19 07:28:25 +02:00
|
|
|
/** Returns the exec context.
|
|
|
|
* @todo: Remove this once the ExecContext is no longer used.
|
|
|
|
*/
|
2006-04-23 00:26:48 +02:00
|
|
|
ExecContext *xcBase() { return thread->getXCProxy(); }
|
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-04-23 00:26:48 +02:00
|
|
|
const Addr &getEA() const { return req->vaddr; }
|
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
|
|
|
|
|
|
|
bool reachedCommit;
|
|
|
|
|
|
|
|
/** 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-04-23 00:26:48 +02:00
|
|
|
if (executed) {
|
|
|
|
fault = cpu->read(req, data, lqIdx);
|
|
|
|
return fault;
|
|
|
|
}
|
|
|
|
|
|
|
|
req = new MemReq(addr, thread->getXCProxy(), sizeof(T), flags);
|
2004-08-20 20:54:07 +02:00
|
|
|
req->asid = asid;
|
2006-04-23 00:26:48 +02:00
|
|
|
req->thread_num = threadNumber;
|
|
|
|
req->pc = this->PC;
|
|
|
|
|
|
|
|
if ((req->vaddr & (TheISA::VMPageSize - 1)) + req->size >
|
|
|
|
TheISA::VMPageSize) {
|
|
|
|
return TheISA::genAlignmentFault();
|
|
|
|
}
|
2004-08-20 20:54:07 +02:00
|
|
|
|
|
|
|
fault = cpu->translateDataReadReq(req);
|
|
|
|
|
|
|
|
effAddr = req->vaddr;
|
|
|
|
physEffAddr = req->paddr;
|
|
|
|
memReqFlags = req->flags;
|
|
|
|
|
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-04-23 00:26:48 +02:00
|
|
|
#if FULL_SYSTEM
|
|
|
|
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-04-23 00:26:48 +02:00
|
|
|
req = new MemReq(addr, thread->getXCProxy(), sizeof(T), flags);
|
2004-08-20 20:54:07 +02:00
|
|
|
|
|
|
|
req->asid = asid;
|
2006-04-23 00:26:48 +02:00
|
|
|
req->thread_num = threadNumber;
|
|
|
|
req->pc = this->PC;
|
|
|
|
|
|
|
|
if ((req->vaddr & (TheISA::VMPageSize - 1)) + req->size >
|
|
|
|
TheISA::VMPageSize) {
|
|
|
|
return TheISA::genAlignmentFault();
|
|
|
|
}
|
2004-08-20 20:54:07 +02:00
|
|
|
|
|
|
|
fault = cpu->translateDataWriteReq(req);
|
|
|
|
|
|
|
|
effAddr = req->vaddr;
|
|
|
|
physEffAddr = req->paddr;
|
|
|
|
memReqFlags = req->flags;
|
|
|
|
|
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-04-23 00:26:48 +02:00
|
|
|
#if FULL_SYSTEM
|
|
|
|
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
|
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
|
|
|
*res = (fault == NoFault) ? req->result : 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__
|