dev-arm: Fix checkpointing for the GenericTimer
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Thu, 9 Apr 2020 09:48:13 +0000 (10:48 +0100)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Tue, 14 Apr 2020 15:01:19 +0000 (15:01 +0000)
commit98c4719d791a5f3aebf20b275ce7a29ed3d7f977
tree31c2ba06e36ac399ff56f5c55ba038ccc5e3c1c6
parent06a92e0d8c9042c2b8cd027b3c187f94c56e9b91
dev-arm: Fix checkpointing for the GenericTimer

The revamp of the GenericTimer was not taking into account:

* The name of the variable will be printed on the checkpoint to label the
data. It is not possible to use different variable names when
serializing/unserializing, and it is not possible to use the same
temporary variable to serialize/unserialize different values.

* the serializeSection is creating a new sub section in the
checkpoint. Doing the following:

void
GenericTimerFrame::serialize(CheckpointOut &cp) const
{
    physTimer.serializeSection(cp, "phys_timer");
    virtTimer.serializeSection(cp, "virt_timer");
    SERIALIZE_SCALAR(accessBits);
}

will serialize the accessBits under the virt_timer subsection
rather than the parent generic_timer_frame.

JIRA: https://gem5.atlassian.net/projects/GEM5/issues/GEM5-426

Change-Id: I7676309965a33156789d2ef13e966c7a4ad88a71
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27708
Tested-by: kokoro <noreply+kokoro@google.com>
src/dev/arm/generic_timer.cc