OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | List of all members
UntilCommand Class Reference

#include <UntilCommand.hh>

Inheritance diagram for UntilCommand:
Inheritance graph
Collaboration diagram for UntilCommand:
Collaboration graph

Public Member Functions

 UntilCommand ()
 
virtual ~UntilCommand ()
 
virtual bool execute (const std::vector< DataObject > &arguments)
 
virtual std::string helpText () const
 
- Public Member Functions inherited from SimControlLanguageCommand
 SimControlLanguageCommand (const std::string &name)
 
virtual ~SimControlLanguageCommand ()
 
SimulatorFrontendsimulatorFrontend ()
 
const SimulatorFrontendsimulatorFrontendConst ()
 
virtual void printNextInstruction ()
 
virtual void printStopInformation ()
 
virtual void printStopReasons ()
 
virtual bool printBreakpointInfo (unsigned int breakpointHandle)
 
virtual void printSimulationTime ()
 
virtual std::ostream & outputStream ()
 
bool checkSimulationInitialized ()
 
bool checkSimulationNotAlreadyRunning ()
 
bool checkSimulationStopped ()
 
bool checkSimulationEnded ()
 
bool checkProgramLoaded ()
 
bool checkMachineLoaded ()
 
InstructionAddress parseInstructionAddressExpression (const std::string &expression)
 
TTAProgram::Address parseDataAddressExpression (const std::string &expression)
 
bool parseBreakpoint (const std::vector< DataObject > &arguments, Breakpoint &target)
 
bool askConditionFromUser (TclConditionScript &target)
 
bool askExpressionFromUser (ExpressionScript &target)
 
bool verifyBreakpointHandles (const std::vector< DataObject > &arguments, std::size_t startIndex=1)
 
void setErrorMessage (const TCEString &errorMsg)
 
- Public Member Functions inherited from CustomCommand
 CustomCommand (std::string name)
 
 CustomCommand (const CustomCommand &cmd)
 
virtual ~CustomCommand ()
 
std::string name () const
 
void setContext (InterpreterContext *context)
 
InterpreterContextcontext () const
 
void setInterpreter (ScriptInterpreter *si)
 
ScriptInterpreterinterpreter () const
 
bool checkArgumentCount (int argumentCount, int minimum, int maximum)
 
bool checkIntegerArgument (const DataObject &argument)
 
bool checkPositiveIntegerArgument (const DataObject &argument)
 
bool checkUnsignedIntegerArgument (const DataObject &argument)
 
bool checkDoubleArgument (const DataObject &argument)
 

Additional Inherited Members

- Protected Member Functions inherited from SimControlLanguageCommand
bool setMemoryAddress (const std::string &addressString, std::string &addressSpaceName, std::size_t &memoryAddress)
 
bool setMemoryPointer (MemorySystem::MemoryPtr &memory, const std::string &addressSpaceName)
 

Detailed Description

Implementation of the "until" command of the Simulator Control Language.

Definition at line 47 of file UntilCommand.hh.

Constructor & Destructor Documentation

◆ UntilCommand()

UntilCommand::UntilCommand ( )

Constructor.

Sets the name of the command to the base class.

Definition at line 52 of file UntilCommand.cc.

◆ ~UntilCommand()

UntilCommand::~UntilCommand ( )
virtual

Destructor.

Does nothing.

Definition at line 60 of file UntilCommand.cc.

60 {
61}

Member Function Documentation

◆ execute()

bool UntilCommand::execute ( const std::vector< DataObject > &  arguments)
virtual

Executes the "until" command.

Run until the program location specified by arg is reached and stop before executing the instruction at specified address. Any valid argument that applies to command break is also a valid argument for until.

Parameters
argumentsThe count of steps (default is one step).
Returns
True in case simulation is initialized and arguments are ok.
Exceptions
NumberFormatExceptionIs never thrown by this command.

Implements CustomCommand.

Definition at line 75 of file UntilCommand.cc.

75 {
76 const int argumentCount = arguments.size() - 1;
77 if (!checkArgumentCount(argumentCount, 0, 1)) {
78 return false;
79 }
80
82 return false;
83 }
84
85 try {
86 const std::string argument =
87 ((argumentCount == 1)?(arguments[1].stringValue()):(""));
88
89 const int instructionAddress =
91 simulatorFrontend().runUntil(instructionAddress);
94 } catch (const IllegalParameters&) {
95 return false;
96 }
97 return true;
98}
bool checkArgumentCount(int argumentCount, int minimum, int maximum)
InstructionAddress parseInstructionAddressExpression(const std::string &expression)
virtual void runUntil(UIntWord address)

References CustomCommand::checkArgumentCount(), SimControlLanguageCommand::checkSimulationInitialized(), SimControlLanguageCommand::checkSimulationStopped(), SimControlLanguageCommand::parseInstructionAddressExpression(), SimControlLanguageCommand::printNextInstruction(), SimControlLanguageCommand::printSimulationTime(), SimulatorFrontend::runUntil(), and SimControlLanguageCommand::simulatorFrontend().

Here is the call graph for this function:

◆ helpText()

std::string UntilCommand::helpText ( ) const
virtual

Returns the help text for this command.

Help text is searched from SimulatorTextGenerator.

Returns
The help text.

Implements CustomCommand.

Definition at line 108 of file UntilCommand.cc.

108 {
111}
static SimulatorTextGenerator & textGenerator()
virtual boost::format text(int textId)
@ TXT_INTERP_HELP_UNTIL
Help text for command "stepi" of the CLI.

References Texts::TextGenerator::text(), SimulatorToolbox::textGenerator(), and Texts::TXT_INTERP_HELP_UNTIL.

Here is the call graph for this function:

The documentation for this class was generated from the following files: