FPGA Design with Xilinx/Mentor Graphics Tools

This document describes the process or designing and implementing digital circuits in Xilinx FPGAs, using CAD tools from Mentor Graphics and Xilinx. There are two basic approaches to creating the FPGA design.

The remainder of this document describes these individual steps, focusing on Xilinx FPGA-specific issues and the Xilinx tools. The reader is referred to the tutorials on Design Architect, Quicksim II, and ModelSimEE for further information on using those tools.

NEW:  Xilinx has provided a "Flow Manager" tool, which is a single window from which each stepcan be performed  in the design entry, simulation, and implementation processes described below.  Each Xilinx-provided unix commands described below can be executed by pressing a button in the Flow Manager window and supplying the parameters in the form that appears.

To access the Flow Manager:

  1. Start the Mentor Graphics Design Manager from a unix command line with the command: pld_dmgr
  2. In the Design Manager "Tools" window, find the flow_mgr icon, and double-click on it.
  3. The steps in the design flow are listed in order in the Flow Manager window.

New Auburn Users

Schematic Capture for Xilinx FPGAs

Use Mentor Graphics' Design Architect to create, check, and save s chematics as usual, but use the provided Xilinx library for the target device family (xc2000, xc3000, xc4000). Refer the the Design Architect Tutorial for information on schematic drawing. The following differences apply to schematics to be realized in Xilinx FPGAs.

Note:There is no simulation model for the OSC4 element. Therefore, in QuickSim II you must manually force clock signals onto each output of OSC4 to be used by the circuit.

Perform Functional Simulation

Before performing the processes needed to compile a design for an FPGA device, the functionality of the design should be verified through simulation with Quicksim II.

Synthesizing a Circuit from a VHDL Model with Leonardo

Use Mentor Graphics' ModelSimEE tools to model and simulate a design. Refer to the on-line tutorial: Design and Simulation with ModelSimEE. Note that design for synthesis principles should be followed in the development of the model.

After the design has been verified with the ModelSimEE simulator, a circuit is synthesized for the desired Xilinx FPGA architecture using the Exemplar Leonardo synthesis tool.

        Click here for an example of the Leonardo "Quick Flow" Tab

  1. Invoke Leonardo via the unix command: leonardo
  2. Select the Leonardo "Quick Flow" Tab (the default).
  3. Select the VHDL file to be synthesized:
  4. If desired, change the output file name in the Output File box.
    The default is model.edf, where model is the VHDL source file name.
    The default output format is an EDIF schematic file.
  5. In the Technologies box, select the target technology:
  6. Select a specific target device from the pull-down Device list.
  7. Select a speed grade for the target device from the pull-down Speed Grade list.
  8. If desired, enter a target clock rate in the Clock box. Leonardo will use this clock rate as a design constraing if provided.
  9. Check the Insert IO Pads box if the circuit is the top-level chip design.
    Uncheck this box if the circuit is to be a module ("macro") to be incorporated into higher-level designs.
  10. Under Optimize for, click on either Area or Delay to select how you wish your circuit to be optimized.
  11. Click the Run Flow to perform the synthesis operations.
    The results of each step in the flow will be summarized in the windows to the right.
    The resulting EDIF schematic will be saved in the output file, as described above.
  12. To view the synthesized circuit, click on the View Technology Schematic button on the Leonardo menu bar.
  13. Exit Leonardo and follow the procedures outlined below to implement the design.

Working with a Mixed VHDL/Schematic Model (Schematic on Top)

To mix VHDL and schematic components in a single model, assuming that the top-level model is a schematic, each component model should be created and debugged via simulation, and then a symbol must be created for each schematic and VHDL component model.  Then these symbols can be instantiated on a sheet and connected to other schematic elements to create the top-level schematic. After synthesizing a circuit from a VHDL model, the synthesized circuit can replace the VHDL model associated with its schematic symbol, and a single schematic model can be generated for the entire circuit.  This schematic can then be mapped onto a FPGA device in the Xilinx Design Manager.

Creating a Schematic Symbol for a VHDL Component

  1. Before you begin work, create a logical name for the ModelSimEE initialization file to use in locating your working library via the unix command:: vmap work work  (This need only be done one time.)
  2. Compile the VHDL model with the "QuickSim Pro symbol information" switch:  vcom -qspro_syminfo mymodel.vhd
  3. Open Design Architect, and from the session window select File > Generate > Symbol
  4. In the Generate Symbol Form, enter the following (assume the entity name is "reg_4bit" and the architecture name is "behavior").  Generally, the other entries in this form should be left at their default values.
  5. Click here for an example of the Generate Symbol Form

  6. In the text palette, click on ADD PROPERTY to associate the EDIF schematic file (to be generated by Leonardo) with this component symbol:
  7. Check the symbol by selecting, from the menu bar: Check > With Defaults
  8. Save the symbol by selecting, from the menu bar: File > Save Symbol > Default Registration

Functional Simulation Before Synthesis

  1. Create a viewpoint for the top-level design (accumulator) for the desired Xilinx technology (xc4000e) using the unix command:
        pld_dve -s accumulator xc4000e
  2. Invoke the QuickSim Pro (QSPro) co-simulation environment to simulate the mixed schematic/VHDL model using the unix command:
        qspro accumulator
  3. QuickSim Pro comprises a QuickSim II window and a ModelSim EE window. Since the top level is a schematic, the simulation will normally be controlled from the QuickSim II window, as you would for a "normal" schematic.  If you wish to view signals in a VHDL model, they would be accessed via the ModelSim EE window, as you would a "normal" VHDL model.

