1#!/usr/bin/env python 2 3# Copyright (c) 2012 ARM Limited 4# All rights reserved 5# 6# The license below extends only to copyright in the software and shall 7# not be construed as granting a license to any other intellectual 8# property including but not limited to intellectual property relating --- 24 unchanged lines hidden (view full) --- 33# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 34# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 36# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37# 38# Authors: Ali Saidi 39# 40 |
41# This python code is used to migrate checkpoints that were created in one 42# version of the simulator to newer version. As features are added or bugs are 43# fixed some of the state that needs to be checkpointed can change. If you have 44# many historic checkpoints that you use, manually editing them to fix them is 45# both time consuming and error-prone. 46 47# This script provides a way to migrate checkpoints to the newer repository in 48# a programatic way. It can be imported into another script or used on the 49# command line. From the command line the script will either migrate every 50# checkpoint it finds recursively (-r option) or a single checkpoint. When a 51# change is made to the gem5 repository that breaks previous checkpoints a 52# from_N() method should be implemented here and the gem5CheckpointVersion 53# variable in src/sim/serialize.hh should be incremented. For each version 54# between the checkpoints current version and the new version the from_N() 55# method will be run, passing in a ConfigParser object which contains the open 56# file. As these operations can be isa specific the method can verify the isa 57# and use regexes to find the correct sections that need to be updated. 58 59 |
60import ConfigParser 61import sys, os 62import os.path as osp 63 64def from_0(cpt): 65 pass 66 67# An example of a translator --- 119 unchanged lines hidden --- |