Deleted Added
sdiff udiff text old ( 10907:94d5a1476c5b ) new ( 11072:6a447a3138ef )
full compact
1/*
2 * Copyright (c) 2015 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 431 unchanged lines hidden (view full) ---

440
441/// The one and only instance of the Globals class.
442Globals globals;
443
444void
445Globals::serialize(CheckpointOut &cp) const
446{
447 paramOut(cp, "curTick", curTick());
448}
449
450void
451Globals::unserialize(CheckpointIn &cp)
452{
453 paramIn(cp, "curTick", unserializedCurTick);
454}
455
456Serializable::Serializable()
457{
458}
459
460Serializable::~Serializable()
461{

--- 30 unchanged lines hidden (view full) ---

492 string cpt_file = dir + CheckpointIn::baseFilename;
493 ofstream outstream(cpt_file.c_str());
494 time_t t = time(NULL);
495 if (!outstream.is_open())
496 fatal("Unable to open file %s for writing\n", cpt_file.c_str());
497 outstream << "## checkpoint generated: " << ctime(&t);
498
499 globals.serializeSection(outstream, "Globals");
500
501 SimObject::serializeAll(outstream);
502}
503
504void
505Serializable::unserializeGlobals(CheckpointIn &cp)
506{
507 globals.unserializeSection(cp, "Globals");
508
509 for (uint32_t i = 0; i < numMainEventQueues; ++i)
510 mainEventQueue[i]->setCurTick(globals.unserializedCurTick);
511}
512
513Serializable::ScopedCheckpointSection::~ScopedCheckpointSection()
514{
515 assert(!path.empty());
516 DPRINTF(Checkpoint, "Popping: %s\n", path.top());
517 path.pop();
518}

--- 18 unchanged lines hidden (view full) ---

537}
538
539void
540debug_serialize(const string &cpt_dir)
541{
542 Serializable::serializeAll(cpt_dir);
543}
544
545const std::string &
546Serializable::currentSection()
547{
548 assert(!path.empty());
549
550 return path.top();
551}
552
553const char *CheckpointIn::baseFilename = "m5.cpt";
554
555string CheckpointIn::currentDirectory;
556
557string
558CheckpointIn::setDir(const string &name)
559{
560 // use csprintf to insert curTick() into directory name if it

--- 55 unchanged lines hidden ---