Difference between revisions of "Xilinx ISE Lab No. 1: Schematics Input"

From dftwiki3
Jump to: navigation, search
(Testing the design with the simulator)
(Testing the design with the simulator)
Line 239: Line 239:
  
 
[[Image:Xilinx_ISE_Simulator1.png|right|400px]]
 
[[Image:Xilinx_ISE_Simulator1.png|right|400px]]
This step will allow you to create a module that will make A and B take all the values possible of 00, 01, 10, and 11, and see how the circuit reacts to it.
+
This step will allow you to create a module that will make A and B take all the possible values ranging from 00, 01, 10, to 11, and see how the two-bit adder circuit reacts to it.
  
 
* First create a new simulation module: From the main menu, pick '''Project''' then '''New Source'''.
 
* First create a new simulation module: From the main menu, pick '''Project''' then '''New Source'''.

Revision as of 14:30, 16 April 2012

--D. Thiebaut 16:53, 14 April 2012 (EDT)


This lab is an introduction to Xilinx ISE and to the CoolRunner-II kit. Unfortunately the CoolRunner-II and its programming utility from Digilent works only with Windows XP, so we won't be able to download the design into the CPLD chip, but we can still energize and test the design with the ISE Simulator.
Note: You'll need a two-button mouse to work with the ISE. The Mac's magic mouse does not open up all the properties of the differen


CoolRunner-II kit.jpg


Introduction

Xilinx's ISE is "Xilinx ISE[1] is a software tool produced by Xilinx for synthesis and analysis of HDL designs, which enables the developer to synthesize ("compile") their designs, perform timing analysis, examine RTL diagrams, simulate a design's reaction to different stimuli, and configure the target device with the programmer." [1]

The goal of this lab/tutorial is to get the reader familiar with the process of designing a simple digital electronic circuit, compiling it, and verifying it correct behavior with a simulator.

Knowledge of digital logic (basic gates, flip-flops, Moore machines) is assumed.

This lab is based on the excellent series of labs created for the CoolRunner CPLD by Tiffany Liu in her Independent Study in the CS. Dept. at Smith College.[2]

Installation of Xilinx ISE 13.4 on Windows 7

The first step is to install the ISE. It is a long process that can take more than an hour, so be prepared and start early!

If you have a Mac, you could use Parallels with Windows 7 running as a virtual machine. The ISE works in this setup as well.

The steps described below describe the installation of the most recent version of the ISE in April 2012: ISE 13.4

  • Go to Xilinx's Download site
  • Download ISE 13.4 full installer for windows
  • When asked for a userId and password, you can either create your own Id or use this one:

    • This section is only visible to computers located at Smith College

  • Click Next
  • The file should start downloading. It takes about 30 minutes on a wireless connection.
  • Unpack tar file into directory (in Dowloads folder). If Windows complain that it doesn't know how to unpack a file with a tar extension, download the 7-zip open-source utility, and use it to unpack the archive.
  • Once in the exploded directory, run the xsetup application
  • Pick WebPack when asked for what to install
  • Accept all defaults and install in C:\Xilinx folder

Lab 1: Creating a 2-bit Adder with Schematics

New Project

CSC270 Xlinx create proj.png
  • Open the ISE
  • File/New Project
  • Pick a name: TwoBitAdder
  • Accept the default location
  • Top-Level source: Schematics









  • Next









CSC270 Xlinx create proj2.png
  • Project Settings:
    • Family: CoolRunner2 CPLDs
    • Device: XC2C257 (this is the marking on the CPLD on the actual kit)
    • Package: TQ144 (also marked on the CPLD on the actual kit)
    • Speed: -7
    • Keep all others unchanged.

















New Source

CSC270 Xilinx ISE emptyProj.png
  • Click on top left icon (see image to the right) to add a new source to the project.
  • Pick Schematic as the type
  • Name it with a name that makes sense, e.g. circuit1.

















  • If you need to remove gates, select the gate you want to delete, and click on the red cross icon in the top icon bar.






