From: Gabe Black Date: Wed, 15 Jan 2020 02:19:18 +0000 (-0800) Subject: arm: Don't checkpoint the SystemCounter's "_period" value. X-Git-Tag: v20.0.0.0~527 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9d8f3f9ad3180959fee6d971f8ba0cf56462abc3;p=gem5.git arm: Don't checkpoint the SystemCounter's "_period" value. This value is just a cached inverse of _freq and can be recalculated easily once the checkpoint is restored. The actual value of _period actually depends on the global resolution of time (ie how much time a Tick represents), and so saving the value of _period is also not technically correct, even though in practice that will very rarely cause a problem. Change-Id: I21e63ba25ac4e189417905e532981f3d80723f19 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24390 Reviewed-by: Gabe Black Maintainer: Gabe Black Tested-by: kokoro --- diff --git a/src/dev/arm/generic_timer.cc b/src/dev/arm/generic_timer.cc index 7c1f09add..3df87681e 100644 --- a/src/dev/arm/generic_timer.cc +++ b/src/dev/arm/generic_timer.cc @@ -83,7 +83,6 @@ SystemCounter::serialize(CheckpointOut &cp) const SERIALIZE_SCALAR(_regCntkctl); SERIALIZE_SCALAR(_regCnthctl); SERIALIZE_SCALAR(_freq); - SERIALIZE_SCALAR(_period); SERIALIZE_SCALAR(_resetTick); } @@ -97,7 +96,7 @@ SystemCounter::unserialize(CheckpointIn &cp) if (!UNSERIALIZE_OPT_SCALAR(_regCnthctl)) _regCnthctl = 0; UNSERIALIZE_SCALAR(_freq); - UNSERIALIZE_SCALAR(_period); + _period = (1.0 / _freq) * SimClock::Frequency; UNSERIALIZE_SCALAR(_resetTick); }