File tree 2 files changed +12
-7
lines changed
2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,13 @@ int main()
51
51
* track) */
52
52
TEST_LOGGER ("MISALIGNED STORE TEST PASSED!\n" );
53
53
54
- /* misalign instuction fetch */
54
+ /*
55
+ * misalign instuction fetch
56
+ *
57
+ * MUST disable ENABLE_EXT_C when building rv32emu before running this test
58
+ * since jalr instruction only check misaligned if lacks of compressed
59
+ * instruction support
60
+ */
55
61
misalign_func ();
56
62
/* execute the registered trap handler is considered a pass (use gdb to
57
63
* track) */
Original file line number Diff line number Diff line change @@ -19,27 +19,27 @@ misalign_func:
19
19
.section .text
20
20
.global _start
21
21
_start:
22
- call main
22
+ call main
23
23
j exit
24
24
25
25
# Assume three traps are delegated to supervisor,
26
26
# so handle them using supervisor CSR
27
27
.global misalign_trap_handler
28
28
misalign_trap_handler:
29
29
csrr t0, scause
30
-
30
+
31
31
# Check for misaligned instruction fetch
32
32
li t1, CAUSE_MISALIGNED_INSN_FETCH
33
33
beq t0, t1, misaligned_insn_fetch_handler
34
-
34
+
35
35
# Check for misaligned load
36
36
li t1, CAUSE_MISALIGNED_LOAD
37
37
beq t0, t1, misaligned_load_handler
38
-
38
+
39
39
# Check for misaligned store
40
40
li t1, CAUSE_MISALIGNED_STORE
41
41
beq t0, t1, misaligned_store_handler
42
-
42
+
43
43
# If none of the above, exit failed
44
44
fail:
45
45
li a0, 1
@@ -67,4 +67,3 @@ misaligned_store_handler:
67
67
addi t0, t0, 4
68
68
csrw sepc, t0
69
69
sret
70
-
You can’t perform that action at this time.
0 commit comments