代码改变世界

XILINX FPGA Debug with VIO and TCL

2011-08-31 17:45  michaelw  阅读(1686)  评论(0编辑  收藏  举报

Use Virtual IO core and TCL script to accommodate FPGA debugging/testing.

基础:
  1. Virtual IO 是Xilinx FPGA提供的软核,通过Xilinx开发环境和jtag下载线可以在PC上获知FPGA内部逻辑信号的状态,也能输出信号给FPGA内部逻辑。
  2. TCL是一种通用的EDA工具脚本语言。Xilinx开发环境提供了一个很方便的TCL应用接口xtclsh,可以方便调用Xilinx的库。
  3. Xilinx FPGA有4条JTAG User Chain(User0/1/2/3),但自带的chipscope analyzer调试软件只能识别一条Chain(User0)。所以,如果要同时在analyzer里面使用ILA(看波形)和VIO会不太现实(需要自己手动例化ILA Core和连接需要看的信号)。但是通过TCL可以访问所有的JTAG Chain和Debug Core,因此本文提出一种比较方便的调试方法来同时使用这两个core:ILA通过analyzer查看,VIO通过TCL控制。

使用步骤:

  1. 使用CoreGEN生成VIO core,注意选择JTAG Chain(USER1、2、3),不能选择USER0。
  2. 将VIO Core例化到design中,并将VIO Core的in/out port 与design相连(可能需要将VIO Core的in/out 信号处理一下再连到内部design,因为VIO的port是level类型的)
  3. Systhesize the design.
  4. Add chipscope ILA core using Chipscope Core Inserter, and select JTAG chain USER0.
  5. Implement the design.
  6. Download bitfile. Watch signal in chipscope analyzer software.
  7. Prepare TCL scripts. There are some template in directory: C:\Xilinx\12.4\ISE_DS\ISE\cse\tcl.
  8. Execute your TCL script in CMD.  xtclsh xxxx.tcl. Then you can watch the result in CMD window.

just for note, and wait modify