提交 67bc70fb 编写于 作者: S SKTT1Ryze

change exit code

上级 4f306d39
...@@ -40,9 +40,9 @@ class Emulator { ...@@ -40,9 +40,9 @@ class Emulator {
enum { enum {
STATE_GOODTRAP = 0, STATE_GOODTRAP = 0,
STATE_BADTRAP, STATE_BADTRAP = 1,
STATE_ABORT, STATE_ABORT = 2,
STATE_LIMIT_EXCEEDED, STATE_LIMIT_EXCEEDED = 3,
STATE_RUNNING = -1 STATE_RUNNING = -1
}; };
...@@ -74,4 +74,5 @@ public: ...@@ -74,4 +74,5 @@ public:
uint64_t get_cycles() const { return cycles; } uint64_t get_cycles() const { return cycles; }
EmuArgs get_args() const { return args; } EmuArgs get_args() const { return args; }
bool is_good_trap() { return trapCode == STATE_GOODTRAP; }; bool is_good_trap() { return trapCode == STATE_GOODTRAP; };
int get_trapcode() { return trapCode; }
}; };
...@@ -21,6 +21,7 @@ int main(int argc, const char** argv) { ...@@ -21,6 +21,7 @@ int main(int argc, const char** argv) {
auto args = emu->get_args(); auto args = emu->get_args();
uint64_t cycles = emu->execute(args.max_cycles, args.max_instr); uint64_t cycles = emu->execute(args.max_cycles, args.max_instr);
bool is_good_trap = emu->is_good_trap(); bool is_good_trap = emu->is_good_trap();
int trapcode = emu->get_trapcode();
delete emu; delete emu;
extern uint32_t uptime(void); extern uint32_t uptime(void);
...@@ -30,5 +31,6 @@ int main(int argc, const char** argv) { ...@@ -30,5 +31,6 @@ int main(int argc, const char** argv) {
" (this will be different from cycleCnt if emu loads a snapshot)\n" ANSI_COLOR_RESET, args.seed, cycles); " (this will be different from cycleCnt if emu loads a snapshot)\n" ANSI_COLOR_RESET, args.seed, cycles);
eprintf(ANSI_COLOR_BLUE "Host time spent: %dms\n" ANSI_COLOR_RESET, ms); eprintf(ANSI_COLOR_BLUE "Host time spent: %dms\n" ANSI_COLOR_RESET, ms);
return !is_good_trap; // return !is_good_trap;
return trapcode;
} }
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
#include "common.h" #include "common.h"
#define EMU_RAM_SIZE (256 * 1024 * 1024UL) // #define EMU_RAM_SIZE (256 * 1024 * 1024UL)
#define EMU_RAM_SIZE (8 * 1024 * 1024 * 1024UL)
void init_ram(const char *img); void init_ram(const char *img);
void ram_finish(); void ram_finish();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册