From a1e82259759ce7290269aeca6742098f1adbf2fd Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Mon, 8 Nov 2010 13:58:25 -0600 Subject: ARM: Add checkpointing support --- src/mem/physical.cc | 30 ++++++++++++++++++++++++++++++ src/mem/physical.hh | 5 +++++ 2 files changed, 35 insertions(+) (limited to 'src/mem') diff --git a/src/mem/physical.cc b/src/mem/physical.cc index 889794db6..c24300cad 100644 --- a/src/mem/physical.cc +++ b/src/mem/physical.cc @@ -1,4 +1,16 @@ /* + * Copyright (c) 2010 ARM Limited + * All rights reserved + * + * The license below extends only to copyright in the software and shall + * not be construed as granting a license to any other intellectual + * property including but not limited to intellectual property relating + * to a hardware implementation of the functionality of the software + * licensed hereunder. You may use the software subject to the license + * terms below provided that you ensure that this notice is replicated + * unmodified and in its entirety in all distributions of the software, + * modified or unmodified, in source code or in binary form. + * * Copyright (c) 2001-2005 The Regents of The University of Michigan * All rights reserved. * @@ -500,6 +512,18 @@ PhysicalMemory::serialize(ostream &os) if (gzclose(compressedMem)) fatal("Close failed on physical memory checkpoint file '%s'\n", filename); + + list::iterator i = lockedAddrList.begin(); + + vector lal_addr; + vector lal_cid; + while (i != lockedAddrList.end()) { + lal_addr.push_back(i->addr); + lal_cid.push_back(i->contextId); + i++; + } + arrayParamOut(os, "lal_addr", lal_addr); + arrayParamOut(os, "lal_cid", lal_cid); } void @@ -579,6 +603,12 @@ PhysicalMemory::unserialize(Checkpoint *cp, const string §ion) fatal("Close failed on physical memory checkpoint file '%s'\n", filename); + vector lal_addr; + vector lal_cid; + arrayParamIn(cp, section, "lal_addr", lal_addr); + arrayParamIn(cp, section, "lal_cid", lal_cid); + for(int i = 0; i < lal_addr.size(); i++) + lockedAddrList.push_front(LockedAddr(lal_addr[i], lal_cid[i])); } PhysicalMemory * diff --git a/src/mem/physical.hh b/src/mem/physical.hh index 290e2bbae..a19db4d9d 100644 --- a/src/mem/physical.hh +++ b/src/mem/physical.hh @@ -105,6 +105,11 @@ class PhysicalMemory : public MemObject contextId(req->contextId()) { } + // constructor for unserialization use + LockedAddr(Addr _addr, int _cid) + : addr(_addr), contextId(_cid) + { + } }; std::list lockedAddrList; -- cgit v1.2.3