OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | Protected Types | Protected Attributes | List of all members
InfoCommand Class Reference

#include <InfoCommand.hh>

Inheritance diagram for InfoCommand:
Inheritance graph
Collaboration diagram for InfoCommand:
Collaboration graph

Public Member Functions

 InfoCommand (bool isCompiledSimulation=false)
 
virtual ~InfoCommand ()
 
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)
 

Protected Types

typedef std::map< std::string, SimControlLanguageSubCommand * > SubCommandMap
 container type for subcommands indexed by name
 

Protected Attributes

SubCommandMap subCommands_
 storage for subcommands
 
bool isCompiledSimulation_
 Is it a compiled simulation?
 

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 "info" command of the Simulator Control Language.

Definition at line 48 of file InfoCommand.hh.

Member Typedef Documentation

◆ SubCommandMap

typedef std::map<std::string, SimControlLanguageSubCommand*> InfoCommand::SubCommandMap
protected

container type for subcommands indexed by name

Definition at line 57 of file InfoCommand.hh.

Constructor & Destructor Documentation

◆ InfoCommand()

InfoCommand::InfoCommand ( bool  isCompiledSimulation = false)

Constructor.

Sets the name of the command to the base class.

Definition at line 1415 of file InfoCommand.cc.

1415 :
1417 isCompiledSimulation_(isCompiledSimulation) {
1418
1419 if (!isCompiledSimulation_) {
1420 subCommands_["breakpoints"] = new InfoBreakpointsCommand(*this);
1421 subCommands_["busses"] = new InfoBussesCommand(*this);
1422 subCommands_["segments"] = new InfoSegmentsCommand(*this);
1423 }
1424
1425 subCommands_["stats"] = new InfoStatsCommand(*this);
1426 subCommands_["registers"] = new InfoRegistersCommand(*this);
1427 subCommands_["proc"] = new InfoProcCommand(*this);
1428 subCommands_["program"] = new InfoProgramCommand(*this);
1429 subCommands_["watches"] = new InfoBreakpointsCommand(*this);
1430 subCommands_["regfiles"] = new InfoRegFilesCommand(*this);
1431 subCommands_["iunits"] = new InfoIunitsCommand(*this);
1432 subCommands_["funits"] = new InfoFunitsCommand(*this);
1433 subCommands_["ports"] = new InfoPortsCommand(*this);
1434 subCommands_["immediates"] = new InfoImmediatesCommand(*this);
1435}
bool isCompiledSimulation_
Is it a compiled simulation?
SubCommandMap subCommands_
storage for subcommands

References isCompiledSimulation_, and subCommands_.

◆ ~InfoCommand()

InfoCommand::~InfoCommand ( )
virtual

Destructor.

Definition at line 1440 of file InfoCommand.cc.

1440 {
1442}
static void deleteAllValues(MapType &aMap)

References MapTools::deleteAllValues(), and subCommands_.

Here is the call graph for this function:

Member Function Documentation

◆ execute()

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

Executes the "info" command.

Provides various information of the simulation.

Parameters
argumentsSubcommand and possible arguments to the subcommand.
Returns
Always true if arguments are valid.

Implements CustomCommand.

Definition at line 1453 of file InfoCommand.cc.

1453 {
1454 assert(interpreter() != NULL);
1455
1456 // "info" as such does not do anything, a subcommand is required.
1457 if (!checkArgumentCount(arguments.size() - 1, 1, INT_MAX)) {
1458 return false;
1459 }
1460
1461 SubCommandMap::iterator subCommandPosition =
1462 subCommands_.find(
1463 StringTools::stringToLower(arguments.at(1).stringValue()));
1464 if (subCommandPosition == subCommands_.end()) {
1468 return false;
1469 }
1470
1471 assert((*subCommandPosition).second != NULL);
1472 SimControlLanguageSubCommand& subCommand = *((*subCommandPosition).second);
1473
1474 return subCommand.execute(arguments);
1475}
#define assert(condition)
bool checkArgumentCount(int argumentCount, int minimum, int maximum)
ScriptInterpreter * interpreter() const
virtual void setError(bool state)
virtual bool execute(const std::vector< DataObject > &arguments)=0
static SimulatorTextGenerator & textGenerator()
static std::string stringToLower(const std::string &source)
@ TXT_UNKNOWN_SUBCOMMAND

References assert, CustomCommand::checkArgumentCount(), SimControlLanguageSubCommand::execute(), CustomCommand::interpreter(), ScriptInterpreter::setError(), StringTools::stringToLower(), subCommands_, SimulatorToolbox::textGenerator(), and Texts::TXT_UNKNOWN_SUBCOMMAND.

Here is the call graph for this function:

◆ helpText()

std::string InfoCommand::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 1485 of file InfoCommand.cc.

1485 {
1488}
virtual boost::format text(int textId)
@ TXT_INTERP_HELP_INFO
Help text for command "info" of the CLI.

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

Here is the call graph for this function:

Member Data Documentation

◆ isCompiledSimulation_

bool InfoCommand::isCompiledSimulation_
protected

Is it a compiled simulation?

Definition at line 62 of file InfoCommand.hh.

Referenced by InfoCommand().

◆ subCommands_

SubCommandMap InfoCommand::subCommands_
protected

storage for subcommands

Definition at line 59 of file InfoCommand.hh.

Referenced by execute(), InfoCommand(), and ~InfoCommand().


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