serialize.cc (10386:c81407818741) | serialize.cc (10453:d0365cc3d05f) |
---|---|
1/* 2 * Copyright (c) 2002-2005 The Regents of The University of Michigan 3 * Copyright (c) 2013 Advanced Micro Devices, Inc. 4 * Copyright (c) 2013 Mark D. Hill and David A. Wood 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions are --- 44 unchanged lines hidden (view full) --- 53#include "sim/sim_exit.hh" 54#include "sim/sim_object.hh" 55 56// For stat reset hack 57#include "sim/stat_control.hh" 58 59using namespace std; 60 | 1/* 2 * Copyright (c) 2002-2005 The Regents of The University of Michigan 3 * Copyright (c) 2013 Advanced Micro Devices, Inc. 4 * Copyright (c) 2013 Mark D. Hill and David A. Wood 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions are --- 44 unchanged lines hidden (view full) --- 53#include "sim/sim_exit.hh" 54#include "sim/sim_object.hh" 55 56// For stat reset hack 57#include "sim/stat_control.hh" 58 59using namespace std; 60 |
61extern SimObject *resolveSimObject(const string &); 62 | |
63// 64// The base implementations use to_number for parsing and '<<' for 65// displaying, suitable for integer types. 66// 67template <class T> 68bool 69parseParam(const string &s, T &value) 70{ --- 524 unchanged lines hidden (view full) --- 595 596string 597Checkpoint::dir() 598{ 599 return currentDirectory; 600} 601 602 | 61// 62// The base implementations use to_number for parsing and '<<' for 63// displaying, suitable for integer types. 64// 65template <class T> 66bool 67parseParam(const string &s, T &value) 68{ --- 524 unchanged lines hidden (view full) --- 593 594string 595Checkpoint::dir() 596{ 597 return currentDirectory; 598} 599 600 |
603Checkpoint::Checkpoint(const string &cpt_dir) 604 : db(new IniFile), cptDir(setDir(cpt_dir)) | 601Checkpoint::Checkpoint(const string &cpt_dir, SimObjectResolver &resolver) 602 : db(new IniFile), objNameResolver(resolver), cptDir(setDir(cpt_dir)) |
605{ 606 string filename = cptDir + "/" + Checkpoint::baseFilename; 607 if (!db->load(filename)) { 608 fatal("Can't load checkpoint file '%s'\n", filename); 609 } 610} 611 612Checkpoint::~Checkpoint() --- 12 unchanged lines hidden (view full) --- 625Checkpoint::findObj(const string §ion, const string &entry, 626 SimObject *&value) 627{ 628 string path; 629 630 if (!db->find(section, entry, path)) 631 return false; 632 | 603{ 604 string filename = cptDir + "/" + Checkpoint::baseFilename; 605 if (!db->load(filename)) { 606 fatal("Can't load checkpoint file '%s'\n", filename); 607 } 608} 609 610Checkpoint::~Checkpoint() --- 12 unchanged lines hidden (view full) --- 623Checkpoint::findObj(const string §ion, const string &entry, 624 SimObject *&value) 625{ 626 string path; 627 628 if (!db->find(section, entry, path)) 629 return false; 630 |
633 value = resolveSimObject(path); | 631 value = objNameResolver.resolveSimObject(path); |
634 return true; 635} 636 637 638bool 639Checkpoint::sectionExists(const string §ion) 640{ 641 return db->sectionExists(section); 642} | 632 return true; 633} 634 635 636bool 637Checkpoint::sectionExists(const string §ion) 638{ 639 return db->sectionExists(section); 640} |