Functional Simulation After Synthesis

After synthesizing a schematic for each VHDL component model instantiated in the top-level design, the final schematic can be resimulated and compared to the results obtained before synthesis.  Note that each VHDL component symbol should have a "file" property defining the name of the EDIF schematic created by Leonardo.

  1. Create a single EDIF schematic (accumulator.edif) of the entire design via the unix command:
          pld_men2edif accumulator xc4000e
  2. Convert the EDIF schematic to a Mentor EDDM schematic for use in QuickSim II:
          pld_edif2sim accumulator.edif accumulator xc4000e -m -eddm
  3. Invoke the QuickSim II simulator as you would on a "plain" schematic.
          pld_quicksim accumulator

Realizing the Design in a Xilinx FPGA

The Xilinx M1 Software "Xilinx Design Manager" (XDM) tool synthesizes an FPGA design from an EDIF or XNF netlist file, producing bitstream files that can be loaded into FPGA devices, and simulation models containing accurate timing parameters. If the design is a VHDL model, a circuit in EDIF or XNF format must be synthesized using Leonardo, as described above.

If the design is in schematic form, it must be converted to an EDIF netlist via the Mentor Graphics ENWRITE (EDIF Netlist Writer) program, using the following unix command (creating file design-name.edif) :

1. Invoke the Xilinx Design Manager on the EDIF or XNF File

The Xilinx Design Manager (XDM) keeps track of each user project. Each project, in turn, may have one or more design versions, with each having one or more implementation revisions. When used for the first time, the user must define a new project, design version, and design implementation revision as follows:

2. Use the XDM Flow Engine to Implement the Design


4. Use the XDM Timing Analyzer To Study The Implemented Design

After the Flow Engine has built a part and generated timing files, invoke the XDM Timing Analyzer by clicking on its icon at the right side of the XDM window, or from the XDM menu bar select Tools > Timing Analyzer.


Simulate the Implemented Design (VHDL + SDF)

The ModelSimEE simulator can be used in the same manner as for functional simulation to verify the implemented design, which now contains accurate timing parameters. The VHDL file generated by the Xilinx Design Manager is a structural model, built from "simulation primitives" in a Xilinx-supplied VHDL library. Timing data is contained in the SDF file generated by the Xilinx Design Manager.

Simulate The Implemented Design (Backannotated EDIF Netlist)

When the Timing Simulation Data option is selected, the Xilinx Design Manager (XDM) generates a backannotated EDIF netlist file (time_sim.edn) that can be converted to a Mentor Graphics component and design viewpoint containing detailed timing information from the chip. This can be simulated to verify that the design works properly under worst case conditions.

  1. Invoke the Mentor Graphics Design Manager with UNIX command:


  2. In the Navigator window, select the backannotated EDIF netlist file: time_sim.edn.

  3. From the Navigator window popup menu, select:


    This runs the EDIF netlist reader to create a new Mentor Graphics component from the backannotated EDIF netlist. If your original schematic component name was counter, the new component will be counter_lib/counter.

  4. In the Navigator window, select the new component: counter_lib/counter

  5. From the Navigator popup menu, create a simulation viewpoint by selecting



  6. From the Navigator popup menu, invoke Quicksim II by selecting




  7. If you selected "Cross-probing", the Design Viewpoint Editor (DVE) will be opened, along with Quicksim II.


  8. Repeat the simulation that was used to verify your logic design, but this time noting the various signal delays and timing.






XC4000 Demonstration Board Features

The figure above shows the inputs and outputs available on the Xilinx XC4000 Demo Board. These include the following.

Octal DIP Switch
SW5 General-purpose inputs connected to LCA pins: 19 20 23 24 25 26 27 28
LEDs (CR2,CR1):
LEDs driven by LCA pins: 61 62 65 66 57 58 59 60
7-Segment Display Digits:
CR3 is driven by LCA pins: 39 38 36 35 29 40 44 37
CR4 is driven by LCA pins: 49 48 47 46 45 50 51 41
(Segments are: a b c d e f g pt)4
Configuration DIP Switches (SW4)
PWR - ON to use alternate power supply
MPE - Multiple Program Enable -
SPE - Single Program Enable
M0:M1:M2 - configuration download option
RST - reset enable (use with RESET pushbutton)
Pushbuttons:
RESET (SW1) - Resets LCA if SW4-1 is ON and RESET is pressed, controlling Global Set-Reset (GSR) via pin 56.
PROG (SW3) - Controls pin 55 (Program_bar) of LCA. Press to reprogram the chip.
SPARE (SW2) - Extra input connected to header J5.
XChecker Cable Connectors (J1 and J3)
Vcc, GND
CCLK - configuration clock from LCA CCLK pin
DONE - configuration done from LCA DONE pin
DIN - data into LCA DIN pin
PROG - reprogram LCA (connected to PROG button)
INIT -initialize LCA
RST - not connected on demo board
Power Connector:
J2 (Be real careful to check this!)
Power, ground, and Xchecker cable connections for stand-alone XC4003A usage:
Vcc - 2,11,22,33,42,54,64,74
Gnd - 1,12,21,31,43,53,64,76
CCLK - 73 (configuration clock)
DONE - 53 (configuration done)
DIN - 71 (FPGA data in from xchecker/sprom)
/PROG - 55 (low to reprogram the FPGA)
/INIT - 41 (low to reinitialize the FPGA)
RST

Note: /INIT = /PROGRAM = +5v during normal operation (pull up).