提交 538f8e5d 编写于 作者: A Allen

Merge branch 'master' of github.com:RISCVERS/XiangShan

......@@ -36,7 +36,7 @@ jobs:
t=${test%.c}
echo $t
make -C $CPU_TEST_DIR ALL=$t ARCH=riscv64-noop AM_HOME=$AM_HOME NEMU_HOME=$NEMU_HOME NOOP_HOME=$NOOP_HOME run 2>/dev/null | grep "HIT GOOD TRAP"
if [[ $? == 1 ]];
if [[ $? != 0 ]];
then
echo $t fail
ret=1
......
......@@ -7,8 +7,8 @@ do
t=${test%.c}
echo -n -e "\x1b[0m $t: "
make -C $TEST_HOME ARCH=riscv64-noop E=0 ALL=$t run 2>/dev/null | grep -E "HIT GOOD TRAP|IPC"
if [[ $? == 1 ]];
if [[ $? != 0 ]];
then
echo -e "\x1b[31mfail"
echo -e "\x1b[31mfail: trap code $?"
fi
done
......@@ -40,9 +40,9 @@ class Emulator {
enum {
STATE_GOODTRAP = 0,
STATE_BADTRAP,
STATE_ABORT,
STATE_LIMIT_EXCEEDED,
STATE_BADTRAP = 1,
STATE_ABORT = 2,
STATE_LIMIT_EXCEEDED = 3,
STATE_RUNNING = -1
};
......@@ -74,4 +74,5 @@ public:
uint64_t get_cycles() const { return cycles; }
EmuArgs get_args() const { return args; }
bool is_good_trap() { return trapCode == STATE_GOODTRAP; };
int get_trapcode() { return trapCode; }
};
......@@ -21,6 +21,7 @@ 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);
......@@ -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);
eprintf(ANSI_COLOR_BLUE "Host time spent: %dms\n" ANSI_COLOR_RESET, ms);
return !is_good_trap;
// return !is_good_trap;
return trapcode;
}
......@@ -4,6 +4,7 @@
#include "common.h"
#define EMU_RAM_SIZE (256 * 1024 * 1024UL)
// #define EMU_RAM_SIZE (8 * 1024 * 1024 * 1024UL)
void init_ram(const char *img);
void ram_finish();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册