arm: Add support for ARMv8 (AArch64 & AArch32)
Note: AArch64 and AArch32 interworking is not supported. If you use an AArch64
kernel you are restricted to AArch64 user-mode binaries. This will be addressed
in a later patch.
Note: Virtualization is only supported in AArch32 mode. This will also be fixed
in a later patch.
Contributors:
Giacomo Gabrielli (TrustZone, LPAE, system-level AArch64, AArch64 NEON, validation)
Thomas Grocutt (AArch32 Virtualization, AArch64 FP, validation)
Mbou Eyole (AArch64 NEON, validation)
Ali Saidi (AArch64 Linux support, code integration, validation)
Edmund Grimley-Evans (AArch64 FP)
William Wang (AArch64 Linux support)
Rene De Jong (AArch64 Linux support, performance opt.)
Matt Horsnell (AArch64 MP, validation)
Matt Evans (device models, code integration, validation)
Chris Adeniyi-Jones (AArch64 syscall-emulation)
Prakash Ramrakhyani (validation)
Dam Sunwoo (validation)
Chander Sudanthi (validation)
Stephan Diestelhorst (validation)
Andreas Hansson (code integration, performance opt.)
Eric Van Hensbergen (performance opt.)
Gabe Black
2014-01-24 22:29:34 +01:00
|
|
|
# Copyright (c) 2012-2013 ARM Limited
|
2012-02-13 12:43:09 +01:00
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# The license below extends only to copyright in the software and shall
|
|
|
|
# not be construed as granting a license to any other intellectual
|
|
|
|
# property including but not limited to intellectual property relating
|
|
|
|
# to a hardware implementation of the functionality of the software
|
|
|
|
# licensed hereunder. You may use the software subject to the license
|
|
|
|
# terms below provided that you ensure that this notice is replicated
|
|
|
|
# unmodified and in its entirety in all distributions of the software,
|
|
|
|
# modified or unmodified, in source code or in binary form.
|
|
|
|
#
|
2008-02-06 05:44:13 +01:00
|
|
|
# Copyright (c) 2005-2008 The Regents of The University of Michigan
|
2011-02-07 07:14:17 +01:00
|
|
|
# Copyright (c) 2011 Regents of the University of California
|
2007-05-28 04:21:17 +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.
|
|
|
|
#
|
|
|
|
# Authors: Nathan Binkert
|
2011-02-07 07:14:17 +01:00
|
|
|
# Rick Strong
|
2012-02-13 12:43:09 +01:00
|
|
|
# Andreas Hansson
|
2007-05-28 04:21:17 +02:00
|
|
|
|
2009-09-23 00:24:16 +02:00
|
|
|
import sys
|
|
|
|
|
|
|
|
from m5.defines import buildEnv
|
2006-09-05 02:14:07 +02:00
|
|
|
from m5.params import *
|
|
|
|
from m5.proxy import *
|
2009-09-23 00:24:16 +02:00
|
|
|
|
Bus: Split the bus into a non-coherent and coherent bus
This patch introduces a class hierarchy of buses, a non-coherent one,
and a coherent one, splitting the existing bus functionality. By doing
so it also enables further specialisation of the two types of buses.
A non-coherent bus connects a number of non-snooping masters and
slaves, and routes the request and response packets based on the
address. The request packets issued by the master connected to a
non-coherent bus could still snoop in caches attached to a coherent
bus, as is the case with the I/O bus and memory bus in most system
configurations. No snoops will, however, reach any master on the
non-coherent bus itself. The non-coherent bus can be used as a
template for modelling PCI, PCIe, and non-coherent AMBA and OCP buses,
and is typically used for the I/O buses.
A coherent bus connects a number of (potentially) snooping masters and
slaves, and routes the request and response packets based on the
address, and also forwards all requests to the snoopers and deals with
the snoop responses. The coherent bus can be used as a template for
modelling QPI, HyperTransport, ACE and coherent OCP buses, and is
typically used for the L1-to-L2 buses and as the main system
interconnect.
The configuration scripts are updated to use a NoncoherentBus for all
peripheral and I/O buses.
A bit of minor tidying up has also been done.
--HG--
rename : src/mem/bus.cc => src/mem/coherent_bus.cc
rename : src/mem/bus.hh => src/mem/coherent_bus.hh
rename : src/mem/bus.cc => src/mem/noncoherent_bus.cc
rename : src/mem/bus.hh => src/mem/noncoherent_bus.hh
2012-05-31 19:30:04 +02:00
|
|
|
from Bus import CoherentBus
|
2007-07-29 05:30:43 +02:00
|
|
|
from InstTracer import InstTracer
|
|
|
|
from ExeTracer import ExeTracer
|
2009-09-23 00:24:16 +02:00
|
|
|
from MemObject import MemObject
|
sim: Add the notion of clock domains to all ClockedObjects
This patch adds the notion of source- and derived-clock domains to the
ClockedObjects. As such, all clock information is moved to the clock
domain, and the ClockedObjects are grouped into domains.
The clock domains are either source domains, with a specific clock
period, or derived domains that have a parent domain and a divider
(potentially chained). For piece of logic that runs at a derived clock
(a ratio of the clock its parent is running at) the necessary derived
clock domain is created from its corresponding parent clock
domain. For now, the derived clock domain only supports a divider,
thus ensuring a lower speed compared to its parent. Multiplier
functionality implies a PLL logic that has not been modelled yet
(create a separate clock instead).
The clock domains should be used as a mechanism to provide a
controllable clock source that affects clock for every clocked object
lying beneath it. The clock of the domain can (in a future patch) be
controlled by a handler responsible for dynamic frequency scaling of
the respective clock domains.
All the config scripts have been retro-fitted with clock domains. For
the System a default SrcClockDomain is created. For CPUs that run at a
different speed than the system, there is a seperate clock domain
created. This domain incorporates the CPU and the associated
caches. As before, Ruby runs under its own clock domain.
The clock period of all domains are pre-computed, such that no virtual
functions or multiplications are needed when calling
clockPeriod. Instead, the clock period is pre-computed when any
changes occur. For this to be possible, each clock domain tracks its
children.
2013-06-27 11:49:49 +02:00
|
|
|
from ClockDomain import *
|
2006-06-10 05:01:31 +02:00
|
|
|
|
2007-07-29 05:30:43 +02:00
|
|
|
default_tracer = ExeTracer()
|
|
|
|
|
2009-09-23 00:24:16 +02:00
|
|
|
if buildEnv['TARGET_ISA'] == 'alpha':
|
2009-04-09 07:21:27 +02:00
|
|
|
from AlphaTLB import AlphaDTB, AlphaITB
|
2011-10-09 09:15:50 +02:00
|
|
|
from AlphaInterrupts import AlphaInterrupts
|
2013-01-07 19:05:35 +01:00
|
|
|
from AlphaISA import AlphaISA
|
|
|
|
isa_class = AlphaISA
|
2009-09-23 00:24:16 +02:00
|
|
|
elif buildEnv['TARGET_ISA'] == 'sparc':
|
2009-04-09 07:21:27 +02:00
|
|
|
from SparcTLB import SparcTLB
|
2011-10-09 09:15:50 +02:00
|
|
|
from SparcInterrupts import SparcInterrupts
|
2013-01-07 19:05:35 +01:00
|
|
|
from SparcISA import SparcISA
|
|
|
|
isa_class = SparcISA
|
2009-09-23 00:24:16 +02:00
|
|
|
elif buildEnv['TARGET_ISA'] == 'x86':
|
2009-04-09 07:21:27 +02:00
|
|
|
from X86TLB import X86TLB
|
2011-10-09 09:15:50 +02:00
|
|
|
from X86LocalApic import X86LocalApic
|
2013-01-07 19:05:35 +01:00
|
|
|
from X86ISA import X86ISA
|
|
|
|
isa_class = X86ISA
|
2009-09-23 00:24:16 +02:00
|
|
|
elif buildEnv['TARGET_ISA'] == 'mips':
|
2009-04-09 07:21:27 +02:00
|
|
|
from MipsTLB import MipsTLB
|
2011-10-09 09:15:50 +02:00
|
|
|
from MipsInterrupts import MipsInterrupts
|
2013-01-07 19:05:35 +01:00
|
|
|
from MipsISA import MipsISA
|
|
|
|
isa_class = MipsISA
|
2009-09-23 00:24:16 +02:00
|
|
|
elif buildEnv['TARGET_ISA'] == 'arm':
|
arm: Add support for ARMv8 (AArch64 & AArch32)
Note: AArch64 and AArch32 interworking is not supported. If you use an AArch64
kernel you are restricted to AArch64 user-mode binaries. This will be addressed
in a later patch.
Note: Virtualization is only supported in AArch32 mode. This will also be fixed
in a later patch.
Contributors:
Giacomo Gabrielli (TrustZone, LPAE, system-level AArch64, AArch64 NEON, validation)
Thomas Grocutt (AArch32 Virtualization, AArch64 FP, validation)
Mbou Eyole (AArch64 NEON, validation)
Ali Saidi (AArch64 Linux support, code integration, validation)
Edmund Grimley-Evans (AArch64 FP)
William Wang (AArch64 Linux support)
Rene De Jong (AArch64 Linux support, performance opt.)
Matt Horsnell (AArch64 MP, validation)
Matt Evans (device models, code integration, validation)
Chris Adeniyi-Jones (AArch64 syscall-emulation)
Prakash Ramrakhyani (validation)
Dam Sunwoo (validation)
Chander Sudanthi (validation)
Stephan Diestelhorst (validation)
Andreas Hansson (code integration, performance opt.)
Eric Van Hensbergen (performance opt.)
Gabe Black
2014-01-24 22:29:34 +01:00
|
|
|
from ArmTLB import ArmTLB, ArmStage2IMMU, ArmStage2DMMU
|
2011-10-09 09:15:50 +02:00
|
|
|
from ArmInterrupts import ArmInterrupts
|
2013-01-07 19:05:35 +01:00
|
|
|
from ArmISA import ArmISA
|
|
|
|
isa_class = ArmISA
|
2009-10-27 17:24:39 +01:00
|
|
|
elif buildEnv['TARGET_ISA'] == 'power':
|
|
|
|
from PowerTLB import PowerTLB
|
2011-10-09 09:15:50 +02:00
|
|
|
from PowerInterrupts import PowerInterrupts
|
2013-01-07 19:05:35 +01:00
|
|
|
from PowerISA import PowerISA
|
|
|
|
isa_class = PowerISA
|
2007-05-28 04:21:17 +02:00
|
|
|
|
2008-08-11 21:22:16 +02:00
|
|
|
class BaseCPU(MemObject):
|
2005-02-03 03:13:01 +01:00
|
|
|
type = 'BaseCPU'
|
2005-01-15 10:12:25 +01:00
|
|
|
abstract = True
|
2012-11-02 17:32:01 +01:00
|
|
|
cxx_header = "cpu/base.hh"
|
2012-09-25 18:49:40 +02:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def export_methods(cls, code):
|
|
|
|
code('''
|
|
|
|
void switchOut();
|
|
|
|
void takeOverFrom(BaseCPU *cpu);
|
2013-01-07 19:05:44 +01:00
|
|
|
bool switchedOut();
|
2013-01-07 19:05:48 +01:00
|
|
|
void flushTLBs();
|
2013-04-22 19:20:31 +02:00
|
|
|
Counter totalInsts();
|
2013-06-11 09:18:25 +02:00
|
|
|
void scheduleInstStop(ThreadID tid, Counter insts, const char *cause);
|
|
|
|
void scheduleLoadStop(ThreadID tid, Counter loads, const char *cause);
|
2012-09-25 18:49:40 +02:00
|
|
|
''')
|
|
|
|
|
2013-02-15 23:40:08 +01:00
|
|
|
@classmethod
|
|
|
|
def memory_mode(cls):
|
|
|
|
"""Which memory mode does this CPU require?"""
|
|
|
|
return 'invalid'
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def require_caches(cls):
|
|
|
|
"""Does the CPU model require caches?
|
|
|
|
|
|
|
|
Some CPU models might make assumptions that require them to
|
|
|
|
have caches.
|
|
|
|
"""
|
|
|
|
return False
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def support_take_over(cls):
|
|
|
|
"""Does the CPU model support CPU takeOverFrom?"""
|
|
|
|
return False
|
|
|
|
|
2012-09-25 18:49:40 +02:00
|
|
|
def takeOverFrom(self, old_cpu):
|
|
|
|
self._ccObject.takeOverFrom(old_cpu._ccObject)
|
|
|
|
|
|
|
|
|
2006-07-13 02:22:07 +02:00
|
|
|
system = Param.System(Parent.any, "system object")
|
2008-11-03 03:56:57 +01:00
|
|
|
cpu_id = Param.Int(-1, "CPU identifier")
|
2014-05-10 00:58:46 +02:00
|
|
|
socket_id = Param.Unsigned(0, "Physical Socket identifier")
|
2008-08-11 21:22:16 +02:00
|
|
|
numThreads = Param.Unsigned(1, "number of HW thread contexts")
|
|
|
|
|
|
|
|
function_trace = Param.Bool(False, "Enable function trace")
|
2012-08-21 11:49:43 +02:00
|
|
|
function_trace_start = Param.Tick(0, "Tick to start function trace")
|
2008-08-11 21:22:16 +02:00
|
|
|
|
2009-01-31 01:08:13 +01:00
|
|
|
checker = Param.BaseCPU(NULL, "checker CPU")
|
2006-10-08 19:53:24 +02:00
|
|
|
|
2008-12-17 18:51:18 +01:00
|
|
|
do_checkpoint_insts = Param.Bool(True,
|
|
|
|
"enable checkpoint pseudo instructions")
|
|
|
|
do_statistics_insts = Param.Bool(True,
|
|
|
|
"enable statistics pseudo instructions")
|
|
|
|
|
2011-11-02 10:11:14 +01:00
|
|
|
profile = Param.Latency('0ns', "trace the kernel stack")
|
|
|
|
do_quiesce = Param.Bool(True, "enable quiesce instructions")
|
|
|
|
|
2011-11-18 10:33:28 +01:00
|
|
|
workload = VectorParam.Process([], "processes to run")
|
2005-01-15 10:12:25 +01:00
|
|
|
|
2009-09-23 00:24:16 +02:00
|
|
|
if buildEnv['TARGET_ISA'] == 'sparc':
|
2009-04-09 07:21:27 +02:00
|
|
|
dtb = Param.SparcTLB(SparcTLB(), "Data TLB")
|
|
|
|
itb = Param.SparcTLB(SparcTLB(), "Instruction TLB")
|
2011-10-09 09:15:50 +02:00
|
|
|
interrupts = Param.SparcInterrupts(
|
2012-03-01 18:37:02 +01:00
|
|
|
NULL, "Interrupt Controller")
|
2013-01-07 19:05:35 +01:00
|
|
|
isa = VectorParam.SparcISA([ isa_class() ], "ISA instance")
|
2009-09-23 00:24:16 +02:00
|
|
|
elif buildEnv['TARGET_ISA'] == 'alpha':
|
2009-04-09 07:21:27 +02:00
|
|
|
dtb = Param.AlphaTLB(AlphaDTB(), "Data TLB")
|
|
|
|
itb = Param.AlphaTLB(AlphaITB(), "Instruction TLB")
|
2011-10-09 09:15:50 +02:00
|
|
|
interrupts = Param.AlphaInterrupts(
|
2012-03-01 18:37:02 +01:00
|
|
|
NULL, "Interrupt Controller")
|
2013-01-07 19:05:35 +01:00
|
|
|
isa = VectorParam.AlphaISA([ isa_class() ], "ISA instance")
|
2009-09-23 00:24:16 +02:00
|
|
|
elif buildEnv['TARGET_ISA'] == 'x86':
|
2009-04-09 07:21:27 +02:00
|
|
|
dtb = Param.X86TLB(X86TLB(), "Data TLB")
|
|
|
|
itb = Param.X86TLB(X86TLB(), "Instruction TLB")
|
2012-03-01 18:37:02 +01:00
|
|
|
interrupts = Param.X86LocalApic(NULL, "Interrupt Controller")
|
2013-01-07 19:05:35 +01:00
|
|
|
isa = VectorParam.X86ISA([ isa_class() ], "ISA instance")
|
2009-09-23 00:24:16 +02:00
|
|
|
elif buildEnv['TARGET_ISA'] == 'mips':
|
2009-04-09 07:21:27 +02:00
|
|
|
dtb = Param.MipsTLB(MipsTLB(), "Data TLB")
|
|
|
|
itb = Param.MipsTLB(MipsTLB(), "Instruction TLB")
|
2011-10-09 09:15:50 +02:00
|
|
|
interrupts = Param.MipsInterrupts(
|
2012-03-01 18:37:02 +01:00
|
|
|
NULL, "Interrupt Controller")
|
2013-01-07 19:05:35 +01:00
|
|
|
isa = VectorParam.MipsISA([ isa_class() ], "ISA instance")
|
2009-09-23 00:24:16 +02:00
|
|
|
elif buildEnv['TARGET_ISA'] == 'arm':
|
2009-04-22 00:40:25 +02:00
|
|
|
dtb = Param.ArmTLB(ArmTLB(), "Data TLB")
|
|
|
|
itb = Param.ArmTLB(ArmTLB(), "Instruction TLB")
|
arm: Add support for ARMv8 (AArch64 & AArch32)
Note: AArch64 and AArch32 interworking is not supported. If you use an AArch64
kernel you are restricted to AArch64 user-mode binaries. This will be addressed
in a later patch.
Note: Virtualization is only supported in AArch32 mode. This will also be fixed
in a later patch.
Contributors:
Giacomo Gabrielli (TrustZone, LPAE, system-level AArch64, AArch64 NEON, validation)
Thomas Grocutt (AArch32 Virtualization, AArch64 FP, validation)
Mbou Eyole (AArch64 NEON, validation)
Ali Saidi (AArch64 Linux support, code integration, validation)
Edmund Grimley-Evans (AArch64 FP)
William Wang (AArch64 Linux support)
Rene De Jong (AArch64 Linux support, performance opt.)
Matt Horsnell (AArch64 MP, validation)
Matt Evans (device models, code integration, validation)
Chris Adeniyi-Jones (AArch64 syscall-emulation)
Prakash Ramrakhyani (validation)
Dam Sunwoo (validation)
Chander Sudanthi (validation)
Stephan Diestelhorst (validation)
Andreas Hansson (code integration, performance opt.)
Eric Van Hensbergen (performance opt.)
Gabe Black
2014-01-24 22:29:34 +01:00
|
|
|
istage2_mmu = Param.ArmStage2MMU(ArmStage2IMMU(), "Stage 2 trans")
|
|
|
|
dstage2_mmu = Param.ArmStage2MMU(ArmStage2DMMU(), "Stage 2 trans")
|
2011-10-09 09:15:50 +02:00
|
|
|
interrupts = Param.ArmInterrupts(
|
2012-03-01 18:37:02 +01:00
|
|
|
NULL, "Interrupt Controller")
|
2013-01-07 19:05:35 +01:00
|
|
|
isa = VectorParam.ArmISA([ isa_class() ], "ISA instance")
|
2009-10-27 17:24:39 +01:00
|
|
|
elif buildEnv['TARGET_ISA'] == 'power':
|
|
|
|
UnifiedTLB = Param.Bool(True, "Is this a Unified TLB?")
|
|
|
|
dtb = Param.PowerTLB(PowerTLB(), "Data TLB")
|
|
|
|
itb = Param.PowerTLB(PowerTLB(), "Instruction TLB")
|
2011-10-09 09:15:50 +02:00
|
|
|
interrupts = Param.PowerInterrupts(
|
2012-03-01 18:37:02 +01:00
|
|
|
NULL, "Interrupt Controller")
|
2013-01-07 19:05:35 +01:00
|
|
|
isa = VectorParam.PowerISA([ isa_class() ], "ISA instance")
|
2007-08-27 05:24:18 +02:00
|
|
|
else:
|
|
|
|
print "Don't know what TLB to use for ISA %s" % \
|
2009-09-23 00:24:16 +02:00
|
|
|
buildEnv['TARGET_ISA']
|
2007-08-27 05:24:18 +02:00
|
|
|
sys.exit(1)
|
|
|
|
|
2005-01-15 10:12:25 +01:00
|
|
|
max_insts_all_threads = Param.Counter(0,
|
|
|
|
"terminate when all threads have reached this inst count")
|
|
|
|
max_insts_any_thread = Param.Counter(0,
|
|
|
|
"terminate when any thread reaches this inst count")
|
2013-04-22 19:20:31 +02:00
|
|
|
simpoint_start_insts = VectorParam.Counter([],
|
|
|
|
"starting instruction counts of simpoints")
|
2005-01-15 10:12:25 +01:00
|
|
|
max_loads_all_threads = Param.Counter(0,
|
|
|
|
"terminate when all threads have reached this load count")
|
|
|
|
max_loads_any_thread = Param.Counter(0,
|
|
|
|
"terminate when any thread reaches this load count")
|
2012-08-28 20:30:33 +02:00
|
|
|
progress_interval = Param.Frequency('0Hz',
|
|
|
|
"frequency to print out the progress message")
|
2005-01-15 10:12:25 +01:00
|
|
|
|
2013-01-07 19:05:45 +01:00
|
|
|
switched_out = Param.Bool(False,
|
|
|
|
"Leave the CPU switched out after startup (used when switching " \
|
|
|
|
"between CPU models)")
|
Make the notion of a global event tick independent of the actual
CPU cycle ticks. This allows the user to have CPUs of different
frequencies, and also allows frequencies and latencies that are
not evenly divisible by the CPU frequency. For now, the CPU
frequency is still set to the global frequency, but soon, we'll
hopefully make the global frequency fixed at something like 1THz
and set all other frequencies independently.
arch/alpha/ev5.cc:
The cycles counter is based on the current cpu cycle.
cpu/base_cpu.cc:
frequency isn't the cpu parameter anymore, cycleTime is.
cpu/base_cpu.hh:
frequency isn't the cpu parameter anymore, cycleTime is.
create several public functions for getting the cpu frequency
and the numbers of ticks for a given number of cycles, etc.
cpu/memtest/memtest.cc:
cpu/simple_cpu/simple_cpu.cc:
cpu/simple_cpu/simple_cpu.hh:
cpu/trace/trace_cpu.cc:
Now that ticks aren't cpu cycles, fixup code to advance
by the proper number of ticks.
cpu/memtest/memtest.hh:
cpu/trace/trace_cpu.hh:
Provide a function to get the number of ticks for a given
number of cycles.
dev/alpha_console.cc:
Update for changes in the way that frequencies and latencies are
accessed. Move some stuff to init()
dev/alpha_console.hh:
Need a pointer to the system and the cpu to get the frequency
so we can pass the info to the console code.
dev/etherbus.cc:
dev/etherbus.hh:
dev/etherlink.cc:
dev/etherlink.hh:
dev/ethertap.cc:
dev/ide_disk.hh:
dev/ns_gige.cc:
dev/ns_gige.hh:
update for changes in the way bandwidths are passed from
python to C++ to accomidate the new way that ticks works.
dev/ide_disk.cc:
update for changes in the way bandwidths are passed from
python to C++ to accomidate the new way that ticks works.
Add some extra debugging printfs
dev/platform.cc:
dev/sinic.cc:
dev/sinic.hh:
outline the constructor and destructor
dev/platform.hh:
outline the constructor and destructor.
don't keep track of the interrupt frequency. Only provide the
accessor function.
dev/tsunami.cc:
dev/tsunami.hh:
outline the constructor and destructor
Don't set the interrupt frequency here. Get it from the actual device
that does the interrupting.
dev/tsunami_io.cc:
dev/tsunami_io.hh:
Make the interrupt interval a configuration parameter. (And convert
the interval to the new latency/frequency stuff in the python)
kern/linux/linux_system.cc:
update for changes in the way bandwidths are passed from
python to C++ to accomidate the new way that ticks works.
For now, we must get the boot cpu's frequency as a parameter
since allowing the system to have a pointer to the boot cpu would
cause a cycle.
kern/tru64/tru64_system.cc:
For now, we must get the boot cpu's frequency as a parameter
since allowing the system to have a pointer to the boot cpu would
cause a cycle.
python/m5/config.py:
Fix support for cycle_time relative latencies and frequencies.
Add support for getting a NetworkBandwidth or a MemoryBandwidth.
python/m5/objects/BaseCPU.mpy:
All CPUs now have a cycle_time. The default is the global frequency,
but it is now possible to set the global frequency to some large value
(like 1THz) and set each CPU frequency independently.
python/m5/objects/BaseCache.mpy:
python/m5/objects/Ide.mpy:
Make this a Latency parameter
python/m5/objects/BaseSystem.mpy:
We need to pass the boot CPU's frequency to the system
python/m5/objects/Ethernet.mpy:
Update parameter types to use latency and bandwidth types
python/m5/objects/Platform.mpy:
this frequency isn't needed. We get it from the clock interrupt.
python/m5/objects/Tsunami.mpy:
The clock generator should hold the frequency
sim/eventq.hh:
Need to remove this assertion because the writeback event
queue is different from the CPU's event queue which can cause
this assertion to fail.
sim/process.cc:
Fix comment.
sim/system.hh:
Struct member to hold the boot CPU's frequency.
sim/universe.cc:
remove unneeded variable.
--HG--
extra : convert_revision : 51efe4041095234bf458d9b3b0d417f4cae16fdc
2005-04-11 21:32:06 +02:00
|
|
|
|
2007-07-29 05:30:43 +02:00
|
|
|
tracer = Param.InstTracer(default_tracer, "Instruction tracer")
|
|
|
|
|
2012-02-13 12:43:09 +01:00
|
|
|
icache_port = MasterPort("Instruction Port")
|
|
|
|
dcache_port = MasterPort("Data Port")
|
2012-01-17 19:55:08 +01:00
|
|
|
_cached_ports = ['icache_port', 'dcache_port']
|
|
|
|
|
2011-10-16 14:06:38 +02:00
|
|
|
if buildEnv['TARGET_ISA'] in ['x86', 'arm']:
|
2012-01-17 19:55:08 +01:00
|
|
|
_cached_ports += ["itb.walker.port", "dtb.walker.port"]
|
arm: Add support for ARMv8 (AArch64 & AArch32)
Note: AArch64 and AArch32 interworking is not supported. If you use an AArch64
kernel you are restricted to AArch64 user-mode binaries. This will be addressed
in a later patch.
Note: Virtualization is only supported in AArch32 mode. This will also be fixed
in a later patch.
Contributors:
Giacomo Gabrielli (TrustZone, LPAE, system-level AArch64, AArch64 NEON, validation)
Thomas Grocutt (AArch32 Virtualization, AArch64 FP, validation)
Mbou Eyole (AArch64 NEON, validation)
Ali Saidi (AArch64 Linux support, code integration, validation)
Edmund Grimley-Evans (AArch64 FP)
William Wang (AArch64 Linux support)
Rene De Jong (AArch64 Linux support, performance opt.)
Matt Horsnell (AArch64 MP, validation)
Matt Evans (device models, code integration, validation)
Chris Adeniyi-Jones (AArch64 syscall-emulation)
Prakash Ramrakhyani (validation)
Dam Sunwoo (validation)
Chander Sudanthi (validation)
Stephan Diestelhorst (validation)
Andreas Hansson (code integration, performance opt.)
Eric Van Hensbergen (performance opt.)
Gabe Black
2014-01-24 22:29:34 +01:00
|
|
|
if buildEnv['TARGET_ISA'] in ['arm']:
|
|
|
|
_cached_ports += ["istage2_mmu.stage2_tlb.walker.port",
|
|
|
|
"dstage2_mmu.stage2_tlb.walker.port"]
|
2011-02-04 05:23:00 +01:00
|
|
|
|
2012-02-13 12:43:09 +01:00
|
|
|
_uncached_slave_ports = []
|
|
|
|
_uncached_master_ports = []
|
2011-10-09 09:15:50 +02:00
|
|
|
if buildEnv['TARGET_ISA'] == 'x86':
|
2012-02-13 12:43:09 +01:00
|
|
|
_uncached_slave_ports += ["interrupts.pio", "interrupts.int_slave"]
|
|
|
|
_uncached_master_ports += ["interrupts.int_master"]
|
2011-02-04 05:23:00 +01:00
|
|
|
|
2012-03-01 18:37:02 +01:00
|
|
|
def createInterruptController(self):
|
|
|
|
if buildEnv['TARGET_ISA'] == 'sparc':
|
|
|
|
self.interrupts = SparcInterrupts()
|
|
|
|
elif buildEnv['TARGET_ISA'] == 'alpha':
|
|
|
|
self.interrupts = AlphaInterrupts()
|
|
|
|
elif buildEnv['TARGET_ISA'] == 'x86':
|
sim: Add the notion of clock domains to all ClockedObjects
This patch adds the notion of source- and derived-clock domains to the
ClockedObjects. As such, all clock information is moved to the clock
domain, and the ClockedObjects are grouped into domains.
The clock domains are either source domains, with a specific clock
period, or derived domains that have a parent domain and a divider
(potentially chained). For piece of logic that runs at a derived clock
(a ratio of the clock its parent is running at) the necessary derived
clock domain is created from its corresponding parent clock
domain. For now, the derived clock domain only supports a divider,
thus ensuring a lower speed compared to its parent. Multiplier
functionality implies a PLL logic that has not been modelled yet
(create a separate clock instead).
The clock domains should be used as a mechanism to provide a
controllable clock source that affects clock for every clocked object
lying beneath it. The clock of the domain can (in a future patch) be
controlled by a handler responsible for dynamic frequency scaling of
the respective clock domains.
All the config scripts have been retro-fitted with clock domains. For
the System a default SrcClockDomain is created. For CPUs that run at a
different speed than the system, there is a seperate clock domain
created. This domain incorporates the CPU and the associated
caches. As before, Ruby runs under its own clock domain.
The clock period of all domains are pre-computed, such that no virtual
functions or multiplications are needed when calling
clockPeriod. Instead, the clock period is pre-computed when any
changes occur. For this to be possible, each clock domain tracks its
children.
2013-06-27 11:49:49 +02:00
|
|
|
self.apic_clk_domain = DerivedClockDomain(clk_domain =
|
|
|
|
Parent.clk_domain,
|
|
|
|
clk_divider = 16)
|
|
|
|
self.interrupts = X86LocalApic(clk_domain = self.apic_clk_domain,
|
2013-02-19 11:56:06 +01:00
|
|
|
pio_addr=0x2000000000000000)
|
|
|
|
_localApic = self.interrupts
|
2012-03-01 18:37:02 +01:00
|
|
|
elif buildEnv['TARGET_ISA'] == 'mips':
|
|
|
|
self.interrupts = MipsInterrupts()
|
|
|
|
elif buildEnv['TARGET_ISA'] == 'arm':
|
|
|
|
self.interrupts = ArmInterrupts()
|
|
|
|
elif buildEnv['TARGET_ISA'] == 'power':
|
|
|
|
self.interrupts = PowerInterrupts()
|
|
|
|
else:
|
|
|
|
print "Don't know what Interrupt Controller to use for ISA %s" % \
|
|
|
|
buildEnv['TARGET_ISA']
|
|
|
|
sys.exit(1)
|
|
|
|
|
2011-02-04 05:23:00 +01:00
|
|
|
def connectCachedPorts(self, bus):
|
|
|
|
for p in self._cached_ports:
|
2012-02-13 12:43:09 +01:00
|
|
|
exec('self.%s = bus.slave' % p)
|
2006-08-16 18:52:05 +02:00
|
|
|
|
2011-02-04 05:23:00 +01:00
|
|
|
def connectUncachedPorts(self, bus):
|
2012-02-13 12:43:09 +01:00
|
|
|
for p in self._uncached_slave_ports:
|
|
|
|
exec('self.%s = bus.master' % p)
|
|
|
|
for p in self._uncached_master_ports:
|
|
|
|
exec('self.%s = bus.slave' % p)
|
2010-06-02 19:58:16 +02:00
|
|
|
|
2011-02-04 05:23:00 +01:00
|
|
|
def connectAllPorts(self, cached_bus, uncached_bus = None):
|
|
|
|
self.connectCachedPorts(cached_bus)
|
|
|
|
if not uncached_bus:
|
|
|
|
uncached_bus = cached_bus
|
|
|
|
self.connectUncachedPorts(uncached_bus)
|
2006-08-16 18:52:05 +02:00
|
|
|
|
2011-02-02 03:28:41 +01:00
|
|
|
def addPrivateSplitL1Caches(self, ic, dc, iwc = None, dwc = None):
|
2006-08-16 18:52:05 +02:00
|
|
|
self.icache = ic
|
|
|
|
self.dcache = dc
|
|
|
|
self.icache_port = ic.cpu_side
|
|
|
|
self.dcache_port = dc.cpu_side
|
2011-02-04 05:23:00 +01:00
|
|
|
self._cached_ports = ['icache.mem_side', 'dcache.mem_side']
|
2012-01-07 11:15:35 +01:00
|
|
|
if buildEnv['TARGET_ISA'] in ['x86', 'arm']:
|
|
|
|
if iwc and dwc:
|
|
|
|
self.itb_walker_cache = iwc
|
|
|
|
self.dtb_walker_cache = dwc
|
arm: Add support for ARMv8 (AArch64 & AArch32)
Note: AArch64 and AArch32 interworking is not supported. If you use an AArch64
kernel you are restricted to AArch64 user-mode binaries. This will be addressed
in a later patch.
Note: Virtualization is only supported in AArch32 mode. This will also be fixed
in a later patch.
Contributors:
Giacomo Gabrielli (TrustZone, LPAE, system-level AArch64, AArch64 NEON, validation)
Thomas Grocutt (AArch32 Virtualization, AArch64 FP, validation)
Mbou Eyole (AArch64 NEON, validation)
Ali Saidi (AArch64 Linux support, code integration, validation)
Edmund Grimley-Evans (AArch64 FP)
William Wang (AArch64 Linux support)
Rene De Jong (AArch64 Linux support, performance opt.)
Matt Horsnell (AArch64 MP, validation)
Matt Evans (device models, code integration, validation)
Chris Adeniyi-Jones (AArch64 syscall-emulation)
Prakash Ramrakhyani (validation)
Dam Sunwoo (validation)
Chander Sudanthi (validation)
Stephan Diestelhorst (validation)
Andreas Hansson (code integration, performance opt.)
Eric Van Hensbergen (performance opt.)
Gabe Black
2014-01-24 22:29:34 +01:00
|
|
|
if buildEnv['TARGET_ISA'] in ['arm']:
|
|
|
|
self.itb_walker_cache_bus = CoherentBus()
|
|
|
|
self.dtb_walker_cache_bus = CoherentBus()
|
|
|
|
self.itb_walker_cache_bus.master = iwc.cpu_side
|
|
|
|
self.dtb_walker_cache_bus.master = dwc.cpu_side
|
|
|
|
self.itb.walker.port = self.itb_walker_cache_bus.slave
|
|
|
|
self.dtb.walker.port = self.dtb_walker_cache_bus.slave
|
|
|
|
self.istage2_mmu.stage2_tlb.walker.port = self.itb_walker_cache_bus.slave
|
|
|
|
self.dstage2_mmu.stage2_tlb.walker.port = self.dtb_walker_cache_bus.slave
|
|
|
|
else:
|
|
|
|
self.itb.walker.port = iwc.cpu_side
|
|
|
|
self.dtb.walker.port = dwc.cpu_side
|
2012-01-07 11:15:35 +01:00
|
|
|
self._cached_ports += ["itb_walker_cache.mem_side", \
|
|
|
|
"dtb_walker_cache.mem_side"]
|
|
|
|
else:
|
|
|
|
self._cached_ports += ["itb.walker.port", "dtb.walker.port"]
|
2012-03-09 15:59:27 +01:00
|
|
|
|
arm: Add support for ARMv8 (AArch64 & AArch32)
Note: AArch64 and AArch32 interworking is not supported. If you use an AArch64
kernel you are restricted to AArch64 user-mode binaries. This will be addressed
in a later patch.
Note: Virtualization is only supported in AArch32 mode. This will also be fixed
in a later patch.
Contributors:
Giacomo Gabrielli (TrustZone, LPAE, system-level AArch64, AArch64 NEON, validation)
Thomas Grocutt (AArch32 Virtualization, AArch64 FP, validation)
Mbou Eyole (AArch64 NEON, validation)
Ali Saidi (AArch64 Linux support, code integration, validation)
Edmund Grimley-Evans (AArch64 FP)
William Wang (AArch64 Linux support)
Rene De Jong (AArch64 Linux support, performance opt.)
Matt Horsnell (AArch64 MP, validation)
Matt Evans (device models, code integration, validation)
Chris Adeniyi-Jones (AArch64 syscall-emulation)
Prakash Ramrakhyani (validation)
Dam Sunwoo (validation)
Chander Sudanthi (validation)
Stephan Diestelhorst (validation)
Andreas Hansson (code integration, performance opt.)
Eric Van Hensbergen (performance opt.)
Gabe Black
2014-01-24 22:29:34 +01:00
|
|
|
if buildEnv['TARGET_ISA'] in ['arm']:
|
|
|
|
self._cached_ports += ["istage2_mmu.stage2_tlb.walker.port", \
|
|
|
|
"dstage2_mmu.stage2_tlb.walker.port"]
|
|
|
|
|
2012-02-01 07:40:08 +01:00
|
|
|
# Checker doesn't need its own tlb caches because it does
|
|
|
|
# functional accesses only
|
2012-03-09 15:59:27 +01:00
|
|
|
if self.checker != NULL:
|
2012-02-01 07:40:08 +01:00
|
|
|
self._cached_ports += ["checker.itb.walker.port", \
|
|
|
|
"checker.dtb.walker.port"]
|
arm: Add support for ARMv8 (AArch64 & AArch32)
Note: AArch64 and AArch32 interworking is not supported. If you use an AArch64
kernel you are restricted to AArch64 user-mode binaries. This will be addressed
in a later patch.
Note: Virtualization is only supported in AArch32 mode. This will also be fixed
in a later patch.
Contributors:
Giacomo Gabrielli (TrustZone, LPAE, system-level AArch64, AArch64 NEON, validation)
Thomas Grocutt (AArch32 Virtualization, AArch64 FP, validation)
Mbou Eyole (AArch64 NEON, validation)
Ali Saidi (AArch64 Linux support, code integration, validation)
Edmund Grimley-Evans (AArch64 FP)
William Wang (AArch64 Linux support)
Rene De Jong (AArch64 Linux support, performance opt.)
Matt Horsnell (AArch64 MP, validation)
Matt Evans (device models, code integration, validation)
Chris Adeniyi-Jones (AArch64 syscall-emulation)
Prakash Ramrakhyani (validation)
Dam Sunwoo (validation)
Chander Sudanthi (validation)
Stephan Diestelhorst (validation)
Andreas Hansson (code integration, performance opt.)
Eric Van Hensbergen (performance opt.)
Gabe Black
2014-01-24 22:29:34 +01:00
|
|
|
if buildEnv['TARGET_ISA'] in ['arm']:
|
|
|
|
self._cached_ports += ["checker.istage2_mmu.stage2_tlb.walker.port", \
|
|
|
|
"checker.dstage2_mmu.stage2_tlb.walker.port"]
|
2006-08-16 18:52:05 +02:00
|
|
|
|
2011-02-02 03:28:41 +01:00
|
|
|
def addTwoLevelCacheHierarchy(self, ic, dc, l2c, iwc = None, dwc = None):
|
|
|
|
self.addPrivateSplitL1Caches(ic, dc, iwc, dwc)
|
2013-06-27 11:49:49 +02:00
|
|
|
# Set a width of 32 bytes (256-bits), which is four times that
|
|
|
|
# of the default bus. The clock of the CPU is inherited by
|
|
|
|
# default.
|
|
|
|
self.toL2Bus = CoherentBus(width = 32)
|
2011-02-04 05:23:00 +01:00
|
|
|
self.connectCachedPorts(self.toL2Bus)
|
2006-08-16 18:52:05 +02:00
|
|
|
self.l2cache = l2c
|
2012-02-13 12:43:09 +01:00
|
|
|
self.toL2Bus.master = self.l2cache.cpu_side
|
2011-02-04 05:23:00 +01:00
|
|
|
self._cached_ports = ['l2cache.mem_side']
|
2012-03-09 15:59:27 +01:00
|
|
|
|
2013-01-07 19:05:35 +01:00
|
|
|
def createThreads(self):
|
|
|
|
self.isa = [ isa_class() for i in xrange(self.numThreads) ]
|
|
|
|
if self.checker != NULL:
|
|
|
|
self.checker.createThreads()
|
|
|
|
|
2012-03-09 15:59:27 +01:00
|
|
|
def addCheckerCpu(self):
|
|
|
|
pass
|