未验证 提交 8189324d 编写于 作者: Y Yinan Xu 提交者: GitHub

emu: return 0 when trapCode is STATE_LIMIT_EXCEEDED (#633)

上级 f3f22d72
......@@ -98,7 +98,9 @@ public:
uint64_t execute(uint64_t max_cycle, uint64_t max_instr);
uint64_t get_cycles() const { return cycles; }
EmuArgs get_args() const { return args; }
bool is_good_trap() { return trapCode == STATE_GOODTRAP; };
bool is_good_trap() {
return trapCode == STATE_GOODTRAP || trapCode == STATE_LIMIT_EXCEEDED;
};
int get_trapcode() { return trapCode; }
};
......
......@@ -30,7 +30,6 @@ int main(int argc, const char** argv) {
auto args = emu->get_args();
uint64_t cycles = emu->execute(args.max_cycles, args.max_instr);
bool is_good_trap = emu->is_good_trap();
int trapcode = emu->get_trapcode();
delete emu;
extern uint32_t uptime(void);
......@@ -40,6 +39,5 @@ 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);
eprintf(ANSI_COLOR_BLUE "Host time spent: %'dms\n" ANSI_COLOR_RESET, ms);
// return !is_good_trap;
return trapcode;
return !is_good_trap;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册