sim: Remove SimObject dependency from serialize.hh

Previously Serializable::serializeAll called SimObject::
serializeAll. This created an unnecessary dependency. This
change makes Serializable responsible for the generation
of the checkpoint file, and then the SimObjects will
perform the serialization of the object using that file.

With this change serialize.hh contains only functions
related to the (un)serialization of basic types or
objects that inherit from Serializable. As a general
rule, functions related to the (un)serialization of
specific/other types must be defined in the file that
introduces that type.

Change-Id: I9438b799d7e9d4c992a62c7f9d1f15f3f3250a5a
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38740
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
This commit is contained in:
Daniel R. Carvalho
2020-12-27 14:22:40 -03:00
committed by Daniel Carvalho
parent 18de63cea0
commit 05c0d52370
5 changed files with 62 additions and 50 deletions

View File

@@ -307,7 +307,7 @@ pybind_init_core(py::module_ &m_native)
* Serialization helpers
*/
m_core
.def("serializeAll", &Serializable::serializeAll)
.def("serializeAll", &SimObject::serializeAll)
.def("getCheckpoint", [](const std::string &cpt_dir) {
SimObject::setSimObjectResolver(&pybindSimObjectResolver);
return new CheckpointIn(cpt_dir);