sim,util: Remove event dependencies from serialize.hh
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>
This commit is contained in:
committed by
Daniel Carvalho
parent
c493d2c4ad
commit
19c7429520
@@ -218,8 +218,12 @@ def process_file(path, **kwargs):
|
||||
change = True
|
||||
|
||||
cpt.remove_option('root', 'cpt_ver')
|
||||
# @todo The 'Globals' option is deprecated, and should be removed in the
|
||||
# future
|
||||
elif cpt.has_option('Globals','version_tags'):
|
||||
tags = set((''.join(cpt.get('Globals','version_tags'))).split())
|
||||
elif cpt.has_option('root.globals','version_tags'):
|
||||
tags = set((''.join(cpt.get('root.globals','version_tags'))).split())
|
||||
else:
|
||||
print("fatal: no version information in checkpoint")
|
||||
exit(1)
|
||||
@@ -253,7 +257,7 @@ def process_file(path, **kwargs):
|
||||
verboseprint("...nothing to do")
|
||||
return
|
||||
|
||||
cpt.set('Globals', 'version_tags', ' '.join(tags))
|
||||
cpt.set('root.globals', 'version_tags', ' '.join(tags))
|
||||
|
||||
# Write the old data back
|
||||
verboseprint("...completed")
|
||||
|
||||
Reference in New Issue
Block a user