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) {
#define assert(condition)
UInt32 InstructionAddress
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...
CycleCount ClockCycleCount
Alias for ClockCycleCount.
@ SRE_AFTER_TIMEOUT
Stopped after simulation timeout instruction.
@ SRE_BREAKPOINT
Stopped because of at least one breakpoint.
@ SRE_USER_REQUESTED
User requested the simulation to stop explicitly, e.g., by pressing ctrl-c in the CLI.
@ SRE_AFTER_UNTIL
Stopped after running to the wanted.
@ SRE_AFTER_STEPPING
Stopped after stepping the given count.
@ SRE_RUNTIME_ERROR
A fatal runtime error occured in the simulated program.
virtual void setAddress(InstructionAddress newAddress)
static unsigned int toUnsignedInt(const T &source)
ScriptInterpreter * interpreter() const
bool checkPositiveIntegerArgument(const DataObject &argument)
virtual void setString(std::string value)
virtual std::ostream & outputStream()
MemoryPtr memory(const TTAMachine::AddressSpace &as)
boost::shared_ptr< Memory > MemoryPtr
virtual InterpreterContext & context() const =0
virtual LineReader * lineReader() const
virtual void setError(bool state)
virtual void setResult(DataObject *result)
virtual DataObject execute()
bool checkSimulationInitialized()
virtual void printStopInformation()
SimulatorFrontend & simulatorFrontend()
bool verifyBreakpointHandles(const std::vector< DataObject > &arguments, std::size_t startIndex=1)
bool checkProgramLoaded()
bool checkSimulationEnded()
bool checkMachineLoaded()
virtual bool printBreakpointInfo(unsigned int breakpointHandle)
virtual void printSimulationTime()
SimControlLanguageCommand(const std::string &name)
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 checkSimulationNotAlreadyRunning()
bool askExpressionFromUser(ExpressionScript &target)
virtual ~SimControlLanguageCommand()
TTAProgram::Address parseDataAddressExpression(const std::string &expression)
bool askConditionFromUser(TclConditionScript &target)
virtual void printNextInstruction()
bool setMemoryAddress(const std::string &addressString, std::string &addressSpaceName, std::size_t &memoryAddress)
bool checkSimulationStopped()
virtual std::ostream & outputStream()
virtual void printStopReasons()
SimControlLanguageCommand & parentCommand_
the main command
SimControlLanguageSubCommand(SimControlLanguageCommand &parentCommand)
virtual SimControlLanguageCommand & parent()
virtual ~SimControlLanguageSubCommand()
double lastRunTime() const
unsigned int stopReasonCount() const
StopReason stopReason(unsigned int index) const
const TTAProgram::Program & program() const
StopPointManager & stopPointManager()
CycleCount lastRunCycleCount() const
std::string programLocationDescription() const
MemorySystem & memorySystem(int coreId=-1)
InstructionAddress programCounter() const
SimulatorFrontend & simulatorFrontend()
unsigned int stopCausingStopPointCount() const
unsigned int stopCausingStopPoint(unsigned int index) const
const StopPoint & stopPointWithHandleConst(unsigned int handle) const
virtual void removeCondition()
virtual std::string description() const =0
virtual void setCondition(const ConditionScript &condition)
virtual TCEString name() const
static NullAddressSpace & instance()
const TTAMachine::AddressSpace & space() const
InstructionAddress location() const
virtual Address address() const
virtual Address endAddress() const
virtual Address startAddress() const
virtual Address address() const
Procedure & procedure(int index) const
const GlobalScope & globalScopeConst() const
Procedure & lastProcedure() const
Procedure & firstProcedure() const
const CodeLabel & codeLabel(const std::string &name) const
const DataLabel & dataLabel(const std::string &name) const
virtual std::vector< std::string > script() const
virtual boost::format text(int textId)
@ TXT_NO_ADDRESS_SPACE_GIVEN
@ TXT_STOPREASON_TIMEOUT
Stop reason: timeout
@ TXT_INTERP_SIMULATION_NOT_INITIALIZED
Text to be printed when simulation is not initialized and it should be.
@ TXT_STOPREASON_STEPPING
Stop reason: stepping.
@ TXT_STOPREASON_USERREQUEST
Stop reason: user requested.
@ TXT_ADDRESS_SPACE_NOT_FOUND
@ TXT_INTERP_ENTER_CONDITION_PROMPT
@ TXT_INTERP_ENTER_EXPRESSION_PROMPT
@ TXT_STOPREASON_RUNTIME_ERROR
Stop reason: user requested.
@ TXT_STOPREASON_DELETED_BREAKPOINT
Stop reason: temporary breakpoint.
@ TXT_INTERP_SIMULATION_NOT_ENDED
Text to be printed when simulation has not ended and it should be.
@ TXT_INTERP_SIMULATION_NOT_RUNNING
Text to be printed when simulation is not running and it should be.
@ TXT_BREAKPOINT_NOT_FOUND
@ TXT_STOPREASON_UNTIL
Stop reason: until.
@ TXT_INTERP_SIMULATION_ALREDY_RUNNING
Text to be printed when simulation is already running and it should not be.
@ TXT_STOPREASON_BREAKPOINT
Stop reason: breakpoint.