Introduction to VHDL in Xilinx ISE 10.1

Objectives


From the previous labs, we have already know that VHDL stands for VHSIC Hardware Description Language. VHSIC means Very High Speed Integrated Circuits. VHDL is an industry-standard language for modeling and synthesizing digital hardware, particularly for programmerable logic or Application Specific Integrated Circuits. The VHDL simulation serves as a basis for testing complex designs and validating the design prior to fabrication. As a result, the redesign is reduced, the design cycle is shortened, and the product is brought to market sooner. A VHDL program can be considered as a description of a digital system; the associated simulator will use this description to produce behavior that will mimic that of the physical system.

Xilinx ISE means Xilinx® Integrated Software Environment (ISE). This Xilinx® design software suite allows you to take your design from design entry through Xilinx device programming. The ISE Project Navigator manages and processes your design through several steps in the ISE design flow. These steps are Design Entry, Synthesis, Implementation, Simulation/Verification, and Device Configuration.

In this lab, you are going to see how to create a counter in the Xilinx ISE and how to simulate it with ISE Simulator. You will create a test bench waveform containing input stimulus you can use to simulate the counter module. This test bench waveform is a graphical view of a test bench.

Open Xilinx ISE 10.1

To open the Xilinx ISE 10.1, click on the Xilinx icon on the desk top
or go to the Start -> Programs -> Xilinx ISE Design Suit 10.1 -> ISE -> Project Navigator. You can close the window for the "Tip of the Day".

Create a project

In this section, you will create a new ISE project. A project is a collection of all files nesessary to create and to download a design to a selected FPGA or CPLD device.
  1. Select File > New Project. The New Project Wizard appears.
  2. First, enter a location (directory path) for the new project, then give a name for the project. For example, we name it Counter01.

    Here is a picture to illustrate the idea.

  3. Select HDL from the Top-Level Module Type list, indicating that the top-level file in your project will be HDL, rather than Schemetic or other stuffs.
  4. Click on Next to move to the project properties page.
  5. Fill in the properties in the table as shown below:
    	Device Family:		Virtex2P
    	Device:			XC2VP30
    	Package:		ff1152
    	Speed:			-6
    	Synthesis Tool:		XST [VHDL/Verilog]
    	Simulator:		ISE Simulator [VHDL/Verilog]
    	Preferred Language:	VHDL
    	
    	all the rest should be default
    
    When the table is complete, your project properties should look like the following:
  6. Click Next to proceed to the Create New Source window in the New Project Wizard. At the end of the next section, your new project will be created.

Create VHDL Source

In this section, you will create a top-level HDL file for your design. You are going to design an up-down counter which is the same as what you did in the previous lab.
	This simple counter design has two inputs: CLOCK and DIRECTION.  
	The direction of the up-down counter is indicatingd by the DIRECTION input.  
	The design has one 4-bit bus output called COUNT_OUT.
  1. Click New Source in the New Project Wizard to add to one new source to your project.
  2. Type in the file name counter.
  3. Select VHDL Module as the source type in the New Source Dialog box.
  4. Verify that the Add to Project checkbox is selected.
  5. Click Next.
  6. Define the ports for your VHDL source.

  7. Click Next in the Define Module dialog box.
  8. Click Finish in the New Project Wizard - Summary dialog box to complete the new source file template.
  9. If the following window appears, click on "yes".
  10. Click Next in the New Project Wizard.
  11. Click Next again.
  12. Click Finish in the New Project Wizard - Project Summary dialog box.
    ISE creates and displays the new project in the Source in Project window and adds the counter.vhd file to the project.

    The counter.vhd file contains:

  13. In the header section, fill in the following fields:
    Here is how it looks like:

Enter and Edit VHDL Code

  1. In VHDL, the output port cannot be read from within the design, therefore a new temporary signal must be made. Type the following line below the architecture declaration and above the first begin statement:
    	signal count_int: std_logic_vector(0 to 3) := "0000";
    
  2. You need a process statement with the following information:
    	if DIRECTION = '1' then 
    		count_int <= count_int + 1;
    	   else
    		count_int <= count_int - 1;
    	end if;
    
  3. Below the end process statement, enter the following line:
    	COUNT_OUT <= count_int;
    
  4. Save the file by selecting File -> Save. When you are finished, the code for the counter should look like the following:
    	architecture Behavioral of counter is
            signal count_int: std_logic_vector(0 to 3) := "0000";
    	begin 
    	
            process (CLOCK)
    	begin
    	     if CLOCK'event and CLOCK = '1' then
    		if DIRECTION = '1' then 
    			count_int <= count_int + 1;
    	   	else
    			count_int <= count_int - 1;
    		end if;
                 end if;
    	end process;
    	
    	COUNT_OUT <= count_int;
    	
    	end Behavioral;
    

    You have created the VHDL source for the Counter01 project. Here is how it looks like:

    Now, proceed to Checking the Syntax of the New Counter.

Check the Syntax of your VHDL source - Synthesize Your Code

When source files are complete, the next step is to check the syntax of the design. Syntax errors and typos can be found using this step.

  1. Select the counter design source in the ISE Sources window to display the related processes in the Processes for Source window.
  2. Click + next to the Synthesize-XST process to expand the hierarchy.
  3. Double-click on the Synthesize -XST process.

    When an ISE process completes, you will see a status indicator next to the process name.

  4. Look in the Console tab of the Transcript window and read the output and status messages produced by any process you run.
  5. You must correct any errors found in your source files. If you continue without valid syntax, you will not be able to simulate or synthesize your design.
  6. You would like to see "Process 'synthesis' completed successfully". or "Process 'Check Syntax' completed successfully".

Design Simulation - Simulate the Module Using the ISE Simulator

Create a Test Bench for Simulation

In this section, you will create a test bench waveform containing input stimulus you can use to simulate the counter module. This test bench waveform is a graphical view of a test bench. It is used with simulator to verify that the counter design meets both behavioral and timing design requirements. You will use the waveform editor to create a test bench waveform (TBW) file.
  1. Select the counter HDL file in the Sources in Project window.
  2. Create a new source by slecting project -> New Source.
  3. In the New Source window, select Test Bench Waveform as the source type, and type countertestbench in the File Name field.
  4. Make sure the box for Add to Project is checked.
  5. Click Next.
  6. The Cource File dialog box shows that you are associating the test bench with the source file: counter. Click Next.
  7. Click Finish.
    You need to set the initial values for test bench waveform in the Initialize Timing dialog box before the test bench waveform editing window opens.

  8. Fill in the fields in the Initialize Timing dialog box using the information below:
  9. Click Finish to open the waveform editor.

    The blue shaded areas are associated with each input signal and corresponding to the Input Setup Time in the Initialize Timing dialog box. In this design, the input transitions occur at the edge of the blue cells located under each rising edge of the CLOCK input.

  10. Look at the following picture for the setup of the DIRECTION port.
  11. Selct File -> Save to save the waveform.
  12. Select the Behavioral Simulation in the Source window.
  13. On the Sources in Project Window, the TBW file countertestbench.tbw is automatically added to your project.

Simulating Behavioral Model (ISE Simulator)

To run the integrated simulation process in ISE:
  1. Select the countertestbench waveform in the Sources in Project window. You can see Xilinx ISE Simulator processes in the Processes for Source window.
  2. Double-click on the Simulate Behavioral Model process in the Project window. The ISE Simulator opens and run the simulation to the end of the test bench.

    Here is the ISE window showing the simulation results.

Lab Assignments


This page last modified:
Thursday, 06-Oct-2011 12:13:32 CST
Accessed     times.