You are on page 1of 16

Xilinx ChipScope Tutorial Electronics Tuts, tips and much more

Page 1 of 16

Electronics Tuts, tips and much more


If we hear, we forget; if we see, we remember; if we do, we understand Confucius

Xilinx ChipScope Tutorial


Posted by Omkar on March 24, 2010

Using the ChipScope Pro for Testing HDL Designs on FPGAs


Introduction: Simulation based method is widely used for debugging the FPGA design on computers. Time required for simulating complex design for all possible test cases becomes prohibitively large and simulation approach fails. For rapid testing, such designs can be loaded on to the target FPGAs and tested by applying test inputs and directly observing their outputs. As the complexity of the design under test increases, so does the impracticality of attaching test equipment probes to these devices under test. The ChipScope Pro tools integrate key logic analyzer and other test and measurement hardware components with the target design inside the FPGA. Computer based software tool communicate with these hardware components and provide a designer robust logic analyzer solution. In this tutorial we will use simple UP counter design and test it using ChipScope. You can download the PDF file of this tutorial from here. NOTE: For more detailed information on various settings and parameters of ChipScope Pro, refer to ChipScope Pro 10.1 Software and Cores User Guide. Couter Design: Create a new project in the Xilinx ISE and paste the following counter code in top module (cntr.v):

http://elecrom.wordpress.com/2010/03/24/xilinx-chipscope-tutorial/

6/20/2013

Xilinx ChipScope Tutorial Electronics Tuts, tips and much more reg [25:0] cnt; assign count[3:0] = cnt[25:22]; always @(posedge clk) begin if(rst) cnt <= 0; else cnt <= cnt + 1; end endmodule

Page 2 of 16

To assign the constraints to the design, create new file named cntr.ucf and add it to ISE project. Paste following constrains in cntr.ucf file. These constraints are applicable for XUP-V2P Development board. NET "count<0>" LOC = AC4; NET "count<1>" LOC = AC3; NET "count<2>" LOC = AA6; NET "count<3>" LOC = AA5; NET "clk" LOC = AJ15; NET "rst" LOC = AG5; These constraints connect the rst signal to ENTER button on the development board. Output nets are connected to on board LEDs. Configuring the logic analyzer core: In order to test the counter design we have to configure and insert the logic analyzer core in our design. Follow these steps: In the Sources view right click on the top module (cntr.v) and select New Source.

http://elecrom.wordpress.com/2010/03/24/xilinx-chipscope-tutorial/

6/20/2013

Xilinx ChipScope Tutorial Electronics Tuts, tips and much more

Page 3 of 16

In the New Source Wizard window, select ChipScope Definition and Connection File and specify the filename as debug. Click Next.

Now we have to associate this debug.cdc file with our desired top module. Thus select cntr from list of the modules. If there are multiple modules shown, select the one which you wish to test. Click Next and then click Finish.

Note that debug.cdc file has been added to your Sources list and is listed below the selected top module (cntr).

Double click on debug.cdc to launch the ChipScope Pro Core Inserter application. This application will integrate the logic analyzer core into our counter design. Do not alter any settings on the first screen. Click Next.

http://elecrom.wordpress.com/2010/03/24/xilinx-chipscope-tutorial/

6/20/2013

Xilinx ChipScope Tutorial Electronics Tuts, tips and much more

Page 4 of 16

To observe any signal, we have to specify the trigger. Logic analyzer core will start capturing the desired signal upon activation of trigger signal. In this example we want to monitor the counters counting action as soon as rst signal is deactivated. So we will create two trigger ports. One port will be rst signal and another port will be counters eight least significant bits. Set Number of trigger ports to 2. In TRIG0 frame set Trigger Width as 1 (since rst is one bit signal). In TRIG1 frame set Trigger Width as 8 (as we want to observe counters 8 least significant bits).

