Go to the documentation of this file.
68 const std::string& name) :
288 for (
unsigned int i = 0;
310 <<
"Stopped because of an unknown reason." << std::endl;
330 double minutes = 0.0;
331 double seconds = modf(time / 60.0 , &minutes) * 60.0;
332 double frequency = (
static_cast<double>(cycleCount) / time) / 1000000;
336 << minutes <<
" min "
338 << frequency <<
" MHz" << std::endl;
379 const std::string& expression) {
381 const std::string errorMessage =
"Illegal argument.";
384 if (expr.size() == 0) {
392 const std::string address = expression;
409 startAddress().location();
415 std::string(
"_") + address).
416 startAddress().location();
424 __FILE__, __LINE__,
__func__, errorMessage);
440 if (theAddress > programLastAddress) {
441 theAddress = programLastAddress;
442 }
else if (theAddress < programFirstAddress) {
443 theAddress = programFirstAddress;
472 const std::string& expression) {
474 const std::string errorMessage =
"Illegal argument.";
479 const std::string addressString = expression;
496 __FILE__, __LINE__,
__func__, errorMessage);
515 std::string conditionScript =
522 conditionScript =
"1";
532 target = testCondition;
553 std::string expressionScript =
573 target = testExpression;
594 const std::vector<DataObject>& arguments,
Breakpoint& target) {
601 size_t conditionArgumentCount = 0;
602 for (
size_t i = 0; i < arguments.size(); ++i) {
606 if (i != arguments.size() - 1) {
612 conditionArgumentCount = 1;
617 if (conditionArgumentCount > 0) {
623 if (condition.
script().at(0) ==
"1") {
630 const int argumentsBeforeCondition =
631 arguments.size() - 1 - conditionArgumentCount;
635 if (argumentsBeforeCondition == 0 || argumentsBeforeCondition == 1) {
637 const std::string argument =
638 ((argumentsBeforeCondition == 0)?
639 (
""):(arguments[1].stringValue()));
679 unsigned int breakpointHandle) {
688 << breakpointHandle <<
": " << stopPoint.
description()
713 const std::vector<DataObject>& arguments,
714 std::size_t startIndex) {
717 for (
size_t i = startIndex; i < arguments.size(); ++i) {
721 const unsigned int breakpointHandle = arguments[i].integerValue();
754 const std::string& addressString,
755 std::string& addressSpaceName,
756 std::size_t& memoryAddress) {
761 if (&parsedAddress.
space() !=
763 addressSpaceName = parsedAddress.
space().
name();
765 memoryAddress = parsedAddress.
location();
782 const std::string& addressSpaceName) {
793 if (addressSpaceName ==
"") {
826 parentCommand_(parentCommand) {
virtual ~SimControlLanguageSubCommand()
static NullAddressSpace & instance()
virtual DataObject execute()
virtual SimControlLanguageCommand & parent()
@ TXT_BREAKPOINT_NOT_FOUND
const CodeLabel & codeLabel(const std::string &name) const
UInt32 InstructionAddress
virtual void setAddress(InstructionAddress newAddress)
SimControlLanguageSubCommand(SimControlLanguageCommand &parentCommand)
virtual std::ostream & outputStream()
bool checkSimulationStopped()
bool checkSimulationNotAlreadyRunning()
virtual TCEString name() const
const TTAProgram::Program & program() const
Procedure & firstProcedure() const
@ TXT_STOPREASON_BREAKPOINT
Stop reason: breakpoint.
@ SRE_USER_REQUESTED
User requested the simulation to stop explicitly, e.g., by pressing ctrl-c in the CLI.
@ TXT_STOPREASON_DELETED_BREAKPOINT
Stop reason: temporary breakpoint.
@ SRE_AFTER_TIMEOUT
Stopped after simulation timeout instruction.
bool setMemoryPointer(MemorySystem::MemoryPtr &memory, const std::string &addressSpaceName)
TTAProgram::Address parseDataAddressExpression(const std::string &expression)
virtual void printNextInstruction()
@ TXT_ADDRESS_SPACE_NOT_FOUND
bool checkPositiveIntegerArgument(const DataObject &argument)
const TTAMachine::AddressSpace & space() const
bool checkProgramLoaded()
SimulatorFrontend & simulatorFrontend()
virtual Address startAddress() const
virtual boost::format text(int textId)
virtual Address address() const
@ TXT_STOPREASON_USERREQUEST
Stop reason: user requested.
unsigned int stopReasonCount() const
virtual void printStopReasons()
@ TXT_INTERP_ENTER_CONDITION_PROMPT
bool setMemoryAddress(const std::string &addressString, std::string &addressSpaceName, std::size_t &memoryAddress)
boost::shared_ptr< Memory > MemoryPtr
bool verifyBreakpointHandles(const std::vector< DataObject > &arguments, std::size_t startIndex=1)
void setErrorMessage(const TCEString &errorMsg)
const GlobalScope & globalScopeConst() const
#define assert(condition)
InstructionAddress programCounter() const
bool checkSimulationEnded()
virtual void printStopInformation()
SimControlLanguageCommand(const std::string &name)
unsigned int stopCausingStopPoint(unsigned int index) const
@ TXT_STOPREASON_RUNTIME_ERROR
Stop reason: user requested.
const int BPINFO_HANDLE_COL_WIDTH
widths of the columns of the break point info table widths don't include the spaces between columns t...
virtual ~SimControlLanguageCommand()
@ TXT_INTERP_SIMULATION_NOT_RUNNING
Text to be printed when simulation is not running and it should be.
const StopPoint & stopPointWithHandleConst(unsigned int handle) const
@ TXT_INTERP_ENTER_EXPRESSION_PROMPT
SimControlLanguageCommand & parentCommand_
the main command
InstructionAddress parseInstructionAddressExpression(const std::string &expression)
bool askConditionFromUser(TclConditionScript &target)
@ TXT_STOPREASON_STEPPING
Stop reason: stepping.
@ TXT_INTERP_SIMULATION_NOT_INITIALIZED
Text to be printed when simulation is not initialized and it should be.
@ TXT_STOPREASON_UNTIL
Stop reason: until.
unsigned int stopCausingStopPointCount() const
@ TXT_INTERP_SIMULATION_NOT_ENDED
Text to be printed when simulation has not ended and it should be.
InstructionAddress location() const
@ SRE_RUNTIME_ERROR
A fatal runtime error occured in the simulated program.
@ SRE_BREAKPOINT
Stopped because of at least one breakpoint.
bool checkSimulationInitialized()
@ SRE_AFTER_UNTIL
Stopped after running to the wanted.
virtual Address address() const
bool checkMachineLoaded()
virtual std::vector< std::string > script() const
virtual std::ostream & outputStream()
ScriptInterpreter * interpreter() const
@ TXT_NO_ADDRESS_SPACE_GIVEN
virtual void setResult(DataObject *result)
static unsigned int toUnsignedInt(const T &source)
@ TXT_INTERP_SIMULATION_ALREDY_RUNNING
Text to be printed when simulation is already running and it should not be.
bool parseBreakpoint(const std::vector< DataObject > &arguments, Breakpoint &target)
MemorySystem & memorySystem(int coreId=-1)
@ SRE_AFTER_STEPPING
Stopped after stepping the given count.
CycleCount lastRunCycleCount() const
MemoryPtr memory(const TTAMachine::AddressSpace &as)
const DataLabel & dataLabel(const std::string &name) const
StopReason stopReason(unsigned int index) const
double lastRunTime() const
virtual Address endAddress() const
CycleCount ClockCycleCount
Alias for ClockCycleCount.
std::string programLocationDescription() const
virtual void removeCondition()
virtual void setError(bool state)
@ TXT_STOPREASON_TIMEOUT
Stop reason: timeout
virtual std::string description() const =0
Procedure & lastProcedure() const
virtual void setString(std::string value)
SimulatorFrontend & simulatorFrontend()
Procedure & procedure(int index) const
virtual LineReader * lineReader() const
virtual InterpreterContext & context() const =0
virtual void setCondition(const ConditionScript &condition)
StopPointManager & stopPointManager()
virtual bool printBreakpointInfo(unsigned int breakpointHandle)
bool askExpressionFromUser(ExpressionScript &target)
virtual void printSimulationTime()