chipscope
- 格式:docx
- 大小:25.91 KB
- 文档页数:1
ChipScope Pro实例教程宋存杰1. ChipScope Pro简介ChipScope Pro的主要功能是通过JTAG口、在线实时地读出FPGA的内部信号。
基本原理是利用FPGA中未使用的BlockRAM,根据用户设定的触发条件将信号实时地保存到这些BlockRAM中,然后通过JTAG口传送到PC机,显示出时序波形。
一般来说,ChipScope Pro在工作时需要在用户设计中实例化两种核:一是集成逻辑分析仪核(ILA core,Integrated Logic Analyzer core),提供触发和跟踪捕获的功能;二是集成控制器核(ICON core,Integrated Controller core),负责ILA核和边界扫描端口的通信,一个ICON核可以连接1~15个ILA核。
ChipScope Pro工具箱包含3个工具:ChipScope Pro Core Generator(核生成器)、ChipScope Pro Core Inserter(核插入器)和ChipScope Pro Analyzer(分析器)。
ChipScope Pro Core Generator的作用是根据设定条件生成在线逻辑分析仪的IP核,包括ICON核、ILA核、ILA/ATC2核和IBA/OPB核等,设计人员在原HDL代码中实例化这些核,然后进行布局布线、下载配置文件,就可以利用ChipScope Pro Analyzer设定触发条件、观察信号波形。
ChipScope Pro Core Inserter除了不能生成IBA/OPB核和ILA/ATC2核以外,功能与ChipScope Pro Core Generator类似,可以生成ICON核和ILA核,但是它能自动完成在设计网表中插入这些核的工作,不用手工在HDL代码中实例化,在实际工作中用得最多。
下图为ChipScope的两种使用流程图,左侧为使用ChipScope Pro Core Generator流程。
ChipScope Pro 使用说明本文档介绍一个在ISE设计中使用ChipScope的例子。
1. 打开要插入Chipscope仿真的工程(略)2.综合及需要的设置注意:综合的时候要保留设计层次,以取得好的综合效果。
3.在工程中右键选择New Source ,新建文件,如下图:4.双击新建的.cdc文件,启动ChipScope。
1、在DEVICE界面,点击NEXT2、在ICON界面,点击NEXT3、在ILA界面分为3页,如下第一页,在Trigger Width栏填入要触发的数据位宽。
NEXT第二页,Data Depth选择采样深度;Data Same As Trigger为触发条件与采样数据是否相同。
Next第三页,添加时钟触发信号及采样信号。
双击红色CLOCK PORT,选择触发信号关联的时钟信号。
同样双击TRIGGER PORTS关联触发信号(若触发信号TIGGER跟采样信号DATA SIGNALS不同,则分开关联信号)(注,查找信号时,可试用Fitter工具,在Fitter中可以使用通配符*,代表任意个任意字符,帮助快速查找)5.在关联完成所有信号后,点击OK返回。
点击Return to Project Navigator返回ISE。
6.双击Process窗口中的Analyze Design Using Chipscope直到弹出ChipsScpoe工具。
7.选中器件,右键Configure,弹出如下窗口,点击OK。
下载程序后,双击左侧边框打开各窗口。
(注:上方黑色三角表示开始触发采集,黑色方块i代表停止采集,Ti代表无需触发条件满足立即采集。
)系数计算方法:例如,cut_x总线为16位宽,1位符号位、1位整数位、14位小数位,则,试用计算器计算为0.00006103515625。
幅度偏移不需要改,显示精度一般2-4左系数为12右即可。
将所有需要修改格式的总线修改后,双击Bus Plot可打开总线绘图,查看总线波形。
第11章片内逻辑分析仪工具——ChipScope Pro11.1 ChipScope Pro工具介绍在FPGA调试阶段,传统的信号分析手段要求在设计时保留一定数量的FPGA管脚作为测试管脚,这种方法灵活性差,对PCB布线也有一定的影响。
当今先进的FPGA器件所具有的规模、速度和板级要求使得利用传统逻辑分析方法来调试采用FPGA器件进行的设计几乎是不可能的。
Xilinx公司推出的片内逻辑分析仪ChipScope Pro能够通过JTAG口,实时地读出FPGA的所有内部信号,而只需要片内的少量BlockRAM和逻辑资源,使得逻辑分析灵活方便。
ChipScope Pro是与ISE配套使用的,其版本经过了ChipScope 4.1i,ChipScope 4.2i,ChipScope Pro 5.1i,ChipScope Pro 5.2i和ChipScope Pro 6.1i的升级过程,ChipScope Pro 6.1i是与ISE 6.1配套使用的最新版本。
ChipScope Pro软件由3个工具组成:(1) ChipScope Pro内核生成器:为综合控制器(ICON)内核、CoreConnect™ OPB的总线分析内核(IBA/OPB)、逻辑分析(ILA)内核及安捷伦跟踪内核(ILA/ATC)提供网表和实例化的模板;(2) ChipScope Pro内核插入器:自动地为用户已经综合完的设计中插入ICON、ILA和ILA/ATC的内核;(3) ChipScope Pro分析仪:提供器件的配置、触发的设定和ILA、IBA/OPB及ILA/ATC核的踪迹显示功能。
各种内核实现了信号的触发和捕获,而ICON内核专门用于与边界扫描(Boundary Scan)管脚的通信。
使用ChipScope Pro工具的设计可以容易地同任何标准的FPGA设计流程结合起来,其中要用到标准的HDL综合工具和Xilinx ISE的实现工具,设计流程如图11.1所示。
ChipScope Debug LabIntroductionThis lab guides you through the process of inserting ChipScope-Pro cores into your design and performing on-chip verification.ObjectivesAfter completing this lab, you will be able to:• Create a new ChipScope-Pro source in ISE• Create ILA and ICON cores using ChipScope-Pro and insert it into a PicoBlaze design • Specify trigger options in ChipScope Analyzer• Download the bitstream and run the design in hardware• Perform an on-chip verification and view the wave forms in ChipScope AnalyzerDesign DescriptionYou will extend the lab 5 design by adding a ChipScope ILA core to the PicoBlaze output bus. Next, you will setup the trigger to capture data when text is entered via Hyper Terminal. You should see the resulting text displayed in ChipScope when the buffer is full.ProcedureThis lab is separated into steps that consist of general overview statements that provide information on the detailed instructions that follow. Follow these detailed instructions to progress through the lab. This lab comprises 4 primary steps: You will create a new ChipScope source, configure and connect an ILA core, configure ChipScope Analyzer trigger options and, finally, perform an on-chip verification. Note: If you are unable to complete the lab at this time, you can download the lab files for this module from the Xilinx University Program site at /universityGeneral Flow for this LabStep 1:Creating a New ChipScope SourceStep 2: Configure and Connect an ILA Core Step 3:Configure ChipScope Analyzer Trigger OptionsStep 4: Perform an On-chip VerificationCreate a New ChipScope Source Step 1 1-1. Open a ChipScope-Pro project from lab6 folder (under vhdl or verilog).1-1-1. Open the Xilinx ISE software by selecting Start All Programs Xilinx ISE Design Suite13.2 ISE Design Tools Project Navigator.1-1-2. Open the project by selecting File Open Project.○Verilog users: Browse to c:\xup\fpgaflow\labs\verilog\lab6\chipccope○VHDL users: Browse to c:\xup\fpgaflow\labs\vhdl\lab6\chipscope1-1-3. Select chipscope.xise and click Open.1-1-4. Create a new ChipScope Definition and Connection File source by selecting Project New Source and entering the name loopback_cs. Click Next to continue.Figure 1. New Source Dialog Box1-1-5. Click Finish. A ChipScope-Pro source will be added to the Sources in Project window.Genesys 6-2 /universityFigure 2. ChipScope Definition and Connection (.cdc) added to VHDL ProjectConfigure and Connect an ILA Core Step 2 2-1. Connect the ILA core to the PicoBlaze output.2-1-1. Double-click the loopback_cs.cdc file in the sources in project window to open the core inserter project.Figure 3. ChipScope-Pro Core InserterNote: Projects saved in the Core Inserter hold all relevant information about source files, destination files, core parameters and core settings.2-1-2. Click Next and then click New ILA Unit. Notice in the left hand window how an instance of the ILA core, U0:ILA, is added to the system.Genesys 6-4 /universityFigure 4. Insert a new integrated logic analyzer (ILA) Unit2-1-3. Click Next to setup the trigger parameters.Each ILA or ILA/ATC core can have up to 16 separate trigger ports that can be setup independently. The individual trigger ports are buses that are made up of individual signals or bits that can range from 1 to 256 bits. Each trigger port can be connected to 1 to 16 match units. A match unit is a comparator that is connected to a trigger port and is used to detect events on that trigger port. The results of one or more match units are combined together to form the overall trigger condition event that is used to control the capturing of data. The different comparisons or match functions that can be performed by the trigger port match units depend on the type of match unit. The ILA and ILA/ITC cores support six types of match units. In this lab, you will setup the ILA core to trigger via some UART control signals.2-1-4. Set the following ILA trigger parameters as follows and then click Next.Trigger Input and Match Unit Settings.• Number of input trigger ports: 3Trigger Port Trigger Width # Match Units Counter WidthMatch Type TRIG0 1 1 Disabled Basic TRIG1 1 1 Disabled Basic TRIG211DisabledBasicTrigger Condition Settings• Enable Trigger Sequencer: Checked (This allows you to specify a sequence of events to enable triggering)•Max Number of Sequencer Levels: 2Storage Qualification Condition Settings• Enable Storage Qualification: Checked (This allows you to specify which data will be stored in the internal buffer)Figure 5. Specify the Trigger ParametersThe maximum number of data sample words that the ILA core can store in the sample buffer is called the data depth. The data depth determines the number of data width bits contributed by each block RAM unit used by the ILA unit. The maximum number of data sample words that can be captured depends on the number and size of block RAM, which varies according to device family and density.2-1-5. Set the following capture parameters and click Next.• Data Depth: 1024• Sample On: Rising clock edge• Data Same as Trigger Port: unchecked• Data Width: 8Figure 6. Specify Trigger ParametersThe net connections tab allows you to choose the signals to connect to the ILA core. If trigger is separate from data, then clock, trigger, and data must be specified. Connections that have not been made will appear in red.Figure 7. Unconnected Net Connections2-1-6. Click the Modify Connections tab.Figure 8. Net ConnectionsThe Select Net dialog provides an easy interface to choose nets to connect to the ILA, ILA/ATC or ATC2 cores. The hierarchical structure of the design can be traversed using the Structure/Nets pane. All the design’s nets of the selected structure hierarchy appear in the table at the lower left pane. The Clock Signals and Trigger/Data Signals tabs illustrate the net connections between the design and the ILA core.2-1-7. With the Clock Signals tab under Net Selections selected, highlight the entry for clk55MHz in the listing of nets and click the Make Connections button to connect the clock signal in the design to the clock port of the ILA core.Figure 9. Connect the clockGenesys 6-6 /university2-1-8. Click the Trigger Signals tab, and connect the three trigger ports as follows:• TP0: data_present (this signal indicates that data is present in the uart_rx module• TP1: read_from_uart (input to uart_rx that indicates that a read operation will occur)• TP2: write_to_uart (input to uart_tx that indicates that a write operation will occur)2-1-9. Click the Data Signals tab and connect the output port of the PicoBlaze controller to the data port of the ILA core (see Figure 10), and click OK.Figure 10. Connect the PicoBlaze output port2-1-10. You will notice that the Clock, Trigger, and Data ports under Net Connections are highlighted in black, indicating valid connections. Click Return to Project Navigator and save the file.Figure 11. Connection between Design and ILA core EstablishedConfigure ChipScope Analyzer Trigger Options Step 3 3-1. You will download the bitstream using ChipScope and configure the ILA core to trigger when the UART reads text from Hyper Terminal.3-1-1. With the top-level file (loopback.v/vhd) selected, double-click on Analyze Design Using ChipScope in the Processes window.3-1-2. Connect up the download cable and power up the Genesys board.3-1-3. Click the Open Cable/Search JTAG Chain button.Figure 12. Establish JTAG Connection3-1-4. Chipscope Pro Analyzer will automatically detect the devices on the Genesys board and then click OK.Figure 13. Impact Detects Devices in JTAG Chain3-1-5. Right Click on the xc5vlx50t device and select configure.3-1-6. Click Select New File and select the loopback.bit bitstream file from the project directory. Note that the import cdc file field shows the cdc file located in the project directory. Also note that the tool will create a bus (out_port) automatically. Click OK.Double-click on Trigger Setup and Waveform entries in Project Tree to open the respective windows.The ChipScope Pro Analyzer interface consists of four parts:Genesys 6-8 /universityFigure 14. ChipScope Analyzer WindowEach ChipScope Pro ILA, ILA/ATC, and IBA core has its own Trigger setup window, which provides a graphical interface for the user to setup triggers. The trigger mechanism inside each ChipScope Pro core can be modified at run-time without having to recompile the design. There are three components to the trigger mechanism:• Match Functions: Defines the match or comparison value of each match unit• Trigger Conditions: Defines the overall trigger condition based on a binary equation or sequence of one or more match functions• Capture Settings: Defines how many samples to capture, how many capture windows, and the position of the trigger in those windowsIn this design, you will setup the triggers to capture text at the PicoBlaze output port, after being entered via Hyper Terminal.3-1-7. Specify the Match Units as follows:• M0:TriggerPort0 (data_present): Value 1• M1:TriggerPort1(read_from_uart): Value 1• M2:TriggerPort1(write_to_uart): Value 1Figure 15. Setup the Match Units3-1-8. Click the field under Trigger Condition Equation, set the equation M0 M1 in the Sequencertab, and then click OK.Genesys 6-10 /universityFigure 16. Trigger Condition Equation3-1-9. Check the field next to Storage Qualification , select the AND Equation , and check M2. ClickOK . This will enable the ILA core to capture data in the buffer only when data is present, and not on every single clock edge.Figure 17. Storage Qualification EquationPerform an On-Chip VerificationStep 44-1.Start Hyper-Terminal program. Set baud rate to 9600. Arm the trigger and view the waveforms of the captured data.4-1-1.Start the Hyper-Terminal program. Make sure that the baud rate is set to 9600.Lab WorkbookChipScope Debug Lab/university Genesys 6-11xup@4-1-2. Set the buffer depth to 16.Figure 18. Select Buffer Depth4-1-3. Cick the Apply Settings and Arm Trigger button.Figure 19. Apply Settings and Arm Trigger4-1-4. Type “Xilinx #1 FPGA!” in Hyper Terminal and view the message in ChipScope Analyzer.Figure 20. Output in Waveform Window4-1-5. Close all applications without saving ChipScope project.ConclusionYou inserted the ILA and ICON cores into the PicoBlaze design, set up trigger conditions in ChipScope Analyzer, performed an on-chip verification, and analyzed the waveforms in ChipScope-Pro Analyzer.。
Chipscope 用法1、Chipscope基础(1)原理:Chipscope可以理解为FPGA中的一个IP核,但是是一种在线调试用的,所以必须以硬件的连接为基础。
在FPGA已经下载程序的情况下,添加我们关心的信号或者接口,将选定了端口Chipscope(不妨理解为一个嵌入的系统)加入到程序后重新布局布线下载到FPGA中,此时我们就可以观察信号和接口的值了。
注意:从图形上看,有点类似于Modelsim的仿真结果,但其本质区别在于Chipscope用的实际的信号波形,而Modelsim仅仅是仿真的结果!(2)方法:一般的,我们会按照信号的方向一步一步进行排查验证。
在下载程序之前如果我们已经在Modelsim中进行过了充分的仿真,而下载到板子上之后程序运行结果没有达到预期时,我们可以先考虑将所有的输入输出结果用Chipscope抓出来观察对比,看能不能找到问题所在。
如果输出结果没有达到预期,我们就采用按照信号传输方向排查的方法一步一步检查,如果输出结果和预期一致,我们应该考虑硬件的连接甚至设计是否出了问题,有时候要对总体方案进行重新评审。
2、具体步骤第一步:新建一个Chipscope 文件,比如命名为test。
第二步:双击打开test.cdc文件,进入Core Insert界面,选择需要观察的信号或者端口(1)一直按照默认的设置点Next直到出现Trigger Width时进行选择,表示一共需要选择的信号的位数;(2)Data Depth选项表示一步要采用的深度,可以理解为运行一次能抓到多少个单位的数据(时间单位一般是固定的,且与选择的时钟有关);同时采用可以选择时钟的上升沿或者下降沿(分别对应Rising和Falling);(3)Next进入到时钟和信号的连接设置,点击Modify Connections即可进入设置界面(4)Clock Signals表示需要采样的时钟信号,一般选择最高频率的那个时钟,而且尽量避免出现跨时钟域采样信号的情况(5)Trigger/Data Signals表示需要采用的数据为,在左侧选中后点击右侧的Make Connections即可,把所有关心的信号连接完后点OK返回到设置界面(6)此时,信号选择完毕,点Return to Project Navigator 并在弹出是否保存的提示框中选择是,返回到ISE环境。
chipscope线仿真测试步骤双击桌面上analyzer_DW_alphal_v1.6.1.exe的图标得到如下界面
若首次使用必须进行如下设置
1、设定chipscope的analyzer_DW_alphal_v1.6.1.exe路径
2、设置IP地址(采用以太网,利用网线进行板级硬件仿真)打开网络连接选择本地连接界面如下
右击在快捷菜单中选择属性对话框出现如下界面
找到internet 版本(TCP/IPv4)双击出现如下界面设置ip和子网掩码
即可完成设置回到如下界面
选择板卡编号和FPGA编号点击确定自动进入如下界面
选择JTAG Chian菜单下的open Plug-in
出现如下界面
单击确定进入如下界面
在Device下的器件的子菜单中选择configure
选择select new File出现如下界面
选择所需的bit文件点击打开回到如下界面
如上图进行勾选后单击OK出现如下界面
单击OK出现如下
点击Waveform出现如下界面
可以编辑信号选择相应的信号右击选择move new Bus可以编辑信号并更改信号名
选择triggersetup在如下界面设置触发信号
点击三角形的按钮即可运行
保存相应工程
如果想打开已存在的工程有如下步骤选择file open project
出现如下界面选择NO
出现如下界面选择相应的工程文件*.Cpj点击打开出现如下界面。
Xilinx的Chipscope类似于Altera的Signaltap。
下面记录一下Chipscope的使用方法。
1. 生成Chipscope文件第一步: 打开ISE Design Tools下的CORE Generator工具。
第二步: 在Xilinx CORE Generator的环境中选择菜单File->New Project,在弹出的对话框中选择存放的目录保存即可。
设置如下。
些,呵呵!选完后Apply一下OK关闭。
第五步: 双击IP Catalog窗口的Debug&Verification下的ICON(chipscope Pro –integrated Controller) 。
第六步: 在弹出的窗口中点击Generate就可以了。
第七步: ICON生成完成后,再双击IP Catalog窗口的Debug&Verification下的ILA(Chipscope Pro –Integrate Logic Analyzer)。
第八步: 在ILA的配置可以根据自己的需要来选择,我们这里不强求,我们这里选择一个触发Group,选择数据的采样深度为2048,就是一次采样2048个点,这个深度当然越大越好,但FPGA资源有限啊!设置完后点击Next。
也会用到Chipscope, 这样程序中基本上的信号都能观察了。
设置完后再Generate。
第十步: 这样我们所需的Chipscope文件都已经生成好了,我们可以在eeprom_test 的目录下看到生成的文件,特别要注意下图中我用红色圈出来的文件,如果在其它的工程中我们需要使用Chipscope的话,只要把这四个文件拷过去就好了,不要费老大力气的再重新生成一边。
接下来是Analyzer:点击Open cable按钮建立JTAG连接。
如果开发板和JTAG连接正常的话,Chipscope能找到开发板使用的FPGA芯片。
点击OK把Data Port里的CH0 ~CH7组合成一个组,方法是按Ctrl键,再选择Data port 里的CH0~CH7, 点击右键,选择Move to Bus->New Bus。
实验:芯片调试实验芯片调试实验实验内容这个实验将指导你通过加入ILA/ICON内核到设计来执行片上查证的过程。
实验目的完成这个实验后,你将能够:●生成一些能在PicoBlaze上运行的任务。
●使用Chipscope-Pro生成ILA 和ICON 内核,将其插入一个PicoBlaze设计中。
●下载位流,在硬件上运行程序。
●执行片上确认,通过Chipscope分析器查看波形。
实验步骤在这个实验中,你将要修正一个以PicoBlaze为目标板的应用软件,使用Chipscope-Pro执行片上确认。
这个实验包括五个主要步骤:●加入一个Chipscope工程文件到设计●修正ILA参数和连接●修正软件,更新设计●对于没有相连的转换输入,分配终端约束●执行片上查证根据以下给出的每条指令,你将找到在以下的实验步骤中,配合每一步操作,我们配有相关的图示。
如果对流程比较熟悉,可以跳过其中的一些操作。
注意:如果在以后你想看这些实验,您可以从Xilinx的大学计划网站/univ上下载相应的文件。
设计总结你将使用Chipscope-Pro插入ICON 和ILA 内核到设计中,ILA内核触发端口从设计中的uar t_rx 和uart_tx 模块实现信号反馈,接着,当文本输入via hyperterminal后,建立的触发端口将捕捉数据。
当缓冲器满的时候,你将看见最终结果列在Chipscope中。
产生一个新的Chipscope-Pro工程步骤1启动ISE™ Project Navigator,打开工程文件。
1.打开Xilinx ISE软件,选择Start → Programs → Xilinx ISE 8.2i → Project Navigator2.选择File → Open ProjectVerilog users: Browse to c:\xup\fpgaflowlabs\verilog\lab4VHDL users: Browse to c: \xup\fpgaflow\labs\vhdl\lab43. 选择chipscope.ise点击Open通过Project Navigator生成一个新的Chipscope-Pro工程1.在Project Navigator中选择Project New Source,打开新的源文件对话框,点击ChipscopeDefinition and Connection,命名为loopback_c s.点击<Next>继续2. 选择loopback作为源文件,点击<next>,然后点击<finish>,一个Chipscope-Pro源文件将被增加到Sources in Project窗口。
Chipscope的使用本来论文都差不多了,但是老师说缺少实验数据,没有办法,自己再加班加点补吧。
好在自己恰好有ChipScope的盘,于是赶快安装上,临阵磨枪,突击看了一晚上,有了一点点概念,这次记一下,下次就不用绞尽脑汁了。
还要感谢King帮忙查找资料。
逻辑分析仪的产生有两种方法:Core Generator(核产生器)和Core Inserter(核插入器),第一种方法产生内核,将这些内核例化后添加到原设计文件,最后综合,实现,下载。
第二种方法不需要修改原文件,它是将生成的内核添加到综合后的网表文件中,所以我们采用第二种方方法。
Core Inserter 的流程为:1)的RTL 综合成Netlist;2)调用Core Inserter 插入逻辑分析仪;3)布置和布局;4)产生bit 文件下载验证。
1. 首先用ISE对所设计的文件进行综合,然后再添加新建文件,选择ChipScope Definition 文件,选择完毕之后,添加到ISE工程。
2.对core Inserter进行配置,选择器件族,其它的默认即可,接下来是选择数据位宽,捕捉对比,进行信号连线等配置,可以根据自己的情况详细设置。
需要注意的是综合的设置需要保存Keep Hierarchy,防止优化过度。
3.按照以前运行ISE的步骤即可,知道最后下载到FPGA开发板,在ISE的最后会有ChipS cope Pro Analyze,然后点击,就运行逻辑分析仪。
然后点击JTAG连接方式,我的是用U SB的,然后选择[Device] configure 进行器件配置。
在window菜单下面可以选择触发设置窗口等选项,然后运行就可以观察你想要的波形了。
搭建Xilinx开发环境(3)…… 使用ChipScope进行调试Xilinx的ChipScope工具就相当于Altera的SignalTap II,能够捕捉FPGA内部的信号,方便了调试过程。
1、首先按平时一样用chipscope对数据进行采样!不过为了方便以后导入matlab查看,这里我们建议查
看采样信号要使用bus总线方式,这个不多说了,应该都会的。
2、点击file->export 选项,弹出一个export signals窗口,format选择ascii选项,signals to
Export选择bus plot buses,core默认就行。
3、点击export按钮,保存为.prn后缀文件。
如username.prn.
4、打开matlab软件,我们可以直接打开这个.prn文件进行编辑和查看(如果需要),也可以使用matla
b命令
xlLoadChipScopeData(‘username.prn’);
把之前chipscope导出的bus总线数据导入为malab空间变量,并且空间变量的名字和在chipscope 中bus总线对应信号线的名字一样的。
呵呵,信号变量有了,以后就可以方便进行相关信号分析处理了。