From 532db85c68d3517ed46f2d9203a3e72db5c8dec3 Mon Sep 17 00:00:00 2001 From: Yunsup Lee Date: Fri, 18 Oct 2013 22:28:58 -0700 Subject: [PATCH] revamp pt tests as well --- env/p/riscv_test.h | 4 ++-- env/pt/riscv_test.h | 54 ++++++++++++++++++--------------------------- env/v/entry.S | 3 ++- env/v/riscv_test.h | 4 ++-- isa/rv64uf/Makefrag | 2 +- isa/rv64ui/Makefrag | 2 +- isa/rv64uv/Makefrag | 2 +- 7 files changed, 31 insertions(+), 40 deletions(-) diff --git a/env/p/riscv_test.h b/env/p/riscv_test.h index 955afc0..8cc7955 100644 --- a/env/p/riscv_test.h +++ b/env/p/riscv_test.h @@ -57,9 +57,9 @@ 2:fssr x0; \ #define RVTEST_VEC_ENABLE \ - setpcr status, SR_EV; \ + setpcr status, SR_EA; \ mfpcr a0, status; \ - and a0, a0, SR_EV; \ + and a0, a0, SR_EA; \ bnez a0, 2f; \ RVTEST_PASS; \ 2: \ diff --git a/env/pt/riscv_test.h b/env/pt/riscv_test.h index e56267f..66eb59c 100644 --- a/env/pt/riscv_test.h +++ b/env/pt/riscv_test.h @@ -43,38 +43,7 @@ regspill: \ .dword 0xdeadbeefcafebabe; \ .dword 0xdeadbeefcafebabe; \ evac: \ - .dword 0xdeadbeefcafebabe; \ - .dword 0xdeadbeefcafebabe; \ - .dword 0xdeadbeefcafebabe; \ - .dword 0xdeadbeefcafebabe; \ - .dword 0xdeadbeefcafebabe; \ - .dword 0xdeadbeefcafebabe; \ - .dword 0xdeadbeefcafebabe; \ - .dword 0xdeadbeefcafebabe; \ - .dword 0xdeadbeefcafebabe; \ - .dword 0xdeadbeefcafebabe; \ - .dword 0xdeadbeefcafebabe; \ - .dword 0xdeadbeefcafebabe; \ - .dword 0xdeadbeefcafebabe; \ - .dword 0xdeadbeefcafebabe; \ - .dword 0xdeadbeefcafebabe; \ - .dword 0xdeadbeefcafebabe; \ - .dword 0xdeadbeefcafebabe; \ - .dword 0xdeadbeefcafebabe; \ - .dword 0xdeadbeefcafebabe; \ - .dword 0xdeadbeefcafebabe; \ - .dword 0xdeadbeefcafebabe; \ - .dword 0xdeadbeefcafebabe; \ - .dword 0xdeadbeefcafebabe; \ - .dword 0xdeadbeefcafebabe; \ - .dword 0xdeadbeefcafebabe; \ - .dword 0xdeadbeefcafebabe; \ - .dword 0xdeadbeefcafebabe; \ - .dword 0xdeadbeefcafebabe; \ - .dword 0xdeadbeefcafebabe; \ - .dword 0xdeadbeefcafebabe; \ - .dword 0xdeadbeefcafebabe; \ - .dword 0xdeadbeefcafebabe; \ + .skip 32768; \ //----------------------------------------------------------------------- // Misc @@ -84,13 +53,32 @@ evac: \ mtpcr x0,clear_ipi; \ mfpcr a0,status; \ li a1,SR_IM; \ + or a0,a0,a1; \ mtpcr a0,status; \ + setpcr status,SR_EI; \ la a0,_handler; \ mtpcr a0,evec; \ mtpcr x0,count; \ addi a0,x0,60; \ mtpcr a0,compare; \ +#define XCPT_HANDLER \ +_handler: \ + mtpcr a0,sup0; \ + mtpcr a1,sup1; \ + vxcptcause x0; \ + la a0,evac; \ + vxcptsave a0; \ + vxcptrestore a0; \ + setpcr status,SR_PEI; \ + mfpcr a0,count; \ + addi a0,a0,60; \ + mtpcr a0,compare; \ + mfpcr a0,sup0; \ + mfpcr a1,sup1; \ + eret; \ + +#if 0 #define XCPT_HANDLER \ _handler: \ mtpcr a0,sup0; \ @@ -167,3 +155,5 @@ _done_skip: \ eret; \ #endif + +#endif diff --git a/env/v/entry.S b/env/v/entry.S index 77107ff..541abae 100644 --- a/env/v/entry.S +++ b/env/v/entry.S @@ -156,7 +156,8 @@ trap_entry: 2:jal handle_trap # when coming from kernel, continue below its stack -1:add x2, sp, -SIZEOF_TRAPFRAME_T +1:li x2,17712 + sub x2, sp, x2 jal save_tf move sp,x2 setpcr status, SR_EI diff --git a/env/v/riscv_test.h b/env/v/riscv_test.h index 75a1388..d9b23fb 100644 --- a/env/v/riscv_test.h +++ b/env/v/riscv_test.h @@ -86,7 +86,7 @@ userstart: \ #define PGSHIFT 13 #define PGSIZE (1 << PGSHIFT) -#define SIZEOF_TRAPFRAME_T 1328 +#define SIZEOF_TRAPFRAME_T 20784 #ifndef __ASSEMBLER__ @@ -147,7 +147,7 @@ typedef struct long cause; long insn; long hwacha_cause; - long evac[128]; + long evac[2560]; } trapframe_t; #endif diff --git a/isa/rv64uf/Makefrag b/isa/rv64uf/Makefrag index f18361a..fc9da14 100644 --- a/isa/rv64uf/Makefrag +++ b/isa/rv64uf/Makefrag @@ -15,4 +15,4 @@ rv64uf_p_vec_tests = $(addprefix rv64uf-p-vec-, $(rv64uf_sc_vec_tests)) rv64uf_pt_vec_tests = $(addprefix rv64uf-pt-vec-, $(rv64uf_sc_vec_tests)) rv64uf_v_vec_tests = $(addprefix rv64uf-v-vec-, $(rv64uf_sc_vec_tests)) -spike_tests += $(rv64uf_p_tests) $(rv64uf_v_tests) $(rv64uf_p_vec_tests) $(rv64uf_v_vec_tests) #$(rv64uf_pt_vec_tests) +spike_tests += $(rv64uf_p_tests) $(rv64uf_v_tests) $(rv64uf_p_vec_tests) $(rv64uf_pt_vec_tests) $(rv64uf_v_vec_tests) diff --git a/isa/rv64ui/Makefrag b/isa/rv64ui/Makefrag index 473d07d..fd4ac41 100644 --- a/isa/rv64ui/Makefrag +++ b/isa/rv64ui/Makefrag @@ -49,4 +49,4 @@ rv64ui_p_vec_tests = $(addprefix rv64ui-p-vec-, $(rv64ui_sc_vec_tests)) rv64ui_pt_vec_tests = $(addprefix rv64ui-pt-vec-, $(rv64ui_sc_vec_tests)) rv64ui_v_vec_tests = $(addprefix rv64ui-v-vec-, $(rv64ui_sc_vec_tests)) -spike_tests += $(rv64ui_p_tests) $(rv64ui_pm_tests) $(rv64ui_v_tests) $(rv64ui_p_vec_tests) $(rv64ui_v_vec_tests) #$(rv64ui_pt_vec_tests) +spike_tests += $(rv64ui_p_tests) $(rv64ui_pm_tests) $(rv64ui_v_tests) $(rv64ui_p_vec_tests) $(rv64ui_pt_vec_tests) $(rv64ui_v_vec_tests) diff --git a/isa/rv64uv/Makefrag b/isa/rv64uv/Makefrag index 78d78e2..53c6525 100644 --- a/isa/rv64uv/Makefrag +++ b/isa/rv64uv/Makefrag @@ -30,4 +30,4 @@ rv64uv_p_vec_tests = $(addprefix rv64uv-p-vec-, $(rv64uv_sc_vec_tests)) rv64uv_pt_vec_tests = $(addprefix rv64uv-pt-vec-, $(rv64uv_sc_vec_tests)) rv64uv_v_vec_tests = $(addprefix rv64uv-v-vec-, $(rv64uv_sc_vec_tests)) -spike_tests += $(rv64uv_p_tests) $(rv64uv_v_tests) +spike_tests += $(rv64uv_p_tests) $(rv64uv_pt_tests) $(rv64uv_v_tests) -- 2.30.2