from m5.params import *
from m5.proxy import *
-from m5.SimObject import SimObject
+from m5.objects.BaseISA import BaseISA
-class AlphaISA(SimObject):
+class AlphaISA(BaseISA):
type = 'AlphaISA'
cxx_class = 'AlphaISA::ISA'
cxx_header = "arch/alpha/isa.hh"
namespace AlphaISA
{
-ISA::ISA(Params *p)
- : SimObject(p), system(p->system)
+ISA::ISA(Params *p) : BaseISA(p), system(p->system)
{
clear();
initializeIprTable();
#include "arch/alpha/registers.hh"
#include "arch/alpha/types.hh"
+#include "arch/generic/isa.hh"
#include "base/types.hh"
#include "cpu/reg_class.hh"
#include "sim/sim_object.hh"
namespace AlphaISA
{
- class ISA : public SimObject
+ class ISA : public BaseISA
{
public:
typedef uint64_t InternalProcReg;
void startup(ThreadContext *tc) {}
/// Explicitly import the otherwise hidden startup
- using SimObject::startup;
+ using BaseISA::startup;
};
}
from m5.params import *
from m5.proxy import *
-from m5.SimObject import SimObject
from m5.objects.ArmPMU import ArmPMU
from m5.objects.ArmSystem import SveVectorLength
+from m5.objects.BaseISA import BaseISA
from m5.objects.ISACommon import VecRegRenameMode
# Enum for DecoderFlavour
class DecoderFlavour(Enum): vals = ['Generic']
-class ArmISA(SimObject):
+class ArmISA(BaseISA):
type = 'ArmISA'
cxx_class = 'ArmISA::ISA'
cxx_header = "arch/arm/isa.hh"
namespace ArmISA
{
-ISA::ISA(Params *p)
- : SimObject(p),
- system(NULL),
- _decoderFlavour(p->decoderFlavour),
- _vecRegRenameMode(Enums::Full),
- pmu(p->pmu),
- haveGICv3CPUInterface(false),
- impdefAsNop(p->impdef_nop),
- afterStartup(false)
+ISA::ISA(Params *p) : BaseISA(p), system(NULL),
+ _decoderFlavour(p->decoderFlavour), _vecRegRenameMode(Enums::Full),
+ pmu(p->pmu), haveGICv3CPUInterface(false), impdefAsNop(p->impdef_nop),
+ afterStartup(false)
{
miscRegs[MISCREG_SCTLR_RST] = 0;
#include "arch/arm/system.hh"
#include "arch/arm/tlb.hh"
#include "arch/arm/types.hh"
+#include "arch/generic/isa.hh"
#include "arch/generic/traits.hh"
#include "debug/Checkpoint.hh"
#include "enums/VecRegRenameMode.hh"
namespace ArmISA
{
- class ISA : public SimObject
+ class ISA : public BaseISA
{
protected:
// Parent system
}
/// Explicitly import the otherwise hidden startup
- using SimObject::startup;
+ using BaseISA::startup;
typedef ArmISAParams Params;
--- /dev/null
+# Copyright 2020 Google, Inc.
+#
+# 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
+
+from m5.params import *
+from m5.SimObject import SimObject
+
+class BaseISA(SimObject):
+ type = 'BaseISA'
+ abstract = True
+ cxx_header = "arch/generic/isa.hh"
Source('mmapped_ipr.cc')
SimObject('BaseInterrupts.py')
+SimObject('BaseISA.py')
SimObject('BaseTLB.py')
SimObject('ISACommon.py')
--- /dev/null
+/*
+ * Copyright 2020 Google Inc.
+ *
+ * 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_GENERIC_ISA_HH__
+#define __ARCH_GENERIC_ISA_HH__
+
+#include "sim/sim_object.hh"
+
+class BaseISA : public SimObject
+{
+ protected:
+ using SimObject::SimObject;
+};
+
+#endif // __ARCH_GENERIC_ISA_HH__
#
# Authors: Andreas Sandberg
-from m5.SimObject import SimObject
from m5.params import *
from m5.proxy import *
-class MipsISA(SimObject):
+from m5.objects.BaseISA import BaseISA
+
+class MipsISA(BaseISA):
type = 'MipsISA'
cxx_class = 'MipsISA::ISA'
cxx_header = "arch/mips/isa.hh"
"LLFlag"
};
-ISA::ISA(Params *p)
- : SimObject(p), numThreads(p->num_threads), numVpes(p->num_vpes)
+ISA::ISA(Params *p) : BaseISA(p), numThreads(p->num_threads),
+ numVpes(p->num_vpes)
{
miscRegFile.resize(NumMiscRegs);
bankType.resize(NumMiscRegs);
#include <string>
#include <vector>
+#include "arch/generic/isa.hh"
#include "arch/mips/registers.hh"
#include "arch/mips/types.hh"
#include "cpu/reg_class.hh"
namespace MipsISA
{
- class ISA : public SimObject
+ class ISA : public BaseISA
{
public:
// The MIPS name for this file is CP0 or Coprocessor 0
void startup(ThreadContext *tc) {}
/// Explicitly import the otherwise hidden startup
- using SimObject::startup;
+ using BaseISA::startup;
const Params *params() const;
#
# Authors: Andreas Sandberg
-from m5.SimObject import SimObject
+from m5.objects.BaseISA import BaseISA
-class PowerISA(SimObject):
+class PowerISA(BaseISA):
type = 'PowerISA'
cxx_class = 'PowerISA::ISA'
cxx_header = "arch/power/isa.hh"
namespace PowerISA
{
-ISA::ISA(Params *p)
- : SimObject(p)
+ISA::ISA(Params *p) : BaseISA(p)
{
clear();
}
#ifndef __ARCH_POWER_ISA_HH__
#define __ARCH_POWER_ISA_HH__
+#include "arch/generic/isa.hh"
#include "arch/power/registers.hh"
#include "arch/power/types.hh"
#include "base/logging.hh"
namespace PowerISA
{
-class ISA : public SimObject
+class ISA : public BaseISA
{
protected:
RegVal dummy;
void startup(ThreadContext *tc) {}
/// Explicitly import the otherwise hidden startup
- using SimObject::startup;
+ using BaseISA::startup;
const Params *params() const;
# Sven Karlsson
# Alec Roelke
-from m5.SimObject import SimObject
+from m5.objects.BaseISA import BaseISA
-class RiscvISA(SimObject):
+class RiscvISA(BaseISA):
type = 'RiscvISA'
cxx_class = 'RiscvISA::ISA'
cxx_header = "arch/riscv/isa.hh"
namespace RiscvISA
{
-ISA::ISA(Params *p) : SimObject(p)
+ISA::ISA(Params *p) : BaseISA(p)
{
miscRegFile.resize(NumMiscRegs);
clear();
#include <map>
#include <string>
+#include "arch/generic/isa.hh"
#include "arch/riscv/registers.hh"
#include "arch/riscv/types.hh"
#include "base/bitfield.hh"
PRV_M = 3
};
-class ISA : public SimObject
+class ISA : public BaseISA
{
protected:
std::vector<RegVal> miscRegFile;
void startup(ThreadContext *tc) {}
/// Explicitly import the otherwise hidden startup
- using SimObject::startup;
+ using BaseISA::startup;
const Params *params() const;
#
# Authors: Andreas Sandberg
-from m5.SimObject import SimObject
+from m5.objects.BaseISA import BaseISA
-class SparcISA(SimObject):
+class SparcISA(BaseISA):
type = 'SparcISA'
cxx_class = 'SparcISA::ISA'
cxx_header = "arch/sparc/isa.hh"
static const PSTATE PstateMask = buildPstateMask();
-ISA::ISA(Params *p)
- : SimObject(p)
+ISA::ISA(Params *p) : BaseISA(p)
{
tickCompare = NULL;
sTickCompare = NULL;
#include <ostream>
#include <string>
+#include "arch/generic/isa.hh"
#include "arch/sparc/registers.hh"
#include "arch/sparc/types.hh"
#include "cpu/cpuevent.hh"
namespace SparcISA
{
-class ISA : public SimObject
+class ISA : public BaseISA
{
private:
void startup(ThreadContext *tc) {}
/// Explicitly import the otherwise hidden startup
- using SimObject::startup;
+ using BaseISA::startup;
protected:
bool isHyperPriv() { return hpstate.hpriv; }
#
# Authors: Andreas Sandberg
-from m5.SimObject import SimObject
+from m5.objects.BaseISA import BaseISA
-class X86ISA(SimObject):
+class X86ISA(BaseISA):
type = 'X86ISA'
cxx_class = 'X86ISA::ISA'
cxx_header = "arch/x86/isa.hh"
regVal[MISCREG_APIC_BASE] = lApicBase;
}
-ISA::ISA(Params *p)
- : SimObject(p)
+ISA::ISA(Params *p) : BaseISA(p)
{
clear();
}
#include <iostream>
#include <string>
+#include "arch/generic/isa.hh"
+#include "arch/x86/registers.hh"
#include "arch/x86/regs/float.hh"
#include "arch/x86/regs/misc.hh"
-#include "arch/x86/registers.hh"
#include "base/types.hh"
#include "cpu/reg_class.hh"
#include "sim/sim_object.hh"
namespace X86ISA
{
- class ISA : public SimObject
+ class ISA : public BaseISA
{
protected:
RegVal regVal[NUM_MISCREGS];
void startup(ThreadContext *tc);
/// Explicitly import the otherwise hidden startup
- using SimObject::startup;
+ using BaseISA::startup;
};
}