OpenASIP  2.0
Public Member Functions | List of all members
NextiCommand Class Reference

#include <NextiCommand.hh>

Inheritance diagram for NextiCommand:
Inheritance graph
Collaboration diagram for NextiCommand:
Collaboration graph

Public Member Functions

 NextiCommand ()
 
virtual ~NextiCommand ()
 
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 "nexti" command of the Simulator Control Language.

Definition at line 47 of file NextiCommand.hh.

Constructor & Destructor Documentation

◆ NextiCommand()

NextiCommand::NextiCommand ( )

Constructor.

Sets the name of the command to the base class.

Definition at line 55 of file NextiCommand.cc.

55  :
56  SimControlLanguageCommand("nexti") {
57 }

◆ ~NextiCommand()

NextiCommand::~NextiCommand ( )
virtual

Destructor.

Does nothing.

Definition at line 64 of file NextiCommand.cc.

64  {
65 }

Member Function Documentation

◆ execute()

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

Executes the "nexti" command.

Advances simulation to the next machine instructions in current procedure. If the instruction contains a function call, simulation proceeds until control returns from it, to the instruction past the function call. The count argument gives the number of machine instruction to simulate.

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 81 of file NextiCommand.cc.

81  {
82  boost::timer time;
83 
84  const int argumentCount = arguments.size() - 1;
85  if (!checkArgumentCount(argumentCount, 0, 1)) {
86  return false;
87  }
88 
90  return false;
91  }
92 
93  unsigned int stepCount = 1;
94  if (argumentCount == 1) {
95  if (!checkPositiveIntegerArgument(arguments[1])) {
96  return false;
97  }
98  stepCount = arguments[1].integerValue();
99  }
100 
101  simulatorFrontend().next(stepCount);
102 
104  return true;
105 }

References CustomCommand::checkArgumentCount(), CustomCommand::checkPositiveIntegerArgument(), SimControlLanguageCommand::checkSimulationInitialized(), SimControlLanguageCommand::checkSimulationStopped(), SimulatorFrontend::next(), SimControlLanguageCommand::printNextInstruction(), and SimControlLanguageCommand::simulatorFrontend().

Here is the call graph for this function:

◆ helpText()

std::string NextiCommand::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 115 of file NextiCommand.cc.

115  {
118 }

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

Here is the call graph for this function:

The documentation for this class was generated from the following files:
CustomCommand::checkArgumentCount
bool checkArgumentCount(int argumentCount, int minimum, int maximum)
Definition: CustomCommand.cc:82
SimControlLanguageCommand::checkSimulationStopped
bool checkSimulationStopped()
Definition: SimControlLanguageCommand.cc:135
SimControlLanguageCommand::printNextInstruction
virtual void printNextInstruction()
Definition: SimControlLanguageCommand.cc:228
SimulatorFrontend::next
virtual void next(int count=1)
Definition: SimulatorFrontend.cc:1052
CustomCommand::checkPositiveIntegerArgument
bool checkPositiveIntegerArgument(const DataObject &argument)
Definition: CustomCommand.cc:134
Texts::TextGenerator::text
virtual boost::format text(int textId)
Definition: TextGenerator.cc:94
SimControlLanguageCommand::SimControlLanguageCommand
SimControlLanguageCommand(const std::string &name)
Definition: SimControlLanguageCommand.cc:67
SimulatorToolbox::textGenerator
static SimulatorTextGenerator & textGenerator()
Definition: SimulatorToolbox.cc:75
Texts::TXT_INTERP_HELP_NEXTI
@ TXT_INTERP_HELP_NEXTI
Help text for command "nexti" of the CLI.
Definition: SimulatorTextGenerator.hh:101
SimControlLanguageCommand::checkSimulationInitialized
bool checkSimulationInitialized()
Definition: SimControlLanguageCommand.cc:88
SimControlLanguageCommand::simulatorFrontend
SimulatorFrontend & simulatorFrontend()
Definition: SimControlLanguageCommand.cc:214