cntfrq = Param.UInt64(0x1800000, "Value for the CNTFRQ timer register")
- # We shouldn't need these, but gem5 gets mad without them.
- isa = [ ArmISA() ]
-
evs = Parent.evs
redistributor = Gicv3CommsTargetSocket('GIC communication target')
namespace FastModel
{
-CortexA76TC::CortexA76TC(
- ::BaseCPU *cpu, int id, System *system, ::BaseTLB *dtb, ::BaseTLB *itb,
+CortexA76TC::CortexA76TC(::BaseCPU *cpu, int id, System *system,
+ ::BaseTLB *dtb, ::BaseTLB *itb, ::BaseISA *isa,
iris::IrisConnectionInterface *iris_if,
const std::string &iris_path) :
- ThreadContext(cpu, id, system, dtb, itb, iris_if, iris_path)
+ ThreadContext(cpu, id, system, dtb, itb, isa, iris_if, iris_path)
{}
bool
public:
CortexA76TC(::BaseCPU *cpu, int id, System *system,
- ::BaseTLB *dtb, ::BaseTLB *itb,
+ ::BaseTLB *dtb, ::BaseTLB *itb, ::BaseISA *isa,
iris::IrisConnectionInterface *iris_if,
const std::string &iris_path);
from m5.objects.BaseCPU import BaseCPU
from m5.objects.BaseInterrupts import BaseInterrupts
+from m5.objects.BaseISA import BaseISA
from m5.objects.BaseTLB import BaseTLB
class IrisTLB(BaseTLB):
cxx_class = 'Iris::Interrupts'
cxx_header = 'arch/arm/fastmodel/iris/interrupts.hh'
+class IrisISA(BaseISA):
+ type = 'IrisISA'
+ cxx_class = 'Iris::ISA'
+ cxx_header = 'arch/arm/fastmodel/iris/isa.hh'
+
class IrisBaseCPU(BaseCPU):
type = 'IrisBaseCPU'
abstract = True
dtb = IrisTLB()
itb = IrisTLB()
+ def createThreads(self):
+ if len(self.isa) == 0:
+ self.isa = [ IrisISA() for i in range(self.numThreads) ]
+ else:
+ assert(len(self.isa) == int(self.numThreads))
+
def createInterruptController(self):
self.interrupts = [ IrisInterrupts() for i in range(self.numThreads) ]
SimObject('Iris.py')
Source('cpu.cc')
Source('interrupts.cc')
+Source('isa.cc')
Source('tlb.cc')
Source('thread_context.cc')
int thread_id = 0;
for (const std::string &sub_path: params->thread_paths) {
std::string path = parent_path + "." + sub_path;
- auto *tc = new TC(this, thread_id++, sys,
- params->dtb, params->itb,iris_if, path);
+ auto id = thread_id++;
+ auto *tc = new TC(this, id, sys, params->dtb, params->itb,
+ params->isa[id], iris_if, path);
threadContexts.push_back(tc);
}
}
--- /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.
+ */
+
+#include "arch/arm/fastmodel/iris/isa.hh"
+
+#include "arch/arm/miscregs.hh"
+#include "cpu/thread_context.hh"
+#include "params/IrisISA.hh"
+#include "sim/serialize.hh"
+
+void
+Iris::ISA::serialize(CheckpointOut &cp) const
+{
+ RegVal miscRegs[ArmISA::NUM_PHYS_MISCREGS];
+ for (int i = 0; i < ArmISA::NUM_PHYS_MISCREGS; i++)
+ miscRegs[i] = tc->readMiscRegNoEffect(i);
+ SERIALIZE_ARRAY(miscRegs, ArmISA::NUM_PHYS_MISCREGS);
+}
+
+Iris::ISA *
+IrisISAParams::create()
+{
+ return new Iris::ISA(this);
+}
--- /dev/null
+/*
+ * Copyright 2019 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.
+ */
+
+#ifndef __ARCH_ARM_FASTMODEL_IRIS_ISA_HH__
+#define __ARCH_ARM_FASTMODEL_IRIS_ISA_HH__
+
+#include "arch/generic/isa.hh"
+
+namespace Iris
+{
+
+class ISA : public BaseISA
+{
+ public:
+ ISA(const Params *p) : BaseISA(p) {}
+
+ void serialize(CheckpointOut &cp) const;
+};
+
+} // namespace Iris
+
+#endif // __ARCH_ARM_FASTMODEL_IRIS_ISA_HH__
ThreadContext::ThreadContext(
BaseCPU *cpu, int id, System *system, ::BaseTLB *dtb, ::BaseTLB *itb,
- iris::IrisConnectionInterface *iris_if, const std::string &iris_path) :
- _cpu(cpu), _threadId(id), _system(system), _dtb(dtb), _itb(itb),
+ BaseISA *isa, iris::IrisConnectionInterface *iris_if,
+ const std::string &iris_path) :
+ _cpu(cpu), _threadId(id), _system(system), _dtb(dtb), _itb(itb), _isa(isa),
_irisPath(iris_path), vecRegs(ArmISA::NumVecRegs),
vecPredRegs(ArmISA::NumVecPredRegs),
comInstEventQueue("instruction-based event queue"),
System *_system;
::BaseTLB *_dtb;
::BaseTLB *_itb;
+ ::BaseISA *_isa;
std::string _irisPath;
iris::InstanceId _instId = iris::IRIS_UINT64_MAX;
public:
ThreadContext(::BaseCPU *cpu, int id, System *system,
- ::BaseTLB *dtb, ::BaseTLB *itb,
+ ::BaseTLB *dtb, ::BaseTLB *itb, ::BaseISA *isa,
iris::IrisConnectionInterface *iris_if,
const std::string &iris_path);
virtual ~ThreadContext();
BaseISA *
getIsaPtr() override
{
- panic("%s not implemented.", __FUNCTION__);
+ return _isa;
}
PortProxy &getPhysProxy() override { return *physProxy; }