Fixed problem in DeviceSettings::strParam, returned wrong string
[avr-sim.git] / src / Analyzer.h
blob78bbf9f893d53c8281eb1d26934beb95aa633072
1 #ifndef AVR_ANALYZER_H
2 #define AVR_ANALYZER_H
4 #include "Types.h"
6 namespace avr {
8 class Core;
10 /**
11 * @author Tom Haber
12 * @date May 17, 2008
13 * @brief Abstraction for analyzers
15 * Analyzers can be inserted into the core and all
16 * changes in the state of the core are reported to it.
18 class Analyzer {
19 public:
20 Analyzer(Core *core) : core(core) {}
21 virtual ~Analyzer() {}
23 public:
24 virtual void reset(unsigned int /*type*/) {}
25 virtual void trace(dword /*address*/) {}
26 virtual void step(lword /*ticks*/) {}
28 public:
29 virtual void readRegister(unsigned int /*r*/, byte /*val*/) {}
30 virtual void writeRegister(unsigned int /*r*/, byte /*val*/) {}
31 virtual void readByte(unsigned int /*addr*/, byte /*val*/) {}
32 virtual void writeByte(unsigned int /*addr*/, byte /*val*/) {}
33 virtual void readFlash(unsigned int /*addr*/, byte /*val*/) {}
34 virtual void writeFlash(unsigned int /*addr*/, word /*data*/) {}
35 virtual void fetchOperand(word /*val*/) {}
37 public:
38 virtual void push(byte /*val*/) {}
39 virtual void pop(byte /*val*/) {}
40 virtual void jump(dword /*address*/, bool /*push*/) {}
41 virtual void skip() {}
42 virtual void call(dword /*address*/, bool /*push*/) {}
43 virtual void ret(bool /*interrupt*/) {}
45 public:
46 virtual void sleep(unsigned int /*mode*/) {}
47 virtual void systemBreak() {}
48 virtual void interrupt(unsigned int /*vector*/, unsigned int /*addr*/) {}
50 protected:
51 Core *core;
54 class ScriptEngine;
56 /**
57 * @author Tom Haber
58 * @date May 23, 2008
59 * @brief Factory for analyzers
61 * A factory for creating analyzers based on their name.
63 class AnalyzerFactory {
64 public:
65 /**
66 * Build a new analyzer with name \e name
68 static Analyzer *newAnalyzer(Core *core, const char *name);
70 #ifdef ENABLE_SCRIPTING
71 public:
72 /**
73 * Set the scriptengine to use when creating scripting analysers
75 static void setScriptEngine(ScriptEngine *vm);
77 private:
78 static ScriptEngine *vm;
79 #endif
84 #endif /*AVR_ANALYZER_H*/