Click Next. Now in this window we will specify capture parameters. We want to use our trigger ports as data ports which will be recorded by logic analyzer. We also want to sample data on rising clock edge. In Sample On list select Rising. Set Number of samples to be recorded by changing Data Depth to 1024 samples. This will record 1024 samples from the trigger event. You can at the most record 16K samples. Select both check boxes in Trigger Ports Used As Data frame.

http://elecrom.wordpress.com/2010/03/24/xilinx-chipscope-tutorial/

6/20/2013

Xilinx ChipScope Tutorial Electronics Tuts, tips and much more

Page 5 of 16

Click Next. Now we will specify which signal(s) to be used as Clock and Trigger. Click on Modify Connections.

Select the Clock signals Pane, then select clk_BUFG signal from the left hand side list and then click on Make Connection. This will add clk signal as the clock signal for logic analyzer.

Now select Trigger/Data signals pane. Select TP0 and connect rst_IBUF signal to CH0 channel.

http://elecrom.wordpress.com/2010/03/24/xilinx-chipscope-tutorial/

6/20/2013

Xilinx ChipScope Tutorial Electronics Tuts, tips and much more

Page 6 of 16

Similarly click on TP1 pane and add connect counters lowe eight bits to eight channels.

Click OK once you finish making connections. Now in the main window click on Return to Project Navigator. It will ask for saving the project, click Yes.

Now we are ready to compile the entire counter design along with the logic analyzer core. In the ISE, select top level module cntr and in the Processes pane double click on Analyze Design Using ChipScope. This will start the process to synthesize combined unit consisting of design under test (in this case counter) and the ChipScope cores.

http://elecrom.wordpress.com/2010/03/24/xilinx-chipscope-tutorial/

6/20/2013

Xilinx ChipScope Tutorial Electronics Tuts, tips and much more Debugging the design using ChipScope Analyzer tool:

Page 7 of 16

Once the synthesis gets over, ISE will launch the Analyzer tool. Make sure that FPGA board is connected to PC. Once the analyzer tool is running, click on Initialize JTAG Chain icon located at the top right corner of the window. This will initialize the JTAG chain and identify the devices found in the chain. A dialog box will appear showing the devices discovered. Click OK.

Now select the FPGA device from the JTAG chain, right click and then select Configure to specify the configuration bit stream file.

Select the bit stream file cntr.bit from the bit stream folder. Then click OK.

http://elecrom.wordpress.com/2010/03/24/xilinx-chipscope-tutorial/

6/20/2013

Xilinx ChipScope Tutorial Electronics Tuts, tips and much more

Page 8 of 16

IMPORTANT: After clicking OK, tool will load the bit stream file into FPGA and check the availability of debugging cores. If debugging core is found tool will show INFO: Found 1 Core Unit in the JTAG device Chain. Message in status window. If you see Found 0 Core message instead, then either you have selected wrong bit stream file or something has gone wrong in one of the previous steps and debugging core has not been inserted properly into the design. If everything is fine then you will see options for Logic Analyzer core inserted in our design. Now double click on the Trigger Setup element to launch trigger setup window. And for trigger port 0 (i.e. rst signal) specify the trigger Value 0.

This will make logic analyzer to trigger as soon as rst become zero and record 1024 samples on successive clock edges. Note that trigger signals are sampled on rising clock edge. Double click on Waveform element to see the waveform. Now everything is ready. To apply the settings and ARM the trigger click on button. After that press the Down button on the development board to release the rst signal. This will trigger the logic analyzer. Once 1024 samples are recorded, this data will be transferred to PC and will be displayed in the waveform window.

http://elecrom.wordpress.com/2010/03/24/xilinx-chipscope-tutorial/

6/20/2013

Xilinx ChipScope Tutorial Electronics Tuts, tips and much more

Page 9 of 16

Final data is uploaded on PC and displayed in waveform window.

NOTE: To see the names of the trigger ports, you can import the debug.cdc file in analyzer tool. Click on File>Import and then select debug.cdc NOTE: For more detailed information on various settings and parameters of ChipScope Pro, refer to ChipScope Pro 10.1 Software and Cores User Guide. About these ads

