By using an FPGA, you can build the circuit without soldering and each pair of students can use the same module. This technique will be valuable, later in research or any enterprise, since you can quickly make moderately complex circuits and yet quickly make changes as the needs change.
A Field Programmable Gate Array, commonly known as an FPGA, is a general purpose programmable IC which is mainly used in the digital design environment that requires flexibility in design and fast turn around time.
In contrast to design using commercial ICs, FPGA can be configured to the designer's specific circuits in a single chip. In addition, in the case of design errors, FPGA can be redesigned and reconfigured easily in software, where as in the commercial IC design, it is not so easy to modify the already connected circuitry. In comparison to EPLD (Electrically Programmable Logic Device), FPGAS have more levels of registers and a more general routing topology. This renders the EPLD less useful in more general systems, especially in pipelined systems. Because of its size, ease of use, and reconfigurability, FPGA represents an attractive alternative in digital design. It is particularly suitable for experimental and rapid prototyping environments.
Different types of FPGA from different vendors are available. The one we will be using is the Xilinx FPGA. Therefore, throughout this document, the term FPGA is referring to the Xilinx FPGA.
In general, there are two kinds of blocks in a Xilinx FPGA: Configurable Logic Blocks (CLB) and Input/Output Blocks (IOB).
Each CLB is capable of supporting generic combinational logic functions of up to 9 inputs and 2 outputs. This is done by using lookup tables. In addition, two flip-flops are provided in each CLB for storing the outputs of the combinational logic, if so desired. Each FPGA contains a good number of CLBs arranged in a 2-dimensional square array to implement and interconnect the desired logic functions of the system. For example, in XC4003, there are 100 CLBs arranged in a 10 by 10 array.
IOBs are used to support the interface, including TTL voltage level, higher driving current, 3-state buffers, etc..., to the external environments. In addition, one flip-flop is also available in each IOB to provide latched input/output. Depending on the size of the chip, different size of FPGA contains different number of IOBs placed on the perimeter of the CLB array. In the case of XC4003, there are 80 IOBs available for external connections.
Configurable routing wires are presented between CLBs and between CLBs and IOBs for interconnecting blocks. The routing wires are arranged in the form of a configurable matrix called switching matrix such that connections from any direction to any other directions are possible.
The Xilinx FPGA design process consists of the following procedures:
This experiment is to acquaint you with the design process of Xilinx FPGA. You will design a simple circuit for FPGA, download it to FPGA, and verify that it works in hardware.
The CAD tool for drawing the circuit schematics is the Design Architect from Mentor Graphics. The following section will provide a short summary of how to enter a Xilinx FPGAS specific circuit using Mentor Design Architect.
The FPGA chip you will be using is XC4003. It contains 100 CLBs arranged in a 10 by 10 array. In addition, there are 80 IOBs available for external connection. For other properties of XC4003, please consult ``The Programmable Logic Data Book" from Xilinx.
A design example called cnt3 is provided in section for your reference.
Decide what digital circuit you want to make in an FPGA and draw it in your notebook. Since the purpose of the experiment is to teach you of the flexibility of FPGAs, you need not choose a complex circuit. In fact, we would prefer each pair of students to choose a circuit which is slightly different from that of other students. As a rough measure of size, we suggest something with 3 or 4 flipflops; perhaps a counter, with 1 or 2 gates giving output pulses at particular counts. It is important to have 2 or 3 outputs with easily recognised signals which you can check on an oscilloscope.
As you make up the design, put a truth table or timing diagram (as appropriate for your circuit) into your notebook. This allows you to check the logic of your design as you do it, and later gives you something to check the measured output against.
Later, print out the ECAD schematic and insert it and sketch the waveforms which you observe.
A Unix HP Workstation with the Xilinx development software.
Stabilized voltage supply of +5.0 volts.
A function Generator from the 623 lab.
An oscilloscope from the 623 lab.
It is assumed that you already know how to draw and edit a schematic using Design Architect software. This section provides a short summary of the Mentor editing notes just for using the Xilinx FPGA.
If your username is ``a'' then all your files (such as one called, say,
filename) will then have the long pathname:
/users/a/filename
or the short pathname:
~/a/filename
For example, the example circuit ``cnt3'' described later has the short
pathname
~/a/cnt3
XC4000_LIB > BY TYPE > arithmetic > ... > buffer > ... > ... > ...
Please consult the Xilinx Library Reference Manual for the properties of the components and how they behave.
In reality, all input/output signals are bonded to IC pins. Normally, It is the designer's job to designate the IC pin for each signal. This is referred to as the pinout constraint. In the case of Xilinx FPGA, there are two ways to assign the signals to the IC pins:
This fixes the pinout such that no rewiring is necessary if the design has to undergo several revisions and if you want to use any of the circuit board components such as the LEDs and pushbuttons.
It is suggested that you use the following pins.
P35 for clock.
P56 for active low reset.
P67 through P72 for input signals.
P57 through P62 and P65-66 for output signals since these pins are connected to the LEDs.
The pins which are attached to LED displays on the test board will not interfere with the signals on the pins.)
Use ``Check Sheet'' with default settings then use ``Save Sheet''.
After the circuit is designed and the pinout properly constrained, you may start mapping the circuit into the Xilinx hardware.
These four steps are dependent on each other, since optimizing the circuit requires knowledge from each step. Many iterations are required to achieve an optimized solution. Hence, these steps are the most time consuming part in the entire process. Together these steps are called the PPR steps.
After the mapping is done, the makebits software will take the generated mapping and produce a corresponding binary configuration bit file downloadable to the actual FPGA hardware.
Xilinx provides a set of software to perform the above tasks. The procedure using this software is as follows:
makebits -f DonePin:Pullup design_name.lca
Edit by clicking the small ``pencil and paper'' icon on the bottom bar or use the Unix editors ``vi'' or ``emacs'' if you prefer.
The option -f DonePin:Pullup ties a pullup resistor to one of the download configuration pins, namely the DonePin. This step is necessary since this open drain pin is used to indicate when the bit file download is complete. Without the pullup resistor, the open drain pin will never go high to indicate the completion of the process.
If errors occur in any of the design procedure, error messages will be written to one of the report files. For preprocessing errors, please check design_name.prp file; for PPR errors, please check design_name.out file. If there are errors, go back to the Mentor circuit editing process to correct the errors and follow the entire design process again.
If there is no error, the design_name.rpt file will report the result of the mapping process. The resource usage including CLB and IOB will be reported as well as the worst case delay. In addition, the pinout assignment will be generated, or confirmed if the pinout constraint is used. Please check the pinout assignment in this report file to verify the validity of the assignment.
If you wish, you can print out a copy of this file with the Unix print command;
lp -d printername design-name.rpt and include it in your notebook.
The binary configuration bit file is now ready to be downloaded to the actual FPGA chip. Please follow the following steps for downloading.
Xchecker is the Xilinx interface between software and the actual FPGA hardware.
The following is the transcript of the xchecker commands for downloading the cnt3 sample circuit.
matatua 37: xchecker Xilinx (R) XCHECKER 5.0.0 - Download/Readback LCA via download cable Copyright (C) Xilinx Inc. 1991-1994. All Rights Reserved. -------------------------------------------------------------------- Cable ID type is 'SERIAL-READBACK' Cable is connected to '/dev/tty00' Baud rate is 38400 XCHECKER ? load cnt3.bit About to download 'cnt3.bit'. Press ENTER key to continue or Q to quit: > Total of 6747 bytes transmitted. DONE signal went high. Transmitting time = 3.34 secs XCHECKER ? quit Profile is saved in xchecker.pro matatua 38:
The binary configuration bit file is now successfully downloaded to the FPGA. You may now enable the clock signal. Press the RESET button if necessary.
Use the oscilloscope to look at the clock signal and the outputs from your circuit. The layout of the FPGA pin locations is given on the last page of this experiment description.
A sample circuit cnt3 is provided in this section for reference. It is a binary 3 bit synchronous up counter. The circuit diagram is provided. Please refer to it as you construct your experimental circuit.