From b46baf107fb88c7b0e80664a9f9951aeaa6ba249 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Wed, 9 Feb 2005 17:33:28 -0500 Subject: [PATCH] enable the Trace, Statistics, and Serialize param contexts. objects/Root.mpy: Fake the param context stuff for now. sim/param.cc: Make empty vector enums work sim/serialize.cc: serialize_dir is always valid --HG-- extra : convert_revision : c46373f0f4c70e6a2f01a81c0fa6bacab72d4c4f --- objects/Root.mpy | 7 +++++++ sim/param.cc | 5 +++++ sim/serialize.cc | 6 +----- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/objects/Root.mpy b/objects/Root.mpy index b21396e36..dd485ac73 100644 --- a/objects/Root.mpy +++ b/objects/Root.mpy @@ -1,4 +1,8 @@ from HierParams import HierParams +from Serialize import Serialize +from Statistics import Statistics +from Trace import Trace + simobj Root(SimObject): type = 'Root' frequency = Param.Tick(200000000, "tick frequency") @@ -9,3 +13,6 @@ simobj Root(SimObject): full_system = Param.Bool("Full system simulation?") hier = HierParams(do_data = False, do_events = True) checkpoint = Param.String('', "Checkpoint file") + stats = Statistics() + trace = Trace() + serialize = Serialize() diff --git a/sim/param.cc b/sim/param.cc index d16578a2d..ff023ce85 100644 --- a/sim/param.cc +++ b/sim/param.cc @@ -441,6 +441,11 @@ EnumVectorParam::parse(const string &s) { vector tokens; + if (s.empty()) { + wasSet = true; + return; + } + tokenize(tokens, s, ' '); value.resize(tokens.size()); diff --git a/sim/serialize.cc b/sim/serialize.cc index 3a073f68d..d5f217e55 100644 --- a/sim/serialize.cc +++ b/sim/serialize.cc @@ -333,11 +333,7 @@ SerializeParamContext::~SerializeParamContext() void SerializeParamContext::checkParams() { - if (serialize_dir.isValid()) { - checkpointDirBase = serialize_dir; - } else { - checkpointDirBase = outputDirectory + "cpt.%012d"; - } + checkpointDirBase = outputDirectory + (string)serialize_dir; // guarantee that directory ends with a '/' if (checkpointDirBase[checkpointDirBase.size() - 1] != '/') -- 2.30.2