This entry was posted on March 24, 2010 at 10:48 pm and is filed under Electronics, Programmable Logic. Tagged: Electronics, FPGA Tutorial. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

27 Responses to Xilinx ChipScope Tutorial


http://elecrom.wordpress.com/2010/03/24/xilinx-chipscope-tutorial/ 6/20/2013

Xilinx ChipScope Tutorial Electronics Tuts, tips and much more

Page 10 of 16

1.

mahi said
May 24, 2013 at 1:43 am i want to see the out put of my adc on chip scope.I have clk2 as a divided clock which i am using as a clock to adc and i hav 10 bit signal as output.I am ot getting which signal to be connected to trigger.I have connected clk2_buf to clk port and my signal to trigger and set the data port same as trigger but i am not getting the output waveforn ..Can me please help me with this. Reply

Omkar said
June 12, 2013 at 2:06 pm May be problem with a clock. Or design is not functioning at all. Try simulating the design first. Reply

2.

Mohan said
March 24, 2013 at 11:55 am sir i have 2 problems in spartan 3e using xilinx 10.1 1. I cant change the trigger width 2. After press play button itll take more time to upload waveform and the sample %ge is at 0 only. Reply

3.

satish said
November 20, 2012 at 6:11 pm for the below comment.. It is not coming as clock signal,it is coming always high signal. Reply

Omkar said
November 26, 2012 at 10:54 am

http://elecrom.wordpress.com/2010/03/24/xilinx-chipscope-tutorial/

6/20/2013

Xilinx ChipScope Tutorial Electronics Tuts, tips and much more

Page 11 of 16

You cannot see the sampling clock in the chipscope. If you wish to see the clock signal itself, then, use the DCM to generate a clock signal which is twice (or even multiple) of the frequency of clock signal you want to observe. Then use this signal as a chipscope clock. You cannot measure time period from chipscope directly. Each time sample in the chipscope corresponds to one time period of the chipscope clock. Reply

4.

satish said
November 20, 2012 at 6:09 pm I tried to see input clk in chip-scope pro wave window,but it is coming as clock signal.Why? In chip -scope pro we are not able to see input clock signal?? If we want to measure the clock frequency of input signal,how to measure the frequency? Reply

5.

sumit darak said


November 6, 2012 at 8:29 am Excellent tutorialThanks a lot Reply

6.

VHDL Student said


July 25, 2012 at 12:17 am Awesome! Reply

7.

Dave said
May 26, 2012 at 5:18 am job well done!! Reply

8.

mavi said
6/20/2013

http://elecrom.wordpress.com/2010/03/24/xilinx-chipscope-tutorial/

Xilinx ChipScope Tutorial Electronics Tuts, tips and much more December 7, 2011 at 10:00 pm Sir can i know deferent between .cdc file,.ucf file,.bit file? Reply

Page 12 of 16

9.

debolina said
October 30, 2011 at 10:08 pm i am new in using chipscope pro, ur tutorial help me a lot.sir, can i watch the output of adc on spartan 3e using cipscopepro? if so,then how? plz help me giving ur suggestion and helpful document or link from where i will learnt thanks in advance sir. Reply

10.

Xilinx ChipScope Tutorial said


February 21, 2011 at 10:12 pm [...] will give students quick hands on session for using xilinx's ChipScope Pro. Have a look at it : http://elecrom.wordpress.com/2010/03cope-tutorial/ Comments/suggestions appreciated. Reply With Quote View [...] Reply

11.

Mukunda said
February 18, 2011 at 9:48 am The instructions are very clear!! Things worked at very first attempt. Thanks, Mukunda Reply

12.

Xilinx ChipScope Tutorial Electronics Tuts, tips and much more PARKCOMM Communications & Networking said
December 14, 2010 at 2:41 pm [...] via Xilinx ChipScope Tutorial Electronics Tuts, tips and much more . [...] Reply

http://elecrom.wordpress.com/2010/03/24/xilinx-chipscope-tutorial/

6/20/2013

Xilinx ChipScope Tutorial Electronics Tuts, tips and much more 13.