CSC270 Xilinx ISE Schematics.png
  • Pick the Symbols tab (bottom of left pane)
  • Select Logic in top list
  • Select And2 and Xor2 gates and position them on sreen



















CSC270 Xilinx ISE SchematicsAdder.png
  • Add wires between the inputs of the two gates (two vertical wires in the shape of [ brackets)
  • Add two horizontal writes between the wires just inserted and points that will become input tags.
  • Add two input tags to the two input wires just addes, and two output tags to the two outputs of the gates.
  • Right-click on the Tabs and rename the two input ones as A and B, and the two output ones as Carry and Sum.
  • Type Control-S to save the schematics to file.

Implementation Constraints File

The purpose of the Implementation Constraints File (ICF) is to associate input and output tabs with actual pins of the CPLD chip we are using.

The image below shows all the pins available to us:


CPLD CoolRunnerII PinOut.jpg


Note that we can use Pins 64, 66, 68, and 69 for LED outputs, and pins 39, 94, 124 and 143 for input pins.

  • Click on the Design tab of the left window.
  • Select the circuit1.sch file and right click on it.
  • New Source. Pick Implementation Constraints File. Name it something like circuits as well. (It will get its own extension.)
  • Check under the circuit1.sch menu item, there should now be a file called circuit1.ucf.
  • Select the ucf file and in the lower pane (processes pane), open the User Constraints option and click on Edit Constraints.
  • In the editor window on the right, enter the following lines:


NET A        LOC = P124; 
NET B        LOC = P38;

NET Carry    LOC = P68;
NET Sum      LOC = P69;

  • Save with Control S


Implement Design

It is now time to

  1. Synthesize
  2. Translate
  3. Fit the design to the chip, and
  4. Generate the Programming File that can be downloaded to the device.
  • Select the circuit1.sch file in the Hierarchy window
  • In the Process window, double click on Implement Desgin. This will automatically call all the actions listed above. The result is a programming file that will appear in the TwoBitAdder project directory.

Downloading to the CPLD

  • Unfortunately, we have to skip this step at this time as the CPLD Windows Utility that interfaces with the CPLD and allows downloading of programming file does not work under Windows 7. Only Windows XP is supported at this time (April 2012).

Testing the design with the simulator

Xilinx ISE Simulator1.png

This step will allow you to create a module that will make A and B take all the possible values ranging from 00, 01, 10, to 11, and see how the two-bit adder circuit reacts to it.

  • First create a new simulation module: From the main menu, pick Project then New Source.
  • Choose Verilog Test Fixture as the type of the module. Give it a meaningful name, for example test.
  • Click Next and make sure that your original schematic module is selected.
  • Next then Finish.
  • the ISE will have generated a test module for us. It's almost what we need. We just need to modify it a tad, as shown below:













// Verilog test fixture created from schematic Y:\Desktop\Xilinx Stuff\Projects\TwoBitAdder\circuit1.sch - Mon Apr 16 14:48:13 2012

`timescale 1ns / 1ps

module circuit1_circuit1_sch_tb();

// Inputs
   reg B;
   reg A;

// Output
   wire Carry;
   wire Sum;

// Bidirs

// Instantiate the UUT
   circuit1 UUT (
		.Carry(Carry), 
		.Sum(Sum), 
		.B(B), 
		.A(A)
   );
	
// Initialize Inputs
   
      initial begin
		B = 0;
		A = 0;

		// wait 100 ns  
		#100;	
			 
		// after 10 ns, set B to 1
		#10 B = 1;
			 
		// after 10 ns, set A to 1, reset B to 0
		#10 A = 1;
		    B = 0;
			 
		// after 10 ns, set B to 1
		#10 B = 1;
		end
		
endmodule














References

  1. Xilinx ISE, captured on wikipedia.org, April 2012.
  2. Tiffany Liu, CSC270 Labs on the CoolRunner-II, Independent Study, Fall 2011, cs.smith.edu/classwiki.