sim: Refactor the serialization base class
Objects that are can be serialized are supposed to inherit from the Serializable class. This class is meant to provide a unified API for such objects. However, so far it has mainly been used by SimObjects due to some fundamental design limitations. This changeset redesigns to the serialization interface to make it more generic and hide the underlying checkpoint storage. Specifically: * Add a set of APIs to serialize into a subsection of the current object. Previously, objects that needed this functionality would use ad-hoc solutions using nameOut() and section name generation. In the new world, an object that implements the interface has the methods serializeSection() and unserializeSection() that serialize into a named /subsection/ of the current object. Calling serialize() serializes an object into the current section. * Move the name() method from Serializable to SimObject as it is no longer needed for serialization. The fully qualified section name is generated by the main serialization code on the fly as objects serialize sub-objects. * Add a scoped ScopedCheckpointSection helper class. Some objects need to serialize data structures, that are not deriving from Serializable, into subsections. Previously, this was done using nameOut() and manual section name generation. To simplify this, this changeset introduces a ScopedCheckpointSection() helper class. When this class is instantiated, it adds a new /subsection/ and subsequent serialization calls during the lifetime of this helper class happen inside this section (or a subsection in case of nested sections). * The serialize() call is now const which prevents accidental state manipulation during serialization. Objects that rely on modifying state can use the serializeOld() call instead. The default implementation simply calls serialize(). Note: The old-style calls need to be explicitly called using the serializeOld()/serializeSectionOld() style APIs. These are used by default when serializing SimObjects. * Both the input and output checkpoints now use their own named types. This hides underlying checkpoint implementation from objects that need checkpointing and makes it easier to change the underlying checkpoint storage code.
This commit is contained in:
parent
d7a56ee524
commit
76cd4393c0
|
@ -121,14 +121,14 @@ class Interrupts : public SimObject
|
|||
}
|
||||
|
||||
void
|
||||
serialize(std::ostream &os)
|
||||
serialize(CheckpointOut &cp) const
|
||||
{
|
||||
SERIALIZE_ARRAY(interrupts, NumInterruptLevels);
|
||||
SERIALIZE_SCALAR(intstatus);
|
||||
}
|
||||
|
||||
void
|
||||
unserialize(Checkpoint *cp, const std::string §ion)
|
||||
unserialize(CheckpointIn &cp)
|
||||
{
|
||||
UNSERIALIZE_ARRAY(interrupts, NumInterruptLevels);
|
||||
UNSERIALIZE_SCALAR(intstatus);
|
||||
|
|
|
@ -53,7 +53,7 @@ ISA::params() const
|
|||
}
|
||||
|
||||
void
|
||||
ISA::serialize(std::ostream &os)
|
||||
ISA::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
SERIALIZE_SCALAR(fpcr);
|
||||
SERIALIZE_SCALAR(uniq);
|
||||
|
@ -63,7 +63,7 @@ ISA::serialize(std::ostream &os)
|
|||
}
|
||||
|
||||
void
|
||||
ISA::unserialize(Checkpoint *cp, const std::string §ion)
|
||||
ISA::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
UNSERIALIZE_SCALAR(fpcr);
|
||||
UNSERIALIZE_SCALAR(uniq);
|
||||
|
|
|
@ -92,8 +92,8 @@ namespace AlphaISA
|
|||
memset(ipr, 0, sizeof(ipr));
|
||||
}
|
||||
|
||||
void serialize(std::ostream &os);
|
||||
void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
|
||||
int
|
||||
flattenIntIndex(int reg) const
|
||||
|
|
|
@ -194,9 +194,9 @@ Statistics::callpal(int code, ThreadContext *tc)
|
|||
}
|
||||
|
||||
void
|
||||
Statistics::serialize(ostream &os)
|
||||
Statistics::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
::Kernel::Statistics::serialize(os);
|
||||
::Kernel::Statistics::serialize(cp);
|
||||
int exemode = themode;
|
||||
SERIALIZE_SCALAR(exemode);
|
||||
SERIALIZE_SCALAR(idleProcess);
|
||||
|
@ -204,9 +204,9 @@ Statistics::serialize(ostream &os)
|
|||
}
|
||||
|
||||
void
|
||||
Statistics::unserialize(Checkpoint *cp, const string §ion)
|
||||
Statistics::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
::Kernel::Statistics::unserialize(cp, section);
|
||||
::Kernel::Statistics::unserialize(cp);
|
||||
int exemode;
|
||||
UNSERIALIZE_SCALAR(exemode);
|
||||
UNSERIALIZE_SCALAR(idleProcess);
|
||||
|
|
|
@ -86,8 +86,8 @@ class Statistics : public ::Kernel::Statistics
|
|||
void setIdleProcess(Addr idle, ThreadContext *tc);
|
||||
|
||||
public:
|
||||
void serialize(std::ostream &os);
|
||||
void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
};
|
||||
|
||||
} // namespace Kernel
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
namespace AlphaISA {
|
||||
|
||||
void
|
||||
TlbEntry::serialize(std::ostream &os)
|
||||
TlbEntry::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
SERIALIZE_SCALAR(tag);
|
||||
SERIALIZE_SCALAR(ppn);
|
||||
|
@ -48,7 +48,7 @@ TlbEntry::serialize(std::ostream &os)
|
|||
}
|
||||
|
||||
void
|
||||
TlbEntry::unserialize(Checkpoint *cp, const std::string §ion)
|
||||
TlbEntry::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
UNSERIALIZE_SCALAR(tag);
|
||||
UNSERIALIZE_SCALAR(ppn);
|
||||
|
|
|
@ -90,7 +90,7 @@ struct PageTableEntry
|
|||
};
|
||||
|
||||
// ITB/DTB table entry
|
||||
struct TlbEntry
|
||||
struct TlbEntry : public Serializable
|
||||
{
|
||||
Addr tag; // virtual page number tag
|
||||
Addr ppn; // physical page number
|
||||
|
@ -124,7 +124,10 @@ struct TlbEntry
|
|||
}
|
||||
|
||||
TlbEntry()
|
||||
{}
|
||||
: tag(0), ppn(0), xre(0), xwe(0), asn(0),
|
||||
asma(false), fonr(0), fonw(0), valid(0)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
updateVaddr(Addr new_vaddr)
|
||||
|
@ -139,8 +142,8 @@ struct TlbEntry
|
|||
return ppn << PageShift;
|
||||
}
|
||||
|
||||
void serialize(std::ostream &os);
|
||||
void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
};
|
||||
|
||||
} // namespace AlphaISA
|
||||
|
|
|
@ -175,7 +175,7 @@ AlphaLiveProcess::setupASNReg()
|
|||
|
||||
|
||||
void
|
||||
AlphaLiveProcess::loadState(Checkpoint *cp)
|
||||
AlphaLiveProcess::loadState(CheckpointIn &cp)
|
||||
{
|
||||
LiveProcess::loadState(cp);
|
||||
// need to set up ASN after unserialization since M5_pid value may
|
||||
|
|
|
@ -42,7 +42,7 @@ class AlphaLiveProcess : public LiveProcess
|
|||
protected:
|
||||
AlphaLiveProcess(LiveProcessParams *params, ObjectFile *objFile);
|
||||
|
||||
void loadState(Checkpoint *cp);
|
||||
void loadState(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
void initState();
|
||||
|
||||
void argsInit(int intSize, int pageSize);
|
||||
|
|
|
@ -218,17 +218,17 @@ AlphaSystem::setAlphaAccess(Addr access)
|
|||
}
|
||||
|
||||
void
|
||||
AlphaSystem::serializeSymtab(std::ostream &os)
|
||||
AlphaSystem::serializeSymtab(CheckpointOut &cp) const
|
||||
{
|
||||
consoleSymtab->serialize("console_symtab", os);
|
||||
palSymtab->serialize("pal_symtab", os);
|
||||
consoleSymtab->serialize("console_symtab", cp);
|
||||
palSymtab->serialize("pal_symtab", cp);
|
||||
}
|
||||
|
||||
void
|
||||
AlphaSystem::unserializeSymtab(Checkpoint *cp, const std::string §ion)
|
||||
AlphaSystem::unserializeSymtab(CheckpointIn &cp)
|
||||
{
|
||||
consoleSymtab->unserialize("console_symtab", cp, section);
|
||||
palSymtab->unserialize("pal_symtab", cp, section);
|
||||
consoleSymtab->unserialize("console_symtab", cp);
|
||||
palSymtab->unserialize("pal_symtab", cp);
|
||||
}
|
||||
|
||||
AlphaSystem *
|
||||
|
|
|
@ -60,8 +60,8 @@ class AlphaSystem : public System
|
|||
/**
|
||||
* Serialization stuff
|
||||
*/
|
||||
virtual void serializeSymtab(std::ostream &os);
|
||||
virtual void unserializeSymtab(Checkpoint *cp, const std::string §ion);
|
||||
void serializeSymtab(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserializeSymtab(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
|
||||
/** Override startup() to provide a path to call setupFuncEvents()
|
||||
*/
|
||||
|
|
|
@ -30,13 +30,15 @@
|
|||
* Andrew Schultz
|
||||
*/
|
||||
|
||||
#include "arch/alpha/tlb.hh"
|
||||
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "arch/alpha/faults.hh"
|
||||
#include "arch/alpha/pagetable.hh"
|
||||
#include "arch/alpha/tlb.hh"
|
||||
#include "arch/generic/debugfaults.hh"
|
||||
#include "base/inifile.hh"
|
||||
#include "base/str.hh"
|
||||
|
@ -62,17 +64,13 @@ bool uncacheBit40 = false;
|
|||
#define MODE2MASK(X) (1 << (X))
|
||||
|
||||
TLB::TLB(const Params *p)
|
||||
: BaseTLB(p), size(p->size), nlu(0)
|
||||
: BaseTLB(p), table(p->size), nlu(0)
|
||||
{
|
||||
table = new TlbEntry[size];
|
||||
memset(table, 0, sizeof(TlbEntry) * size);
|
||||
flushCache();
|
||||
}
|
||||
|
||||
TLB::~TLB()
|
||||
{
|
||||
if (table)
|
||||
delete [] table;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -283,7 +281,7 @@ void
|
|||
TLB::flushAll()
|
||||
{
|
||||
DPRINTF(TLB, "flushAll\n");
|
||||
memset(table, 0, sizeof(TlbEntry) * size);
|
||||
std::fill(table.begin(), table.end(), TlbEntry());
|
||||
flushCache();
|
||||
lookupTable.clear();
|
||||
nlu = 0;
|
||||
|
@ -345,25 +343,26 @@ TLB::flushAddr(Addr addr, uint8_t asn)
|
|||
|
||||
|
||||
void
|
||||
TLB::serialize(ostream &os)
|
||||
TLB::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
const unsigned size(table.size());
|
||||
SERIALIZE_SCALAR(size);
|
||||
SERIALIZE_SCALAR(nlu);
|
||||
|
||||
for (int i = 0; i < size; i++) {
|
||||
nameOut(os, csprintf("%s.Entry%d", name(), i));
|
||||
table[i].serialize(os);
|
||||
}
|
||||
for (int i = 0; i < size; i++)
|
||||
table[i].serializeSection(cp, csprintf("Entry%d", i));
|
||||
}
|
||||
|
||||
void
|
||||
TLB::unserialize(Checkpoint *cp, const string §ion)
|
||||
TLB::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
unsigned size(0);
|
||||
UNSERIALIZE_SCALAR(size);
|
||||
UNSERIALIZE_SCALAR(nlu);
|
||||
|
||||
table.resize(size);
|
||||
for (int i = 0; i < size; i++) {
|
||||
table[i].unserialize(cp, csprintf("%s.Entry%d", section, i));
|
||||
table[i].unserializeSection(cp, csprintf("Entry%d", i));
|
||||
if (table[i].valid) {
|
||||
lookupTable.insert(make_pair(table[i].tag, i));
|
||||
}
|
||||
|
|
|
@ -74,11 +74,10 @@ class TLB : public BaseTLB
|
|||
typedef std::multimap<Addr, int> PageTable;
|
||||
PageTable lookupTable; // Quick lookup into page table
|
||||
|
||||
TlbEntry *table; // the Page Table
|
||||
int size; // TLB Size
|
||||
std::vector<TlbEntry> table; // the Page Table
|
||||
int nlu; // not last used entry (for replacement)
|
||||
|
||||
void nextnlu() { if (++nlu >= size) nlu = 0; }
|
||||
void nextnlu() { if (++nlu >= table.size()) nlu = 0; }
|
||||
TlbEntry *lookup(Addr vpn, uint8_t asn);
|
||||
|
||||
public:
|
||||
|
@ -90,7 +89,7 @@ class TLB : public BaseTLB
|
|||
|
||||
virtual void regStats();
|
||||
|
||||
int getsize() const { return size; }
|
||||
int getsize() const { return table.size(); }
|
||||
|
||||
TlbEntry &index(bool advance = true);
|
||||
void insert(Addr vaddr, TlbEntry &entry);
|
||||
|
@ -118,8 +117,8 @@ class TLB : public BaseTLB
|
|||
static Fault checkCacheability(RequestPtr &req, bool itb = false);
|
||||
|
||||
// Checkpointing
|
||||
virtual void serialize(std::ostream &os);
|
||||
virtual void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
|
||||
// Most recently used page table entries
|
||||
TlbEntry *EntryCache[3];
|
||||
|
|
|
@ -272,14 +272,14 @@ class Interrupts : public SimObject
|
|||
}
|
||||
|
||||
void
|
||||
serialize(std::ostream &os)
|
||||
serialize(CheckpointOut &cp) const
|
||||
{
|
||||
SERIALIZE_ARRAY(interrupts, NumInterruptTypes);
|
||||
SERIALIZE_SCALAR(intStatus);
|
||||
}
|
||||
|
||||
void
|
||||
unserialize(Checkpoint *cp, const std::string §ion)
|
||||
unserialize(CheckpointIn &cp)
|
||||
{
|
||||
UNSERIALIZE_ARRAY(interrupts, NumInterruptTypes);
|
||||
UNSERIALIZE_SCALAR(intStatus);
|
||||
|
|
|
@ -402,7 +402,7 @@ namespace ArmISA
|
|||
return flat_idx;
|
||||
}
|
||||
|
||||
void serialize(std::ostream &os)
|
||||
void serialize(CheckpointOut &cp) const
|
||||
{
|
||||
DPRINTF(Checkpoint, "Serializing Arm Misc Registers\n");
|
||||
SERIALIZE_ARRAY(miscRegs, NumMiscRegs);
|
||||
|
@ -413,7 +413,7 @@ namespace ArmISA
|
|||
SERIALIZE_SCALAR(haveLargeAsid64);
|
||||
SERIALIZE_SCALAR(physAddrRange64);
|
||||
}
|
||||
void unserialize(Checkpoint *cp, const std::string §ion)
|
||||
void unserialize(CheckpointIn &cp)
|
||||
{
|
||||
DPRINTF(Checkpoint, "Unserializing Arm Misc Registers\n");
|
||||
UNSERIALIZE_ARRAY(miscRegs, NumMiscRegs);
|
||||
|
|
|
@ -66,13 +66,13 @@ KvmGic::~KvmGic()
|
|||
}
|
||||
|
||||
void
|
||||
KvmGic::serialize(std::ostream &os)
|
||||
KvmGic::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
panic("Checkpointing unsupported\n");
|
||||
}
|
||||
|
||||
void
|
||||
KvmGic::unserialize(Checkpoint *cp, const std::string &sec)
|
||||
KvmGic::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
panic("Checkpointing unsupported\n");
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ class KvmGic : public BaseGic
|
|||
void startup() M5_ATTR_OVERRIDE { verifyMemoryMode(); }
|
||||
void drainResume() M5_ATTR_OVERRIDE { verifyMemoryMode(); }
|
||||
|
||||
void serialize(std::ostream &os) M5_ATTR_OVERRIDE;
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserialize(Checkpoint *cp, const std::string &sec) M5_ATTR_OVERRIDE;
|
||||
|
||||
public: // PioDevice
|
||||
|
|
|
@ -61,12 +61,12 @@ struct VAddr
|
|||
// ITB/DTB page table entry
|
||||
struct PTE
|
||||
{
|
||||
void serialize(std::ostream &os)
|
||||
void serialize(CheckpointOut &cp) const
|
||||
{
|
||||
panic("Need to implement PTE serialization\n");
|
||||
}
|
||||
|
||||
void unserialize(Checkpoint *cp, const std::string §ion)
|
||||
void unserialize(CheckpointIn &cp)
|
||||
{
|
||||
panic("Need to implement PTE serialization\n");
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ enum LookupLevel {
|
|||
};
|
||||
|
||||
// ITB/DTB table entry
|
||||
struct TlbEntry
|
||||
struct TlbEntry : public Serializable
|
||||
{
|
||||
public:
|
||||
enum class MemoryType : std::uint8_t {
|
||||
|
@ -284,7 +284,7 @@ struct TlbEntry
|
|||
}
|
||||
|
||||
void
|
||||
serialize(std::ostream &os)
|
||||
serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE
|
||||
{
|
||||
SERIALIZE_SCALAR(longDescFormat);
|
||||
SERIALIZE_SCALAR(pfn);
|
||||
|
@ -311,10 +311,10 @@ struct TlbEntry
|
|||
SERIALIZE_SCALAR(ap);
|
||||
SERIALIZE_SCALAR(hap);
|
||||
uint8_t domain_ = static_cast<uint8_t>(domain);
|
||||
paramOut(os, "domain", domain_);
|
||||
paramOut(cp, "domain", domain_);
|
||||
}
|
||||
void
|
||||
unserialize(Checkpoint *cp, const std::string §ion)
|
||||
unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE
|
||||
{
|
||||
UNSERIALIZE_SCALAR(longDescFormat);
|
||||
UNSERIALIZE_SCALAR(pfn);
|
||||
|
@ -341,7 +341,7 @@ struct TlbEntry
|
|||
UNSERIALIZE_SCALAR(ap);
|
||||
UNSERIALIZE_SCALAR(hap);
|
||||
uint8_t domain_;
|
||||
paramIn(cp, section, "domain", domain_);
|
||||
paramIn(cp, "domain", domain_);
|
||||
domain = static_cast<DomainType>(domain_);
|
||||
}
|
||||
|
||||
|
|
|
@ -513,7 +513,7 @@ PMU::raiseInterrupt()
|
|||
}
|
||||
|
||||
void
|
||||
PMU::serialize(std::ostream &os)
|
||||
PMU::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
DPRINTF(Checkpoint, "Serializing Arm PMU\n");
|
||||
|
||||
|
@ -525,17 +525,14 @@ PMU::serialize(std::ostream &os)
|
|||
SERIALIZE_SCALAR(reg_pmceid);
|
||||
SERIALIZE_SCALAR(clock_remainder);
|
||||
|
||||
for (size_t i = 0; i < counters.size(); ++i) {
|
||||
nameOut(os, csprintf("%s.counters.%i", name(), i));
|
||||
counters[i].serialize(os);
|
||||
}
|
||||
for (size_t i = 0; i < counters.size(); ++i)
|
||||
counters[i].serializeSection(cp, csprintf("counters.%i", i));
|
||||
|
||||
nameOut(os, csprintf("%s.cycleCounter", name()));
|
||||
cycleCounter.serialize(os);
|
||||
cycleCounter.serializeSection(cp, "cycleCounter");
|
||||
}
|
||||
|
||||
void
|
||||
PMU::unserialize(Checkpoint *cp, const std::string §ion)
|
||||
PMU::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
DPRINTF(Checkpoint, "Unserializing Arm PMU\n");
|
||||
|
||||
|
@ -548,13 +545,13 @@ PMU::unserialize(Checkpoint *cp, const std::string §ion)
|
|||
UNSERIALIZE_SCALAR(clock_remainder);
|
||||
|
||||
for (size_t i = 0; i < counters.size(); ++i)
|
||||
counters[i].unserialize(cp, csprintf("%s.counters.%i", section, i));
|
||||
counters[i].unserializeSection(cp, csprintf("counters.%i", i));
|
||||
|
||||
cycleCounter.unserialize(cp, csprintf("%s.cycleCounter", section));
|
||||
cycleCounter.unserializeSection(cp, "cycleCounter");
|
||||
}
|
||||
|
||||
void
|
||||
PMU::CounterState::serialize(std::ostream &os)
|
||||
PMU::CounterState::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
SERIALIZE_SCALAR(eventId);
|
||||
SERIALIZE_SCALAR(value);
|
||||
|
@ -563,7 +560,7 @@ PMU::CounterState::serialize(std::ostream &os)
|
|||
}
|
||||
|
||||
void
|
||||
PMU::CounterState::unserialize(Checkpoint *cp, const std::string §ion)
|
||||
PMU::CounterState::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
UNSERIALIZE_SCALAR(eventId);
|
||||
UNSERIALIZE_SCALAR(value);
|
||||
|
|
|
@ -96,8 +96,8 @@ class PMU : public SimObject, public ArmISA::BaseISADevice {
|
|||
void addEventProbe(unsigned int id, SimObject *obj, const char *name);
|
||||
|
||||
public: // SimObject and related interfaces
|
||||
void serialize(std::ostream &os) M5_ATTR_OVERRIDE;
|
||||
void unserialize(Checkpoint *cp, const std::string &sec) M5_ATTR_OVERRIDE;
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
|
||||
void drainResume() M5_ATTR_OVERRIDE;
|
||||
|
||||
|
@ -321,7 +321,7 @@ class PMU : public SimObject, public ArmISA::BaseISADevice {
|
|||
};
|
||||
|
||||
/** State of a counter within the PMU. */
|
||||
struct CounterState {
|
||||
struct CounterState : public Serializable {
|
||||
CounterState()
|
||||
: eventId(0), filter(0), value(0), enabled(false),
|
||||
overflow64(false) {
|
||||
|
@ -329,8 +329,8 @@ class PMU : public SimObject, public ArmISA::BaseISADevice {
|
|||
listeners.reserve(4);
|
||||
}
|
||||
|
||||
void serialize(std::ostream &os);
|
||||
void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
|
||||
/**
|
||||
* Add an event count to the counter and check for overflow.
|
||||
|
|
|
@ -383,7 +383,7 @@ TLB::takeOverFrom(BaseTLB *_otlb)
|
|||
}
|
||||
|
||||
void
|
||||
TLB::serialize(ostream &os)
|
||||
TLB::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
DPRINTF(Checkpoint, "Serializing Arm TLB\n");
|
||||
|
||||
|
@ -394,14 +394,12 @@ TLB::serialize(ostream &os)
|
|||
|
||||
int num_entries = size;
|
||||
SERIALIZE_SCALAR(num_entries);
|
||||
for(int i = 0; i < size; i++){
|
||||
nameOut(os, csprintf("%s.TlbEntry%d", name(), i));
|
||||
table[i].serialize(os);
|
||||
}
|
||||
for(int i = 0; i < size; i++)
|
||||
table[i].serializeSection(cp, csprintf("TlbEntry%d", i));
|
||||
}
|
||||
|
||||
void
|
||||
TLB::unserialize(Checkpoint *cp, const string §ion)
|
||||
TLB::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
DPRINTF(Checkpoint, "Unserializing Arm TLB\n");
|
||||
|
||||
|
@ -412,9 +410,8 @@ TLB::unserialize(Checkpoint *cp, const string §ion)
|
|||
|
||||
int num_entries;
|
||||
UNSERIALIZE_SCALAR(num_entries);
|
||||
for(int i = 0; i < min(size, num_entries); i++){
|
||||
table[i].unserialize(cp, csprintf("%s.TlbEntry%d", section, i));
|
||||
}
|
||||
for(int i = 0; i < min(size, num_entries); i++)
|
||||
table[i].unserializeSection(cp, csprintf("TlbEntry%d", i));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -287,8 +287,8 @@ class TLB : public BaseTLB
|
|||
void drainResume();
|
||||
|
||||
// Checkpointing
|
||||
void serialize(std::ostream &os);
|
||||
void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
|
||||
void regStats();
|
||||
|
||||
|
|
|
@ -483,9 +483,9 @@ namespace ArmISA
|
|||
}
|
||||
|
||||
void
|
||||
serialize(std::ostream &os)
|
||||
serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE
|
||||
{
|
||||
Base::serialize(os);
|
||||
Base::serialize(cp);
|
||||
SERIALIZE_SCALAR(flags);
|
||||
SERIALIZE_SCALAR(_size);
|
||||
SERIALIZE_SCALAR(nextFlags);
|
||||
|
@ -494,9 +494,9 @@ namespace ArmISA
|
|||
}
|
||||
|
||||
void
|
||||
unserialize(Checkpoint *cp, const std::string §ion)
|
||||
unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE
|
||||
{
|
||||
Base::unserialize(cp, section);
|
||||
Base::unserialize(cp);
|
||||
UNSERIALIZE_SCALAR(flags);
|
||||
UNSERIALIZE_SCALAR(_size);
|
||||
UNSERIALIZE_SCALAR(nextFlags);
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace GenericISA
|
|||
{
|
||||
|
||||
// The guaranteed interface.
|
||||
class PCStateBase
|
||||
class PCStateBase : public Serializable
|
||||
{
|
||||
protected:
|
||||
Addr _pc;
|
||||
|
@ -105,14 +105,14 @@ class PCStateBase
|
|||
}
|
||||
|
||||
void
|
||||
serialize(std::ostream &os)
|
||||
serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE
|
||||
{
|
||||
SERIALIZE_SCALAR(_pc);
|
||||
SERIALIZE_SCALAR(_npc);
|
||||
}
|
||||
|
||||
void
|
||||
unserialize(Checkpoint *cp, const std::string §ion)
|
||||
unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE
|
||||
{
|
||||
UNSERIALIZE_SCALAR(_pc);
|
||||
UNSERIALIZE_SCALAR(_npc);
|
||||
|
@ -248,17 +248,17 @@ class UPCState : public SimplePCState<MachInst>
|
|||
}
|
||||
|
||||
void
|
||||
serialize(std::ostream &os)
|
||||
serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE
|
||||
{
|
||||
Base::serialize(os);
|
||||
Base::serialize(cp);
|
||||
SERIALIZE_SCALAR(_upc);
|
||||
SERIALIZE_SCALAR(_nupc);
|
||||
}
|
||||
|
||||
void
|
||||
unserialize(Checkpoint *cp, const std::string §ion)
|
||||
unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE
|
||||
{
|
||||
Base::unserialize(cp, section);
|
||||
Base::unserialize(cp);
|
||||
UNSERIALIZE_SCALAR(_upc);
|
||||
UNSERIALIZE_SCALAR(_nupc);
|
||||
}
|
||||
|
@ -329,16 +329,16 @@ class DelaySlotPCState : public SimplePCState<MachInst>
|
|||
}
|
||||
|
||||
void
|
||||
serialize(std::ostream &os)
|
||||
serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE
|
||||
{
|
||||
Base::serialize(os);
|
||||
Base::serialize(cp);
|
||||
SERIALIZE_SCALAR(_nnpc);
|
||||
}
|
||||
|
||||
void
|
||||
unserialize(Checkpoint *cp, const std::string §ion)
|
||||
unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE
|
||||
{
|
||||
Base::unserialize(cp, section);
|
||||
Base::unserialize(cp);
|
||||
UNSERIALIZE_SCALAR(_nnpc);
|
||||
}
|
||||
};
|
||||
|
@ -426,17 +426,17 @@ class DelaySlotUPCState : public DelaySlotPCState<MachInst>
|
|||
}
|
||||
|
||||
void
|
||||
serialize(std::ostream &os)
|
||||
serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE
|
||||
{
|
||||
Base::serialize(os);
|
||||
Base::serialize(cp);
|
||||
SERIALIZE_SCALAR(_upc);
|
||||
SERIALIZE_SCALAR(_nupc);
|
||||
}
|
||||
|
||||
void
|
||||
unserialize(Checkpoint *cp, const std::string §ion)
|
||||
unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE
|
||||
{
|
||||
Base::unserialize(cp, section);
|
||||
Base::unserialize(cp);
|
||||
UNSERIALIZE_SCALAR(_upc);
|
||||
UNSERIALIZE_SCALAR(_nupc);
|
||||
}
|
||||
|
|
|
@ -116,13 +116,13 @@ class Interrupts : public SimObject
|
|||
|
||||
|
||||
void
|
||||
serialize(std::ostream &os)
|
||||
serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE
|
||||
{
|
||||
fatal("Serialization of Interrupts Unimplemented for MIPS");
|
||||
}
|
||||
|
||||
void
|
||||
unserialize(Checkpoint *cp, const std::string §ion)
|
||||
unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE
|
||||
{
|
||||
fatal("Unserialization of Interrupts Unimplemented for MIPS");
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace MipsISA
|
|||
{
|
||||
|
||||
void
|
||||
PTE::serialize(std::ostream &os)
|
||||
PTE::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
SERIALIZE_SCALAR(Mask);
|
||||
SERIALIZE_SCALAR(VPN);
|
||||
|
@ -57,7 +57,7 @@ PTE::serialize(std::ostream &os)
|
|||
}
|
||||
|
||||
void
|
||||
PTE::unserialize(Checkpoint *cp, const std::string §ion)
|
||||
PTE::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
UNSERIALIZE_SCALAR(Mask);
|
||||
UNSERIALIZE_SCALAR(VPN);
|
||||
|
|
|
@ -74,8 +74,8 @@ struct PTE
|
|||
int OffsetMask;
|
||||
|
||||
bool Valid() { return (V0 | V1); };
|
||||
void serialize(std::ostream &os);
|
||||
void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
void serialize(CheckpointOut &cp) const;
|
||||
void unserialize(CheckpointIn &cp);
|
||||
};
|
||||
|
||||
// WARN: This particular TLB entry is not necessarily conformed to MIPS ISA
|
||||
|
@ -100,12 +100,12 @@ struct TlbEntry
|
|||
void
|
||||
updateVaddr(Addr new_vaddr) {}
|
||||
|
||||
void serialize(std::ostream &os)
|
||||
void serialize(CheckpointOut &cp) const
|
||||
{
|
||||
SERIALIZE_SCALAR(_pageStart);
|
||||
}
|
||||
|
||||
void unserialize(Checkpoint *cp, const std::string §ion)
|
||||
void unserialize(CheckpointIn &cp)
|
||||
{
|
||||
UNSERIALIZE_SCALAR(_pageStart);
|
||||
}
|
||||
|
|
|
@ -197,25 +197,26 @@ TLB::flushAll()
|
|||
}
|
||||
|
||||
void
|
||||
TLB::serialize(ostream &os)
|
||||
TLB::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
SERIALIZE_SCALAR(size);
|
||||
SERIALIZE_SCALAR(nlu);
|
||||
|
||||
for (int i = 0; i < size; i++) {
|
||||
nameOut(os, csprintf("%s.PTE%d", name(), i));
|
||||
table[i].serialize(os);
|
||||
ScopedCheckpointSection sec(cp, csprintf("PTE%d", i));
|
||||
table[i].serialize(cp);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
TLB::unserialize(Checkpoint *cp, const string §ion)
|
||||
TLB::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
UNSERIALIZE_SCALAR(size);
|
||||
UNSERIALIZE_SCALAR(nlu);
|
||||
|
||||
for (int i = 0; i < size; i++) {
|
||||
table[i].unserialize(cp, csprintf("%s.PTE%d", section, i));
|
||||
ScopedCheckpointSection sec(cp, csprintf("PTE%d", i));
|
||||
table[i].unserialize(cp);
|
||||
if (table[i].V0 || table[i].V1) {
|
||||
lookupTable.insert(make_pair(table[i].VPN, i));
|
||||
}
|
||||
|
|
|
@ -107,8 +107,8 @@ class TLB : public BaseTLB
|
|||
static Fault checkCacheability(RequestPtr &req);
|
||||
|
||||
// Checkpointing
|
||||
void serialize(std::ostream &os);
|
||||
void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
|
||||
void regStats();
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ namespace PowerISA
|
|||
{
|
||||
|
||||
void
|
||||
PTE::serialize(std::ostream &os)
|
||||
PTE::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
SERIALIZE_SCALAR(Mask);
|
||||
SERIALIZE_SCALAR(VPN);
|
||||
|
@ -61,7 +61,7 @@ PTE::serialize(std::ostream &os)
|
|||
}
|
||||
|
||||
void
|
||||
PTE::unserialize(Checkpoint *cp, const std::string §ion)
|
||||
PTE::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
UNSERIALIZE_SCALAR(Mask);
|
||||
UNSERIALIZE_SCALAR(VPN);
|
||||
|
|
|
@ -146,9 +146,8 @@ struct PTE
|
|||
return (V0 | V1);
|
||||
};
|
||||
|
||||
void serialize(std::ostream &os);
|
||||
|
||||
void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
void serialize(CheckpointOut &cp) const;
|
||||
void unserialize(CheckpointIn &cp);
|
||||
};
|
||||
|
||||
} // namespace PowerISA
|
||||
|
|
|
@ -195,25 +195,25 @@ TLB::flushAll()
|
|||
}
|
||||
|
||||
void
|
||||
TLB::serialize(ostream &os)
|
||||
TLB::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
SERIALIZE_SCALAR(size);
|
||||
SERIALIZE_SCALAR(nlu);
|
||||
|
||||
for (int i = 0; i < size; i++) {
|
||||
nameOut(os, csprintf("%s.PTE%d", name(), i));
|
||||
table[i].serialize(os);
|
||||
ScopedCheckpointSection sec(cp, csprintf("PTE%d", i));
|
||||
table[i].serialize(cp);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
TLB::unserialize(Checkpoint *cp, const string §ion)
|
||||
TLB::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
UNSERIALIZE_SCALAR(size);
|
||||
UNSERIALIZE_SCALAR(nlu);
|
||||
|
||||
for (int i = 0; i < size; i++) {
|
||||
table[i].unserialize(cp, csprintf("%s.PTE%d", section, i));
|
||||
ScopedCheckpointSection sec(cp, csprintf("PTE%d", i));
|
||||
if (table[i].V0 || table[i].V1) {
|
||||
lookupTable.insert(make_pair(table[i].VPN, i));
|
||||
}
|
||||
|
|
|
@ -84,13 +84,13 @@ struct TlbEntry
|
|||
}
|
||||
|
||||
void
|
||||
serialize(std::ostream &os)
|
||||
serialize(CheckpointOut &cp) const
|
||||
{
|
||||
SERIALIZE_SCALAR(_pageStart);
|
||||
}
|
||||
|
||||
void
|
||||
unserialize(Checkpoint *cp, const std::string §ion)
|
||||
unserialize(CheckpointIn &cp)
|
||||
{
|
||||
UNSERIALIZE_SCALAR(_pageStart);
|
||||
}
|
||||
|
@ -172,8 +172,9 @@ class TLB : public BaseTLB
|
|||
Fault finalizePhysical(RequestPtr req, ThreadContext *tc, Mode mode) const;
|
||||
|
||||
// Checkpointing
|
||||
void serialize(std::ostream &os);
|
||||
void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
|
||||
void regStats();
|
||||
};
|
||||
|
||||
|
|
|
@ -191,14 +191,14 @@ class Interrupts : public SimObject
|
|||
}
|
||||
|
||||
void
|
||||
serialize(std::ostream &os)
|
||||
serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE
|
||||
{
|
||||
SERIALIZE_ARRAY(interrupts,NumInterruptTypes);
|
||||
SERIALIZE_SCALAR(intStatus);
|
||||
}
|
||||
|
||||
void
|
||||
unserialize(Checkpoint *cp, const std::string §ion)
|
||||
unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE
|
||||
{
|
||||
UNSERIALIZE_ARRAY(interrupts,NumInterruptTypes);
|
||||
UNSERIALIZE_SCALAR(intStatus);
|
||||
|
|
|
@ -638,7 +638,7 @@ ISA::setMiscReg(int miscReg, MiscReg val, ThreadContext * tc)
|
|||
}
|
||||
|
||||
void
|
||||
ISA::serialize(std::ostream &os)
|
||||
ISA::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
SERIALIZE_SCALAR(asi);
|
||||
SERIALIZE_SCALAR(tick);
|
||||
|
@ -714,7 +714,7 @@ ISA::serialize(std::ostream &os)
|
|||
}
|
||||
|
||||
void
|
||||
ISA::unserialize(Checkpoint *cp, const std::string §ion)
|
||||
ISA::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
UNSERIALIZE_SCALAR(asi);
|
||||
UNSERIALIZE_SCALAR(tick);
|
||||
|
|
|
@ -167,9 +167,8 @@ class ISA : public SimObject
|
|||
|
||||
void clear();
|
||||
|
||||
void serialize(std::ostream & os);
|
||||
|
||||
void unserialize(Checkpoint *cp, const std::string & section);
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
|
||||
void startup(ThreadContext *tc) {}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace SparcISA
|
|||
{
|
||||
|
||||
void
|
||||
TlbEntry::serialize(std::ostream &os)
|
||||
TlbEntry::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
SERIALIZE_SCALAR(range.va);
|
||||
SERIALIZE_SCALAR(range.size);
|
||||
|
@ -52,7 +52,7 @@ TlbEntry::serialize(std::ostream &os)
|
|||
|
||||
|
||||
void
|
||||
TlbEntry::unserialize(Checkpoint *cp, const std::string §ion)
|
||||
TlbEntry::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
UNSERIALIZE_SCALAR(range.va);
|
||||
UNSERIALIZE_SCALAR(range.size);
|
||||
|
|
|
@ -277,8 +277,8 @@ struct TlbEntry
|
|||
range.va = new_vaddr;
|
||||
}
|
||||
|
||||
void serialize(std::ostream &os);
|
||||
void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
void serialize(CheckpointOut &cp) const;
|
||||
void unserialize(CheckpointIn &cp);
|
||||
};
|
||||
|
||||
} // namespace SparcISA
|
||||
|
|
|
@ -177,26 +177,26 @@ SparcSystem::~SparcSystem()
|
|||
}
|
||||
|
||||
void
|
||||
SparcSystem::serializeSymtab(std::ostream &os)
|
||||
SparcSystem::serializeSymtab(CheckpointOut &cp) const
|
||||
{
|
||||
resetSymtab->serialize("reset_symtab", os);
|
||||
hypervisorSymtab->serialize("hypervisor_symtab", os);
|
||||
openbootSymtab->serialize("openboot_symtab", os);
|
||||
nvramSymtab->serialize("nvram_symtab", os);
|
||||
hypervisorDescSymtab->serialize("hypervisor_desc_symtab", os);
|
||||
partitionDescSymtab->serialize("partition_desc_symtab", os);
|
||||
resetSymtab->serialize("reset_symtab", cp);
|
||||
hypervisorSymtab->serialize("hypervisor_symtab", cp);
|
||||
openbootSymtab->serialize("openboot_symtab", cp);
|
||||
nvramSymtab->serialize("nvram_symtab", cp);
|
||||
hypervisorDescSymtab->serialize("hypervisor_desc_symtab", cp);
|
||||
partitionDescSymtab->serialize("partition_desc_symtab", cp);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
SparcSystem::unserializeSymtab(Checkpoint *cp, const std::string §ion)
|
||||
SparcSystem::unserializeSymtab(CheckpointIn &cp)
|
||||
{
|
||||
resetSymtab->unserialize("reset_symtab", cp, section);
|
||||
hypervisorSymtab->unserialize("hypervisor_symtab", cp, section);
|
||||
openbootSymtab->unserialize("openboot_symtab", cp, section);
|
||||
nvramSymtab->unserialize("nvram_symtab", cp, section);
|
||||
hypervisorDescSymtab->unserialize("hypervisor_desc_symtab", cp, section);
|
||||
partitionDescSymtab->unserialize("partition_desc_symtab", cp, section);
|
||||
resetSymtab->unserialize("reset_symtab", cp);
|
||||
hypervisorSymtab->unserialize("hypervisor_symtab", cp);
|
||||
openbootSymtab->unserialize("openboot_symtab", cp);
|
||||
nvramSymtab->unserialize("nvram_symtab", cp);
|
||||
hypervisorDescSymtab->unserialize("hypervisor_desc_symtab", cp);
|
||||
partitionDescSymtab->unserialize("partition_desc_symtab", cp);
|
||||
}
|
||||
|
||||
SparcSystem *
|
||||
|
|
|
@ -54,8 +54,8 @@ class SparcSystem : public System
|
|||
* Serialization stuff
|
||||
*/
|
||||
public:
|
||||
virtual void serializeSymtab(std::ostream &os);
|
||||
virtual void unserializeSymtab(Checkpoint *cp, const std::string §ion);
|
||||
void serializeSymtab(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserializeSymtab(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
|
||||
/** reset binary symbol table */
|
||||
SymbolTable *resetSymtab;
|
||||
|
|
|
@ -1353,23 +1353,18 @@ TLB::MakeTsbPtr(TsbPageSize ps, uint64_t tag_access, uint64_t c0_tsb,
|
|||
}
|
||||
|
||||
void
|
||||
TLB::serialize(std::ostream &os)
|
||||
TLB::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
SERIALIZE_SCALAR(size);
|
||||
SERIALIZE_SCALAR(usedEntries);
|
||||
SERIALIZE_SCALAR(lastReplaced);
|
||||
|
||||
// convert the pointer based free list into an index based one
|
||||
int *free_list = (int*)malloc(sizeof(int) * size);
|
||||
int cntr = 0;
|
||||
std::list<TlbEntry*>::iterator i;
|
||||
i = freeList.begin();
|
||||
while (i != freeList.end()) {
|
||||
free_list[cntr++] = ((size_t)*i - (size_t)tlb)/ sizeof(TlbEntry);
|
||||
i++;
|
||||
}
|
||||
SERIALIZE_SCALAR(cntr);
|
||||
SERIALIZE_ARRAY(free_list, cntr);
|
||||
std::vector<int> free_list;
|
||||
for (const TlbEntry *entry : freeList)
|
||||
free_list.push_back(entry - tlb);
|
||||
|
||||
SERIALIZE_CONTAINER(free_list);
|
||||
|
||||
SERIALIZE_SCALAR(c0_tsb_ps0);
|
||||
SERIALIZE_SCALAR(c0_tsb_ps1);
|
||||
|
@ -1381,31 +1376,28 @@ TLB::serialize(std::ostream &os)
|
|||
SERIALIZE_SCALAR(tag_access);
|
||||
|
||||
for (int x = 0; x < size; x++) {
|
||||
nameOut(os, csprintf("%s.PTE%d", name(), x));
|
||||
tlb[x].serialize(os);
|
||||
ScopedCheckpointSection sec(cp, csprintf("PTE%d", x));
|
||||
tlb[x].serialize(cp);
|
||||
}
|
||||
SERIALIZE_SCALAR(sfar);
|
||||
}
|
||||
|
||||
void
|
||||
TLB::unserialize(Checkpoint *cp, const std::string §ion)
|
||||
TLB::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
int oldSize;
|
||||
|
||||
paramIn(cp, section, "size", oldSize);
|
||||
paramIn(cp, "size", oldSize);
|
||||
if (oldSize != size)
|
||||
panic("Don't support unserializing different sized TLBs\n");
|
||||
UNSERIALIZE_SCALAR(usedEntries);
|
||||
UNSERIALIZE_SCALAR(lastReplaced);
|
||||
|
||||
int cntr;
|
||||
UNSERIALIZE_SCALAR(cntr);
|
||||
|
||||
int *free_list = (int*)malloc(sizeof(int) * cntr);
|
||||
std::vector<int> free_list;
|
||||
UNSERIALIZE_CONTAINER(free_list);
|
||||
freeList.clear();
|
||||
UNSERIALIZE_ARRAY(free_list, cntr);
|
||||
for (int x = 0; x < cntr; x++)
|
||||
freeList.push_back(&tlb[free_list[x]]);
|
||||
for (int idx : free_list)
|
||||
freeList.push_back(&tlb[idx]);
|
||||
|
||||
UNSERIALIZE_SCALAR(c0_tsb_ps0);
|
||||
UNSERIALIZE_SCALAR(c0_tsb_ps1);
|
||||
|
@ -1418,7 +1410,8 @@ TLB::unserialize(Checkpoint *cp, const std::string §ion)
|
|||
|
||||
lookupTable.clear();
|
||||
for (int x = 0; x < size; x++) {
|
||||
tlb[x].unserialize(cp, csprintf("%s.PTE%d", section, x));
|
||||
ScopedCheckpointSection sec(cp, csprintf("PTE%d", x));
|
||||
tlb[x].unserialize(cp);
|
||||
if (tlb[x].valid)
|
||||
lookupTable.insert(tlb[x].range, &tlb[x]);
|
||||
|
||||
|
|
|
@ -176,8 +176,8 @@ class TLB : public BaseTLB
|
|||
void GetTsbPtr(ThreadContext *tc, Addr addr, int ctx, Addr *ptrs);
|
||||
|
||||
// Checkpointing
|
||||
virtual void serialize(std::ostream &os);
|
||||
virtual void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
|
||||
/** Give an entry id, read that tlb entries' tte */
|
||||
uint64_t TteRead(int entry);
|
||||
|
|
|
@ -729,7 +729,7 @@ X86ISA::Interrupts::updateIntrInfo(ThreadContext *tc)
|
|||
}
|
||||
|
||||
void
|
||||
X86ISA::Interrupts::serialize(std::ostream &os)
|
||||
X86ISA::Interrupts::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
SERIALIZE_ARRAY(regs, NUM_APIC_REGS);
|
||||
SERIALIZE_SCALAR(pendingSmi);
|
||||
|
@ -754,7 +754,7 @@ X86ISA::Interrupts::serialize(std::ostream &os)
|
|||
}
|
||||
|
||||
void
|
||||
X86ISA::Interrupts::unserialize(Checkpoint *cp, const std::string §ion)
|
||||
X86ISA::Interrupts::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
UNSERIALIZE_ARRAY(regs, NUM_APIC_REGS);
|
||||
UNSERIALIZE_SCALAR(pendingSmi);
|
||||
|
|
|
@ -293,9 +293,8 @@ class Interrupts : public BasicPioDevice, IntDevice
|
|||
/*
|
||||
* Serialization.
|
||||
*/
|
||||
|
||||
virtual void serialize(std::ostream &os);
|
||||
virtual void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
|
||||
/*
|
||||
* Old functions needed for compatability but which will be phased out
|
||||
|
|
|
@ -409,13 +409,13 @@ ISA::setMiscReg(int miscReg, MiscReg val, ThreadContext * tc)
|
|||
}
|
||||
|
||||
void
|
||||
ISA::serialize(std::ostream & os)
|
||||
ISA::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
SERIALIZE_ARRAY(regVal, NumMiscRegs);
|
||||
}
|
||||
|
||||
void
|
||||
ISA::unserialize(Checkpoint * cp, const std::string & section)
|
||||
ISA::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
UNSERIALIZE_ARRAY(regVal, NumMiscRegs);
|
||||
updateHandyM5Reg(regVal[MISCREG_EFER],
|
||||
|
|
|
@ -97,8 +97,9 @@ namespace X86ISA
|
|||
return reg;
|
||||
}
|
||||
|
||||
void serialize(std::ostream &os);
|
||||
void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
|
||||
void startup(ThreadContext *tc);
|
||||
|
||||
/// Explicitly import the otherwise hidden startup
|
||||
|
|
|
@ -45,15 +45,22 @@
|
|||
namespace X86ISA
|
||||
{
|
||||
|
||||
TlbEntry::TlbEntry()
|
||||
: paddr(0), vaddr(0), logBytes(0), writable(0),
|
||||
user(true), uncacheable(0), global(false), patBit(0),
|
||||
noExec(false), lruSeq(0)
|
||||
{
|
||||
}
|
||||
|
||||
TlbEntry::TlbEntry(Addr asn, Addr _vaddr, Addr _paddr,
|
||||
bool uncacheable, bool read_only) :
|
||||
paddr(_paddr), vaddr(_vaddr), logBytes(PageShift), writable(!read_only),
|
||||
user(true), uncacheable(uncacheable), global(false), patBit(0),
|
||||
noExec(false)
|
||||
noExec(false), lruSeq(0)
|
||||
{}
|
||||
|
||||
void
|
||||
TlbEntry::serialize(std::ostream &os)
|
||||
TlbEntry::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
SERIALIZE_SCALAR(paddr);
|
||||
SERIALIZE_SCALAR(vaddr);
|
||||
|
@ -68,7 +75,7 @@ TlbEntry::serialize(std::ostream &os)
|
|||
}
|
||||
|
||||
void
|
||||
TlbEntry::unserialize(Checkpoint *cp, const std::string §ion)
|
||||
TlbEntry::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
UNSERIALIZE_SCALAR(paddr);
|
||||
UNSERIALIZE_SCALAR(vaddr);
|
||||
|
|
|
@ -97,7 +97,7 @@ namespace X86ISA
|
|||
EndBitUnion(PageTableEntry)
|
||||
|
||||
|
||||
struct TlbEntry
|
||||
struct TlbEntry : public Serializable
|
||||
{
|
||||
// The base of the physical page.
|
||||
Addr paddr;
|
||||
|
@ -130,7 +130,7 @@ namespace X86ISA
|
|||
|
||||
TlbEntry(Addr asn, Addr _vaddr, Addr _paddr,
|
||||
bool uncacheable, bool read_only);
|
||||
TlbEntry() {}
|
||||
TlbEntry();
|
||||
|
||||
void
|
||||
updateVaddr(Addr new_vaddr)
|
||||
|
@ -149,8 +149,8 @@ namespace X86ISA
|
|||
return (1 << logBytes);
|
||||
}
|
||||
|
||||
void serialize(std::ostream &os);
|
||||
void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
};
|
||||
|
||||
/** The size of each level of the page table expressed in base 2
|
||||
|
|
|
@ -62,13 +62,12 @@
|
|||
|
||||
namespace X86ISA {
|
||||
|
||||
TLB::TLB(const Params *p) : BaseTLB(p), configAddress(0), size(p->size),
|
||||
lruSeq(0)
|
||||
TLB::TLB(const Params *p)
|
||||
: BaseTLB(p), configAddress(0), size(p->size),
|
||||
tlb(size), lruSeq(0)
|
||||
{
|
||||
if (!size)
|
||||
fatal("TLBs must have a non-zero size.\n");
|
||||
tlb = new TlbEntry[size];
|
||||
std::memset(tlb, 0, sizeof(TlbEntry) * size);
|
||||
|
||||
for (int x = 0; x < size; x++) {
|
||||
tlb[x].trieHandle = NULL;
|
||||
|
@ -451,7 +450,7 @@ TLB::getWalker()
|
|||
}
|
||||
|
||||
void
|
||||
TLB::serialize(std::ostream &os)
|
||||
TLB::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
// Only store the entries in use.
|
||||
uint32_t _size = size - freeList.size();
|
||||
|
@ -459,18 +458,14 @@ TLB::serialize(std::ostream &os)
|
|||
SERIALIZE_SCALAR(lruSeq);
|
||||
|
||||
uint32_t _count = 0;
|
||||
|
||||
for (uint32_t x = 0; x < size; x++) {
|
||||
if (tlb[x].trieHandle != NULL) {
|
||||
os << "\n[" << csprintf("%s.Entry%d", name(), _count) << "]\n";
|
||||
tlb[x].serialize(os);
|
||||
_count++;
|
||||
}
|
||||
if (tlb[x].trieHandle != NULL)
|
||||
tlb[x].serializeSection(cp, csprintf("Entry%d", _count++));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
TLB::unserialize(Checkpoint *cp, const std::string §ion)
|
||||
TLB::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
// Do not allow to restore with a smaller tlb.
|
||||
uint32_t _size;
|
||||
|
@ -485,7 +480,7 @@ TLB::unserialize(Checkpoint *cp, const std::string §ion)
|
|||
TlbEntry *newEntry = freeList.front();
|
||||
freeList.pop_front();
|
||||
|
||||
newEntry->unserialize(cp, csprintf("%s.Entry%d", name(), x));
|
||||
newEntry->unserializeSection(cp, csprintf("Entry%d", x));
|
||||
newEntry->trieHandle = trie.insert(newEntry->vaddr,
|
||||
TlbEntryTrie::MaxBits - newEntry->logBytes, newEntry);
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ namespace X86ISA
|
|||
protected:
|
||||
uint32_t size;
|
||||
|
||||
TlbEntry * tlb;
|
||||
std::vector<TlbEntry> tlb;
|
||||
|
||||
EntryList freeList;
|
||||
|
||||
|
@ -148,8 +148,8 @@ namespace X86ISA
|
|||
TlbEntry * insert(Addr vpn, TlbEntry &entry);
|
||||
|
||||
// Checkpointing
|
||||
virtual void serialize(std::ostream &os);
|
||||
virtual void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
|
||||
/**
|
||||
* Get the table walker master port. This is used for
|
||||
|
|
|
@ -36,69 +36,68 @@ using namespace std;
|
|||
|
||||
template <>
|
||||
void
|
||||
paramOut(ostream &os, const string &name, ExtMachInst const &machInst)
|
||||
paramOut(CheckpointOut &cp, const string &name, ExtMachInst const &machInst)
|
||||
{
|
||||
// Prefixes
|
||||
paramOut(os, name + ".legacy", (uint8_t)machInst.legacy);
|
||||
paramOut(os, name + ".rex", (uint8_t)machInst.rex);
|
||||
paramOut(cp, name + ".legacy", (uint8_t)machInst.legacy);
|
||||
paramOut(cp, name + ".rex", (uint8_t)machInst.rex);
|
||||
|
||||
// Opcode
|
||||
paramOut(os, name + ".opcode.type", (uint8_t)machInst.opcode.type);
|
||||
paramOut(os, name + ".opcode.op", (uint8_t)machInst.opcode.op);
|
||||
paramOut(cp, name + ".opcode.type", (uint8_t)machInst.opcode.type);
|
||||
paramOut(cp, name + ".opcode.op", (uint8_t)machInst.opcode.op);
|
||||
|
||||
// Modifier bytes
|
||||
paramOut(os, name + ".modRM", (uint8_t)machInst.modRM);
|
||||
paramOut(os, name + ".sib", (uint8_t)machInst.sib);
|
||||
paramOut(cp, name + ".modRM", (uint8_t)machInst.modRM);
|
||||
paramOut(cp, name + ".sib", (uint8_t)machInst.sib);
|
||||
|
||||
// Immediate fields
|
||||
paramOut(os, name + ".immediate", machInst.immediate);
|
||||
paramOut(os, name + ".displacement", machInst.displacement);
|
||||
paramOut(cp, name + ".immediate", machInst.immediate);
|
||||
paramOut(cp, name + ".displacement", machInst.displacement);
|
||||
|
||||
// Sizes
|
||||
paramOut(os, name + ".opSize", machInst.opSize);
|
||||
paramOut(os, name + ".addrSize", machInst.addrSize);
|
||||
paramOut(os, name + ".stackSize", machInst.stackSize);
|
||||
paramOut(os, name + ".dispSize", machInst.dispSize);
|
||||
paramOut(cp, name + ".opSize", machInst.opSize);
|
||||
paramOut(cp, name + ".addrSize", machInst.addrSize);
|
||||
paramOut(cp, name + ".stackSize", machInst.stackSize);
|
||||
paramOut(cp, name + ".dispSize", machInst.dispSize);
|
||||
|
||||
// Mode
|
||||
paramOut(os, name + ".mode", (uint8_t)machInst.mode);
|
||||
paramOut(cp, name + ".mode", (uint8_t)machInst.mode);
|
||||
}
|
||||
|
||||
template <>
|
||||
void
|
||||
paramIn(Checkpoint *cp, const string §ion,
|
||||
const string &name, ExtMachInst &machInst)
|
||||
paramIn(CheckpointIn &cp, const string &name, ExtMachInst &machInst)
|
||||
{
|
||||
uint8_t temp8;
|
||||
// Prefixes
|
||||
paramIn(cp, section, name + ".legacy", temp8);
|
||||
paramIn(cp, name + ".legacy", temp8);
|
||||
machInst.legacy = temp8;
|
||||
paramIn(cp, section, name + ".rex", temp8);
|
||||
paramIn(cp, name + ".rex", temp8);
|
||||
machInst.rex = temp8;
|
||||
|
||||
// Opcode
|
||||
paramIn(cp, section, name + ".opcode.type", temp8);
|
||||
paramIn(cp, name + ".opcode.type", temp8);
|
||||
machInst.opcode.type = (OpcodeType)temp8;
|
||||
paramIn(cp, section, name + ".opcode.op", temp8);
|
||||
paramIn(cp, name + ".opcode.op", temp8);
|
||||
machInst.opcode.op = temp8;
|
||||
|
||||
// Modifier bytes
|
||||
paramIn(cp, section, name + ".modRM", temp8);
|
||||
paramIn(cp, name + ".modRM", temp8);
|
||||
machInst.modRM = temp8;
|
||||
paramIn(cp, section, name + ".sib", temp8);
|
||||
paramIn(cp, name + ".sib", temp8);
|
||||
machInst.sib = temp8;;
|
||||
|
||||
// Immediate fields
|
||||
paramIn(cp, section, name + ".immediate", machInst.immediate);
|
||||
paramIn(cp, section, name + ".displacement", machInst.displacement);
|
||||
paramIn(cp, name + ".immediate", machInst.immediate);
|
||||
paramIn(cp, name + ".displacement", machInst.displacement);
|
||||
|
||||
// Sizes
|
||||
paramIn(cp, section, name + ".opSize", machInst.opSize);
|
||||
paramIn(cp, section, name + ".addrSize", machInst.addrSize);
|
||||
paramIn(cp, section, name + ".stackSize", machInst.stackSize);
|
||||
paramIn(cp, section, name + ".dispSize", machInst.dispSize);
|
||||
paramIn(cp, name + ".opSize", machInst.opSize);
|
||||
paramIn(cp, name + ".addrSize", machInst.addrSize);
|
||||
paramIn(cp, name + ".stackSize", machInst.stackSize);
|
||||
paramIn(cp, name + ".dispSize", machInst.dispSize);
|
||||
|
||||
// Mode
|
||||
paramIn(cp, section, name + ".mode", temp8);
|
||||
paramIn(cp, name + ".mode", temp8);
|
||||
machInst.mode = temp8;
|
||||
}
|
||||
|
|
|
@ -276,16 +276,16 @@ namespace X86ISA
|
|||
}
|
||||
|
||||
void
|
||||
serialize(std::ostream &os)
|
||||
serialize(CheckpointOut &cp) const
|
||||
{
|
||||
Base::serialize(os);
|
||||
Base::serialize(cp);
|
||||
SERIALIZE_SCALAR(_size);
|
||||
}
|
||||
|
||||
void
|
||||
unserialize(Checkpoint *cp, const std::string §ion)
|
||||
unserialize(CheckpointIn &cp)
|
||||
{
|
||||
Base::unserialize(cp, section);
|
||||
Base::unserialize(cp);
|
||||
UNSERIALIZE_SCALAR(_size);
|
||||
}
|
||||
};
|
||||
|
@ -314,11 +314,11 @@ __hash_namespace_end
|
|||
// and UNSERIALIZE_SCALAR.
|
||||
template <>
|
||||
void
|
||||
paramOut(std::ostream &os, const std::string &name,
|
||||
paramOut(CheckpointOut &cp, const std::string &name,
|
||||
const X86ISA::ExtMachInst &machInst);
|
||||
template <>
|
||||
void
|
||||
paramIn(Checkpoint *cp, const std::string §ion,
|
||||
const std::string &name, X86ISA::ExtMachInst &machInst);
|
||||
paramIn(CheckpointIn &cp, const std::string &name,
|
||||
X86ISA::ExtMachInst &machInst);
|
||||
|
||||
#endif // __ARCH_X86_TYPES_HH__
|
||||
|
|
|
@ -1063,7 +1063,7 @@ CPA::doDq(System *sys, int flags, int cpuid, int sm,
|
|||
|
||||
|
||||
void
|
||||
CPA::serialize(std::ostream &os)
|
||||
CPA::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
|
||||
SERIALIZE_SCALAR(numSm);
|
||||
|
@ -1077,8 +1077,6 @@ CPA::serialize(std::ostream &os)
|
|||
arrayParamOut(os, "qSize", qSize);
|
||||
arrayParamOut(os, "qBytes", qBytes);
|
||||
|
||||
std::list<AnnDataPtr>::iterator ai;
|
||||
|
||||
SCache::iterator i;
|
||||
int x = 0, y = 0;
|
||||
|
||||
|
@ -1211,36 +1209,33 @@ CPA::serialize(std::ostream &os)
|
|||
if (!qData[x].size())
|
||||
continue;
|
||||
y = 0;
|
||||
ai = qData[x].begin();
|
||||
while (ai != qData[x].end()) {
|
||||
nameOut(os, csprintf("%s.Q%d_%d", name(), x, y));
|
||||
(*ai)->serialize(os);
|
||||
ai++;
|
||||
for (auto &ann : qData[x]) {
|
||||
ann->serializeSection(os, csprintf("Q%d_%d", x, y));
|
||||
y++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CPA::unserialize(Checkpoint *cp, const std::string §ion)
|
||||
CPA::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
UNSERIALIZE_SCALAR(numSm);
|
||||
UNSERIALIZE_SCALAR(numSmt);
|
||||
arrayParamIn(cp, section, "numSt", numSt);
|
||||
arrayParamIn(cp, section, "numQ", numQ);
|
||||
UNSERIALIZE_CONTAINER(numSt);
|
||||
UNSERIALIZE_CONTAINER(numQ);
|
||||
UNSERIALIZE_SCALAR(numSys);
|
||||
UNSERIALIZE_SCALAR(numQs);
|
||||
UNSERIALIZE_SCALAR(conId);
|
||||
arrayParamIn(cp, section, "qSize", qSize);
|
||||
arrayParamIn(cp, section, "qBytes", qBytes);
|
||||
UNSERIALIZE_CONTAINER(qSize);
|
||||
UNSERIALIZE_CONTAINER(qBytes);
|
||||
|
||||
|
||||
// smtCache (SCache
|
||||
string str;
|
||||
int smi;
|
||||
for (int x = 0; x < numSmt; x++) {
|
||||
paramIn(cp, section, csprintf("smtCache%d.str", x), str);
|
||||
paramIn(cp, section, csprintf("smtCache%d.int", x), smi);
|
||||
paramIn(cp, csprintf("smtCache%d.str", x), str);
|
||||
paramIn(cp, csprintf("smtCache%d.int", x), smi);
|
||||
smtCache[str] = smi;
|
||||
}
|
||||
|
||||
|
@ -1248,8 +1243,8 @@ CPA::unserialize(Checkpoint *cp, const std::string §ion)
|
|||
stCache.resize(numSmt);
|
||||
for (int x = 0; x < numSmt; x++) {
|
||||
for (int y = 0; y < numSt[x]; y++) {
|
||||
paramIn(cp, section, csprintf("stCache%d_%d.str", x,y), str);
|
||||
paramIn(cp, section, csprintf("stCache%d_%d.int", x,y), smi);
|
||||
paramIn(cp, csprintf("stCache%d_%d.str", x,y), str);
|
||||
paramIn(cp, csprintf("stCache%d_%d.int", x,y), smi);
|
||||
stCache[x][str] = smi;
|
||||
}
|
||||
}
|
||||
|
@ -1259,9 +1254,9 @@ CPA::unserialize(Checkpoint *cp, const std::string §ion)
|
|||
qCache.resize(numSys);
|
||||
for (int x = 0; x < numSys; x++) {
|
||||
for (int y = 0; y < numQ[x]; y++) {
|
||||
paramIn(cp, section, csprintf("qCache%d_%d.str", x,y), str);
|
||||
paramIn(cp, section, csprintf("qCache%d_%d.id", x,y), id);
|
||||
paramIn(cp, section, csprintf("qCache%d_%d.int", x,y), smi);
|
||||
paramIn(cp, csprintf("qCache%d_%d.str", x,y), str);
|
||||
paramIn(cp, csprintf("qCache%d_%d.id", x,y), id);
|
||||
paramIn(cp, csprintf("qCache%d_%d.int", x,y), smi);
|
||||
qCache[x][Id(str,id)] = smi;
|
||||
}
|
||||
}
|
||||
|
@ -1270,11 +1265,11 @@ CPA::unserialize(Checkpoint *cp, const std::string §ion)
|
|||
smCache.resize(numSys);
|
||||
for (int x = 0; x < numSys; x++) {
|
||||
int size;
|
||||
paramIn(cp, section, csprintf("smCache%d", x), size);
|
||||
paramIn(cp, csprintf("smCache%d", x), size);
|
||||
for (int y = 0; y < size; y++) {
|
||||
paramIn(cp, section, csprintf("smCache%d_%d.str", x,y), str);
|
||||
paramIn(cp, section, csprintf("smCache%d_%d.id", x,y), id);
|
||||
paramIn(cp, section, csprintf("smCache%d_%d.int", x,y), smi);
|
||||
paramIn(cp, csprintf("smCache%d_%d.str", x,y), str);
|
||||
paramIn(cp, csprintf("smCache%d_%d.id", x,y), id);
|
||||
paramIn(cp, csprintf("smCache%d_%d.int", x,y), smi);
|
||||
smCache[x][Id(str,id)] = smi;
|
||||
}
|
||||
}
|
||||
|
@ -1290,27 +1285,27 @@ CPA::unserialize(Checkpoint *cp, const std::string §ion)
|
|||
string str;
|
||||
int sysi;
|
||||
|
||||
objParamIn(cp, section, csprintf("nameCache%d.name", x), sptr);
|
||||
objParamIn(cp, csprintf("nameCache%d.name", x), sptr);
|
||||
sys = dynamic_cast<System*>(sptr);
|
||||
|
||||
paramIn(cp, section, csprintf("nameCache%d.str", x), str);
|
||||
paramIn(cp, section, csprintf("nameCache%d.int", x), sysi);
|
||||
paramIn(cp, csprintf("nameCache%d.str", x), str);
|
||||
paramIn(cp, csprintf("nameCache%d.int", x), sysi);
|
||||
nameCache[sys] = std::make_pair(str, sysi);
|
||||
}
|
||||
|
||||
//smStack (SmStack)
|
||||
int smStack_size;
|
||||
paramIn(cp, section, "smStackIdCount", smStack_size);
|
||||
paramIn(cp, "smStackIdCount", smStack_size);
|
||||
for (int x = 0; x < smStack_size; x++) {
|
||||
int sysi;
|
||||
uint64_t frame;
|
||||
int count;
|
||||
paramIn(cp, section, csprintf("smStackId%d.sys", x), sysi);
|
||||
paramIn(cp, section, csprintf("smStackId%d.frame", x), frame);
|
||||
paramIn(cp, section, csprintf("smStackId%d.count", x), count);
|
||||
paramIn(cp, csprintf("smStackId%d.sys", x), sysi);
|
||||
paramIn(cp, csprintf("smStackId%d.frame", x), frame);
|
||||
paramIn(cp, csprintf("smStackId%d.count", x), count);
|
||||
StackId sid = StackId(sysi, frame);
|
||||
for (int y = 0; y < count; y++) {
|
||||
paramIn(cp, section, csprintf("smStackId%d_%d", x, y), smi);
|
||||
paramIn(cp, csprintf("smStackId%d_%d", x, y), smi);
|
||||
smStack[sid].push_back(smi);
|
||||
}
|
||||
}
|
||||
|
@ -1318,23 +1313,23 @@ CPA::unserialize(Checkpoint *cp, const std::string §ion)
|
|||
// lnMap (LinkMap)
|
||||
int lsmi;
|
||||
int lnMap_size;
|
||||
paramIn(cp, section, "lnMapSize", lnMap_size);
|
||||
paramIn(cp, "lnMapSize", lnMap_size);
|
||||
for (int x = 0; x < lnMap_size; x++) {
|
||||
paramIn(cp, section, csprintf("lnMap%d.smi", x), smi);
|
||||
paramIn(cp, section, csprintf("lnMap%d.lsmi", x), lsmi);
|
||||
paramIn(cp, csprintf("lnMap%d.smi", x), smi);
|
||||
paramIn(cp, csprintf("lnMap%d.lsmi", x), lsmi);
|
||||
lnMap[smi] = lsmi;
|
||||
}
|
||||
|
||||
// swExpl (vector)
|
||||
int swExpl_size;
|
||||
paramIn(cp, section, "swExplCount", swExpl_size);
|
||||
paramIn(cp, "swExplCount", swExpl_size);
|
||||
for (int x = 0; x < swExpl_size; x++) {
|
||||
int sysi;
|
||||
uint64_t frame;
|
||||
bool b;
|
||||
paramIn(cp, section, csprintf("swExpl%d.sys", x), sysi);
|
||||
paramIn(cp, section, csprintf("swExpl%d.frame", x), frame);
|
||||
paramIn(cp, section, csprintf("swExpl%d.swexpl", x), b);
|
||||
paramIn(cp, csprintf("swExpl%d.sys", x), sysi);
|
||||
paramIn(cp, csprintf("swExpl%d.frame", x), frame);
|
||||
paramIn(cp, csprintf("swExpl%d.swexpl", x), b);
|
||||
StackId sid = StackId(sysi, frame);
|
||||
swExpl[sid] = b;
|
||||
}
|
||||
|
@ -1342,10 +1337,10 @@ CPA::unserialize(Checkpoint *cp, const std::string §ion)
|
|||
// lastState (IMap)
|
||||
int sti;
|
||||
int lastState_size;
|
||||
paramIn(cp, section, "lastStateSize", lastState_size);
|
||||
paramIn(cp, "lastStateSize", lastState_size);
|
||||
for (int x = 0; x < lastState_size; x++) {
|
||||
paramIn(cp, section, csprintf("lastState%d.smi", x), smi);
|
||||
paramIn(cp, section, csprintf("lastState%d.sti", x), sti);
|
||||
paramIn(cp, csprintf("lastState%d.smi", x), smi);
|
||||
paramIn(cp, csprintf("lastState%d.sti", x), sti);
|
||||
lastState[smi] = sti;
|
||||
}
|
||||
|
||||
|
@ -1353,17 +1348,17 @@ CPA::unserialize(Checkpoint *cp, const std::string §ion)
|
|||
//smMap (IdMap)
|
||||
smMap.resize(numSm);
|
||||
for (int x = 0; x < smMap.size(); x++) {
|
||||
paramIn(cp, section, csprintf("smMap%d.sys", x), smMap[x].first);
|
||||
paramIn(cp, section, csprintf("smMap%d.smname", x), smMap[x].second.first);
|
||||
paramIn(cp, section, csprintf("smMap%d.id", x), smMap[x].second.second);
|
||||
paramIn(cp, csprintf("smMap%d.sys", x), smMap[x].first);
|
||||
paramIn(cp, csprintf("smMap%d.smname", x), smMap[x].second.first);
|
||||
paramIn(cp, csprintf("smMap%d.id", x), smMap[x].second.second);
|
||||
}
|
||||
|
||||
//qMap (IdMap)
|
||||
qMap.resize(numQs);
|
||||
for (int x = 0; x < qMap.size(); x++) {
|
||||
paramIn(cp, section, csprintf("qMap%d.sys", x), qMap[x].first);
|
||||
paramIn(cp, section, csprintf("qMap%d.qname", x), qMap[x].second.first);
|
||||
paramIn(cp, section, csprintf("qMap%d.id", x), qMap[x].second.second);
|
||||
paramIn(cp, csprintf("qMap%d.sys", x), qMap[x].first);
|
||||
paramIn(cp, csprintf("qMap%d.qname", x), qMap[x].second.first);
|
||||
paramIn(cp, csprintf("qMap%d.id", x), qMap[x].second.second);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1374,7 +1369,7 @@ CPA::unserialize(Checkpoint *cp, const std::string §ion)
|
|||
continue;
|
||||
for (int y = 0; y < qSize[x]; y++) {
|
||||
AnnDataPtr a = std::make_shared<AnnotateData>();
|
||||
a->unserialize(cp, csprintf("%s.Q%d_%d", section, x, y));
|
||||
a->unserializeSection(cp, csprintf("Q%d_%d", x, y));
|
||||
data.push_back(a);
|
||||
qData[x].push_back(a);
|
||||
}
|
||||
|
@ -1382,7 +1377,7 @@ CPA::unserialize(Checkpoint *cp, const std::string §ion)
|
|||
}
|
||||
|
||||
void
|
||||
CPA::AnnotateData::serialize(std::ostream &os)
|
||||
CPA::AnnotateData::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
SERIALIZE_SCALAR(time);
|
||||
SERIALIZE_SCALAR(data);
|
||||
|
@ -1394,7 +1389,7 @@ CPA::AnnotateData::serialize(std::ostream &os)
|
|||
}
|
||||
|
||||
void
|
||||
CPA::AnnotateData::unserialize(Checkpoint *cp, const std::string §ion)
|
||||
CPA::AnnotateData::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
UNSERIALIZE_SCALAR(time);
|
||||
UNSERIALIZE_SCALAR(data);
|
||||
|
|
|
@ -190,7 +190,7 @@ class CPA : SimObject
|
|||
}
|
||||
|
||||
/* struct that is written to the annotation output file */
|
||||
struct AnnotateData {
|
||||
struct AnnotateData : public Serializable {
|
||||
|
||||
Tick time;
|
||||
uint32_t data;
|
||||
|
@ -202,9 +202,8 @@ class CPA : SimObject
|
|||
uint8_t cpu;
|
||||
bool dump;
|
||||
|
||||
void serialize(std::ostream &os);
|
||||
void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
};
|
||||
|
||||
typedef std::shared_ptr<AnnotateData> AnnDataPtr;
|
||||
|
@ -541,9 +540,8 @@ class CPA : SimObject
|
|||
void dump(bool all);
|
||||
void dumpKey();
|
||||
|
||||
void serialize(std::ostream &os);
|
||||
void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
};
|
||||
#endif // !CP_ANNOTATE
|
||||
|
||||
|
|
|
@ -108,32 +108,31 @@ SymbolTable::load(const string &filename)
|
|||
}
|
||||
|
||||
void
|
||||
SymbolTable::serialize(const string &base, ostream &os)
|
||||
SymbolTable::serialize(const string &base, CheckpointOut &cp) const
|
||||
{
|
||||
paramOut(os, base + ".size", addrTable.size());
|
||||
paramOut(cp, base + ".size", addrTable.size());
|
||||
|
||||
int i = 0;
|
||||
ATable::const_iterator p, end = addrTable.end();
|
||||
for (p = addrTable.begin(); p != end; ++p) {
|
||||
paramOut(os, csprintf("%s.addr_%d", base, i), p->first);
|
||||
paramOut(os, csprintf("%s.symbol_%d", base, i), p->second);
|
||||
paramOut(cp, csprintf("%s.addr_%d", base, i), p->first);
|
||||
paramOut(cp, csprintf("%s.symbol_%d", base, i), p->second);
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
SymbolTable::unserialize(const string &base, Checkpoint *cp,
|
||||
const string §ion)
|
||||
SymbolTable::unserialize(const string &base, CheckpointIn &cp)
|
||||
{
|
||||
clear();
|
||||
int size;
|
||||
paramIn(cp, section, base + ".size", size);
|
||||
paramIn(cp, base + ".size", size);
|
||||
for (int i = 0; i < size; ++i) {
|
||||
Addr addr;
|
||||
std::string symbol;
|
||||
|
||||
paramIn(cp, section, csprintf("%s.addr_%d", base, i), addr);
|
||||
paramIn(cp, section, csprintf("%s.symbol_%d", base, i), symbol);
|
||||
paramIn(cp, csprintf("%s.addr_%d", base, i), addr);
|
||||
paramIn(cp, csprintf("%s.symbol_%d", base, i), symbol);
|
||||
insert(addr, symbol);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,8 +37,8 @@
|
|||
#include <string>
|
||||
|
||||
#include "base/types.hh"
|
||||
#include "sim/serialize.hh"
|
||||
|
||||
class Checkpoint;
|
||||
class SymbolTable
|
||||
{
|
||||
public:
|
||||
|
@ -76,9 +76,8 @@ class SymbolTable
|
|||
const STable &getSymbolTable() const { return symbolTable; }
|
||||
|
||||
public:
|
||||
void serialize(const std::string &base, std::ostream &os);
|
||||
void unserialize(const std::string &base, Checkpoint *cp,
|
||||
const std::string §ion);
|
||||
void serialize(const std::string &base, CheckpointOut &cp) const;
|
||||
void unserialize(const std::string &base, CheckpointIn &cp);
|
||||
|
||||
public:
|
||||
bool
|
||||
|
|
|
@ -88,7 +88,7 @@ PollEvent::enable()
|
|||
}
|
||||
|
||||
void
|
||||
PollEvent::serialize(ostream &os)
|
||||
PollEvent::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
SERIALIZE_SCALAR(pfd.fd);
|
||||
SERIALIZE_SCALAR(pfd.events);
|
||||
|
@ -96,7 +96,7 @@ PollEvent::serialize(ostream &os)
|
|||
}
|
||||
|
||||
void
|
||||
PollEvent::unserialize(Checkpoint *cp, const std::string §ion)
|
||||
PollEvent::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
UNSERIALIZE_SCALAR(pfd.fd);
|
||||
UNSERIALIZE_SCALAR(pfd.events);
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
class Checkpoint;
|
||||
class PollQueue;
|
||||
|
||||
class PollEvent
|
||||
class PollEvent : public Serializable
|
||||
{
|
||||
private:
|
||||
friend class PollQueue;
|
||||
|
@ -60,8 +60,8 @@ class PollEvent
|
|||
|
||||
bool queued() { return queue != 0; }
|
||||
|
||||
virtual void serialize(std::ostream &os);
|
||||
virtual void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
};
|
||||
|
||||
class PollQueue
|
||||
|
|
|
@ -70,7 +70,7 @@ Random::init(uint32_t s)
|
|||
}
|
||||
|
||||
void
|
||||
Random::serialize(std::ostream &os)
|
||||
Random::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
panic("Currently not used anywhere.\n");
|
||||
|
||||
|
@ -78,11 +78,11 @@ Random::serialize(std::ostream &os)
|
|||
std::ostringstream oss;
|
||||
oss << gen;
|
||||
std::string state = oss.str();
|
||||
paramOut(os, "mt_state", state);
|
||||
paramOut(cp, "mt_state", state);
|
||||
}
|
||||
|
||||
void
|
||||
Random::unserialize(Checkpoint *cp, const std::string §ion)
|
||||
Random::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
panic("Currently not used anywhere.\n");
|
||||
|
||||
|
@ -90,7 +90,7 @@ Random::unserialize(Checkpoint *cp, const std::string §ion)
|
|||
// checkpoint state, so be forgiving in the unserialization and
|
||||
// keep on going if the parameter is not there
|
||||
std::string state;
|
||||
if (optParamIn(cp, section, "mt_state", state)) {
|
||||
if (optParamIn(cp, "mt_state", state)) {
|
||||
std::istringstream iss(state);
|
||||
iss >> gen;
|
||||
}
|
||||
|
|
|
@ -53,11 +53,13 @@
|
|||
#include <string>
|
||||
#include <type_traits>
|
||||
|
||||
#include "base/compiler.hh"
|
||||
#include "base/types.hh"
|
||||
#include "sim/serialize.hh"
|
||||
|
||||
class Checkpoint;
|
||||
|
||||
class Random
|
||||
class Random : public Serializable
|
||||
{
|
||||
|
||||
private:
|
||||
|
@ -102,8 +104,8 @@ class Random
|
|||
return dist(gen);
|
||||
}
|
||||
|
||||
void serialize(std::ostream &os);
|
||||
void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
};
|
||||
|
||||
extern Random random_mt;
|
||||
|
|
|
@ -117,20 +117,19 @@ Time::time() const
|
|||
}
|
||||
|
||||
void
|
||||
Time::serialize(const std::string &base, ostream &os)
|
||||
Time::serialize(const std::string &base, CheckpointOut &cp) const
|
||||
{
|
||||
paramOut(os, base + ".sec", sec());
|
||||
paramOut(os, base + ".nsec", nsec());
|
||||
paramOut(cp, base + ".sec", sec());
|
||||
paramOut(cp, base + ".nsec", nsec());
|
||||
}
|
||||
|
||||
void
|
||||
Time::unserialize(const std::string &base, Checkpoint *cp,
|
||||
const string §ion)
|
||||
Time::unserialize(const std::string &base, CheckpointIn &cp)
|
||||
{
|
||||
time_t secs;
|
||||
time_t nsecs;
|
||||
paramIn(cp, section, base + ".sec", secs);
|
||||
paramIn(cp, section, base + ".nsec", nsecs);
|
||||
paramIn(cp, base + ".sec", secs);
|
||||
paramIn(cp, base + ".nsec", nsecs);
|
||||
sec(secs);
|
||||
nsec(nsecs);
|
||||
}
|
||||
|
|
|
@ -43,8 +43,7 @@
|
|||
#include <string>
|
||||
|
||||
#include "base/types.hh"
|
||||
|
||||
class Checkpoint;
|
||||
#include "sim/serialize.hh"
|
||||
|
||||
class Time
|
||||
{
|
||||
|
@ -198,9 +197,8 @@ class Time
|
|||
std::string date(const std::string &format = "") const;
|
||||
std::string time() const;
|
||||
|
||||
void serialize(const std::string &base, std::ostream &os);
|
||||
void unserialize(const std::string &base, Checkpoint *cp,
|
||||
const std::string §ion);
|
||||
void serialize(const std::string &base, CheckpointOut &cp) const;
|
||||
void unserialize(const std::string &base, CheckpointIn &cp);
|
||||
};
|
||||
|
||||
void sleep(const Time &time);
|
||||
|
|
|
@ -640,7 +640,7 @@ BaseCPU::ProfileEvent::process()
|
|||
}
|
||||
|
||||
void
|
||||
BaseCPU::serialize(std::ostream &os)
|
||||
BaseCPU::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
SERIALIZE_SCALAR(instCnt);
|
||||
|
||||
|
@ -651,28 +651,30 @@ BaseCPU::serialize(std::ostream &os)
|
|||
* system. */
|
||||
SERIALIZE_SCALAR(_pid);
|
||||
|
||||
interrupts->serialize(os);
|
||||
interrupts->serialize(cp);
|
||||
|
||||
// Serialize the threads, this is done by the CPU implementation.
|
||||
for (ThreadID i = 0; i < numThreads; ++i) {
|
||||
nameOut(os, csprintf("%s.xc.%i", name(), i));
|
||||
serializeThread(os, i);
|
||||
ScopedCheckpointSection sec(cp, csprintf("xc.%i", i));
|
||||
serializeThread(cp, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BaseCPU::unserialize(Checkpoint *cp, const std::string §ion)
|
||||
BaseCPU::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
UNSERIALIZE_SCALAR(instCnt);
|
||||
|
||||
if (!_switchedOut) {
|
||||
UNSERIALIZE_SCALAR(_pid);
|
||||
interrupts->unserialize(cp, section);
|
||||
interrupts->unserialize(cp);
|
||||
|
||||
// Unserialize the threads, this is done by the CPU implementation.
|
||||
for (ThreadID i = 0; i < numThreads; ++i)
|
||||
unserializeThread(cp, csprintf("%s.xc.%i", section, i), i);
|
||||
for (ThreadID i = 0; i < numThreads; ++i) {
|
||||
ScopedCheckpointSection sec(cp, csprintf("xc.%i", i));
|
||||
unserializeThread(cp, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -390,7 +390,7 @@ class BaseCPU : public MemObject
|
|||
*
|
||||
* @param os The stream to serialize to.
|
||||
*/
|
||||
virtual void serialize(std::ostream &os);
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
|
||||
/**
|
||||
* Reconstruct the state of this object from a checkpoint.
|
||||
|
@ -403,7 +403,7 @@ class BaseCPU : public MemObject
|
|||
* @param cp The checkpoint use.
|
||||
* @param section The section name of this object.
|
||||
*/
|
||||
virtual void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
|
||||
/**
|
||||
* Serialize a single thread.
|
||||
|
@ -411,7 +411,7 @@ class BaseCPU : public MemObject
|
|||
* @param os The stream to serialize to.
|
||||
* @param tid ID of the current thread.
|
||||
*/
|
||||
virtual void serializeThread(std::ostream &os, ThreadID tid) {};
|
||||
virtual void serializeThread(CheckpointOut &cp, ThreadID tid) const {};
|
||||
|
||||
/**
|
||||
* Unserialize one thread.
|
||||
|
@ -420,8 +420,7 @@ class BaseCPU : public MemObject
|
|||
* @param section The section name of this thread.
|
||||
* @param tid ID of the current thread.
|
||||
*/
|
||||
virtual void unserializeThread(Checkpoint *cp, const std::string §ion,
|
||||
ThreadID tid) {};
|
||||
virtual void unserializeThread(CheckpointIn &cp, ThreadID tid) {};
|
||||
|
||||
virtual Counter totalInsts() const = 0;
|
||||
|
||||
|
|
|
@ -129,12 +129,12 @@ CheckerCPU::setDcachePort(MasterPort *dcache_port)
|
|||
}
|
||||
|
||||
void
|
||||
CheckerCPU::serialize(ostream &os)
|
||||
CheckerCPU::serialize(ostream &os) const
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
CheckerCPU::unserialize(Checkpoint *cp, const string §ion)
|
||||
CheckerCPU::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -189,8 +189,8 @@ class CheckerCPU : public BaseCPU, public ExecContext
|
|||
Counter numLoad;
|
||||
Counter startNumLoad;
|
||||
|
||||
virtual void serialize(std::ostream &os);
|
||||
virtual void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
|
||||
// These functions are only used in CPU models that split
|
||||
// effective address computation from the actual memory access.
|
||||
|
|
|
@ -180,10 +180,6 @@ class CheckerThreadContext : public ThreadContext
|
|||
checkerTC->regStats(name);
|
||||
}
|
||||
|
||||
void serialize(std::ostream &os) { actualTC->serialize(os); }
|
||||
void unserialize(Checkpoint *cp, const std::string §ion)
|
||||
{ actualTC->unserialize(cp, section); }
|
||||
|
||||
EndQuiesceEvent *getQuiesceEvent() { return actualTC->getQuiesceEvent(); }
|
||||
|
||||
Tick readLastActivate() { return actualTC->readLastActivate(); }
|
||||
|
|
|
@ -53,7 +53,7 @@ class BaseKvmCPU(BaseCPU):
|
|||
@classmethod
|
||||
def export_methods(cls, code):
|
||||
code('''
|
||||
void dump();
|
||||
void dump() const;
|
||||
''')
|
||||
|
||||
@classmethod
|
||||
|
|
|
@ -259,7 +259,7 @@ BaseKvmCPU::regStats()
|
|||
}
|
||||
|
||||
void
|
||||
BaseKvmCPU::serializeThread(std::ostream &os, ThreadID tid)
|
||||
BaseKvmCPU::serializeThread(CheckpointOut &cp, ThreadID tid) const
|
||||
{
|
||||
if (DTRACE(Checkpoint)) {
|
||||
DPRINTF(Checkpoint, "KVM: Serializing thread %i:\n", tid);
|
||||
|
@ -268,18 +268,17 @@ BaseKvmCPU::serializeThread(std::ostream &os, ThreadID tid)
|
|||
|
||||
assert(tid == 0);
|
||||
assert(_status == Idle);
|
||||
thread->serialize(os);
|
||||
thread->serialize(cp);
|
||||
}
|
||||
|
||||
void
|
||||
BaseKvmCPU::unserializeThread(Checkpoint *cp, const std::string §ion,
|
||||
ThreadID tid)
|
||||
BaseKvmCPU::unserializeThread(CheckpointIn &cp, ThreadID tid)
|
||||
{
|
||||
DPRINTF(Checkpoint, "KVM: Unserialize thread %i:\n", tid);
|
||||
|
||||
assert(tid == 0);
|
||||
assert(_status == Idle);
|
||||
thread->unserialize(cp, section);
|
||||
thread->unserialize(cp);
|
||||
threadContextDirty = true;
|
||||
}
|
||||
|
||||
|
@ -511,7 +510,7 @@ BaseKvmCPU::totalOps() const
|
|||
}
|
||||
|
||||
void
|
||||
BaseKvmCPU::dump()
|
||||
BaseKvmCPU::dump() const
|
||||
{
|
||||
inform("State dumping not implemented.");
|
||||
}
|
||||
|
|
|
@ -84,9 +84,10 @@ class BaseKvmCPU : public BaseCPU
|
|||
void startup();
|
||||
void regStats();
|
||||
|
||||
void serializeThread(std::ostream &os, ThreadID tid);
|
||||
void unserializeThread(Checkpoint *cp, const std::string §ion,
|
||||
ThreadID tid);
|
||||
void serializeThread(CheckpointOut &cp,
|
||||
ThreadID tid) const M5_ATTR_OVERRIDE;
|
||||
void unserializeThread(CheckpointIn &cp,
|
||||
ThreadID tid) M5_ATTR_OVERRIDE;
|
||||
|
||||
unsigned int drain(DrainManager *dm);
|
||||
void drainResume();
|
||||
|
@ -111,7 +112,7 @@ class BaseKvmCPU : public BaseCPU
|
|||
Counter totalOps() const;
|
||||
|
||||
/** Dump the internal state to the terminal. */
|
||||
virtual void dump();
|
||||
virtual void dump() const;
|
||||
|
||||
/**
|
||||
* Force an exit from KVM.
|
||||
|
|
|
@ -562,7 +562,7 @@ X86KvmCPU::startup()
|
|||
}
|
||||
|
||||
void
|
||||
X86KvmCPU::dump()
|
||||
X86KvmCPU::dump() const
|
||||
{
|
||||
dumpIntRegs();
|
||||
if (useXSave)
|
||||
|
|
|
@ -47,7 +47,7 @@ class X86KvmCPU : public BaseKvmCPU
|
|||
void startup();
|
||||
|
||||
/** @{ */
|
||||
void dump();
|
||||
void dump() const M5_ATTR_OVERRIDE;
|
||||
void dumpFpuRegs() const;
|
||||
void dumpIntRegs() const;
|
||||
void dumpSpecRegs() const;
|
||||
|
|
|
@ -130,33 +130,32 @@ MinorCPU::regStats()
|
|||
}
|
||||
|
||||
void
|
||||
MinorCPU::serializeThread(std::ostream &os, ThreadID thread_id)
|
||||
MinorCPU::serializeThread(CheckpointOut &cp, ThreadID thread_id) const
|
||||
{
|
||||
threads[thread_id]->serialize(os);
|
||||
threads[thread_id]->serialize(cp);
|
||||
}
|
||||
|
||||
void
|
||||
MinorCPU::unserializeThread(Checkpoint *cp, const std::string §ion,
|
||||
ThreadID thread_id)
|
||||
MinorCPU::unserializeThread(CheckpointIn &cp, ThreadID thread_id)
|
||||
{
|
||||
if (thread_id != 0)
|
||||
fatal("Trying to load more than one thread into a MinorCPU\n");
|
||||
|
||||
threads[thread_id]->unserialize(cp, section);
|
||||
threads[thread_id]->unserialize(cp);
|
||||
}
|
||||
|
||||
void
|
||||
MinorCPU::serialize(std::ostream &os)
|
||||
MinorCPU::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
pipeline->serialize(os);
|
||||
BaseCPU::serialize(os);
|
||||
pipeline->serialize(cp);
|
||||
BaseCPU::serialize(cp);
|
||||
}
|
||||
|
||||
void
|
||||
MinorCPU::unserialize(Checkpoint *cp, const std::string §ion)
|
||||
MinorCPU::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
pipeline->unserialize(cp, section);
|
||||
BaseCPU::unserialize(cp, section);
|
||||
pipeline->unserialize(cp);
|
||||
BaseCPU::unserialize(cp);
|
||||
}
|
||||
|
||||
Addr
|
||||
|
|
|
@ -146,13 +146,13 @@ class MinorCPU : public BaseCPU
|
|||
Counter totalInsts() const;
|
||||
Counter totalOps() const;
|
||||
|
||||
void serializeThread(std::ostream &os, ThreadID thread_id);
|
||||
void unserializeThread(Checkpoint *cp, const std::string §ion,
|
||||
ThreadID thread_id);
|
||||
void serializeThread(CheckpointOut &cp,
|
||||
ThreadID tid) const M5_ATTR_OVERRIDE;
|
||||
void unserializeThread(CheckpointIn &cp, ThreadID tid) M5_ATTR_OVERRIDE;
|
||||
|
||||
/** Serialize pipeline data */
|
||||
void serialize(std::ostream &os);
|
||||
void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
void serialize(CheckpointOut &cp) const;
|
||||
void unserialize(CheckpointIn &cp);
|
||||
|
||||
/** Drain interface */
|
||||
unsigned int drain(DrainManager *drain_manager);
|
||||
|
|
|
@ -986,17 +986,16 @@ FullO3CPU<Impl>::syscall(int64_t callnum, ThreadID tid)
|
|||
|
||||
template <class Impl>
|
||||
void
|
||||
FullO3CPU<Impl>::serializeThread(std::ostream &os, ThreadID tid)
|
||||
FullO3CPU<Impl>::serializeThread(CheckpointOut &cp, ThreadID tid) const
|
||||
{
|
||||
thread[tid]->serialize(os);
|
||||
thread[tid]->serialize(cp);
|
||||
}
|
||||
|
||||
template <class Impl>
|
||||
void
|
||||
FullO3CPU<Impl>::unserializeThread(Checkpoint *cp, const std::string §ion,
|
||||
ThreadID tid)
|
||||
FullO3CPU<Impl>::unserializeThread(CheckpointIn &cp, ThreadID tid)
|
||||
{
|
||||
thread[tid]->unserialize(cp, section);
|
||||
thread[tid]->unserialize(cp);
|
||||
}
|
||||
|
||||
template <class Impl>
|
||||
|
|
|
@ -338,10 +338,9 @@ class FullO3CPU : public BaseO3CPU
|
|||
/** Is the CPU draining? */
|
||||
bool isDraining() const { return getDrainState() == Drainable::Draining; }
|
||||
|
||||
void serializeThread(std::ostream &os, ThreadID tid);
|
||||
|
||||
void unserializeThread(Checkpoint *cp, const std::string §ion,
|
||||
ThreadID tid);
|
||||
void serializeThread(CheckpointOut &cp,
|
||||
ThreadID tid) const M5_ATTR_OVERRIDE;
|
||||
void unserializeThread(CheckpointIn &cp, ThreadID tid) M5_ATTR_OVERRIDE;
|
||||
|
||||
public:
|
||||
/** Executes a syscall.
|
||||
|
|
|
@ -112,24 +112,24 @@ struct O3ThreadState : public ThreadState {
|
|||
profilePC = 3;
|
||||
}
|
||||
|
||||
void serialize(std::ostream &os)
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE
|
||||
{
|
||||
ThreadState::serialize(os);
|
||||
ThreadState::serialize(cp);
|
||||
// Use the ThreadContext serialization helper to serialize the
|
||||
// TC.
|
||||
::serialize(*tc, os);
|
||||
::serialize(*tc, cp);
|
||||
}
|
||||
|
||||
void unserialize(Checkpoint *cp, const std::string §ion)
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE
|
||||
{
|
||||
// Prevent squashing - we don't have any instructions in
|
||||
// flight that we need to squash since we just instantiated a
|
||||
// clean system.
|
||||
noSquashFromTC = true;
|
||||
ThreadState::unserialize(cp, section);
|
||||
ThreadState::unserialize(cp);
|
||||
// Use the ThreadContext serialization helper to unserialize
|
||||
// the TC.
|
||||
::unserialize(*tc, cp, section);
|
||||
::unserialize(*tc, cp);
|
||||
noSquashFromTC = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -305,21 +305,20 @@ BaseSimpleCPU::resetStats()
|
|||
}
|
||||
|
||||
void
|
||||
BaseSimpleCPU::serializeThread(ostream &os, ThreadID tid)
|
||||
BaseSimpleCPU::serializeThread(CheckpointOut &cp, ThreadID tid) const
|
||||
{
|
||||
assert(_status == Idle || _status == Running);
|
||||
assert(tid == 0);
|
||||
|
||||
thread->serialize(os);
|
||||
thread->serialize(cp);
|
||||
}
|
||||
|
||||
void
|
||||
BaseSimpleCPU::unserializeThread(Checkpoint *cp, const string §ion,
|
||||
ThreadID tid)
|
||||
BaseSimpleCPU::unserializeThread(CheckpointIn &cp, ThreadID tid)
|
||||
{
|
||||
if (tid != 0)
|
||||
fatal("Trying to load more than one thread into a SimpleCPU\n");
|
||||
thread->unserialize(cp, section);
|
||||
thread->unserialize(cp);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -278,9 +278,9 @@ class BaseSimpleCPU : public BaseCPU, public ExecContext
|
|||
// instruction mix histogram by OpClass
|
||||
Stats::Vector statExecutedInstType;
|
||||
|
||||
void serializeThread(std::ostream &os, ThreadID tid);
|
||||
void unserializeThread(Checkpoint *cp, const std::string §ion,
|
||||
ThreadID tid);
|
||||
void serializeThread(CheckpointOut &cp,
|
||||
ThreadID tid) const M5_ATTR_OVERRIDE;
|
||||
void unserializeThread(CheckpointIn &cp, ThreadID tid) M5_ATTR_OVERRIDE;
|
||||
|
||||
// These functions are only used in CPU models that split
|
||||
// effective address computation from the actual memory access.
|
||||
|
|
|
@ -131,18 +131,18 @@ SimpleThread::copyState(ThreadContext *oldContext)
|
|||
}
|
||||
|
||||
void
|
||||
SimpleThread::serialize(ostream &os)
|
||||
SimpleThread::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
ThreadState::serialize(os);
|
||||
::serialize(*tc, os);
|
||||
ThreadState::serialize(cp);
|
||||
::serialize(*tc, cp);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
SimpleThread::unserialize(Checkpoint *cp, const std::string §ion)
|
||||
SimpleThread::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
ThreadState::unserialize(cp, section);
|
||||
::unserialize(*tc, cp, section);
|
||||
ThreadState::unserialize(cp);
|
||||
::unserialize(*tc, cp);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -154,8 +154,8 @@ class SimpleThread : public ThreadState
|
|||
|
||||
void copyState(ThreadContext *oldContext);
|
||||
|
||||
void serialize(std::ostream &os);
|
||||
void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
void startup();
|
||||
|
||||
/***************************************************************
|
||||
|
|
|
@ -139,7 +139,7 @@ TrafficGen::drain(DrainManager *dm)
|
|||
}
|
||||
|
||||
void
|
||||
TrafficGen::serialize(ostream &os)
|
||||
TrafficGen::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
DPRINTF(Checkpoint, "Serializing TrafficGen\n");
|
||||
|
||||
|
@ -158,7 +158,7 @@ TrafficGen::serialize(ostream &os)
|
|||
}
|
||||
|
||||
void
|
||||
TrafficGen::unserialize(Checkpoint* cp, const string& section)
|
||||
TrafficGen::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
// restore scheduled events
|
||||
Tick nextEvent;
|
||||
|
|
|
@ -203,9 +203,8 @@ class TrafficGen : public MemObject
|
|||
|
||||
unsigned int drain(DrainManager *dm);
|
||||
|
||||
void serialize(std::ostream &os);
|
||||
|
||||
void unserialize(Checkpoint* cp, const std::string& section);
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
|
||||
/** Register statistics */
|
||||
void regStats();
|
||||
|
|
|
@ -104,7 +104,7 @@ ThreadContext::compare(ThreadContext *one, ThreadContext *two)
|
|||
}
|
||||
|
||||
void
|
||||
serialize(ThreadContext &tc, std::ostream &os)
|
||||
serialize(ThreadContext &tc, CheckpointOut &cp)
|
||||
{
|
||||
using namespace TheISA;
|
||||
|
||||
|
@ -113,7 +113,7 @@ serialize(ThreadContext &tc, std::ostream &os)
|
|||
floatRegs[i] = tc.readFloatRegBitsFlat(i);
|
||||
// This is a bit ugly, but needed to maintain backwards
|
||||
// compatibility.
|
||||
arrayParamOut(os, "floatRegs.i", floatRegs, NumFloatRegs);
|
||||
arrayParamOut(cp, "floatRegs.i", floatRegs, NumFloatRegs);
|
||||
|
||||
IntReg intRegs[NumIntRegs];
|
||||
for (int i = 0; i < NumIntRegs; ++i)
|
||||
|
@ -127,20 +127,20 @@ serialize(ThreadContext &tc, std::ostream &os)
|
|||
SERIALIZE_ARRAY(ccRegs, NumCCRegs);
|
||||
#endif
|
||||
|
||||
tc.pcState().serialize(os);
|
||||
tc.pcState().serialize(cp);
|
||||
|
||||
// thread_num and cpu_id are deterministic from the config
|
||||
}
|
||||
|
||||
void
|
||||
unserialize(ThreadContext &tc, Checkpoint *cp, const std::string §ion)
|
||||
unserialize(ThreadContext &tc, CheckpointIn &cp)
|
||||
{
|
||||
using namespace TheISA;
|
||||
|
||||
FloatRegBits floatRegs[NumFloatRegs];
|
||||
// This is a bit ugly, but needed to maintain backwards
|
||||
// compatibility.
|
||||
arrayParamIn(cp, section, "floatRegs.i", floatRegs, NumFloatRegs);
|
||||
arrayParamIn(cp, "floatRegs.i", floatRegs, NumFloatRegs);
|
||||
for (int i = 0; i < NumFloatRegs; ++i)
|
||||
tc.setFloatRegBitsFlat(i, floatRegs[i]);
|
||||
|
||||
|
@ -157,7 +157,7 @@ unserialize(ThreadContext &tc, Checkpoint *cp, const std::string §ion)
|
|||
#endif
|
||||
|
||||
PCState pcState;
|
||||
pcState.unserialize(cp, section);
|
||||
pcState.unserialize(cp);
|
||||
tc.pcState(pcState);
|
||||
|
||||
// thread_num and cpu_id are deterministic from the config
|
||||
|
|
|
@ -499,8 +499,8 @@ class ProxyThreadContext : public ThreadContext
|
|||
* be confusing when the ThreadContext is exported via a proxy.
|
||||
*/
|
||||
|
||||
void serialize(ThreadContext &tc, std::ostream &os);
|
||||
void unserialize(ThreadContext &tc, Checkpoint *cp, const std::string §ion);
|
||||
void serialize(ThreadContext &tc, CheckpointOut &cp);
|
||||
void unserialize(ThreadContext &tc, CheckpointIn &cp);
|
||||
|
||||
/** @} */
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ ThreadState::~ThreadState()
|
|||
}
|
||||
|
||||
void
|
||||
ThreadState::serialize(std::ostream &os)
|
||||
ThreadState::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
SERIALIZE_ENUM(_status);
|
||||
// thread_num and cpu_id are deterministic from the config
|
||||
|
@ -77,11 +77,11 @@ ThreadState::serialize(std::ostream &os)
|
|||
quiesceEndTick = quiesceEvent->when();
|
||||
SERIALIZE_SCALAR(quiesceEndTick);
|
||||
if (kernelStats)
|
||||
kernelStats->serialize(os);
|
||||
kernelStats->serialize(cp);
|
||||
}
|
||||
|
||||
void
|
||||
ThreadState::unserialize(Checkpoint *cp, const std::string §ion)
|
||||
ThreadState::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
|
||||
UNSERIALIZE_ENUM(_status);
|
||||
|
@ -96,7 +96,7 @@ ThreadState::unserialize(Checkpoint *cp, const std::string §ion)
|
|||
if (quiesceEndTick)
|
||||
baseCpu->schedule(quiesceEvent, quiesceEndTick);
|
||||
if (kernelStats)
|
||||
kernelStats->unserialize(cp, section);
|
||||
kernelStats->unserialize(cp);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -56,16 +56,16 @@ class Checkpoint;
|
|||
* memory, quiesce events, and certain stats. This can be expanded
|
||||
* to hold more thread-specific stats within it.
|
||||
*/
|
||||
struct ThreadState {
|
||||
struct ThreadState : public Serializable {
|
||||
typedef ThreadContext::Status Status;
|
||||
|
||||
ThreadState(BaseCPU *cpu, ThreadID _tid, Process *_process);
|
||||
|
||||
virtual ~ThreadState();
|
||||
|
||||
void serialize(std::ostream &os);
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
|
||||
void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
|
||||
int cpuId() const { return baseCpu->cpuId(); }
|
||||
|
||||
|
|
|
@ -252,7 +252,7 @@ AlphaBackdoor::write(PacketPtr pkt)
|
|||
}
|
||||
|
||||
void
|
||||
AlphaBackdoor::Access::serialize(ostream &os)
|
||||
AlphaBackdoor::Access::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
SERIALIZE_SCALAR(last_offset);
|
||||
SERIALIZE_SCALAR(version);
|
||||
|
@ -274,7 +274,7 @@ AlphaBackdoor::Access::serialize(ostream &os)
|
|||
}
|
||||
|
||||
void
|
||||
AlphaBackdoor::Access::unserialize(Checkpoint *cp, const std::string §ion)
|
||||
AlphaBackdoor::Access::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
UNSERIALIZE_SCALAR(last_offset);
|
||||
UNSERIALIZE_SCALAR(version);
|
||||
|
@ -296,15 +296,15 @@ AlphaBackdoor::Access::unserialize(Checkpoint *cp, const std::string §ion)
|
|||
}
|
||||
|
||||
void
|
||||
AlphaBackdoor::serialize(ostream &os)
|
||||
AlphaBackdoor::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
alphaAccess->serialize(os);
|
||||
alphaAccess->serialize(cp);
|
||||
}
|
||||
|
||||
void
|
||||
AlphaBackdoor::unserialize(Checkpoint *cp, const std::string §ion)
|
||||
AlphaBackdoor::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
alphaAccess->unserialize(cp, section);
|
||||
alphaAccess->unserialize(cp);
|
||||
}
|
||||
|
||||
AlphaBackdoor *
|
||||
|
|
|
@ -74,10 +74,10 @@ class SimpleDisk;
|
|||
class AlphaBackdoor : public BasicPioDevice
|
||||
{
|
||||
protected:
|
||||
struct Access : public AlphaAccess
|
||||
struct Access : public AlphaAccess, public Serializable
|
||||
{
|
||||
void serialize(std::ostream &os);
|
||||
void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
};
|
||||
|
||||
union {
|
||||
|
@ -118,8 +118,8 @@ class AlphaBackdoor : public BasicPioDevice
|
|||
/**
|
||||
* standard serialization routines for checkpointing
|
||||
*/
|
||||
virtual void serialize(std::ostream &os);
|
||||
virtual void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // __DEV_ALPHA_BACKDOOR_HH__
|
||||
|
|
|
@ -114,13 +114,13 @@ Tsunami::calcPciMemAddr(Addr addr)
|
|||
}
|
||||
|
||||
void
|
||||
Tsunami::serialize(std::ostream &os)
|
||||
Tsunami::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
SERIALIZE_ARRAY(intr_sum_type, Tsunami::Max_CPUs);
|
||||
}
|
||||
|
||||
void
|
||||
Tsunami::unserialize(Checkpoint *cp, const std::string §ion)
|
||||
Tsunami::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
UNSERIALIZE_ARRAY(intr_sum_type, Tsunami::Max_CPUs);
|
||||
}
|
||||
|
|
|
@ -124,18 +124,8 @@ class Tsunami : public Platform
|
|||
*/
|
||||
virtual Addr calcPciMemAddr(Addr addr);
|
||||
|
||||
/**
|
||||
* Serialize this object to the given output stream.
|
||||
* @param os The stream to serialize to.
|
||||
*/
|
||||
virtual void serialize(std::ostream &os);
|
||||
|
||||
/**
|
||||
* Reconstruct the state of this object from a checkpoint.
|
||||
* @param cp The checkpoint use.
|
||||
* @param section The section name of this object
|
||||
*/
|
||||
virtual void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // __DEV_TSUNAMI_HH__
|
||||
|
|
|
@ -507,7 +507,7 @@ TsunamiCChip::clearDRIR(uint32_t interrupt)
|
|||
|
||||
|
||||
void
|
||||
TsunamiCChip::serialize(std::ostream &os)
|
||||
TsunamiCChip::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
SERIALIZE_ARRAY(dim, Tsunami::Max_CPUs);
|
||||
SERIALIZE_ARRAY(dir, Tsunami::Max_CPUs);
|
||||
|
@ -517,7 +517,7 @@ TsunamiCChip::serialize(std::ostream &os)
|
|||
}
|
||||
|
||||
void
|
||||
TsunamiCChip::unserialize(Checkpoint *cp, const std::string §ion)
|
||||
TsunamiCChip::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
UNSERIALIZE_ARRAY(dim, Tsunami::Max_CPUs);
|
||||
UNSERIALIZE_ARRAY(dir, Tsunami::Max_CPUs);
|
||||
|
|
|
@ -131,20 +131,8 @@ class TsunamiCChip : public BasicPioDevice
|
|||
*/
|
||||
void reqIPI(uint64_t ipreq);
|
||||
|
||||
|
||||
/**
|
||||
* Serialize this object to the given output stream.
|
||||
* @param os The stream to serialize to.
|
||||
*/
|
||||
virtual void serialize(std::ostream &os);
|
||||
|
||||
/**
|
||||
* Reconstruct the state of this object from a checkpoint.
|
||||
* @param cp The checkpoint use.
|
||||
* @param section The section name of this object
|
||||
*/
|
||||
virtual void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // __TSUNAMI_CCHIP_HH__
|
||||
|
|
|
@ -251,7 +251,7 @@ TsunamiIO::clearPIC(uint8_t bitvector)
|
|||
}
|
||||
|
||||
void
|
||||
TsunamiIO::serialize(ostream &os)
|
||||
TsunamiIO::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
SERIALIZE_SCALAR(rtcAddr);
|
||||
SERIALIZE_SCALAR(timerData);
|
||||
|
@ -263,12 +263,12 @@ TsunamiIO::serialize(ostream &os)
|
|||
SERIALIZE_SCALAR(picInterrupting);
|
||||
|
||||
// Serialize the timers
|
||||
pitimer.serialize("pitimer", os);
|
||||
rtc.serialize("rtc", os);
|
||||
pitimer.serialize("pitimer", cp);
|
||||
rtc.serialize("rtc", cp);
|
||||
}
|
||||
|
||||
void
|
||||
TsunamiIO::unserialize(Checkpoint *cp, const string §ion)
|
||||
TsunamiIO::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
UNSERIALIZE_SCALAR(rtcAddr);
|
||||
UNSERIALIZE_SCALAR(timerData);
|
||||
|
@ -280,8 +280,8 @@ TsunamiIO::unserialize(Checkpoint *cp, const string §ion)
|
|||
UNSERIALIZE_SCALAR(picInterrupting);
|
||||
|
||||
// Unserialize the timers
|
||||
pitimer.unserialize("pitimer", cp, section);
|
||||
rtc.unserialize("rtc", cp, section);
|
||||
pitimer.unserialize("pitimer", cp);
|
||||
rtc.unserialize("rtc", cp);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -138,18 +138,8 @@ class TsunamiIO : public BasicPioDevice
|
|||
*/
|
||||
void clearPIC(uint8_t bitvector);
|
||||
|
||||
/**
|
||||
* Serialize this object to the given output stream.
|
||||
* @param os The stream to serialize to.
|
||||
*/
|
||||
virtual void serialize(std::ostream &os);
|
||||
|
||||
/**
|
||||
* Reconstruct the state of this object from a checkpoint.
|
||||
* @param cp The checkpoint use.
|
||||
* @param section The section name of this object
|
||||
*/
|
||||
virtual void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
|
||||
/**
|
||||
* Start running.
|
||||
|
|
|
@ -324,7 +324,7 @@ TsunamiPChip::calcMemAddr(Addr addr)
|
|||
}
|
||||
|
||||
void
|
||||
TsunamiPChip::serialize(std::ostream &os)
|
||||
TsunamiPChip::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
SERIALIZE_SCALAR(pctl);
|
||||
SERIALIZE_ARRAY(wsba, 4);
|
||||
|
@ -333,7 +333,7 @@ TsunamiPChip::serialize(std::ostream &os)
|
|||
}
|
||||
|
||||
void
|
||||
TsunamiPChip::unserialize(Checkpoint *cp, const std::string §ion)
|
||||
TsunamiPChip::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
UNSERIALIZE_SCALAR(pctl);
|
||||
UNSERIALIZE_ARRAY(wsba, 4);
|
||||
|
|
|
@ -89,18 +89,8 @@ class TsunamiPChip : public BasicPioDevice
|
|||
virtual Tick read(PacketPtr pkt);
|
||||
virtual Tick write(PacketPtr pkt);
|
||||
|
||||
/**
|
||||
* Serialize this object to the given output stream.
|
||||
* @param os The stream to serialize to.
|
||||
*/
|
||||
virtual void serialize(std::ostream &os);
|
||||
|
||||
/**
|
||||
* Reconstruct the state of this object from a checkpoint.
|
||||
* @param cp The checkpoint use.
|
||||
* @param section The section name of this object
|
||||
*/
|
||||
virtual void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // __TSUNAMI_PCHIP_HH__
|
||||
|
|
|
@ -216,7 +216,7 @@ EnergyCtrl::write(PacketPtr pkt)
|
|||
}
|
||||
|
||||
void
|
||||
EnergyCtrl::serialize(std::ostream &os)
|
||||
EnergyCtrl::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
SERIALIZE_SCALAR(domainID);
|
||||
SERIALIZE_SCALAR(domainIDIndexToRead);
|
||||
|
@ -228,7 +228,7 @@ EnergyCtrl::serialize(std::ostream &os)
|
|||
}
|
||||
|
||||
void
|
||||
EnergyCtrl::unserialize(Checkpoint *cp, const std::string §ion)
|
||||
EnergyCtrl::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
UNSERIALIZE_SCALAR(domainID);
|
||||
UNSERIALIZE_SCALAR(domainIDIndexToRead);
|
||||
|
|
|
@ -132,8 +132,8 @@ class EnergyCtrl : public BasicPioDevice
|
|||
*/
|
||||
virtual Tick write(PacketPtr pkt);
|
||||
|
||||
void serialize(std::ostream &os);
|
||||
void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
|
||||
void startup();
|
||||
void init();
|
||||
|
|
|
@ -518,7 +518,7 @@ FlashDevice::regStats()
|
|||
*/
|
||||
|
||||
void
|
||||
FlashDevice::serialize(std::ostream &os)
|
||||
FlashDevice::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
SERIALIZE_SCALAR(planeMask);
|
||||
|
||||
|
@ -551,7 +551,7 @@ FlashDevice::serialize(std::ostream &os)
|
|||
*/
|
||||
|
||||
void
|
||||
FlashDevice::unserialize(Checkpoint *cp, const std::string §ion)
|
||||
FlashDevice::unserialize(CheckpointIn &cp)
|
||||
{
|
||||
UNSERIALIZE_SCALAR(planeMask);
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue