> compile NEMU
ysyx_22040000 李心杨 Linux calcite 6.6.18 #1-NixOS SMP PREEMPT_DYNAMIC Fri Feb 23 08:25:28 UTC 2024 x86_64 GNU/Linux 11:38:47 up 1 day 15:07, 2 users, load average: 0.48, 0.44, 0.38
This commit is contained in:
parent
427adbac29
commit
9aea490721
2 changed files with 176 additions and 1 deletions
175
nemu/1
Normal file
175
nemu/1
Normal file
|
@ -0,0 +1,175 @@
|
|||
[1;34m[INFO] src/utils/log.c:30 init_log() [0mLog is written to stdout
|
||||
[1;34m[INFO] src/utils/log.c:30 init_log() [0mLog is written to stdout
|
||||
[1;34m[INFO] src/memory/paddr.c:50 init_mem() [0mphysical memory area [0x80000000, 0x87ffffff]
|
||||
[1;34m[INFO] src/memory/paddr.c:50 init_mem() [0mphysical memory area [0x80000000, 0x87ffffff]
|
||||
[1;34m[INFO] src/monitor/monitor.c:59 load_img() [0mThe image is /nix/store/d0jlcjdrgsb5pis8flyy5ihifdnfhms5-am-kernels-riscv32-none-elf-2024.02.18/share/images/goldbach-riscv32-nemu.bin, size = 329
|
||||
[1;34m[INFO] src/monitor/monitor.c:59 load_img() [0mThe image is /nix/store/d0jlcjdrgsb5pis8flyy5ihifdnfhms5-am-kernels-riscv32-none-elf-2024.02.18/share/images/goldbach-riscv32-nemu.bin, size = 329
|
||||
[1;34m[INFO] src/monitor/monitor.c:28 welcome() [0mTrace: [1;32mON[0m
|
||||
[1;34m[INFO] src/monitor/monitor.c:28 welcome() [0mTrace: [1;32mON[0m
|
||||
[1;34m[INFO] src/monitor/monitor.c:29 welcome() [0mIf trace is enabled, a log file will be generated to record the trace. This may lead to a large log file. If it is not necessary, you can disable it in menuconfig
|
||||
[1;34m[INFO] src/monitor/monitor.c:29 welcome() [0mIf trace is enabled, a log file will be generated to record the trace. This may lead to a large log file. If it is not necessary, you can disable it in menuconfig
|
||||
[1;34m[INFO] src/monitor/monitor.c:32 welcome() [0mBuild time: 00:00:00, Jan 1 1980
|
||||
[1;34m[INFO] src/monitor/monitor.c:32 welcome() [0mBuild time: 00:00:00, Jan 1 1980
|
||||
Welcome to [1;33m[1;41mriscv32[0m-NEMU!
|
||||
For help, type "help"
|
||||
0x80000000: 00 00 04 13 addi s0, zero, 0
|
||||
0x80000004: 00 00 91 17 auipc sp, 9
|
||||
0x80000008: ff c1 01 13 addi sp, sp, -4
|
||||
0x8000000c: 11 c0 00 ef jal ra, 0x80000128
|
||||
0x80000128: ff 01 01 13 addi sp, sp, -16
|
||||
0x8000012c: 00 00 05 17 auipc a0, 0
|
||||
0x80000130: 01 c5 05 13 addi a0, a0, 28
|
||||
0x80000134: 00 11 26 23 sw ra, 12(sp)
|
||||
0x80000138: f9 9f f0 ef jal ra, 0x800000d0
|
||||
0x800000d0: ff 01 01 13 addi sp, sp, -16
|
||||
0x800000d4: 00 81 24 23 sw s0, 8(sp)
|
||||
0x800000d8: 00 91 22 23 sw s1, 4(sp)
|
||||
0x800000dc: 00 11 26 23 sw ra, 12(sp)
|
||||
0x800000e0: 00 40 04 13 addi s0, zero, 4
|
||||
0x800000e4: 02 00 04 93 addi s1, zero, 32
|
||||
0x800000e8: 00 04 05 13 addi a0, s0, 0
|
||||
0x800000ec: f3 df f0 ef jal ra, 0x80000028
|
||||
0x80000028: 00 20 07 93 addi a5, zero, 2
|
||||
0x8000002c: 00 05 08 13 addi a6, a0, 0
|
||||
0x80000030: 08 a7 d8 63 bge a5, a0, 0x800000c0
|
||||
0x80000034: ff e5 07 13 addi a4, a0, -2
|
||||
0x80000038: 00 10 07 93 addi a5, zero, 1
|
||||
0x8000003c: 00 00 05 13 addi a0, zero, 0
|
||||
0x80000040: 06 f7 0e 63 beq a4, a5, 0x800000bc
|
||||
0x80000044: 00 07 05 93 addi a1, a4, 0
|
||||
0x80000048: 00 20 06 93 addi a3, zero, 2
|
||||
0x8000004c: 00 20 03 13 addi t1, zero, 2
|
||||
0x80000050: 00 10 08 93 addi a7, zero, 1
|
||||
0x80000050: 00 10 08 93 addi a7, zero, 1
|
||||
0x80000054: 06 67 0a 63 beq a4, t1, 0x800000c8
|
||||
0x800000c8: 00 10 05 13 addi a0, zero, 1
|
||||
0x800000cc: 00 00 80 67 jalr zero, 0(ra)
|
||||
0x800000f0: ff f5 05 13 addi a0, a0, -1
|
||||
0x800000f4: 00 15 35 13 sltiu a0, a0, 1
|
||||
0x800000f8: 00 24 04 13 addi s0, s0, 2
|
||||
0x800000fc: f1 5f f0 ef jal ra, 0x80000010
|
||||
0x80000010: 00 05 04 63 beq a0, zero, 0x80000018
|
||||
0x80000014: 00 00 80 67 jalr zero, 0(ra)
|
||||
0x80000014: 00 00 80 67 jalr zero, 0(ra)
|
||||
0x80000100: fe 94 14 e3 bne s0, s1, 0x800000e8
|
||||
0x800000e8: 00 04 05 13 addi a0, s0, 0
|
||||
0x800000ec: f3 df f0 ef jal ra, 0x80000028
|
||||
0x80000028: 00 20 07 93 addi a5, zero, 2
|
||||
0x8000002c: 00 05 08 13 addi a6, a0, 0
|
||||
0x80000030: 08 a7 d8 63 bge a5, a0, 0x800000c0
|
||||
0x80000034: ff e5 07 13 addi a4, a0, -2
|
||||
0x80000038: 00 10 07 93 addi a5, zero, 1
|
||||
0x8000003c: 00 00 05 13 addi a0, zero, 0
|
||||
0x80000040: 06 f7 0e 63 beq a4, a5, 0x800000bc
|
||||
0x80000044: 00 07 05 93 addi a1, a4, 0
|
||||
0x80000048: 00 20 06 93 addi a3, zero, 2
|
||||
0x8000004c: 00 20 03 13 addi t1, zero, 2
|
||||
0x80000050: 00 10 08 93 addi a7, zero, 1
|
||||
0x80000054: 06 67 0a 63 beq a4, t1, 0x800000c8
|
||||
0x80000058: 00 17 75 13 andi a0, a4, 1
|
||||
0x8000005c: 00 20 07 93 addi a5, zero, 2
|
||||
0x80000060: 00 05 18 63 bne a0, zero, 0x80000070
|
||||
0x80000064: 02 00 00 6f jal zero, 0x80000084
|
||||
0x80000084: 00 06 86 13 addi a2, a3, 0
|
||||
0x80000088: 00 16 86 93 addi a3, a3, 1
|
||||
0x8000008c: ff f5 85 93 addi a1, a1, -1
|
||||
0x80000090: 02 d8 08 63 beq a6, a3, 0x800000c0
|
||||
0x80000094: 00 16 f7 93 andi a5, a3, 1
|
||||
0x80000098: fe 07 86 e3 beq a5, zero, 0x80000084
|
||||
0x8000009c: 00 20 07 93 addi a5, zero, 2
|
||||
0x800000a0: 00 c0 00 6f jal zero, 0x800000ac
|
||||
0x800000ac: 00 07 87 13 addi a4, a5, 0
|
||||
0x800000b0: 00 17 87 93 addi a5, a5, 1
|
||||
0x800000b4: fe c7 18 e3 bne a4, a2, 0x800000a4
|
||||
0x800000b8: fc 5f f0 6f jal zero, 0x8000007c
|
||||
0x8000007c: 00 05 87 13 addi a4, a1, 0
|
||||
0x8000007c: 00 05 87 13 addi a4, a1, 0
|
||||
0x80000080: fc b8 ca e3 blt a7, a1, 0x80000054
|
||||
0x80000054: 06 67 0a 63 beq a4, t1, 0x800000c8
|
||||
0x80000058: 00 17 75 13 andi a0, a4, 1
|
||||
0x8000005c: 00 20 07 93 addi a5, zero, 2
|
||||
0x8000005c: 00 20 07 93 addi a5, zero, 2
|
||||
0x80000060: 00 05 18 63 bne a0, zero, 0x80000070
|
||||
0x80000070: 00 17 87 93 addi a5, a5, 1
|
||||
0x80000074: fe e7 9a e3 bne a5, a4, 0x80000068
|
||||
0x80000078: 00 00 80 67 jalr zero, 0(ra)
|
||||
0x800000f0: ff f5 05 13 addi a0, a0, -1
|
||||
0x800000f4: 00 15 35 13 sltiu a0, a0, 1
|
||||
0x800000f8: 00 24 04 13 addi s0, s0, 2
|
||||
0x800000fc: f1 5f f0 ef jal ra, 0x80000010
|
||||
0x80000010: 00 05 04 63 beq a0, zero, 0x80000018
|
||||
0x80000014: 00 00 80 67 jalr zero, 0(ra)
|
||||
0x80000014: 00 00 80 67 jalr zero, 0(ra)
|
||||
0x80000100: fe 94 14 e3 bne s0, s1, 0x800000e8
|
||||
0x800000e8: 00 04 05 13 addi a0, s0, 0
|
||||
0x800000ec: f3 df f0 ef jal ra, 0x80000028
|
||||
0x80000028: 00 20 07 93 addi a5, zero, 2
|
||||
0x8000002c: 00 05 08 13 addi a6, a0, 0
|
||||
0x80000030: 08 a7 d8 63 bge a5, a0, 0x800000c0
|
||||
0x80000034: ff e5 07 13 addi a4, a0, -2
|
||||
0x80000038: 00 10 07 93 addi a5, zero, 1
|
||||
0x8000003c: 00 00 05 13 addi a0, zero, 0
|
||||
0x80000040: 06 f7 0e 63 beq a4, a5, 0x800000bc
|
||||
0x80000044: 00 07 05 93 addi a1, a4, 0
|
||||
0x80000048: 00 20 06 93 addi a3, zero, 2
|
||||
0x8000004c: 00 20 03 13 addi t1, zero, 2
|
||||
0x80000050: 00 10 08 93 addi a7, zero, 1
|
||||
0x80000054: 06 67 0a 63 beq a4, t1, 0x800000c8
|
||||
0x80000058: 00 17 75 13 andi a0, a4, 1
|
||||
0x8000005c: 00 20 07 93 addi a5, zero, 2
|
||||
0x80000060: 00 05 18 63 bne a0, zero, 0x80000070
|
||||
0x80000064: 02 00 00 6f jal zero, 0x80000084
|
||||
0x80000084: 00 06 86 13 addi a2, a3, 0
|
||||
0x80000088: 00 16 86 93 addi a3, a3, 1
|
||||
0x8000008c: ff f5 85 93 addi a1, a1, -1
|
||||
0x80000090: 02 d8 08 63 beq a6, a3, 0x800000c0
|
||||
0x80000094: 00 16 f7 93 andi a5, a3, 1
|
||||
0x80000098: fe 07 86 e3 beq a5, zero, 0x80000084
|
||||
0x8000009c: 00 20 07 93 addi a5, zero, 2
|
||||
0x800000a0: 00 c0 00 6f jal zero, 0x800000ac
|
||||
0x800000ac: 00 07 87 13 addi a4, a5, 0
|
||||
0x800000b0: 00 17 87 93 addi a5, a5, 1
|
||||
0x800000b4: fe c7 18 e3 bne a4, a2, 0x800000a4
|
||||
0x800000b8: fc 5f f0 6f jal zero, 0x8000007c
|
||||
0x8000007c: 00 05 87 13 addi a4, a1, 0
|
||||
0x8000007c: 00 05 87 13 addi a4, a1, 0
|
||||
0x80000080: fc b8 ca e3 blt a7, a1, 0x80000054
|
||||
0x80000054: 06 67 0a 63 beq a4, t1, 0x800000c8
|
||||
0x80000058: 00 17 75 13 andi a0, a4, 1
|
||||
0x8000005c: 00 20 07 93 addi a5, zero, 2
|
||||
0x8000005c: 00 20 07 93 addi a5, zero, 2
|
||||
0x80000060: 00 05 18 63 bne a0, zero, 0x80000070
|
||||
0x80000070: 00 17 87 93 addi a5, a5, 1
|
||||
0x80000070: 00 17 87 93 addi a5, a5, 1
|
||||
0x80000074: fe e7 9a e3 bne a5, a4, 0x80000068
|
||||
invalid opcode(PC = 0x80000068):
|
||||
33 66 f7 02 63 0c 06 00 ...
|
||||
02f76633 00060c63...
|
||||
There are two cases which will trigger this unexpected exception:
|
||||
1. The instruction at PC = 0x80000068 is not implemented.
|
||||
2. Something is implemented incorrectly.
|
||||
Find this PC(0x80000068) in the disassembling result to distinguish which case it is.
|
||||
|
||||
[1;31mIf it is the first case, see
|
||||
_ __ __ _
|
||||
(_) | \/ | | |
|
||||
_ __ _ ___ ___ ________ __ | \ / | __ _ _ __ _ _ __ _| |
|
||||
| '__| / __|/ __|______\ \ / / | |\/| |/ _` | '_ \| | | |/ _` | |
|
||||
| | | \__ \ (__ \ V / | | | | (_| | | | | |_| | (_| | |
|
||||
|_| |_|___/\___| \_/ |_| |_|\__,_|_| |_|\__,_|\__,_|_|
|
||||
|
||||
for more details.
|
||||
|
||||
If it is the second case, remember:
|
||||
* The machine is always right!
|
||||
* Every line of untested code is always wrong!
|
||||
|
||||
[0m0x80000068: 02 f7 66 33 rem a2, a4, a5
|
||||
[1;34m[INFO] src/cpu/cpu-exec.c:125 cpu_exec() [0mnemu: [1;31mABORT[0m at pc = 0x80000068
|
||||
[1;34m[INFO] src/cpu/cpu-exec.c:125 cpu_exec() [0mnemu: [1;31mABORT[0m at pc = 0x80000068
|
||||
[1;34m[INFO] src/cpu/cpu-exec.c:93 statistic() [0mhost time spent = 383 us
|
||||
[1;34m[INFO] src/cpu/cpu-exec.c:93 statistic() [0mhost time spent = 383 us
|
||||
[1;34m[INFO] src/cpu/cpu-exec.c:94 statistic() [0mtotal guest instructions = 123
|
||||
[1;34m[INFO] src/cpu/cpu-exec.c:94 statistic() [0mtotal guest instructions = 123
|
||||
[1;34m[INFO] src/cpu/cpu-exec.c:95 statistic() [0msimulation frequency = 321,148 inst/s
|
||||
[1;34m[INFO] src/cpu/cpu-exec.c:95 statistic() [0msimulation frequency = 321,148 inst/s
|
|
@ -83,7 +83,7 @@ $(IMAGES): %: %.bin $(BINARY)
|
|||
|
||||
integration-tests: $(IMAGES)
|
||||
@cat $(RESULT)
|
||||
@echo $(shell wc -l $(RESULT))
|
||||
@echo $(shell wc -l $(RESULT) | cut -f1)
|
||||
@$(RM) $(RESULT)
|
||||
|
||||
test: unit-tests integration-tests
|
||||
|
|
Loading…
Reference in a new issue