KoMo2  1.0.0
A modern ARM emulator GUI.
jimulatorInterface.h
Go to the documentation of this file.
1 
11 #include <array>
12 #include <string>
13 
18 enum class ClientState : unsigned char {
19  NORMAL = 0X00,
20  BUSY = 0X01,
21  BREAKPOINT = 0X41,
22  MEMFAULT = 0X43,
23  FINISHED = 0X44,
24  RUNNING = 0X80,
25  RUNNING_SWI = 0x81,
26  STEPPING = 0X82,
27  BROKEN = 0x30,
28 };
29 
36 inline unsigned char operator|(ClientState l, unsigned char r) {
37  return static_cast<unsigned char>(l) | r;
38 }
39 
43 extern int writeToJimulator;
47 extern int readFromJimulator;
52 extern int communicationFromJimulator[2];
57 extern int communicationToJimulator[2];
62 extern int compilerCommunication[2];
63 
69 namespace Jimulator {
74 class MemoryValues {
75  public:
79  u_int32_t address;
83  std::string hex;
87  std::string disassembly;
91  bool breakpoint = false;
92 };
93 
94 // ! Reading data
95 
96 const ClientState checkBoardState();
97 const std::array<std::string, 16> getJimulatorRegisterValues();
98 std::array<Jimulator::MemoryValues, 13> getJimulatorMemoryValues(
99  const uint32_t s_address_int);
100 const std::string getJimulatorTerminalMessages();
101 
102 // ! Loading data
103 
104 void compileJimulator(const char* const pathToBin,
105  const char* const pathToS,
106  const char* const pathToKMD);
107 const bool loadJimulator(const char* const pathToKMD);
108 
109 // ! Sending commands
110 
111 void startJimulator(const int steps);
112 void continueJimulator();
113 void pauseJimulator();
114 void resetJimulator();
115 const bool sendTerminalInputToJimulator(const unsigned int val);
116 const bool setBreakpoint(const uint32_t address);
117 } // namespace Jimulator
Groups together functions that make up the Jimulator API layer - these functions and classes are used...
Definition: kcmd.h:45
int writeToJimulator
Stores the file descriptor used for writing to Jimulator.
Definition: kcmd.cpp:79
unsigned char operator|(ClientState l, unsigned char r)
Performing an or between a ClientState and an unsigned char.
int readFromJimulator
Stores the file descriptor used for reading from Jimulator.
Definition: kcmd.cpp:80
int communicationToJimulator[2]
The pipe which will be used by KoMo2 to write to Jimulator (i.e. Jimulator will read from it...
Definition: kcmd.cpp:77
void compileJimulator(const char *const pathToBin, const char *const pathToS, const char *const pathToKMD)
Runs pathToS through the associated compiler binary, and outputs a .kmd file at pathToKMD.
int communicationFromJimulator[2]
The pipe which will be used by KoMo2 to read from Jimulator (i.e. Jimulator will write to it...
Definition: kcmd.cpp:76
int compilerCommunication[2]
The pipe that handles communication between the compiler process and KoMo2.
Definition: kcmd.cpp:78