serialize.cc (11076:463a4b0f0dda) | serialize.cc (11077:fae097742b7e) |
---|---|
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 --- 482 unchanged lines hidden (view full) --- 491 void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE; 492 493 Tick unserializedCurTick; 494}; 495 496/// The one and only instance of the Globals class. 497Globals globals; 498 | 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 --- 482 unchanged lines hidden (view full) --- 491 void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE; 492 493 Tick unserializedCurTick; 494}; 495 496/// The one and only instance of the Globals class. 497Globals globals; 498 |
499/// The version tags for this build of the simulator, to be stored in the 500/// Globals section during serialization and compared upon unserialization. 501extern std::set<std::string> version_tags; 502 |
|
499void 500Globals::serialize(CheckpointOut &cp) const 501{ 502 paramOut(cp, "curTick", curTick()); | 503void 504Globals::serialize(CheckpointOut &cp) const 505{ 506 paramOut(cp, "curTick", curTick()); |
507 SERIALIZE_CONTAINER(version_tags); |
|
503} 504 505void 506Globals::unserialize(CheckpointIn &cp) 507{ 508 paramIn(cp, "curTick", unserializedCurTick); | 508} 509 510void 511Globals::unserialize(CheckpointIn &cp) 512{ 513 paramIn(cp, "curTick", unserializedCurTick); |
514 515 const std::string §ion(Serializable::currentSection()); 516 std::string str; 517 if (!cp.find(section, "version_tags", str)) { 518 warn("**********************************************************\n"); 519 warn("!!!! Checkpoint uses an old versioning scheme. !!!!\n"); 520 warn("Run the checkpoint upgrader (util/cpt_upgrader.py) on your " 521 "checkpoint\n"); 522 warn("**********************************************************\n"); 523 return; 524 } 525 526 std::set<std::string> cpt_tags; 527 arrayParamIn(cp, "version_tags", cpt_tags); // UNSERIALIZE_CONTAINER 528 529 bool err = false; 530 for (const auto& t : version_tags) { 531 if (cpt_tags.find(t) == cpt_tags.end()) { 532 // checkpoint is missing tag that this binary has 533 if (!err) { 534 warn("*****************************************************\n"); 535 warn("!!!! Checkpoint is missing the following version tags:\n"); 536 err = true; 537 } 538 warn(" %s\n", t); 539 } 540 } 541 if (err) { 542 warn("You might experience some issues when restoring and should run " 543 "the checkpoint upgrader (util/cpt_upgrader.py) on your " 544 "checkpoint\n"); 545 warn("**********************************************************\n"); 546 } 547 548 err = false; 549 for (const auto& t : cpt_tags) { 550 if (version_tags.find(t) == version_tags.end()) { 551 // gem5 binary is missing tag that this checkpoint has 552 if (!err) { 553 warn("*****************************************************\n"); 554 warn("!!!! gem5 is missing the following version tags:\n"); 555 err = true; 556 } 557 warn(" %s\n", t); 558 } 559 } 560 if (err) { 561 warn("Running a checkpoint with incompatible version tags is not " 562 "supported. While it might work, you may experience incorrect " 563 "behavior or crashes.\n"); 564 warn("**********************************************************\n"); 565 } |
|
509} 510 511Serializable::Serializable() 512{ 513} 514 515Serializable::~Serializable() 516{ --- 154 unchanged lines hidden --- | 566} 567 568Serializable::Serializable() 569{ 570} 571 572Serializable::~Serializable() 573{ --- 154 unchanged lines hidden --- |