changeset 95f69a436c82 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=95f69a436c82
description:
Registers: Add an ISA object which replaces the MiscRegFile.
This object encapsulates (or will eventually) the identity and
characteristics
of the ISA in the CPU.
diffstat:
46 files changed, 1070 insertions(+), 482 deletions(-)
src/arch/SConscript | 1
src/arch/alpha/SConscript | 1
src/arch/alpha/isa.cc | 79 ++++++++++++++++++
src/arch/alpha/isa.hh | 101 +++++++++++++++++++++++
src/arch/alpha/isa/main.isa | 2
src/arch/alpha/regfile.cc | 3
src/arch/alpha/regfile.hh | 50 -----------
src/arch/arm/SConscript | 1
src/arch/arm/isa.cc | 79 ++++++++++++++++++
src/arch/arm/isa.hh | 79 ++++++++++++++++++
src/arch/arm/regfile/misc_regfile.hh | 1
src/arch/arm/regfile/regfile.cc | 11 --
src/arch/arm/regfile/regfile.hh | 37 --------
src/arch/mips/SConscript | 1
src/arch/mips/isa.cc | 80 ++++++++++++++++++
src/arch/mips/isa.hh | 101 +++++++++++++++++++++++
src/arch/mips/regfile.cc | 5 -
src/arch/mips/regfile/regfile.cc | 47 ----------
src/arch/mips/regfile/regfile.hh | 14 ---
src/arch/mips/utility.hh | 11 --
src/arch/sparc/SConscript | 1
src/arch/sparc/isa.cc | 147 ++++++++++++++++++++++++++++++++++
src/arch/sparc/isa.hh | 87 ++++++++++++++++++++
src/arch/sparc/regfile.cc | 92 ---------------------
src/arch/sparc/regfile.hh | 28 ------
src/arch/x86/SConscript | 1
src/arch/x86/isa.cc | 101 +++++++++++++++++++++++
src/arch/x86/isa.hh | 78 ++++++++++++++++++
src/arch/x86/miscregfile.hh | 6 -
src/arch/x86/process.cc | 1
src/arch/x86/regfile.cc | 86 ++++---------------
src/arch/x86/regfile.hh | 33 -------
src/arch/x86/tlb.cc | 1
src/arch/x86/utility.hh | 1
src/cpu/inorder/cpu.cc | 24 ++---
src/cpu/inorder/cpu.hh | 7 +
src/cpu/inorder/thread_context.hh | 6 +
src/cpu/o3/cpu.cc | 8 -
src/cpu/o3/cpu.hh | 6 -
src/cpu/o3/regfile.hh | 33 -------
src/cpu/o3/rename_impl.hh | 6 -
src/cpu/o3/thread_context.hh | 3
src/cpu/o3/thread_context_impl.hh | 34 +++++--
src/cpu/simple_thread.hh | 47 ++++++----
src/cpu/thread_context.hh | 10 ++
src/kern/tru64/tru64.hh | 1
diffs (truncated from 2463 to 300 lines):
diff -r 94b1a249422e -r 95f69a436c82 src/arch/SConscript
--- a/src/arch/SConscript Wed Jul 08 23:02:20 2009 -0700
+++ b/src/arch/SConscript Wed Jul 08 23:02:20 2009 -0700
@@ -46,6 +46,7 @@
arguments.hh
faults.hh
interrupts.hh
+ isa.hh
isa_traits.hh
kernel_stats.hh
locked_mem.hh
diff -r 94b1a249422e -r 95f69a436c82 src/arch/alpha/SConscript
--- a/src/arch/alpha/SConscript Wed Jul 08 23:02:20 2009 -0700
+++ b/src/arch/alpha/SConscript Wed Jul 08 23:02:20 2009 -0700
@@ -37,6 +37,7 @@
Source('floatregfile.cc')
Source('intregfile.cc')
Source('ipr.cc')
+ Source('isa.cc')
Source('miscregfile.cc')
Source('pagetable.cc')
Source('regfile.cc')
diff -r 94b1a249422e -r 95f69a436c82 src/arch/alpha/isa.cc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/arch/alpha/isa.cc Wed Jul 08 23:02:20 2009 -0700
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2009 The Regents of The University of Michigan
+ * 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.
+ *
+ * Authors: Gabe Black
+ */
+
+#include "arch/alpha/isa.hh"
+#include "cpu/thread_context.hh"
+
+namespace AlphaISA
+{
+
+void
+ISA::clear()
+{
+ miscRegFile.clear();
+}
+
+MiscReg
+ISA::readMiscRegNoEffect(int miscReg)
+{
+ return miscRegFile.readRegNoEffect((MiscRegIndex)miscReg);
+}
+
+MiscReg
+ISA::readMiscReg(int miscReg, ThreadContext *tc)
+{
+ return miscRegFile.readReg((MiscRegIndex)miscReg, tc);
+}
+
+void
+ISA::setMiscRegNoEffect(int miscReg, const MiscReg val)
+{
+ miscRegFile.setRegNoEffect((MiscRegIndex)miscReg, val);
+}
+
+void
+ISA::setMiscReg(int miscReg, const MiscReg val, ThreadContext *tc)
+{
+ miscRegFile.setReg((MiscRegIndex)miscReg, val, tc);
+}
+
+void
+ISA::serialize(std::ostream &os)
+{
+ miscRegFile.serialize(os);
+}
+
+void
+ISA::unserialize(Checkpoint *cp, const std::string §ion)
+{
+ miscRegFile.unserialize(cp, section);
+}
+
+}
diff -r 94b1a249422e -r 95f69a436c82 src/arch/alpha/isa.hh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/arch/alpha/isa.hh Wed Jul 08 23:02:20 2009 -0700
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2009 The Regents of The University of Michigan
+ * 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.
+ *
+ * Authors: Gabe Black
+ */
+
+#ifndef __ARCH_ALPHA_ISA_HH__
+#define __ARCH_ALPHA_ISA_HH__
+
+#include "arch/alpha/miscregfile.hh"
+#include "arch/alpha/types.hh"
+
+class Checkpoint;
+class EventManager;
+
+namespace AlphaISA
+{
+ class ISA
+ {
+ protected:
+ MiscRegFile miscRegFile;
+
+ public:
+
+ void expandForMultithreading(ThreadID num_threads, unsigned num_vpes)
+ {
+ miscRegFile.expandForMultithreading(num_threads, num_vpes);
+ }
+
+ void reset(std::string core_name, ThreadID num_threads,
+ unsigned num_vpes, BaseCPU *_cpu)
+ {
+ miscRegFile.reset(core_name, num_threads, num_vpes, _cpu);
+ }
+
+ int instAsid()
+ {
+ return miscRegFile.getInstAsid();
+ }
+
+ int dataAsid()
+ {
+ return miscRegFile.getDataAsid();
+ }
+
+ void clear();
+
+ MiscReg readMiscRegNoEffect(int miscReg);
+ MiscReg readMiscReg(int miscReg, ThreadContext *tc);
+
+ void setMiscRegNoEffect(int miscReg, const MiscReg val);
+ void setMiscReg(int miscReg, const MiscReg val,
+ ThreadContext *tc);
+
+ int
+ flattenIntIndex(int reg)
+ {
+ return reg;
+ }
+
+ int
+ flattenFloatIndex(int reg)
+ {
+ return reg;
+ }
+
+ void serialize(std::ostream &os);
+ void unserialize(Checkpoint *cp, const std::string §ion);
+
+ ISA()
+ {
+ clear();
+ }
+ };
+}
+
+#endif
diff -r 94b1a249422e -r 95f69a436c82 src/arch/alpha/isa/main.isa
--- a/src/arch/alpha/isa/main.isa Wed Jul 08 23:02:20 2009 -0700
+++ b/src/arch/alpha/isa/main.isa Wed Jul 08 23:02:20 2009 -0700
@@ -55,6 +55,7 @@
output decoder {{
#include <cmath>
+#include "arch/alpha/miscregfile.hh"
#include "base/cprintf.hh"
#include "base/fenv.hh"
#include "base/loader/symtab.hh"
@@ -71,6 +72,7 @@
#include "base/cp_annotate.hh"
#include "sim/pseudo_inst.hh"
#include "arch/alpha/ipr.hh"
+#include "arch/alpha/miscregfile.hh"
#include "base/fenv.hh"
#include "config/ss_compatible_fp.hh"
#include "cpu/base.hh"
diff -r 94b1a249422e -r 95f69a436c82 src/arch/alpha/regfile.cc
--- a/src/arch/alpha/regfile.cc Wed Jul 08 23:02:20 2009 -0700
+++ b/src/arch/alpha/regfile.cc Wed Jul 08 23:02:20 2009 -0700
@@ -31,6 +31,7 @@
*/
#include "arch/alpha/regfile.hh"
+#include "arch/alpha/miscregfile.hh"
#include "cpu/thread_context.hh"
using namespace std;
@@ -42,7 +43,6 @@
{
intRegFile.serialize(os);
floatRegFile.serialize(os);
- miscRegFile.serialize(os);
SERIALIZE_SCALAR(pc);
SERIALIZE_SCALAR(npc);
#if FULL_SYSTEM
@@ -55,7 +55,6 @@
{
intRegFile.unserialize(cp, section);
floatRegFile.unserialize(cp, section);
- miscRegFile.unserialize(cp, section);
UNSERIALIZE_SCALAR(pc);
UNSERIALIZE_SCALAR(npc);
#if FULL_SYSTEM
diff -r 94b1a249422e -r 95f69a436c82 src/arch/alpha/regfile.hh
--- a/src/arch/alpha/regfile.hh Wed Jul 08 23:02:20 2009 -0700
+++ b/src/arch/alpha/regfile.hh Wed Jul 08 23:02:20 2009 -0700
@@ -93,23 +93,10 @@
protected:
IntRegFile intRegFile; // (signed) integer register file
FloatRegFile floatRegFile; // floating point register file
- MiscRegFile miscRegFile; // control register file
public:
#if FULL_SYSTEM
int intrflag; // interrupt flag
-
- int
- instAsid()
- {
- return miscRegFile.getInstAsid();
- }
-
- int
- dataAsid()
- {
- return miscRegFile.getDataAsid();
- }
#endif // FULL_SYSTEM
void
@@ -117,31 +104,6 @@
{
intRegFile.clear();
floatRegFile.clear();
- miscRegFile.clear();
- }
-
- MiscReg
- readMiscRegNoEffect(int miscReg)
- {
- return miscRegFile.readRegNoEffect(miscReg);
- }
-
- MiscReg
- readMiscReg(int miscReg, ThreadContext *tc)
- {
- return miscRegFile.readReg(miscReg, tc);
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev