From 831cda0965d87635930e46ac024c2bd8c3f5593a Mon Sep 17 00:00:00 2001 From: Yu-hsin Wang Date: Wed, 21 Oct 2020 18:19:34 +0800 Subject: [PATCH] dev-arm: Fix VExpressFastmodel timer configs generic_timer is no longer in the return value of _on_chip_devices. We should correct the _on_chip_devices. Furthermore, to prevent the timer conflict with the fastmodel, we should remove unwanted timer. Change-Id: I6ec7f9749546df3e8f125a5b96e7ed83cab2ea56 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36379 Reviewed-by: Giacomo Travaglini Maintainer: Giacomo Travaglini Tested-by: kokoro --- .../fastmodel/CortexA76/FastModelCortexA76.py | 16 ++++++++++++++++ src/dev/arm/VExpressFastmodel.py | 18 ++++++++++++------ 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/src/arch/arm/fastmodel/CortexA76/FastModelCortexA76.py b/src/arch/arm/fastmodel/CortexA76/FastModelCortexA76.py index 65d57a1c1..0b0fa8d99 100644 --- a/src/arch/arm/fastmodel/CortexA76/FastModelCortexA76.py +++ b/src/arch/arm/fastmodel/CortexA76/FastModelCortexA76.py @@ -34,6 +34,7 @@ from m5.objects.FastModelGIC import Gicv3CommsTargetSocket from m5.objects.Gic import ArmPPI from m5.objects.Iris import IrisBaseCPU from m5.objects.SystemC import SystemC_ScModule +from m5.util.fdthelper import FdtNode, FdtPropertyWords class FastModelCortexA76(IrisBaseCPU): type = 'FastModelCortexA76' @@ -348,6 +349,21 @@ class FastModelCortexA76Cluster(SimObject): walk_cache_latency = Param.UInt64(0, "Walk cache latency for TA (Timing "\ "Annotation), expressed in simulation ticks") + def generateDeviceTree(self, state): + node = FdtNode("timer") + + node.appendCompatible(["arm,cortex-a15-timer", + "arm,armv7-timer", + "arm,armv8-timer"]) + node.append(FdtPropertyWords("interrupts", [ + 1, int(self.cntpsirq.num), 0xf08, + 1, int(self.cntpnsirq.num), 0xf08, + 1, int(self.cntvirq.num), 0xf08, + 1, int(self.cnthpirq.num), 0xf08, + ])) + + yield node + class FastModelScxEvsCortexA76x1(SystemC_ScModule): type = 'FastModelScxEvsCortexA76x1' cxx_class = 'FastModel::ScxEvsCortexA76' diff --git a/src/dev/arm/VExpressFastmodel.py b/src/dev/arm/VExpressFastmodel.py index 015f6d4d7..a6b9b3426 100644 --- a/src/dev/arm/VExpressFastmodel.py +++ b/src/dev/arm/VExpressFastmodel.py @@ -26,6 +26,7 @@ from m5.objects.FastModelGIC import FastModelGIC, SCFastModelGIC from m5.objects.Gic import ArmSPI from m5.objects.RealView import VExpress_GEM5_Base, HDLcd +from m5.objects.SubSystem import SubSystem class VExpressFastmodel(VExpress_GEM5_Base): gic = FastModelGIC( @@ -39,14 +40,19 @@ class VExpressFastmodel(VExpress_GEM5_Base): pxl_clk=VExpress_GEM5_Base.dcc.osc_pxl, pio_addr=0x2b000000, interrupt=ArmSPI(num=95)) - def __init__(self, *args, **kwargs): - super(VExpressFastmodel, self).__init__(*args, **kwargs) + # Remove original timer to prevent from possible conflict with Fastmodel + # timer. + generic_timer = SubSystem() + generic_timer_mem = SubSystem() + sys_counter = SubSystem() def _on_chip_devices(self): - devices = super(VExpressFastmodel, self)._on_chip_devices() - devices += [ self.gic, self.hdlcd ] - devices.remove(self.generic_timer) - return devices + return [ + self.gic, + self.hdlcd, + self.system_watchdog, + self.trusted_watchdog, + ] def setupBootLoader(self, cur_sys, loc, boot_loader=None): if boot_loader is None: -- 2.30.2