OpenASIP 2.2
Loading...
Searching...
No Matches
SimControlLanguageCommand.hh
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 SimControlLanguageCommand.hh
26 *
27 * Declaration of SimControlLanguageCommand class.
28 *
29 * @author Pekka J��skel�inen 2005 (pjaaskel-no.spam-cs.tut.fi)
30 * @note rating: red
31 */
32
33#ifndef TTA_SIMCONLANG_COMMAND
34#define TTA_SIMCONLANG_COMMAND
35
36#include <string>
37#include <vector>
38#include <iostream>
39
40#include "DataObject.hh"
41#include "CustomCommand.hh"
42#include "Exception.hh"
43#include "SimulatorConstants.hh"
44#include "Address.hh"
45#include "MemorySystem.hh"
46
48class Breakpoint;
51class TCEString;
52
53///////////////////////////////////////////////////////////////////////////////
54// SimControlLanguageCommand
55///////////////////////////////////////////////////////////////////////////////
56
57/**
58 * This is a base class for Simulator Control Language commands.
59 *
60 * Provides services command and useful for all Simulator Control Language
61 * commands.
62 */
64public:
65 SimControlLanguageCommand(const std::string& name);
67
70 virtual void printNextInstruction();
71 virtual void printStopInformation();
72 virtual void printStopReasons();
73 virtual bool printBreakpointInfo(unsigned int breakpointHandle);
74 virtual void printSimulationTime();
75
76 virtual std::ostream& outputStream();
77
82 bool checkProgramLoaded();
83 bool checkMachineLoaded();
84
86 const std::string& expression);
87
89 const std::string& expression);
90
91 bool parseBreakpoint(
92 const std::vector<DataObject>& arguments,
93 Breakpoint& target);
94
97
99 const std::vector<DataObject>& arguments,
100 std::size_t startIndex = 1);
101
102 void setErrorMessage(const TCEString& errorMsg);
103protected:
104 bool setMemoryAddress(
105 const std::string& addressString,
106 std::string& addressSpaceName,
107 std::size_t& memoryAddress);
108 bool setMemoryPointer(
110 const std::string& addressSpaceName);
111
112};
113
114///////////////////////////////////////////////////////////////////////////////
115// SimControlLanguageSubCommand
116///////////////////////////////////////////////////////////////////////////////
117
118/**
119 * Base class for classes that implement subcommands of Simulator Control
120 * Language.
121 */
123public:
126 virtual bool execute(const std::vector<DataObject>& arguments) = 0;
128private:
129 /// the main command
131};
132
133
134#endif
UInt32 InstructionAddress
Definition BaseType.hh:175
std::string name() const
boost::shared_ptr< Memory > MemoryPtr
const SimulatorFrontend & simulatorFrontendConst()
bool verifyBreakpointHandles(const std::vector< DataObject > &arguments, std::size_t startIndex=1)
virtual bool printBreakpointInfo(unsigned int breakpointHandle)
InstructionAddress parseInstructionAddressExpression(const std::string &expression)
bool setMemoryPointer(MemorySystem::MemoryPtr &memory, const std::string &addressSpaceName)
bool parseBreakpoint(const std::vector< DataObject > &arguments, Breakpoint &target)
void setErrorMessage(const TCEString &errorMsg)
bool askExpressionFromUser(ExpressionScript &target)
TTAProgram::Address parseDataAddressExpression(const std::string &expression)
bool askConditionFromUser(TclConditionScript &target)
bool setMemoryAddress(const std::string &addressString, std::string &addressSpaceName, std::size_t &memoryAddress)
virtual std::ostream & outputStream()
virtual bool execute(const std::vector< DataObject > &arguments)=0
SimControlLanguageCommand & parentCommand_
the main command
virtual SimControlLanguageCommand & parent()