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

How to debug Xiangshan on FPGA with OpenOCD? #3388

Open
3 tasks done
x402 opened this issue Aug 15, 2024 · 7 comments
Open
3 tasks done

How to debug Xiangshan on FPGA with OpenOCD? #3388

x402 opened this issue Aug 15, 2024 · 7 comments
Assignees
Labels
problem Problem requiring help

Comments

@x402
Copy link

x402 commented Aug 15, 2024

Before start

  • I have read the XiangShan Documents. 我已经阅读过香山文档。
  • I have searched the previous issues and did not find anything relevant. 我已经搜索过之前的 issue,并没有找到相关的。
  • I have searched the previous discussions and did not find anything relevant. 我已经搜索过之前的 discussions,并没有找到相关的。

Describe you problem

It is mentioned that how to use OpenOCD to debug emu of XiangShan in the doc, but not XiangShan running on FPGA with JTAG. While we are tring to implement the minimal FPGA system of Nanhu on S2C's Prodigy™ S7-19PD Logic System #3377 , I suppose that the CPU crashes on some instruction. So I want to use JTAG and OpenOCD to find out if the CPU stops on some instruction. But we don't know how to begin. So we hope to get some help.
香山文档中有提到如何在仿真中使用OpenOCD进行调试,但是没提到在FPGA平台上运行香山时如何用OpenOCD连接JTAG进行调试。我和同伴正在S2C's Prodigy™ S7-19PD Logic System上搭载南湖的FPGA最小系统进行实验 #3377 ,想知道CPU是否是卡在某个地址的指令无法运行,所以想用JTAG+OpenOCD进行调试,但是现在无从下手,希望可以得到一些指点。

What did you do before

#3377

Environment

  • XiangShan branch:
  • XiangShan commit id:
  • NEMU commit id:
  • SPIKE commit id:
  • Operating System:
  • gcc version:
  • mill version:
  • java version:

Additional context

No response

@x402 x402 added the problem Problem requiring help label Aug 15, 2024
@cebarobot
Copy link
Member

It seems that you could wire the JTAG from FPGA and use an hardware JTAG debugger to debug it.

看起来您需要在 FPGA 平台上引出 JTAG 接口,并且连接一个硬件 JTAG 调试器即可。

@cebarobot
Copy link
Member

We write an tutorial for using FPGA JTAG: FPGA JTAG - XiangShan-doc. Hope that could help you.

我们撰写了一个 FPGA JTAG 使用的简易教程:FPGA JTAG - XiangShan-doc。希望能帮到您。

@x402
Copy link
Author

x402 commented Aug 20, 2024

We write an tutorial for using FPGA JTAG: FPGA JTAG - XiangShan-doc. Hope that could help you.

我们撰写了一个 FPGA JTAG 使用的简易教程:FPGA JTAG - XiangShan-doc。希望能帮到您。

Thank you very much! The tutorial is helpful.
非常感谢,这个教程很有帮助。

@Headcrabed
Copy link

@cebarobot 另外请问有测试过直接使用jlink驱动本身的riscv64调试功能吗?openocd的性能和便利程度比起jlink官方驱动还是差了一些

@cebarobot
Copy link
Member

@cebarobot 另外请问有测试过直接使用jlink驱动本身的riscv64调试功能吗?openocd的性能和便利程度比起jlink官方驱动还是差了一些

我们没有尝试过,您可以尝试一下。

We haven't try that. You could have a try.

@wissygh wissygh assigned cebarobot and unassigned wissygh Aug 28, 2024
@yorange1
Copy link

yorange1 commented Oct 9, 2024

@x402 请问你有撰写一些在 S2C's Prodigy™ S7-19PD上运行香山的文档吗?我正在进行一些类似的工作,如果能够得到你们的分享的话将会对我有很大的帮助,十分感谢

@stwjt
Copy link

stwjt commented Oct 14, 2024

@cebarobot 另外请问有测试过直接使用jlink驱动本身的riscv64调试功能吗?openocd的性能和便利程度比起jlink官方驱动还是差了一些

我们没有尝试过,您可以尝试一下。

We haven't try that. You could have a try.

您好 能确认下JLINK的型号吗?我看这里写的是JLINK-v9。我怕我买错了,烧坏板子。。。
JLink_version

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

No branches or pull requests

6 participants