11 eeng 1920 introduction to vhdl. 22 hardware description language a computer language used to...
DESCRIPTION
33 VHDL History Developed by defense contractors as a standard for programming circuits. Currently defined by IEEE Standard Related standard for certain data types is IEEE StandardTRANSCRIPT
11
EENG 1920
Introduction to VHDL
22
Hardware Description Language
• A computer language used to design circuits with text-based descriptions of the circuits.
• VHDL (VHSIC Very High Speed Integrated Circuit Hardware Description Language) is the industry-standard language used for programming PLDs.
33
VHDL History
• Developed by defense contractors as a standard for programming circuits.
• Currently defined by IEEE Standard 1076-1993.
• Related standard for certain data types is IEEE Standard 1164-1993.
44
VHDL
• Used to describe the structure or behavior of hardware.
• Describes how the hardware should operate (modeling).
• Describes how how the hardware should be built (synthesis).
55
VHDL
• In VHDL the designer enters text according to the syntax of the language.
• Syntax: The rules of construction, or “grammar”, of a programming language.
66
Entity and Architecture
• Two basic constructs required for all VHDL code.
• The entity declaration describes the inputs and outputs.
• The architecture body defines the relationships between the inputs and outputs.
77
VHDL Entity
• Defines the external aspects of the function.• Each input or output is a port.
– IN refers to a port used only for input.– OUT refers to a port used only for output
8
VHDL Entity Declaration
8
AC BC AB Y
AB
AC
BC
ENTITY majority_vote IS PORT( a, b, c: IN BIT; y : OUT BIT);END majority_vote;
99
VHDL Architecture Body
ARCHITECTURE maj_vote OF majority vote ISBEGIN y <= (a and b) or (b and c) or (a and c);END maj_vote;
AC BC AB Y
AB
AC
BC
1010
Boolean Operators in VHDL
• AND, OR, NOT, NAND, NOR, XOR, and XNOR are represented as written.
• VHDL has no order of precedence for Boolean operators.
• Expressions must be written explicitly with parentheses.
1111
Boolean Operators Example
• • Y <= (a and(not b)) or ((not a) and b and (not
c));• • Y <= not((a and b) or ((not a) and (not c)) or d);
CBA B AY
DCAAB Y
Using Xilinx ISE 8.1i
12
Using Xilinx ISE 8.1i1. Start/All Programs2. Locate Modelsim / license Wizard(Click)
13
Using Xilinx ISE 8.1i
3. Click Continue
14
Using Xilinx ISE 8.1i
4. Click OK (Window should be as shown)
15
Using Xilinx ISE 8.1i
5. Click Yes
16
Using Xilinx ISE 8.1i6. Click OK
17
Using Xilinx ISE 8.1i7. Click OK8. Repeat steps 1-7 one more time.
18
Using Xilinx ISE 11.1
19
Using Xilinx ISE 11.1
1. Before beginning, license your Xilinx ISE. 2. Double click on Xilinx ISE 11.1.3. Click oK on “NO license” window.4. Click on Help.5. Click on Manage license.6. In the XILINX_LICENSE_FILE type: [email protected]. Click Set8. In the LM_ LICENSE_FILE type: [email protected]. Click Set10. Click Close
20
21
VHDL EntryIf we choose VHDL as the design entry, we can use any text editor tool to create and edit the VHDL code and then add the VHDL file into an ISE project. For example, you can open Notepad, type (or cut and paste) in the following VHDL code, and save the model as a file such as ccb2.vhd (be sure to remove any .txt extension that Notepad adds at the end of the file name).library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_ARITH.all; use IEEE.std_logic_UNSIGNED.all;
entity CCB2 is Port ( Din0 : in STD_LOGIC; Din1 : in STD_LOGIC; Sel : in STD_LOGIC; Dout : out STD_LOGIC);
end CCB2;
architecture Behavioral of CCB2 is
begin Dout <= (Din0 and not Sel) or (Din1 and Sel);
end Behavioral;
22
New Project
1. Start Xilinx ISE 8.1i project navigator by double clicking the ISE icon on your desktop.
2. Click on File and select New project
23
Project window3. Name your project and project location, then click next
24
New Project Wizard4. The Spartan Starter Kit PCB board uses a Xilinx Spartan3 XCS200
FPGA chip which is packaged in a flat thin 256-pin (FT256) ball Grid Array. Set these values the new project Wizard window,
25
Create New Source 5. We will add our sources to this project later, so here we skip the
following two steps (create source and add source). Click on Next.
26
Project Summary6. Check the project summary and click Finish
27
VHDL7. Now we will create a blank sheet for schematic capture. First,
click the project and new Source menu.
28
VHDL2. Click VHDL Module and type in the name for your
schematic. Select add to project before clicking Next.
VHDL
29
We will program this circuit in VHDL
30
VHDL3. Define the Module
31
VHDL4. Check over the summary and click on Finish
32
VHDL5. Now an empty VHDL file has been created which already has the entity and skeleton of the architecture. Type in your VHDL codes in architecture and complete your design. After you finish the design, save the file.
33
Design Verification
34
Design Verification
1. Select Behavioral Simulation and double click on CCB2.sch
35
Design Verification2. Expand ModelSim Simulator and double click on Double click on
Simulate Behavioral Model
36
Design Verification3. This is the window that appears
37
Design Verification4. At VSIM2> type in force signal-name state-value time as
shown. Enter after run will run the simulation.
38
Synthesize the Design
39
Synthesize the Design1. Click on Xilinx-ISE to get Design Summary and select as shown by
the arrows
40
Synthesize the Design2. Right click as shown by the arrow and click on run. A design
is produced.
41
Synthesize the Design3. Select Project/New Source
42
Synthesize the Design4. Click as shown, type in the File name and click
on Next.
43
Synthesize the Design5. This window appears, click on Next.
44
Synthesize the Design6. This window appears, click on Finish
45
Synthesize the Design7. The design summary appears, click as shown by the arrow. We will assign
pin numbers
46
Synthesize the Design
8.
47
Synthesize the Design
9.After saving the pin arrangement, click on OK
48
Synthesize the Design10. After the constraints file has been completed, right click on
Implement Design and select Run.
49
Synthesize the Design11. Right click on Generate Programming file and select Run
50
Synthesize the Design12. Finally, an FPGA configuration data (*.bit) file is generated.
51
Download and Verify The Design
52
Download and Verify The DesignThis is the last step in the design verification process. This section provides instructions for downloading the MUX design onto the Spartan 3 PCB.
1) Connect the 5V DC power cable to the power input on the demo board (J4). (note: you may see a sequence of numbers begin to flash on the 7-segment LEDs, this is just a test configuration stored in the flash memory on the PCB and you can manipulate the various switches and button, except for the PROG button, on the PCB to see the operation of the LEDs and 7-segment displays).
2) Connect the download cable between the PC parallel port and the demo board (J7). 3) Select Synthesis/Implementation from the drop-down list in the Sources window and select Mux_Schematic or Mux_vhdl (or whatever you named you design) in the Sources Window. In the Processes window, expand the Generate Programming File process and double-click the Configure Device (iMPACT) process.
53
Download and Verify The Design1. Processes window, expand the Generate Programming File
process and double-click the Configure Device (iMPACT) process.
54
Download and Verify The Design2. iMPACT opens and the Configure Devices dialog box is displayed. In the
Welcome dialog box, select Configure devices using Boundary-Scan (JTAG). Verify that Automatically connect to a cable and identify Boundary-Scan chain is selected. Click Finish.
55
Download and Verify The Design3. When programming is complete, the Program Succeeded
message is displayed.
56
Download and Verify The Design
4. Close iMPACT without saving. Your design is downloaded into the FPGA and you can begin to verify the design by manipulating swithes/buttons and observing LEDs as specified in your design.