Page 13 of 16

Ammar said
December 14, 2010 at 10:05 am So clear tutorial. Good job Ammar Reply

14.

Ravi said
September 20, 2010 at 2:27 pm Thanks a lot. Very well documented. Reply

15.

ABDULLAH GILL said


August 10, 2010 at 10:17 am i m unable to see the waveform on SPARTAN 3E XC3S500 . CAN U KINDLY TELL WHERE THE PROBLEM IS? I LL BE VERY MUCH THANKFULL TO U. Reply

Omkar said
August 10, 2010 at 2:41 pm please check your email. Reply

ABDULLAH GILL said


August 11, 2010 at 8:31 am i m having difficulty in understanding why u have use trigger width of 8 for the second trigger port? we may have used 6 as we had 6 signals to see. 2nd problem is what the waveform is showing to us?it is a littel bit confusing?

http://elecrom.wordpress.com/2010/03/24/xilinx-chipscope-tutorial/

6/20/2013

Xilinx ChipScope Tutorial Electronics Tuts, tips and much more i hope u dont mind my silly questions . waiting for ur reply. GOD BLESS U Reply

Page 14 of 16

Omkar said
August 11, 2010 at 9:50 am - Yes, you can very well use the width of 6. What I have shown is just one example. You can use suitable width according to your requirement. What waveform chipscope shows ? Ans : Chipscope will sample the trigger ports on positive clock egde and show you the output waveform. Whatever you see at the output is basically plot of all such samples collected on the posedge of clk. It doesnt show you what happens in-between two clock edges and it is not possible to do that using chipscope. Reply

16.

abdullah said
August 9, 2010 at 11:29 am hi thanks for the tutorial its really very easy but i m having problem with it while capturing data on analyzer i m using spartan 3e starter kit.can u please help me out of this? Reply

Omkar said
August 9, 2010 at 12:08 pm which analyzer u r using ? Reply

ABDULLAH GILL said


August 10, 2010 at 12:41 pm i m using v10.1 of xilinx . how can i use chipscope pro in my design of OFDM. do i need to make some ammendments or just follow the above steps. anxiously waiting for ur reply. Reply

http://elecrom.wordpress.com/2010/03/24/xilinx-chipscope-tutorial/

6/20/2013

Xilinx ChipScope Tutorial Electronics Tuts, tips and much more

Page 15 of 16

17.

Santosh said
July 18, 2010 at 2:14 pm Thanks for the tutorial. Easy to follow and effective. Reply

18.

Charles said
June 18, 2010 at 8:55 pm Excellent tutorial. I am an independent contractor and I have a client who is interested using the Xilinx Virtix5 in an FPGA design. What tools do I need to input the the state diagram and input into a state machine. Is there a program that can take the state machine and cover it into a timing diagram? Thanks Reply

Omkar said
June 20, 2010 at 11:39 am Hi, I didnt get what exactly you want to do. There are some tools available which can realize the state machine from state diagram, but they are highly expensive. If you have complete description of the system and its state (or the state diagram), it is simple to implement the state machine directly by writing verilog code. Time required to do the implementation depends on the complexity of state diagram. Reply

19.

Aaron said
May 5, 2010 at 1:24 am Excellent. Thanks. Reply

Products http://elecrom.wordpress.com/2010/03/24/xilinx-chipscope-tutorial/ 6/20/2013

Xilinx ChipScope Tutorial Electronics Tuts, tips and much more AVR fuse bits settings

Page 16 of 16

Blog at WordPress.com. | Theme: Andreas09 by Andreas Viklund.

Trust Rating 71% elecrom.wordpress.com


Related Searches: IP Cores IC Design FPGA Prototyping Electronic Systems Design Online Tutoring Program Free Online Tutoring FPGA Design Repair Windows Designing Embedded Hardware Tutor Information Circuit Board Assembly Free Photoshop

http://elecrom.wordpress.com/2010/03/24/xilinx-chipscope-tutorial/

6/20/2013

You might also like