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 <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
SERIALIZE_SCALAR(_regCntkctl);
SERIALIZE_SCALAR(_regCnthctl);
SERIALIZE_SCALAR(_freq);
- SERIALIZE_SCALAR(_period);
SERIALIZE_SCALAR(_resetTick);
}
if (!UNSERIALIZE_OPT_SCALAR(_regCnthctl))
_regCnthctl = 0;
UNSERIALIZE_SCALAR(_freq);
- UNSERIALIZE_SCALAR(_period);
+ _period = (1.0 / _freq) * SimClock::Frequency;
UNSERIALIZE_SCALAR(_resetTick);
}