OpenASIP  2.0
CompiledSimSettingCommand.cc
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2009 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file CompiledSimSettingCommand.cc
26  *
27  * Definition of CompiledSimSettingCommand class.
28  *
29  * @author Viljami Korhonen 2008 (viljami.korhonen-no.spam-tut.fi)
30  * @note rating: red
31  */
32 
34 #include "MapTools.hh"
35 
36 /**
37  * Setting action that sets the FU resource conflict detection.
38  */
40 public:
41 
42  /**
43  * Sets the FU resource conflict detection.
44  *
45  * @param simFront SimulatorFrontend to set the detection for.
46  * @param newValue Value to set.
47  * @return True if setting was successful.
48  */
49  static bool execute(
50  SimulatorInterpreter&, SimulatorFrontend& simFront, bool newValue) {
51  simFront.setFUResourceConflictDetection(newValue);
52  return true;
53  }
54 
55  /**
56  * Returns the default value of this setting.
57  *
58  * @return The default value.
59  */
60  static const DataObject& defaultValue() {
61  static const DataObject defaultValue_("0");
62  return defaultValue_;
63  }
64 
65  /**
66  * Should the action warn if program & machine exist and value was changed
67  *
68  * @return boolean value on whether or not to warn
69  */
71  return false;
72  }
73 };
74 
75 
76 /**
77  * Default constructor
78  */
80  SettingCommand() {
81 
82  // Remove unsupported settings
83  MapTools::deleteByKey(settings_, "rf_tracking");
84  MapTools::deleteByKey(settings_, "bus_trace");
85  MapTools::deleteByKey(settings_, "profile_data_saving");
86  MapTools::deleteByKey(settings_, "utilization_data_saving");
87 
88  // Replace FU conflict detection setting
89  MapTools::deleteByKey(settings_, "fu_conflict_detection");
90  settings_["fu_conflict_detection"] =
91  new TemplatedSimulatorSetting<
92  BooleanSetting, CompiledSimSetFUConflictDetection>(
95 }
96 
97 /**
98  * Default destructor
99  */
101 }
SettingCommand
Definition: SettingCommand.hh:51
DataObject
Definition: DataObject.hh:50
MapTools.hh
Texts::TextGenerator::text
virtual boost::format text(int textId)
Definition: TextGenerator.cc:94
MapTools::deleteByKey
static void deleteByKey(MapType &aMap, const KeyType &aKey)
CompiledSimSetFUConflictDetection::warnOnExistingProgramAndMachine
static bool warnOnExistingProgramAndMachine()
Definition: CompiledSimSettingCommand.cc:70
SettingCommand::settings_
SettingMap settings_
storage for simulator settings
Definition: SettingCommand.hh:80
SimulatorInterpreter
Definition: SimulatorInterpreter.hh:49
SimulatorToolbox::textGenerator
static SimulatorTextGenerator & textGenerator()
Definition: SimulatorToolbox.cc:75
CompiledSimSettingCommand::CompiledSimSettingCommand
CompiledSimSettingCommand()
Definition: CompiledSimSettingCommand.cc:79
CompiledSimSetFUConflictDetection::defaultValue
static const DataObject & defaultValue()
Definition: CompiledSimSettingCommand.cc:60
SimulatorFrontend::setFUResourceConflictDetection
void setFUResourceConflictDetection(bool value)
Definition: SimulatorFrontend.cc:2022
CompiledSimSetFUConflictDetection::execute
static bool execute(SimulatorInterpreter &, SimulatorFrontend &simFront, bool newValue)
Definition: CompiledSimSettingCommand.cc:49
CompiledSimSettingCommand.hh
SimulatorFrontend
Definition: SimulatorFrontend.hh:89
Texts::TXT_INTERP_SETTING_FU_CONFLICT_DETECTION
@ TXT_INTERP_SETTING_FU_CONFLICT_DETECTION
Definition: SimulatorTextGenerator.hh:151
CompiledSimSetFUConflictDetection
Definition: CompiledSimSettingCommand.cc:39
CompiledSimSettingCommand::~CompiledSimSettingCommand
virtual ~CompiledSimSettingCommand()
Definition: CompiledSimSettingCommand.cc:100