From: Adrian Herrera Date: Wed, 8 Jul 2020 16:03:34 +0000 (+0100) Subject: dev-arm: FVPBasePwrCtrl, fix vector resizing X-Git-Tag: develop-gem5-snapshot~721 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=87328c2fc15746ed50619d7c1785ae737e04cb54;p=gem5.git dev-arm: FVPBasePwrCtrl, fix vector resizing (1) ThreadContexts are registered into System in BaseCPU::init. (2) FVPBasePwrCtrl state is resized based on registered ThreadContexts in FVPBasePwrCtrl::init. FVPBasePwrCtrl::init may be called before BaseCPU::init based on the model names alphabetical order, leading to segmentation faults. To fix this, (2) is now carried out in FVPBasePwrCtrl::startup. Change-Id: Ica6c5b7448da556d61aee53f8777a709fcad2212 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35075 Reviewed-by: Giacomo Travaglini Maintainer: Giacomo Travaglini Tested-by: kokoro --- diff --git a/src/dev/arm/fvp_base_pwr_ctrl.cc b/src/dev/arm/fvp_base_pwr_ctrl.cc index fc66e1c33..d6b6a5980 100644 --- a/src/dev/arm/fvp_base_pwr_ctrl.cc +++ b/src/dev/arm/fvp_base_pwr_ctrl.cc @@ -58,13 +58,13 @@ FVPBasePwrCtrl::FVPBasePwrCtrl(FVPBasePwrCtrlParams *const params) } void -FVPBasePwrCtrl::init() +FVPBasePwrCtrl::startup() { // All cores are ON by default (PwrStatus.{l0,l1} = 0b1) corePwrStatus.resize(sys->threads.size(), 0x60000000); for (const auto &tc : sys->threads) poweredCoresPerCluster[tc->socketId()] += 1; - BasicPioDevice::init(); + BasicPioDevice::startup(); } void diff --git a/src/dev/arm/fvp_base_pwr_ctrl.hh b/src/dev/arm/fvp_base_pwr_ctrl.hh index aa446a866..92c31980a 100644 --- a/src/dev/arm/fvp_base_pwr_ctrl.hh +++ b/src/dev/arm/fvp_base_pwr_ctrl.hh @@ -88,7 +88,7 @@ class FVPBasePwrCtrl : public BasicPioDevice */ void clearWakeRequest(ThreadContext *const tc); - void init() override; + void startup() override; protected: Tick read(PacketPtr pkt) override;