1

我正在尝试使用 github 存储库中给出的指令在火箭芯片模拟器中执行一组程序。即使对于小型 riscv 测试(ISA 测试),我也注意到跟踪中还有其他说明。许多这些附加指令是在跳转到我尝试运行的实际程序之前执行的。

这个这个我知道这些是由于调试中断不断检查执行是否结束。

有谁知道如何禁用这些中断,以便我可以获得干净的指令跟踪? 另外,我有一个更大的程序,它可以用 Spike 很好地执行,但在火箭芯片仿真器中永远不会结束(一段时间后继续循环调试序列)。

我使用的是默认的火箭芯片配置,没有任何附加功能。我正在使用截至 2021 年 9 月 18 日的最新火箭芯片提交。

下面是我用来模拟 ISA 测试的命令:

./emulator-freechips.rocketchip.system-freechips.rocketchip.system.DefaultConfig +verbose ../rocket-tools/riscv-tests/isa/rv64ua-v-amoxor_d 2>&1 | spike-dasm |& tee run.0.1.log

我得到的调试序列的一部分:

C0:        192 [1] pc=[0000000000000800] W[r 0=0000000000000804][1] R[r 0=0000000000000000] R[r 0=0000000000000000] inst=[00c0006f] j       pc + 0xc
C0:        193 [1] pc=[000000000000080c] W[r 0=0000000000000000][0] R[r 0=0000000000000000] R[r 0=0000000000000000] inst=[0ff0000f] fence
C0:        194 [1] pc=[0000000000000810] W[r 0=3a01a49e17ab3e32][1] R[r 8=3a01a49e17ab3e32] R[r 0=0000000000000000] inst=[7b241073] csrw    dscratch0, s0
C0:        199 [1] pc=[0000000000000814] W[r 8=0000000000000000][1] R[r 0=0000000000000000] R[r 0=0000000000000000] inst=[f1402473] csrr    s0, mhartid
C0:        202 [1] pc=[0000000000000818] W[r 0=0000000000000000][0] R[r 0=0000000000000000] R[r 8=0000000000000000] inst=[10802023] sw      s0, 256(zero)
C0:        208 [1] pc=[000000000000081c] W[r 8=0000000000000000][0] R[r 8=0000000000000000] R[r 0=0000000000000000] inst=[40044403] lbu     s0, 1024(s0)
C0:        216 [1] pc=[0000000000000820] W[r 8=0000000000000000][1] R[r 8=0000000000000000] R[r 0=0000000000000000] inst=[00347413] andi    s0, s0, 3
C0:        217 [1] pc=[0000000000000824] W[r 0=0000000000000000][0] R[r 8=0000000000000000] R[r 0=0000000000000000] inst=[fe0408e3] beqz    s0, pc - 16
C0:        221 [1] pc=[0000000000000814] W[r 8=0000000000000000][1] R[r 0=0000000000000000] R[r 0=0000000000000000] inst=[f1402473] csrr    s0, mhartid
C0:        224 [1] pc=[0000000000000818] W[r 0=0000000000000000][0] R[r 0=0000000000000000] R[r 8=0000000000000000] inst=[10802023] sw      s0, 256(zero)
C0:        230 [1] pc=[000000000000081c] W[r 8=0000000000000000][0] R[r 8=0000000000000000] R[r 0=0000000000000000] inst=[40044403] lbu     s0, 1024(s0)
C0:        238 [1] pc=[0000000000000820] W[r 8=0000000000000002][1] R[r 8=0000000000000002] R[r 0=0000000000000000] inst=[00347413] andi    s0, s0, 3
C0:        239 [1] pc=[0000000000000824] W[r 0=0000000000000000][0] R[r 8=0000000000000002] R[r 0=0000000000000000] inst=[fe0408e3] beqz    s0, pc - 16
C0:        240 [1] pc=[0000000000000828] W[r 8=0000000000000000][1] R[r 8=0000000000000002] R[r 0=0000000000000000] inst=[00147413] andi    s0, s0, 1
C0:        241 [1] pc=[000000000000082c] W[r 0=0000000000000000][0] R[r 8=0000000000000000] R[r 0=0000000000000000] inst=[00040863] beqz    s0, pc + 16
C0:        245 [1] pc=[000000000000083c] W[r 8=0000000000000000][1] R[r 0=0000000000000000] R[r 0=0000000000000000] inst=[f1402473] csrr    s0, mhartid
C0:        265 [1] pc=[0000000000000840] W[r 0=0000000000000000][0] R[r 0=0000000000000000] R[r 8=0000000000000000] inst=[10802423] sw      s0, 264(zero)
C0:        266 [1] pc=[0000000000000844] W[r 8=3a01a49e17ab3e32][1] R[r 0=0000000000000000] R[r 0=0000000000000000] inst=[7b202473] csrr    s0, dscratch0
C0:        267 [1] pc=[0000000000000848] W[r 0=0000000000000000][0] R[r 0=0000000000000000] R[r 0=0000000000000000] inst=[7b200073] dret
C0:        286 [1] pc=[0000000000010058] W[r 0=000000000001005a][1] R[r 0=0000000000000000] R[r 0=0000000000000000] inst=[0000bff5] c.j     pc - 4
C0:        288 [1] pc=[0000000000010054] W[r 0=0000000000000000][0] R[r 0=0000000000000000] R[r 0=0000000000000000] inst=[10500073] wfi
C0:        291 [0] pc=[0000000000010058] W[r 0=0000000000000000][0] R[r31=0000000000000000] R[r 0=0000000000000000] inst=[0000bff5] c.j     pc - 4
C0:        296 [1] pc=[0000000000000800] W[r 0=0000000000000804][1] R[r 0=0000000000000000] R[r 0=0000000000000000] inst=[00c0006f] j       pc + 0xc
C0:        297 [1] pc=[000000000000080c] W[r 0=0000000000000000][0] R[r 0=0000000000000000] R[r 0=0000000000000000] inst=[0ff0000f] fence
C0:        298 [1] pc=[0000000000000810] W[r 0=3a01a49e17ab3e32][1] R[r 8=3a01a49e17ab3e32] R[r 0=0000000000000000] inst=[7b241073] csrw    dscratch0, s0
C0:        303 [1] pc=[0000000000000814] W[r 8=0000000000000000][1] R[r 0=0000000000000000] R[r 0=0000000000000000] inst=[f1402473] csrr    s0, mhartid
C0:        306 [1] pc=[0000000000000818] W[r 0=0000000000000000][0] R[r 0=0000000000000000] R[r 8=0000000000000000] inst=[10802023] sw      s0, 256(zero)
C0:        312 [1] pc=[000000000000081c] W[r 8=0000000000000000][0] R[r 8=0000000000000000] R[r 0=0000000000000000] inst=[40044403] lbu     s0, 1024(s0)
C0:        320 [1] pc=[0000000000000820] W[r 8=0000000000000000][1] R[r 8=0000000000000000] R[r 0=0000000000000000] inst=[00347413] andi    s0, s0, 3
C0:        321 [1] pc=[0000000000000824] W[r 0=0000000000000000][0] R[r 8=0000000000000000] R[r 0=0000000000000000] inst=[fe0408e3] beqz    s0, pc - 16
C0:        325 [1] pc=[0000000000000814] W[r 8=0000000000000000][1] R[r 0=0000000000000000] R[r 0=0000000000000000] inst=[f1402473] csrr    s0, mhartid
C0:        328 [1] pc=[0000000000000818] W[r 0=0000000000000000][0] R[r 0=0000000000000000] R[r 8=0000000000000000] inst=[10802023] sw      s0, 256(zero)
C0:        334 [1] pc=[000000000000081c] W[r 8=0000000000000000][0] R[r 8=0000000000000000] R[r 0=0000000000000000] inst=[40044403] lbu     s0, 1024(s0)
C0:        342 [1] pc=[0000000000000820] W[r 8=0000000000000000][1] R[r 8=0000000000000000] R[r 0=0000000000000000] inst=[00347413] andi    s0, s0, 3
C0:        343 [1] pc=[0000000000000824] W[r 0=0000000000000000][0] R[r 8=0000000000000000] R[r 0=0000000000000000] inst=[fe0408e3] beqz    s0, pc - 16
C0:        347 [1] pc=[0000000000000814] W[r 8=0000000000000000][1] R[r 0=0000000000000000] R[r 0=0000000000000000] inst=[f1402473] csrr    s0, mhartid
C0:        350 [1] pc=[0000000000000818] W[r 0=0000000000000000][0] R[r 0=0000000000000000] R[r 8=0000000000000000] inst=[10802023] sw      s0, 256(zero)
C0:        356 [1] pc=[000000000000081c] W[r 8=0000000000000000][0] R[r 8=0000000000000000] R[r 0=0000000000000000] inst=[40044403] lbu     s0, 1024(s0)
C0:        364 [1] pc=[0000000000000820] W[r 8=0000000000000001][1] R[r 8=0000000000000001] R[r 0=0000000000000000] inst=[00347413] andi    s0, s0, 3
C0:        365 [1] pc=[0000000000000824] W[r 0=0000000000000000][0] R[r 8=0000000000000001] R[r 0=0000000000000000] inst=[fe0408e3] beqz    s0, pc - 16
C0:        366 [1] pc=[0000000000000828] W[r 8=0000000000000001][1] R[r 8=0000000000000001] R[r 0=0000000000000000] inst=[00147413] andi    s0, s0, 1
C0:        367 [1] pc=[000000000000082c] W[r 0=0000000000000000][0] R[r 8=0000000000000001] R[r 0=0000000000000000] inst=[00040863] beqz    s0, pc + 16
C0:        368 [1] pc=[0000000000000830] W[r 8=3a01a49e17ab3e32][1] R[r 0=0000000000000000] R[r 0=0000000000000000] inst=[7b202473] csrr    s0, dscratch0
C0:        369 [1] pc=[0000000000000834] W[r 0=0000000000000000][0] R[r 0=0000000000000000] R[r 0=0000000000000000] inst=[10002223] sw      zero, 260(zero)
C0:        370 [1] pc=[0000000000000838] W[r 0=000000000000083c][1] R[r 0=0000000000000000] R[r 0=0000000000000000] inst=[30000067] jalr    zero, zero, 768
C0:        389 [1] pc=[0000000000000300] W[r 0=0000000000000304][1] R[r 0=0000000000000000] R[r 0=0000000000000000] inst=[0380006f] j       pc + 0x38
C0:        390 [1] pc=[0000000000000338] W[r 0=0000000000000000][0] R[r 0=0000000000000000] R[r 8=3a01a49e17ab3e32] inst=[38803023] sd      s0, 896(zero)
C0:        391 [0] pc=[000000000000033c] W[r 0=0000000000000000][0] R[r 0=0000000000000000] R[r 0=0000000000000000] inst=[00100073] ebreak
C0:        410 [1] pc=[0000000000000800] W[r 0=0000000000000804][1] R[r 0=0000000000000000] R[r 0=0000000000000000] inst=[00c0006f] j       pc + 0xc
4

0 回答 0