Академический Документы
Профессиональный Документы
Культура Документы
Based on ISE In-Depth Tutorial (Xilinx) Adapted to a simple, non-clocked example design by Ragnar Johnsen, University of Agder
17.08.2010
Sources Tab
The Sources tab displays the project name, the specified device, and user documents and design source files associated with the selected Design View. The Design View (Sources for) drop-down list at the top of the Sources tab allows you to view only those source files associated with the selected Design View, such as Synthesis/Implementation. Each file in a Design View has an associated icon. The icon indicates the file type (HDL file, schematic, core, or text file, for example). For a complete list of possible source types and their associated icons, see the ISE Help. Select Help > ISE Help Contents, select the Index tab and search for Source file types. If a file contains lower levels of hierarchy, the icon has a + to the left of the name. HDL files have this + to show the entities (VHDL) or modules (Verilog) within the file. You can expand the hierarchy by clicking the +. You can open a file for editing by doubleclicking on the filename.
Snapshots Tab
The Snapshots tab displays all snapshots associated with the project currently open in Project Navigator. A snapshot is a copy of the project including all files in the working directory, and synthesis and simulation sub-directories. A snapshot is stored with the project for which it was taken, and the snapshot can be viewed in the Snapshots tab. You can view the reports, user documents, and source files for all snapshots. All information displayed in the Snapshots tab is read-only. Using snapshots provides an excellent version control system, enabling subteams to do simultaneous development on the same design.
Libraries Tab
The Libraries tab displays all libraries associated with the project open in Project Navigator.
Processes Window
This window contains one default tab called the Processes tab.
Processes Tab
The Processes tab is context sensitive and it changes based upon the source type selected in the Sources tab and the Top-Level Source in your project. From the Processes tab, you can run the functions necessary to define, run and view your design. The Processes tab provides access to the following functions: Add an Existing Source Create New Source View Design Summary Design Utilities User Constraints Synthesis Implement Design Generate Programming File
Transcript Window
The Transcript window contains five default tabs: Console, Errors, Warnings, Tcl Shell, Find in Files. Console Displays errors, warnings, and information messages. Errors are signified by a red (X) next to the message, while warnings have a yellow exclamation mark (!). Warnings Displays only warning messages. Other console messages are filtered out. Errors Displays only error messages. Other console messages are filtered out.
Based on ISE In-Depth Tutorial (Xilinx) Adapted to a simple, non-clocked example design by Ragnar Johnsen, University of Agder 17.08.2010
Workspace
Design Summary
The Design Summary lists high-level information about your project, including overview information, a device utilization summary, performance data gathered from the Place & Route (PAR) report, constraints information, and summary information from all reports with links to the individual reports.
Text Editor
Source files and other text documents can be opened in a user designated editor. The editor is determined by the setting found by selecting Edit > Preferences, expand ISE General and click Editors. The default editor is the ISE Text Editor. ISE Text Editor enables you to edit source files and user documents. You can access the Language Templates, which is a catalog of ABEL, Verilog, VHDL, Tcl and User Constraints File templates that you can use and modify in your own design.
ISIM Simulator
The iSIM simulator can be used to simulate a test bench and test fixture within the Project Navigator framework. A VHDL test bench or Verilog test fixture is the input to the simulator.
Schematic Editor
The Schematic Editor is integrated in the Project Navigator framework. The Schematic Editor can be used to graphically create and view logical designs.
Based on ISE In-Depth Tutorial (Xilinx) Adapted to a simple, non-clocked example design by Ragnar Johnsen, University of Agder
17.08.2010
2 HDL-Based Design
Getting Started
The following sections describe the basic requirements for running the tutorial based on a simple design example.
Design Description
In this tutorial we will produce a design of a cirquit that turns eight LED-lamps (L0 L7) on and off as a function of three input buttons (btn-west, btn-east, btn-north) and four input slide switches (sw3, sw2, sw1, sw0). The design is split into a lower level module, bin_decode, which is used as a function block in the top level design, LED_control. The lower level module, bin_decode, will be a HDL based design and the top level, LED_control, will be a scematic based design. The functioning of the LED_control is defined as followes: When sw3 = 0 : sw2, sw1, sw0 = 000 sw2, sw1, sw0 = 001 sw2, sw1, sw0 = 010 sw2, sw1, sw0 = 011 sw2, sw1, sw0 = 100 sw2, sw1, sw0 = 101 sw2, sw1, sw0 = 110 sw2, sw1, sw0 = 111 When sw3 = 1 : btn_west = 1 btn_east = 1 btn_north = 1 else
=> L0 => L1, L0 => L2, L1, L0 => L3, L2, L1, L0 => L4, L3, L2, L1, L0 => L5, L4, L3, L2, L1, L0 => L6, L5, L4, L3, L2, L1, L0 => L7, L6, L5, L4, L3, L2, L1, L0
Inputs
The LED_control design have the physical inputs: sw(3:0) A bus of four slide switches. These inputs are also inputs to the HDL module. btn_west, btn_east, btn_north Push buttons used only in the top-level SCH design.
Outputs
The following are outputs signals for the design. L7, L6, L5, L4, L3, L2, L1, L0 These outputs control the LED lamps of the Spartan-3E demo board.
Based on ISE In-Depth Tutorial (Xilinx) Adapted to a simple, non-clocked example design by Ragnar Johnsen, University of Agder
17.08.2010
Figure 2-1: New Project Wizard - Create New Project 3. Verify that Schematic is selected as the Top-Level Source Type and click Next. The New Project Wizard Device Properties window appears.
Based on ISE In-Depth Tutorial (Xilinx) Adapted to a simple, non-clocked example design by Ragnar Johnsen, University of Agder 17.08.2010
Figure 2-2: New Project Wizard - Device Properties 4. Select the following values in the New Project Wizard - Device Properties window:
Product Category: All Family: Spartan3E Device: XC3S500E Package: FG320 Speed: -4 Synthesis Tool: XST (VHDL/Verilog) Simulator: ISim (VHDL/Verilog) Preferred Language: VHDL-200X. This will determine the default language for all processes that generate HDL
Figure 2-3: New Source Wizard - Define Module 7. Give the names for input and outputs, in this example input bus sw (msb=3) and output buss L (msb=7) and then click Next. 8. Click Finish to complete the New Project Wizard.
Based on ISE In-Depth Tutorial (Xilinx) Adapted to a simple, non-clocked example design by Ragnar Johnsen, University of Agder 17.08.2010
Figure 2-4: VHDL File in ISE Text Editor 9. Put the code shown in FIG-2-5 between begin and end Behavioral in the automaticly generated code. with sw select L <= "00000001" when "0000", "00000011" when "0001", "00000111" when "0010", "00001111" when "0011", "00011111" when "0100", "00111111" when "0101", "01111111" when "0110", "11111111" when "0111", "00000000" when others; Figure 2-5: Manually added VHDL code
Based on ISE In-Depth Tutorial (Xilinx) Adapted to a simple, non-clocked example design by Ragnar Johnsen, University of Agder
17.08.2010
3 Schematic-Based Design
Overview of Schematic-Based Design
This chapter guides you through a FPGA schematic-based design procedure. After the design is successfully entered in the Schematic Editor, you will perform behavioral simulation, run implementation with the Xilinx Implementation Tools, perform timing simulation and configure and download to the Spartan-3E (XC3S500E) demo board.
Creating a New Source: Using New Source Wizard 1. From the top menu Project, select New Source. The New Source Wizard appears.
Figure 3-1 New Source Wizard 2. Select Schematic , type LED_control as the File Name and save in the same location as the other files. 3. Click Next and Finish 4. The Drawing window appears in the working area.
Based on ISE In-Depth Tutorial (Xilinx) Adapted to a simple, non-clocked example design by Ragnar Johnsen, University of Agder
17.08.2010
Figure 3-2: Create IO Markes Wizard 2. In the Inputs box, enter sw(3:0) 3. In the Outputs box, enter LED(7:0) 4. Click OK. The I/O markers are added to the schematic sheet. Note: The Create I/O Marker function is available only for an empty schematic sheet. However, I/O markers may be added to nets at any time by selecting Add > I/O Marker and selecting the desired net.
Based on ISE In-Depth Tutorial (Xilinx) Adapted to a simple, non-clocked example design by Ragnar Johnsen, University of Agder
17.08.2010
Figure 3-4: Symbol Browser The first component you will place is the bin_decode module. 2. Select the bin_decode module, using one of two ways: Highlight the project directory category from the Symbol Browser dialog box and select the component bin_decode from the symbols list. or Select All Symbols and type bin_decode in the Symbol Name Filter at the bottom of the Symbol Browser window. 3. Move the mouse back into the schematic window. You will notice that the cursor has changed to represent the bin_decode symbol. 4. Move the symbol outline near the top and center of the sheet and click the left mouse button to place the object. Note: You can rotate new or existing components being added to a schematic by selecting Ctrl+R. 5. Use the procedure outlined in steps 1 through 4 above to place the following components on the schematic sheet: Three AND2 Four OR2 One Obuf8 Place the components as shown in Fig 3-5.
10
Drawing Wires
Use the Add Wire icon in the Tools toolbar to draw wires (also called nets) to connect the components placed in the schematic. Perform the following steps to draw a net between the input symbol sw(3:0) and the input of bin_decode. 1. Select Add > Wire or click the Add Wire icon in the Tools toolbar.
Figure 3-6: Add Wire Icon. 2. Click the output pin of the sw(3:0) and then click the input pin on the bin_decode module. The Schematic Editor draws a net between the two pins. 3. Draw nets to connect the AND and OR components and hanging wires to the rest of the inputs and outputs as shown in Fig 3-7.
Figure 3-7: Lines between Components To specify the shape of the net: 1. Move the mouse in the direction you want to draw the net. 2. Click the mouse to create a 90-degree bend in the wire. To draw a net between an already existing net and a pin, click once on the component pin and once on the existing net. A junction point is drawn on the existing net.
Adding Buses
In the Schematic Editor, a bus is simply a wire that has been given a multi-bit name. To add a bus, use the methodology for adding wires and then add a multi-bit name. Once a bus has been created, you have the option of tapping this bus off to use each signal individually.
Based on ISE In-Depth Tutorial (Xilinx) Adapted to a simple, non-clocked example design by Ragnar Johnsen, University of Agder
17.08.2010
11
Figure 3-8: Add Net Name Icon 2. Type sw(3) in the Name box. The net name sw(3) is now attached to the cursor. 3. Click the short input line attached to the upper AND2 component. The name is then attached to this net. The net name appears above the net if the name is placed on any point of the net other than an end point. 4. Repeat the procedure for the three long lines (nets) coming into the AND2 components and give them names (starting from top): btn_west, btn_east and btn_north. 5. Repeat with the names L(7:0) (from bin_decode), int_LED(7), int_LED(0), int_LED(4), int_LED(3) (from the OR outputs) and int_LED(7:0) (into obuf8). Draw lines to combine all the short input lines to the AND2 components into one net (sw(3)). You now have the drawing shown on Fig 3-9.
Figure 3-9: More Net Names added Note: Each of the wires with identical names are now electrically connected. In this case, the nets do not need to be physically connected on the schematic to make the logical connection. Bus lines are adressed by the bus name and line number (bus sw consist of lines sw0, sw1, sw2 and sw3).
Figure 3-10: Add IO Marker Icon 2. Plase the cursor over the end of the line where you will connect the IO Marker and click the left mouse button. The IO Marker will take the name of the net it is connected to.
Correcting Mistakes
If you make a mistake when placing a component or connection, you can easily move or delete the component or line. To move the component, click the component and drag the mouse around the window. Delete a placed component in one of two ways: Click the component and press the Delete key on your keyboard. or
Based on ISE In-Depth Tutorial (Xilinx) Adapted to a simple, non-clocked example design by Ragnar Johnsen, University of Agder 17.08.2010
12
Connecting nets
Nets with different names can not be connected. All nets with the same name are handled as one net. To pass a signal from one net to another you can use the component buf between the nets. In the example we will send the signals from L(6), L(5), L(2) and L(1) to int_LED(6), int_LED(5), int_LED(2) and int_LED(1) and place a buf in each connection. The buf component has no influence on the signal. 1. Place four buf components in the drawing and connect a line stub to the input and output of each buf. 2. name the input line stubs L(6), L(5), L(2), L(1) and the output line stubs int_LED(6), int_LED(5), int_LED(2), int_LED(1) 3. Name the upper input line stubs to the OR2 components L(7), L(0), L(4), L(3). The final drawing will look like Fig 3-11. Note: If the nets appear disconnected, select View > Refresh to refresh the screen.
13
4 Behavioral Simulation
ISE Simulator Setup
ISE Simulator (ISIM) is automatically installed and set up with the ISE 12.2 installer.
Required Files
The behavioral simulation flow requires design files, a test bench file, and Xilinx simulation libraries.
Design Simulation
Verifying Functionality using Behavioral Simulation
To verify the functionality of the counter module, create a test bench waveform containing input stimuli. Create the test bench waveform as follows: 1. Select the LED_control.sch file in the Sources window. 2. Create a new test bench source by selecting Project New Source. 3. In the New Source Wizard, select VHDL Test Bench as the source type, and type LED_control_tb in the File Name field. 4. Click Next. 5. The Associated Source page shows that you are associating the test bench waveform with the source file LED_control. Click Next. 6. The Summary page shows that the source will be added to the project, and it displays the source directory, type, and name. Click Finish. 7. A template of the testbench code now opens in the text editor, se fig 4-1 below.
Based on ISE In-Depth Tutorial (Xilinx) Adapted to a simple, non-clocked example design by Ragnar Johnsen, University of Agder
17.08.2010
14
Fig 4-1: Test bench code template The template includes the component declaration section (lines 22-37) and the instantiation of the test (lines 40-46). The template also includes a stub for the main test process (tb:PROCESS, lines 48-52). It is our job to turn this simple stub into an actual test sequence that will stimulate and test our design. 8. Replace WAIT (line 51 in fig4-1) with the code shown in fig 4-2, line 52 to 87 and save the file.
Based on ISE In-Depth Tutorial (Xilinx) Adapted to a simple, non-clocked example design by Ragnar Johnsen, University of Agder
17.08.2010
15
Based on ISE In-Depth Tutorial (Xilinx) Adapted to a simple, non-clocked example design by Ragnar Johnsen, University of Agder
17.08.2010
16
Figure 4-3: Sources tab Behavioral Simulation 3. Click the + beside ISIM Simulator to expand the process hierarchy and see the picture shown in fig 4-4.
Fig 4-4: Simulation processes Simulate Behavioral Model This process starts the design simulation.
Based on ISE In-Depth Tutorial (Xilinx) Adapted to a simple, non-clocked example design by Ragnar Johnsen, University of Agder
17.08.2010
17
Performing Simulation
Once the process properties have been set, you are ready to run the ISE Simulator. To start the behavioral simulation, double-click Simulate Behavioral Model. ISE Simulator creates the work directory, compiles the source files, loads the design, and performs simulation for the time specified.
Based on ISE In-Depth Tutorial (Xilinx) Adapted to a simple, non-clocked example design by Ragnar Johnsen, University of Agder
17.08.2010
18
5 Design Implementation
Overview of Design Implementation
Design Implementation is the process of translating, mapping, placing, routing, and generating a BIT file for your design. The Design Implementation tools are embedded in the ISE software for easy access and project management. This chapter demonstrates the ISE Implementation flow. In this chapter, you will be passing an input netlist (EDN, NGC) from the front-end tool to the back-end Design Implementation tools, and you will be incorporating placement constraints through a User Constraints File (UCF). You will add timing constraints later through the Floorplan Editor.
Figure 5-1: Edit Package Pin Placement This process launches Floorplan Editor PlanAhead, but if an UCF file is not already created, the pop up window shown in fig 5-2 will appear. Answer Yes to create a new UCF file.
Based on ISE In-Depth Tutorial (Xilinx) Adapted to a simple, non-clocked example design by Ragnar Johnsen, University of Agder
17.08.2010
19
Based on ISE In-Depth Tutorial (Xilinx) Adapted to a simple, non-clocked example design by Ragnar Johnsen, University of Agder
17.08.2010
20
Figure 5-4: I/O Pin Placement 3.Repeat the placement procedure for all I/O pins with reference to the following list:
sw(3) input port connects to FPGA pin N17 sw(2) input port connects to FPGA pin H18 sw(1) input port connects to FPGA pin L14 sw(0) input port connects to FPGA pin L13 btn_west input port connects to FPGA pin D18 btn_east input port connects to FPGA pin H13 btn_north input port connects to FPGA pin V4 LED(7) output port connects to FPGA pin F9 LED(6) output port connects to FPGA pin E9 LED(5) output port connects to FPGA pin D11 LED(4) output port connects to FPGA pin C11 LED(3) output port connects to FPGA pin F11 LED(2) output port connects to FPGA pin E11 LED(1) output port connects to FPGA pin E12 LED(0) output port connects to FPGA pin F12
Based on ISE In-Depth Tutorial (Xilinx) Adapted to a simple, non-clocked example design by Ragnar Johnsen, University of Agder
17.08.2010
21
Slide Switches
When in the UP or ON position, a switch connects the FPGA pin to 3.3V, a logic High. When DOWN or in the OFF position, the switch connects the FPGA pin to ground, a logic Low. The switches typically exhibit about 2 ms of mechanical bounce and there is no active debouncing circuitry, although such circuitry could easily be added to the FPGA design programmed on the board. UCF constraints for the four slide switches, including the I/O pin assignment and the I/O standard used are shown below. The PULLUP resistor is not required, but it defines the input value when the switch is in the middle of a transition.
NET NET NET NET "SW<0>" "SW<1>" "SW<2>" "SW<3>" LOC LOC LOC LOC = = = = "L13" "L14" "H18" "N17" | | | | IOSTANDARD IOSTANDARD IOSTANDARD IOSTANDARD = = = = LVTTL LVTTL LVTTL LVTTL | | | | PULLUP PULLUP PULLUP PULLUP ; ; ; ;
Push-Button Switches
Pressing a push button connects the associated FPGA pin to 3.3V, as shown in Figure 5.6.
Figure 5-6: Push-Button Switches Require an Internal Pull-Down Resistor in FPGA Input Pin Use an internal pull-down resistor within the FPGA pin to generate a logic Low when the button is not pressed. The table below shows how to specify a pull-down resistor within the UCF. There is no active debouncing circuitry on the push button.
NET NET NET NET "BTN_EAST" "BTN_NORTH" "BTN_SOUTH" "BTN_WEST" LOC LOC LOC LOC = = = = "H13" "V4" "K17" "D18" | | | | IOSTANDARD IOSTANDARD IOSTANDARD IOSTANDARD = = = = LVTTL LVTTL LVTTL LVTTL | | | | PULLDOWN PULLDOWN PULLDOWN PULLDOWN ; ; ; ;
Discrete LEDs
Each LED has one side connected to ground and the other side connected to a pin on the Spartan-3E device via a 390current limiting resistor. To light an individual LED, drive the associated FPGA control signal High.
NET NET NET NET NET NET NET NET "LED<7>" "LED<6>" "LED<5>" "LED<4>" "LED<3>" "LED<2>" "LED<1>" "LED<0>" LOC LOC LOC LOC LOC LOC LOC LOC = = = = = = = = "F9" "E9" "D11" "C11" "F11" "E11" "E12" "F12" | | | | | | | | IOSTANDARD IOSTANDARD IOSTANDARD IOSTANDARD IOSTANDARD IOSTANDARD IOSTANDARD IOSTANDARD = = = = = = = = LVTTL LVTTL LVTTL LVTTL LVTTL LVTTL LVTTL LVTTL | | | | | | | | SLEW SLEW SLEW SLEW SLEW SLEW SLEW SLEW = = = = = = = = SLOW SLOW SLOW SLOW SLOW SLOW SLOW SLOW | | | | | | | | DRIVE DRIVE DRIVE DRIVE DRIVE DRIVE DRIVE DRIVE = = = = = = = = 8 8 8 8 8 8 8 8 ; ; ; ; ; ; ; ;
7. Select File Save design. If you are prompted to select the bus delimiter type based on the synthesis tool you are using. Select XST Default <> and click OK. 6. Close PACE.
Based on ISE In-Depth Tutorial (Xilinx) Adapted to a simple, non-clocked example design by Ragnar Johnsen, University of Agder 17.08.2010
22
Based on ISE In-Depth Tutorial (Xilinx) Adapted to a simple, non-clocked example design by Ragnar Johnsen, University of Agder
17.08.2010
23
Figure 6-1: iMPACT Welcome Dialog window 9. In the Welcome dialog window, doubleclick Boundary-Scan (JTAG). 10. In the boundary scan window: Right click to add device or initialize JTAG chain.
Figure 6-2: iMPACT Boundary scan window 11. Rigth click in the boundary scan window (fig. 6-2), select Initialize Chain. 12. The boundary scan now looks like the one in fig. 6-3. Click yes in the dialog box.
Based on ISE In-Depth Tutorial (Xilinx) Adapted to a simple, non-clocked example design by Ragnar Johnsen, University of Agder
17.08.2010
24
Figure 6-4: Assign configuration file 13. The left component in the window is now green and a dialog box (Assign New Configuration File) has popped up. Select the file led_control.bit and click open.
Figure 6-5: SPI or BPI PROM dialog box 14. Click NO in the dialog box shown in fig. 5-7 and then Bypass two times. 15. Click OK in the next dialog box and you are finally ready to program the device by double clicking Program in the iMPACT Processes window.
25