With this change serialize.hh is no longer responsible for the (un)serialization of events. As a general rule, rules to (un)serialize non-basic types should be defined at the file that introduces that type. Therefore, (UN)SERIALIZE_EVENT have been moved to eventq.hh. Globals has a single instance which must be serialized and unserialized. Instead of having a stray global variable handled by Serialization, we pass its management to Root. As a side effect, Globals is assigned its own files: sim/globals.(cc/hh). Finally, 'unserializeGlobals()' is removed, so that Root can fully handle Globals' serialization. This breaks checkpoint compatibility, so a checkpoint upgrader is added. Change-Id: I9c8e57306f83f9cc30ab2b745a4972755191bec4 Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/43586 Tested-by: kokoro <noreply+kokoro@google.com> Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu> Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
14 lines
420 B
Python
14 lines
420 B
Python
# This upgrader renames section "Globals" as "root.globals".
|
|
def upgrader(cpt):
|
|
import re
|
|
for sec in cpt.sections():
|
|
if re.match('Globals', sec):
|
|
# rename the section
|
|
items = cpt.items(sec)
|
|
cpt.add_section('root.globals')
|
|
for item in items:
|
|
cpt.set('root.globals', item[0], item[1])
|
|
cpt.remove_section(sec)
|
|
|
|
legacy_version = 16
|