From 87b9da2df4d4dc0028566a7803ee55159343d735 Mon Sep 17 00:00:00 2001 From: Curtis Dunham Date: Wed, 2 Sep 2015 15:23:30 -0500 Subject: sim: tag-based checkpoint versioning This commit addresses gem5 checkpoints' linear versioning bottleneck. Since development is distributed across many private trees, there exists a sort of 'race' for checkpoint version numbers: internally a checkpoint version may be used but then resynchronizing with the external tree causes a conflict on that version. This change replaces the linear version number with a set of unique strings called tags. Now the only conflicts that can arise are of tag names, where collisions are much easier to avoid. The checkpoint upgrader (util/cpt_upgrader.py) upgrades the version representation, as one would expect. Each tag version implements its upgrader code in a python file in the util/cpt_upgraders directory rather than adding a function to the upgrader script itself. The version tags are stored in the 'Globals' section rather than 'root' (as the version was previously) because 'Globals' gets unserialized first and can provide a warning before any other unserialization errors can occur. --- util/cpt_upgraders/memory-per-range.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 util/cpt_upgraders/memory-per-range.py (limited to 'util/cpt_upgraders/memory-per-range.py') diff --git a/util/cpt_upgraders/memory-per-range.py b/util/cpt_upgraders/memory-per-range.py new file mode 100644 index 000000000..8ad78577c --- /dev/null +++ b/util/cpt_upgraders/memory-per-range.py @@ -0,0 +1,32 @@ +# The backing store supporting the memories in the system has changed +# in that it is now stored globally per address range. As a result the +# actual storage is separate from the memory controllers themselves. +def upgrader(cpt): + for sec in cpt.sections(): + import re + # Search for a physical memory + if re.search('.*sys.*\.physmem$', sec): + # Add the number of stores attribute to the global physmem + cpt.set(sec, 'nbr_of_stores', '1') + + # Get the filename and size as this is moving to the + # specific backing store + mem_filename = cpt.get(sec, 'filename') + mem_size = cpt.get(sec, '_size') + cpt.remove_option(sec, 'filename') + cpt.remove_option(sec, '_size') + + # Get the name so that we can create the new section + system_name = str(sec).split('.')[0] + section_name = system_name + '.physmem.store0' + cpt.add_section(section_name) + cpt.set(section_name, 'store_id', '0') + cpt.set(section_name, 'range_size', mem_size) + cpt.set(section_name, 'filename', mem_filename) + elif re.search('.*sys.*\.\w*mem$', sec): + # Due to the lack of information about a start address, + # this migration only works if there is a single memory in + # the system, thus starting at 0 + raise ValueError("more than one memory detected (" + sec + ")") + +legacy_version = 2 -- cgit v1.2.3