Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add register and mempry dump function #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

zhouyangye1076
Copy link
Contributor

  1. add 2 function in interactive menu: "dump_mem" to dump all the visited memory as hex which can be used by verilog environment to initial the memory; "dump_all" to dump both memory like "dump_mem" and registers.
  2. "dump_all" add another part of assmbly I call it reg_info memory to initial the register as the dumping register value
  • change the begin part of the 0x80000000 with code jmp to the reg_info memory
  • at the beginning of the reg_info memory, recovery the memory in the 0x80000000
  • use csrw to inital csr registers
  • change the mepc as the target address and chaneg the mstatus's mpp and pmie as the target priv and mie
  • use lui,slli,srli,addi,ld to initial registers as the dump value by itself
  • mret to the target address
  1. you can use gdb link and then set breakpoint on the address you want to jump, then let spike run to this address, then use ctrl+c to switch to the interactive menu and input dump_all to get the info
  2. there is a problem, because at that time, the spike is trapped in the debug loop, so some register and pc is changed, maybe when need to change spike to let it can stop at the appointed address automatically so that the context will not be changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant